163 lines
114 KiB
JavaScript
163 lines
114 KiB
JavaScript
import{a as tr}from"./chunk-T5OCTHI4.mjs";import{a as $e,b as je}from"./chunk-7FYTHRHK.mjs";import{a as Je,b as Ze,d as Kt,e as Ft,f as lt,g as Pt}from"./chunk-LII3EMHJ.mjs";import{c as Qe,n as ae,p as X}from"./chunk-QA3QBVWF.mjs";import{a as xr}from"./chunk-KNLZD3CH.mjs";import{$ as Xe,A as St,B as We,D as Q,E as mt,F as re,G as k,O as Ke,S as Fe,T as se,U as qe,V as He,W as ze,X as Ue,Y as Ge,_ as $,a as Ye,t as wt}from"./chunk-67TQ5CYL.mjs";import{b as j,h as kt}from"./chunk-7W6UQGC5.mjs";import{a as x,d as gr}from"./chunk-AQ6EADP3.mjs";var ne=(function(){var e=x(function(ut,w,C,P){for(C=C||{},P=ut.length;P--;C[ut[P]]=w);return C},"o"),t=[1,2],s=[1,3],r=[1,4],n=[2,4],i=[1,9],a=[1,11],l=[1,12],E=[1,14],h=[1,15],c=[1,17],_=[1,18],u=[1,19],y=[1,25],T=[1,26],f=[1,27],g=[1,28],b=[1,29],R=[1,30],O=[1,31],A=[1,32],N=[1,33],S=[1,34],V=[1,35],v=[1,36],H=[1,37],U=[1,38],G=[1,39],J=[1,40],et=[1,42],z=[1,43],at=[1,44],rt=[1,45],nt=[1,46],Y=[1,47],M=[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],Bt=[1,74],L=[1,80],D=[1,81],dt=[1,82],st=[1,83],W=[1,84],he=[1,85],pe=[1,86],Te=[1,87],Ee=[1,88],ue=[1,89],fe=[1,90],ge=[1,91],xe=[1,92],_e=[1,93],be=[1,94],me=[1,95],Ie=[1,96],ye=[1,97],Re=[1,98],Oe=[1,99],Le=[1,100],Ne=[1,101],Ae=[1,102],we=[1,103],Se=[1,104],ke=[1,105],Pe=[2,78],Nt=[4,5,17,51,53,54],Vt=[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],De=[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],Gt=[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],Ce=[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],Xt=[5,52],F=[70,71,72,73],ot=[1,151],Jt={trace:x(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:x(function(w,C,P,m,q,o,At){var p=o.length-1;switch(q){case 3:return m.apply(o[p]),o[p];break;case 4:case 10:this.$=[];break;case 5:case 11:o[p-1].push(o[p]),this.$=o[p-1];break;case 6:case 7:case 12:case 13:this.$=o[p];break;case 8:case 9:case 14:this.$=[];break;case 16:o[p].type="createParticipant",this.$=o[p];break;case 17:o[p-1].unshift({type:"boxStart",boxData:m.parseBoxData(o[p-2])}),o[p-1].push({type:"boxEnd",boxText:o[p-2]}),this.$=o[p-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(o[p-2]),sequenceIndexStep:Number(o[p-1]),sequenceVisible:!0,signalType:m.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(o[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:m.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:m.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:m.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:m.LINETYPE.ACTIVE_START,actor:o[p-1].actor};break;case 24:this.$={type:"activeEnd",signalType:m.LINETYPE.ACTIVE_END,actor:o[p-1].actor};break;case 30:m.setDiagramTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 31:m.setDiagramTitle(o[p].substring(7)),this.$=o[p].substring(7);break;case 32:this.$=o[p].trim(),m.setAccTitle(this.$);break;case 33:case 34:this.$=o[p].trim(),m.setAccDescription(this.$);break;case 35:o[p-1].unshift({type:"loopStart",loopText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.LOOP_START}),o[p-1].push({type:"loopEnd",loopText:o[p-2],signalType:m.LINETYPE.LOOP_END}),this.$=o[p-1];break;case 36:o[p-1].unshift({type:"rectStart",color:m.parseMessage(o[p-2]),signalType:m.LINETYPE.RECT_START}),o[p-1].push({type:"rectEnd",color:m.parseMessage(o[p-2]),signalType:m.LINETYPE.RECT_END}),this.$=o[p-1];break;case 37:o[p-1].unshift({type:"optStart",optText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.OPT_START}),o[p-1].push({type:"optEnd",optText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.OPT_END}),this.$=o[p-1];break;case 38:o[p-1].unshift({type:"altStart",altText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.ALT_START}),o[p-1].push({type:"altEnd",signalType:m.LINETYPE.ALT_END}),this.$=o[p-1];break;case 39:o[p-1].unshift({type:"parStart",parText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.PAR_START}),o[p-1].push({type:"parEnd",signalType:m.LINETYPE.PAR_END}),this.$=o[p-1];break;case 40:o[p-1].unshift({type:"parStart",parText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.PAR_OVER_START}),o[p-1].push({type:"parEnd",signalType:m.LINETYPE.PAR_END}),this.$=o[p-1];break;case 41:o[p-1].unshift({type:"criticalStart",criticalText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.CRITICAL_START}),o[p-1].push({type:"criticalEnd",signalType:m.LINETYPE.CRITICAL_END}),this.$=o[p-1];break;case 42:o[p-1].unshift({type:"breakStart",breakText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.BREAK_START}),o[p-1].push({type:"breakEnd",optText:m.parseMessage(o[p-2]),signalType:m.LINETYPE.BREAK_END}),this.$=o[p-1];break;case 44:this.$=o[p-3].concat([{type:"option",optionText:m.parseMessage(o[p-1]),signalType:m.LINETYPE.CRITICAL_OPTION},o[p]]);break;case 46:this.$=o[p-3].concat([{type:"and",parText:m.parseMessage(o[p-1]),signalType:m.LINETYPE.PAR_AND},o[p]]);break;case 48:this.$=o[p-3].concat([{type:"else",altText:m.parseMessage(o[p-1]),signalType:m.LINETYPE.ALT_ELSE},o[p]]);break;case 49:o[p-3].draw="participant",o[p-3].type="addParticipant",o[p-3].description=m.parseMessage(o[p-1]),this.$=o[p-3];break;case 50:o[p-1].draw="participant",o[p-1].type="addParticipant",this.$=o[p-1];break;case 51:o[p-3].draw="actor",o[p-3].type="addParticipant",o[p-3].description=m.parseMessage(o[p-1]),this.$=o[p-3];break;case 52:case 57:o[p-1].draw="actor",o[p-1].type="addParticipant",this.$=o[p-1];break;case 53:o[p-1].type="destroyParticipant",this.$=o[p-1];break;case 54:o[p-3].draw="participant",o[p-3].type="addParticipant",o[p-3].description=m.parseMessage(o[p-1]),this.$=o[p-3];break;case 55:o[p-1].draw="participant",o[p-1].type="addParticipant",this.$=o[p-1];break;case 56:o[p-3].draw="actor",o[p-3].type="addParticipant",o[p-3].description=m.parseMessage(o[p-1]),this.$=o[p-3];break;case 58:this.$=[o[p-1],{type:"addNote",placement:o[p-2],actor:o[p-1].actor,text:o[p]}];break;case 59:o[p-2]=[].concat(o[p-1],o[p-1]).slice(0,2),o[p-2][0]=o[p-2][0].actor,o[p-2][1]=o[p-2][1].actor,this.$=[o[p-1],{type:"addNote",placement:m.PLACEMENT.OVER,actor:o[p-2].slice(0,2),text:o[p]}];break;case 60:this.$=[o[p-1],{type:"addLinks",actor:o[p-1].actor,text:o[p]}];break;case 61:this.$=[o[p-1],{type:"addALink",actor:o[p-1].actor,text:o[p]}];break;case 62:this.$=[o[p-1],{type:"addProperties",actor:o[p-1].actor,text:o[p]}];break;case 63:this.$=[o[p-1],{type:"addDetails",actor:o[p-1].actor,text:o[p]}];break;case 66:this.$=[o[p-2],o[p]];break;case 67:this.$=o[p];break;case 68:this.$=m.PLACEMENT.LEFTOF;break;case 69:this.$=m.PLACEMENT.RIGHTOF;break;case 70:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p],activate:!0},{type:"activeStart",signalType:m.LINETYPE.ACTIVE_START,actor:o[p-1].actor}];break;case 71:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p]},{type:"activeEnd",signalType:m.LINETYPE.ACTIVE_END,actor:o[p-4].actor}];break;case 72:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p],activate:!0,centralConnection:m.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:m.LINETYPE.CENTRAL_CONNECTION,actor:o[p-1].actor}];break;case 73:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-2],msg:o[p],activate:!1,centralConnection:m.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:m.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[p-4].actor}];break;case 74:this.$=[o[p-5],o[p-1],{type:"addMessage",from:o[p-5].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p],activate:!0,centralConnection:m.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:m.LINETYPE.CENTRAL_CONNECTION,actor:o[p-1].actor},{type:"centralConnectionReverse",signalType:m.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[p-5].actor}];break;case 75:this.$=[o[p-3],o[p-1],{type:"addMessage",from:o[p-3].actor,to:o[p-1].actor,signalType:o[p-2],msg:o[p]}];break;case 76:this.$={type:"addParticipant",actor:o[p-1],config:o[p]};break;case 77:this.$=o[p-1].trim();break;case 78:this.$={type:"addParticipant",actor:o[p]};break;case 79:this.$=m.LINETYPE.SOLID_OPEN;break;case 80:this.$=m.LINETYPE.DOTTED_OPEN;break;case 81:this.$=m.LINETYPE.SOLID;break;case 82:this.$=m.LINETYPE.SOLID_TOP;break;case 83:this.$=m.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=m.LINETYPE.STICK_TOP;break;case 85:this.$=m.LINETYPE.STICK_BOTTOM;break;case 86:this.$=m.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=m.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=m.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=m.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=m.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=m.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=m.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=m.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=m.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=m.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=m.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=m.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=m.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=m.LINETYPE.DOTTED;break;case 100:this.$=m.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=m.LINETYPE.SOLID_CROSS;break;case 102:this.$=m.LINETYPE.DOTTED_CROSS;break;case 103:this.$=m.LINETYPE.SOLID_POINT;break;case 104:this.$=m.LINETYPE.DOTTED_POINT;break;case 105:this.$=m.parseMessage(o[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:s,6:r},{1:[3]},{3:5,4:t,5:s,6:r},{3:6,4:t,5:s,6:r},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],n,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},e(M,[2,5]),{9:48,13:13,14:E,15:h,18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},e(M,[2,7]),e(M,[2,8]),e(M,[2,9]),e(M,[2,15]),{13:49,51:U,53:G,54:J},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(M,[2,30]),e(M,[2,31]),{33:[1,62]},{35:[1,63]},e(M,[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:Bt},{23:75,55:76,73:Bt},{23:77,73:Y},{69:78,72:[1,79],78:L,79:D,80:dt,81:st,82:W,83:he,84:pe,85:Te,86:Ee,87:ue,88:fe,89:ge,90:xe,91:_e,92:be,93:me,94:Ie,95:ye,96:Re,97:Oe,98:Le,99:Ne,100:Ae,101:we,102:Se,103:ke},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},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],Pe),e(M,[2,6]),e(M,[2,16]),e(Nt,[2,10],{11:114}),e(M,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(M,[2,22]),{5:[1,118]},{5:[1,119]},e(M,[2,25]),e(M,[2,26]),e(M,[2,27]),e(M,[2,28]),e(M,[2,29]),e(M,[2,32]),e(M,[2,33]),e(Vt,n,{7:120}),e(Vt,n,{7:121}),e(Vt,n,{7:122}),e(De,n,{41:123,7:124}),e(Gt,n,{43:125,7:126}),e(Gt,n,{7:126,43:127}),e(Ce,n,{46:128,7:129}),e(Vt,n,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Xt,Pe,{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:Y},{69:146,78:L,79:D,80:dt,81:st,82:W,83:he,84:pe,85:Te,86:Ee,87:ue,88:fe,89:ge,90:xe,91:_e,92:be,93:me,94:Ie,95:ye,96:Re,97:Oe,98:Le,99:Ne,100:Ae,101:we,102:Se,103:ke},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:J},{5:[1,160]},e(M,[2,20]),e(M,[2,21]),e(M,[2,23]),e(M,[2,24]),{4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,161],18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},{4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,162],18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},{4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,163],18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},{17:[1,164]},{4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,17:[2,47],18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,50:[1,165],51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},{17:[1,166]},{4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,17:[2,45],18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,49:[1,167],51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},{17:[1,168]},{17:[1,169]},{4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,17:[2,43],18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,48:[1,170],51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},{4:i,5:a,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,171],18:16,19:c,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:y,31:T,32:f,34:g,36:b,37:R,38:O,39:A,40:N,42:S,44:V,45:v,47:H,51:U,53:G,54:J,56:et,61:z,62:at,63:rt,64:nt,73:Y},{16:[1,172]},e(M,[2,50]),{16:[1,173]},e(M,[2,55]),e(Xt,[2,76]),{76:[1,174]},{16:[1,175]},e(M,[2,52]),{16:[1,176]},e(M,[2,57]),e(M,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(M,[2,17]),e(Nt,[2,11]),{13:186,51:U,53:G,54:J},e(Nt,[2,13]),e(Nt,[2,14]),e(M,[2,19]),e(M,[2,35]),e(M,[2,36]),e(M,[2,37]),e(M,[2,38]),{16:[1,187]},e(M,[2,39]),{16:[1,188]},e(M,[2,40]),e(M,[2,41]),{16:[1,189]},e(M,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(Nt,[2,12]),e(De,n,{7:124,41:201}),e(Gt,n,{7:126,43:202}),e(Ce,n,{7:129,46:203}),e(M,[2,49]),e(M,[2,54]),e(Xt,[2,77]),e(M,[2,51]),e(M,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{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:x(function(w,C){if(C.recoverable)this.trace(w);else{var P=new Error(w);throw P.hash=C,P}},"parseError"),parse:x(function(w){var C=this,P=[0],m=[],q=[null],o=[],At=this.table,p="",vt=0,Me=0,Be=0,Tr=2,Ve=1,Er=o.slice.call(arguments,1),Z=Object.create(this.lexer),_t={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(_t.yy[Qt]=this.yy[Qt]);Z.setInput(w,_t.yy),_t.yy.lexer=Z,_t.yy.parser=this,typeof Z.yylloc>"u"&&(Z.yylloc={});var $t=Z.yylloc;o.push($t);var ur=Z.options&&Z.options.ranges;typeof _t.yy.parseError=="function"?this.parseError=_t.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Es(it){P.length=P.length-2*it,q.length=q.length-it,o.length=o.length-it}x(Es,"popStack");function fr(){var it;return it=m.pop()||Z.lex()||Ve,typeof it!="number"&&(it instanceof Array&&(m=it,it=m.pop()),it=C.symbols_[it]||it),it}x(fr,"lex");for(var tt,jt,bt,ct,us,te,Ot={},Yt,pt,ve,Wt;;){if(bt=P[P.length-1],this.defaultActions[bt]?ct=this.defaultActions[bt]:((tt===null||typeof tt>"u")&&(tt=fr()),ct=At[bt]&&At[bt][tt]),typeof ct>"u"||!ct.length||!ct[0]){var ee="";Wt=[];for(Yt in At[bt])this.terminals_[Yt]&&Yt>Tr&&Wt.push("'"+this.terminals_[Yt]+"'");Z.showPosition?ee="Parse error on line "+(vt+1)+`:
|
|
`+Z.showPosition()+`
|
|
Expecting `+Wt.join(", ")+", got '"+(this.terminals_[tt]||tt)+"'":ee="Parse error on line "+(vt+1)+": Unexpected "+(tt==Ve?"end of input":"'"+(this.terminals_[tt]||tt)+"'"),this.parseError(ee,{text:Z.match,token:this.terminals_[tt]||tt,line:Z.yylineno,loc:$t,expected:Wt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+tt);switch(ct[0]){case 1:P.push(tt),q.push(Z.yytext),o.push(Z.yylloc),P.push(ct[1]),tt=null,jt?(tt=jt,jt=null):(Me=Z.yyleng,p=Z.yytext,vt=Z.yylineno,$t=Z.yylloc,Be>0&&Be--);break;case 2:if(pt=this.productions_[ct[1]][1],Ot.$=q[q.length-pt],Ot._$={first_line:o[o.length-(pt||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(pt||1)].first_column,last_column:o[o.length-1].last_column},ur&&(Ot._$.range=[o[o.length-(pt||1)].range[0],o[o.length-1].range[1]]),te=this.performAction.apply(Ot,[p,Me,vt,_t.yy,ct[1],q,o].concat(Er)),typeof te<"u")return te;pt&&(P=P.slice(0,-1*pt*2),q=q.slice(0,-1*pt),o=o.slice(0,-1*pt)),P.push(this.productions_[ct[1]][0]),q.push(Ot.$),o.push(Ot._$),ve=At[P[P.length-2]][P[P.length-1]],P.push(ve);break;case 3:return!0}}return!0},"parse")},pr=(function(){var ut={EOF:1,parseError:x(function(C,P){if(this.yy.parser)this.yy.parser.parseError(C,P);else throw new Error(C)},"parseError"),setInput:x(function(w,C){return this.yy=C||this.yy||{},this._input=w,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:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var C=w.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:x(function(w){var C=w.length,P=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;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),P.length-1&&(this.yylineno-=P.length-1);var q=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===m.length?this.yylloc.first_column:0)+m[m.length-P.length].length-P[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[q[0],q[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(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:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),C=new Array(w.length+1).join("-");return w+this.upcomingInput()+`
|
|
`+C+"^"},"showPosition"),test_match:x(function(w,C){var P,m,q;if(this.options.backtrack_lexer&&(q={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&&(q.yylloc.range=this.yylloc.range.slice(0))),m=w[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+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,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(w[0].length),this.matched+=w[0],P=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var o in q)this[o]=q[o];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,C,P,m;this._more||(this.yytext="",this.match="");for(var q=this._currentRules(),o=0;o<q.length;o++)if(P=this._input.match(this.rules[q[o]]),P&&(!C||P[0].length>C[0].length)){if(C=P,m=o,this.options.backtrack_lexer){if(w=this.test_match(P,q[o]),w!==!1)return w;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(w=this.test_match(C,q[m]),w!==!1?w:!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:x(function(){var C=this.next();return C||this.lex()},"lex"),begin:x(function(C){this.conditionStack.push(C)},"begin"),popState:x(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(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:x(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:x(function(C){this.begin(C)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(C,P,m,q){var o=q;switch(m){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;break;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;break;case 10:return this.popState(),this.popState(),77;break;case 11:return P.yytext=P.yytext.trim(),73;break;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),73;break;case 13:return P.yytext=P.yytext.trim(),this.popState(),73;break;case 14:return this.popState(),10;break;case 15:return P.yytext=P.yytext.trim(),this.popState(),10;break;case 16:return this.begin("LINE"),15;break;case 17:return this.begin("ID"),51;break;case 18:return this.begin("ID"),53;break;case 19:return 14;case 20:return this.begin("ID"),54;break;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;break;case 22:return this.popState(),this.popState(),5;break;case 23:return this.begin("LINE"),37;break;case 24:return this.begin("LINE"),38;break;case 25:return this.begin("LINE"),39;break;case 26:return this.begin("LINE"),40;break;case 27:return this.begin("LINE"),50;break;case 28:return this.begin("LINE"),42;break;case 29:return this.begin("LINE"),44;break;case 30:return this.begin("LINE"),49;break;case 31:return this.begin("LINE"),45;break;case 32:return this.begin("LINE"),48;break;case 33:return this.begin("LINE"),47;break;case 34:return this.popState(),16;break;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;break;case 45:return this.begin("ID"),24;break;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;break;case 49:return this.popState(),"acc_title_value";break;case 50:return this.begin("acc_descr"),34;break;case 51:return this.popState(),"acc_descr_value";break;case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return P.yytext=P.yytext.trim(),73;break;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\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:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ut})();Jt.lexer=pr;function Zt(){this.yy={}}return x(Zt,"Parser"),Zt.prototype=Jt,Jt.Parser=Zt,new Zt})();ne.parser=ne;var er=ne;var _r={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},br={FILLED:0,OPEN:1},mr={LEFTOF:0,RIGHTOF:1,OVER:2},Dt={ACTOR:"actor",BOUNDARY:"boundary",COLLECTIONS:"collections",CONTROL:"control",DATABASE:"database",ENTITY:"entity",PARTICIPANT:"participant",QUEUE:"queue"},qt=class{constructor(){this.state=new tr(()=>({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=se;this.setAccDescription=He;this.setDiagramTitle=Ue;this.getAccTitle=qe;this.getAccDescription=ze;this.getDiagramTitle=Ge;this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($().wrap),this.LINETYPE=_r,this.ARROWTYPE=br,this.PLACEMENT=mr}static{x(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,s,r,n,i){let a=this.state.records.currentBox,l;if(i!==void 0){let h;i.includes(`
|
|
`)?h=i+`
|
|
`:h=`{
|
|
`+i+`
|
|
}`,l=je(h,{schema:$e})}n=l?.type??n,l?.alias&&(!r||r.text===s)&&(r={text:l.alias,wrap:r?.wrap,type:n});let E=this.state.records.actors.get(t);if(E){if(this.state.records.currentBox&&E.box&&this.state.records.currentBox!==E.box)throw new Error(`A same participant should only be defined in one Box: ${E.name} can't be in '${E.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=E.box?E.box:this.state.records.currentBox,E.box=a,E&&s===E.name&&r==null)return}if(r?.text==null&&(r={text:s,type:n}),(n==null||r.text==null)&&(r={text:s,type:n}),this.state.records.actors.set(t,{box:a,name:s,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),this.state.records.prevActor){let h=this.state.records.actors.get(this.state.records.prevActor);h&&(h.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let s,r=0;if(!t)return 0;for(s=0;s<this.state.records.messages.length;s++)this.state.records.messages[s].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[s].from===t&&r++,this.state.records.messages[s].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[s].from===t&&r--;return r}addMessage(t,s,r,n){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:s,message:r.text,wrap:r.wrap??this.autoWrap(),answer:n})}addSignal(t,s,r,n,i=!1,a){if(n===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){let E=new Error("Trying to inactivate an inactive participant ("+t+")");throw E.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},E}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:s,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:n,activate:i,centralConnection:a??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:$().sequence?.wrap??!1}clear(){this.state.reset(),Fe()}parseMessage(t){let s=t.trim(),{wrap:r,cleanedText:n}=this.extractWrap(s),i={text:n,wrap:r};return j.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){let s=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),r=s?.[1]?s[1].trim():"transparent",n=s?.[2]?s[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{let l=new Option().style;l.color=r,l.color!==r&&(r="transparent",n=t.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(n);return{text:a?St(a,$()):void 0,color:r,wrap:i}}addNote(t,s,r){let n={actor:t,placement:s,message:r.text,wrap:r.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(n),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:s})}addLinks(t,s){let r=this.getActor(t);try{let n=St(s.text,$());n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");let i=JSON.parse(n);this.insertLinks(r,i)}catch(n){j.error("error while parsing actor link text",n)}}addALink(t,s){let r=this.getActor(t);try{let n={},i=St(s.text,$()),a=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");let l=i.slice(0,a-1).trim(),E=i.slice(a+1).trim();n[l]=E,this.insertLinks(r,n)}catch(n){j.error("error while parsing actor link text",n)}}insertLinks(t,s){if(t.links==null)t.links=s;else for(let r in s)t.links[r]=s[r]}addProperties(t,s){let r=this.getActor(t);try{let n=St(s.text,$()),i=JSON.parse(n);this.insertProperties(r,i)}catch(n){j.error("error while parsing actor properties text",n)}}insertProperties(t,s){if(t.properties==null)t.properties=s;else for(let r in s)t.properties[r]=s[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,s){let r=this.getActor(t),n=document.getElementById(s.text);try{let i=n.innerHTML,a=JSON.parse(i);a.properties&&this.insertProperties(r,a.properties),a.links&&this.insertLinks(r,a.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":se(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}getConfig(){return $().sequence}};var Ir=x(e=>{let t=e.dropShadow??"none",{look:s}=$();return`.actor {
|
|
stroke: ${e.actorBorder};
|
|
fill: ${e.actorBkg};
|
|
stroke-width: ${e.strokeWidth??1};
|
|
}
|
|
|
|
rect.actor.outer-path[data-look="neo"] {
|
|
filter: ${t};
|
|
}
|
|
|
|
rect.note[data-look="neo"] {
|
|
stroke:${e.noteBorderColor};
|
|
fill:${e.noteBkgColor};
|
|
filter: ${t};
|
|
}
|
|
|
|
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};
|
|
}
|
|
|
|
[id$="-arrowhead"] path {
|
|
fill: ${e.signalColor};
|
|
stroke: ${e.signalColor};
|
|
}
|
|
|
|
.sequenceNumber {
|
|
fill: ${e.sequenceNumberColor};
|
|
}
|
|
|
|
[id$="-sequencenumber"] {
|
|
fill: ${e.signalColor};
|
|
}
|
|
|
|
[id$="-crosshead"] path {
|
|
fill: ${e.signalColor};
|
|
stroke: ${e.signalColor};
|
|
}
|
|
|
|
.messageText {
|
|
fill: ${e.signalTextColor};
|
|
stroke: none;
|
|
}
|
|
|
|
.labelBox {
|
|
stroke: ${e.labelBoxBorderColor};
|
|
fill: ${e.labelBoxBkgColor};
|
|
filter: ${s==="neo"?t:"none"};
|
|
}
|
|
|
|
.labelText, .labelText > tspan {
|
|
fill: ${e.labelTextColor};
|
|
stroke: none;
|
|
}
|
|
|
|
.loopText, .loopText > tspan {
|
|
fill: ${e.loopTextColor};
|
|
stroke: none;
|
|
}
|
|
|
|
.sectionTitle, .sectionTitle > 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;
|
|
${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""}
|
|
}
|
|
|
|
.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 circle, line {
|
|
fill: ${e.actorBkg};
|
|
stroke-width: 2px;
|
|
}
|
|
|
|
g rect.rect {
|
|
filter: ${t};
|
|
stroke: ${e.nodeBorder};
|
|
}
|
|
`},"getStyles"),rr=Ir;var ie=gr(xr(),1);var ft=36,gt="actor-top",xt="actor-bottom",Ht="actor-box",It="actor-man",Tt=new Set(["redux-color","redux-dark-color"]),Ct=x(function(e,t){let s=Je(e,t);return wt().look==="neo"&&s.attr("data-look","neo"),s},"drawRect"),Rr=x(function(e,t,s,r,n){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let i=t.links,a=t.actorCnt,l=t.rectData;var E="none";n&&(E="block !important");let h=e.append("g");h.attr("id","actor"+a+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",E);var c="";l.class!==void 0&&(c=" "+l.class);let _=l.width>s?l.width:s,u=h.append("rect");if(u.attr("class","actorPopupMenuPanel"+c),u.attr("x",l.x),u.attr("y",l.height),u.attr("fill",l.fill),u.attr("stroke",l.stroke),u.attr("width",_),u.attr("height",l.height),u.attr("rx",l.rx),u.attr("ry",l.ry),i!=null){var y=20;for(let g in i){var T=h.append("a"),f=(0,ie.sanitizeUrl)(i[g]);T.attr("xlink:href",f),T.attr("target","_blank"),Gr(r)(g,T,l.x+10,l.height+y,_,20,{class:"actor"},r),y+=30}}return u.attr("height",y),{height:l.height+y,width:_}},"drawPopup"),zt=x(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Mt=x(async function(e,t,s=null){let r=e.append("foreignObject"),n=await re(t.text,wt()),a=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(n).node().getBoundingClientRect();if(r.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),t.class==="noteText"){let l=e.node().firstChild;l.setAttribute("height",a.height+2*t.textMargin);let E=l.getBBox();r.attr("x",Math.round(E.x+E.width/2-a.width/2)).attr("y",Math.round(E.y+E.height/2-a.height/2))}else if(s){let{startx:l,stopx:E,starty:h}=s;if(l>E){let c=l;l=E,E=c}r.attr("x",Math.round(l+Math.abs(l-E)/2-a.width/2)),t.class==="loopText"?r.attr("y",Math.round(h)):r.attr("y",Math.round(h-a.height))}return[r]},"drawKatex"),yt=x(function(e,t){let s=0,r=0,n=t.text.split(k.lineBreakRegex),[i,a]=ae(t.fontSize),l=[],E=0,h=x(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":h=x(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":h=x(()=>Math.round(t.y+(s+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":h=x(()=>Math.round(t.y+(s+r+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[c,_]of n.entries()){t.textMargin!==void 0&&t.textMargin===0&&i!==void 0&&(E=c*i);let u=e.append("text");u.attr("x",t.x),u.attr("y",h()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),a!==void 0&&u.style("font-size",a),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);let y=_||Qe;if(t.tspan){let T=u.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(y)}else u.text(y);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,s=r),l.push(u)}return l},"drawText"),sr=x(function(e,t){function s(n,i,a,l,E){return n+","+i+" "+(n+a)+","+i+" "+(n+a)+","+(i+l-E)+" "+(n+a-E*1.2)+","+(i+l)+" "+n+","+(i+l)}x(s,"genPoints");let r=e.append("polygon");return r.attr("points",s(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,yt(e,t),r},"drawLabel"),B=-1,oe=x((e,t,s,r)=>{e.select&&s.forEach(n=>{let i=t.get(n),a=e.select("#actor"+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr("y2",i.stopy+i.height/2):r.mirrorActors&&a.attr("y2",i.stopy)})},"fixLifeLineHeights"),Or=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+t.height,{look:E,theme:h,themeVariables:c}=s,{bkgColorArray:_,borderColorArray:u}=c,y=e.append("g").lower();var T=y;r||(B++,Object.keys(t.links||{}).length&&!s.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=y.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look","neo"));let f=lt();var g="actor";t.properties?.class?g=t.properties.class:f.fill="#eaeaea",r?g+=` ${xt}`:g+=` ${gt}`,f.x=t.x,f.y=i,f.width=t.width,f.height=t.height,f.class=g,f.rx=3,f.ry=3,f.name=t.name,E==="neo"&&(f.rx=6,f.ry=6);let b=Ct(T,f),R=n.get(t.name)??0;if(Tt.has(h)&&(b.style("stroke",u[R%u.length]),b.style("fill",_[R%u.length])),E==="neo"&&b.attr("filter","url(#drop-shadow)"),t.rectData=f,t.properties?.icon){let A=t.properties.icon.trim();A.charAt(0)==="@"?Ft(T,f.x+f.width-20,f.y+10,A.substr(1)):Kt(T,f.x+f.width-20,f.y+10,A)}r||(T.attr("data-et","participant"),T.attr("data-type","participant"),T.attr("data-id",t.name)),Et(s,Q(t.description))(t.description,T,f.x,f.y,f.width,f.height,{class:`actor ${Ht}`},s);let O=t.height;if(b.node){let A=b.node().getBBox();t.height=A.height,O=A.height}return O},"drawActorTypeParticipant"),Lr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+t.height,{look:E,theme:h,themeVariables:c}=s,{bkgColorArray:_,borderColorArray:u}=c,y=e.append("g").lower();var T=y;r||(B++,Object.keys(t.links||{}).length&&!s.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=y.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look","neo"));let f=lt();var g="actor";t.properties?.class?g=t.properties.class:f.fill="#eaeaea",r?g+=` ${xt}`:g+=` ${gt}`,f.x=t.x,f.y=i,f.width=t.width,f.height=t.height,f.class=g,f.name=t.name;let b=6,R={...f,x:f.x+-b,y:f.y+ +b,class:"actor"},O=Ct(T,f),A=Ct(T,R);t.rectData=f,E==="neo"&&T.attr("filter","url(#drop-shadow)");let N=n.get(t.name)??0;if(Tt.has(h)&&(O.style("stroke",u[N%u.length]),O.style("fill",_[N%u.length]),A.style("stroke",u[N%u.length]),A.style("fill",_[N%u.length])),t.properties?.icon){let V=t.properties.icon.trim();V.charAt(0)==="@"?Ft(T,f.x+f.width-20,f.y+10,V.substr(1)):Kt(T,f.x+f.width-20,f.y+10,V)}Et(s,Q(t.description))(t.description,T,f.x-b,f.y+b,f.width,f.height,{class:`actor ${Ht}`},s);let S=t.height;if(O.node){let V=O.node().getBBox();t.height=V.height,S=V.height}return r||(T.attr("data-et","participant"),T.attr("data-type","collections"),T.attr("data-id",t.name)),S},"drawActorTypeCollections"),Nr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+t.height,{look:E,theme:h,themeVariables:c}=s,{bkgColorArray:_,borderColorArray:u}=c,y=e.append("g").lower(),T=y;r||(B++,Object.keys(t.links||{}).length&&!s.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=y.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look","neo"));let f=lt(),g="actor";t.properties?.class?g=t.properties.class:f.fill="#eaeaea",r?g+=` ${xt}`:g+=` ${gt}`,T.attr("class",g),f.x=t.x,f.y=i,f.width=t.width,f.height=t.height,f.name=t.name;let b=f.height/2,R=b/(2.5+f.height/50),O=T.append("g"),A=T.append("g"),N=`M ${f.x},${f.y+b}
|
|
a ${R},${b} 0 0 0 0,${f.height}
|
|
h ${f.width-2*R}
|
|
a ${R},${b} 0 0 0 0,-${f.height}
|
|
Z
|
|
`;O.append("path").attr("d",N),A.append("path").attr("d",`M ${f.x},${f.y+b}
|
|
a ${R},${b} 0 0 0 0,${f.height}`),O.attr("transform",`translate(${R}, ${-(f.height/2)})`),A.attr("transform",`translate(${f.width-R}, ${-f.height/2})`),t.rectData=f,E==="neo"&&O.attr("filter","url(#drop-shadow)");let S=n.get(t.name)??0;if(Tt.has(h)&&(O.style("stroke",u[S%u.length]),O.style("fill",_[S%u.length]),A.style("stroke",u[S%u.length]),A.style("fill",_[S%u.length])),t.properties?.icon){let H=t.properties.icon.trim(),U=f.x+f.width-20,G=f.y+10;H.charAt(0)==="@"?Ft(T,U,G,H.substr(1)):Kt(T,U,G,H)}Et(s,Q(t.description))(t.description,T,f.x,f.y,f.width,f.height,{class:`actor ${Ht}`},s);let V=t.height,v=O.select("path:last-child");if(v.node()){let H=v.node().getBBox();t.height=H.height,V=H.height}return r||(T.attr("data-et","participant"),T.attr("data-type","queue"),T.attr("data-id",t.name)),V},"drawActorTypeQueue"),Ar=x(function(e,t,s,r,n,i){let a=r?t.stopy:t.starty,l=t.x+t.width/2,E=a+75,{look:h,theme:c,themeVariables:_}=s,{bkgColorArray:u,borderColorArray:y,actorBorder:T,actorBkg:f}=_,g=e.append("g").lower();r||(B++,g.append("line").attr("id","actor"+B).attr("x1",l).attr("y1",E).attr("x2",l).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);let b=e.append("g"),R=It;r?R+=` ${xt}`:R+=` ${gt}`,b.attr("class",R),b.attr("name",t.name);let O=lt();O.x=t.x,O.y=a,O.fill="#eaeaea",O.width=t.width,O.height=t.height,O.class="actor";let A=t.x+t.width/2,N=a+32,S=22;b.append("defs").append("marker").attr("id",n+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),b.append("circle").attr("cx",A).attr("cy",N).attr("r",S).attr("filter",`${h==="neo"?"url(#drop-shadow)":""}`),b.append("line").attr("marker-end","url(#"+n+"-filled-head-control)").attr("transform",`translate(${A}, ${N-S})`);let V=i.get(t.name)??0;Tt.has(c)?(b.style("stroke",y[V%y.length]),b.style("fill",u[V%y.length])):(b.style("stroke",T),b.style("fill",f));let v=b.node().getBBox();return t.height=v.height+2*(s?.sequence?.labelBoxHeight??0),Et(s,Q(t.description))(t.description,b,O.x,O.y+S+(r?5:12),O.width,O.height,{class:`actor ${It}`},s),r||(b.attr("data-et","participant"),b.attr("data-type","control"),b.attr("data-id",t.name)),t.height},"drawActorTypeControl"),wr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+75,{look:E,theme:h,themeVariables:c}=s,{bkgColorArray:_,borderColorArray:u}=c,y=e.append("g").lower(),T=e.append("g"),f="actor";r?f+=` ${xt}`:f+=` ${gt}`,T.attr("class",f),T.attr("name",t.name);let g=lt();g.x=t.x,g.y=i,g.fill="#eaeaea",g.width=t.width,g.height=t.height,g.class="actor";let b=t.x+t.width/2,R=i+(r?10:25),O=22;T.append("circle").attr("cx",b).attr("cy",R).attr("r",O).attr("width",t.width).attr("height",t.height),T.append("line").attr("x1",b-O).attr("x2",b+O).attr("y1",R+O).attr("y2",R+O).attr("stroke-width",2),E==="neo"&&T.attr("filter","url(#drop-shadow)");let A=n.get(t.name)??0;Tt.has(h)&&(T.style("stroke",u[A%u.length]),T.style("fill",_[A%u.length]));let N=T.node().getBBox();return t.height=N.height+(s?.sequence?.labelBoxHeight??0),r||(B++,y.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B),Et(s,Q(t.description))(t.description,T,g.x,g.y+(r?15:30),g.width,g.height,{class:`actor ${It}`},s),r?T.attr("transform",`translate(0, ${O})`):(T.attr("transform",`translate(0, ${O/2-5})`),T.attr("data-et","participant"),T.attr("data-type","entity"),T.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),Sr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+t.height+2*s.boxTextMargin,{theme:E,themeVariables:h,look:c}=s,{bkgColorArray:_,borderColorArray:u,actorBorder:y}=h,T=e.append("g").lower(),f=T;r||(B++,Object.keys(t.links||{}).length&&!s.forceMenus&&f.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),f.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),f=T.append("g"),t.actorCnt=B,t.links!=null&&f.attr("id","root-"+B),c==="neo"&&f.attr("data-look","neo"));let g=lt(),b="actor";t.properties?.class?b=t.properties.class:g.fill="#eaeaea",r?b+=` ${xt}`:b+=` ${gt}`,g.x=t.x,g.y=i,g.width=t.width,g.height=t.height,g.class=b,g.name=t.name,g.x=t.x,g.y=i;let R=g.width/3,O=g.width/3,A=R/2,N=A/(2.5+R/50),S=f.append("g");S.attr("class",b);let V=`
|
|
M ${g.x},${g.y+N}
|
|
a ${A},${N} 0 0 0 ${R},0
|
|
a ${A},${N} 0 0 0 -${R},0
|
|
l 0,${O-2*N}
|
|
a ${A},${N} 0 0 0 ${R},0
|
|
l 0,-${O-2*N}
|
|
`;S.append("path").attr("d",V),c==="neo"&&S.attr("filter","url(#drop-shadow)");let v=n.get(t.name)??0;Tt.has(E)?(S.style("stroke",u[v%u.length]),S.style("fill",_[v%u.length])):S.style("stroke",y),S.attr("transform",`translate(${R}, ${N})`),t.rectData=g,Et(s,Q(t.description))(t.description,f,g.x,g.y+35,g.width,g.height,{class:`actor ${Ht}`},s);let H=S.select("path:last-child");if(H.node()){let U=H.node().getBBox();t.height=U.height+(s.sequence.labelBoxHeight??0)}return r||(f.attr("data-et","participant"),f.attr("data-type","database"),f.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),kr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+80,E=22,h=e.append("g").lower(),{look:c,theme:_,themeVariables:u}=s,{bkgColorArray:y,borderColorArray:T,actorBorder:f}=u;r||(B++,h.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);let g=e.append("g"),b=It;r?b+=` ${xt}`:b+=` ${gt}`,g.attr("class",b),g.attr("name",t.name);let R=lt();R.x=t.x,R.y=i,R.fill="#eaeaea",R.width=t.width,R.height=t.height,R.class="actor",g.append("line").attr("id","actor-man-torso"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",i+12).attr("x2",t.x+t.width/2-15).attr("y2",i+12),g.append("line").attr("id","actor-man-arms"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",i+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",i+22),g.append("circle").attr("cx",t.x+t.width/2).attr("cy",i+12).attr("r",E),c==="neo"&&g.attr("filter","url(#drop-shadow)");let O=n.get(t.name)??0;Tt.has(_)?(g.style("stroke",T[O%T.length]),g.style("fill",y[O%T.length])):g.style("stroke",f);let A=g.node().getBBox();return t.height=A.height+(s.sequence.labelBoxHeight??0),Et(s,Q(t.description))(t.description,g,R.x,R.y+15,R.width,R.height,{class:`actor ${It}`},s),g.attr("transform",`translate(0,${E/2+10})`),r||(g.attr("data-et","participant"),g.attr("data-type","boundary"),g.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),Pr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+80,{look:E,theme:h,themeVariables:c}=s,{bkgColorArray:_,borderColorArray:u,actorBorder:y}=c,T=e.append("g").lower();r||(B++,T.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);let f=e.append("g"),g=It;r?g+=` ${xt}`:g+=` ${gt}`,f.attr("class",g),f.attr("name",t.name),r||f.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);let b=E==="neo"?.5:1,R=E==="neo"?i+(1-b)*30:i;f.append("line").attr("id","actor-man-torso"+B).attr("x1",a).attr("y1",R+25*b).attr("x2",a).attr("y2",R+45*b),f.append("line").attr("id","actor-man-arms"+B).attr("x1",a-ft/2*b).attr("y1",R+33*b).attr("x2",a+ft/2*b).attr("y2",R+33*b),f.append("line").attr("x1",a-ft/2*b).attr("y1",R+60*b).attr("x2",a).attr("y2",R+45*b),f.append("line").attr("x1",a).attr("y1",R+45*b).attr("x2",a+(ft/2-2)*b).attr("y2",R+60*b);let O=f.append("circle");O.attr("cx",t.x+t.width/2),O.attr("cy",R+10*b),O.attr("r",15*b),O.attr("width",t.width*b),O.attr("height",t.height*b);let A=f.node().getBBox();t.height=A.height;let N=lt();N.x=t.x,N.y=R,N.fill="#eaeaea",N.width=t.width,N.height=t.height/b,N.class="actor",N.rx=3,N.ry=3;let S=n.get(t.name)??0;return Tt.has(h)?(f.style("stroke",u[S%u.length]),f.style("fill",_[S%u.length])):f.style("stroke",y),Et(s,Q(t.description))(t.description,f,N.x,R+35*b-(E==="neo"?10:0),N.width,N.height,{class:`actor ${It}`},s),t.height},"drawActorTypeActor"),Dr=x(async function(e,t,s,r,n,i,a){let l=a??new Map([...i.db.getActors().values()].map((E,h)=>[E.name,h]));switch(t.type){case"actor":return await Pr(e,t,s,r,l);case"participant":return await Or(e,t,s,r,l);case"boundary":return await kr(e,t,s,r,l);case"control":return await Ar(e,t,s,r,n,l);case"entity":return await wr(e,t,s,r,l);case"database":return await Sr(e,t,s,r,l);case"collections":return await Lr(e,t,s,r,l);case"queue":return await Nr(e,t,s,r,l)}},"drawActor"),Cr=x(function(e,t,s){let n=e.append("g");ar(n,t),t.name&&Et(s)(t.name,n,t.x,t.y+s.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},s),n.lower()},"drawBox"),Mr=x(function(e){return e.append("g")},"anchorElement"),Br=x(function(e,t,s,r,n,i,a){let{theme:l,themeVariables:E}=r,{bkgColorArray:h,borderColorArray:c,mainBkg:_}=E,u=lt(),y=t.anchored,T=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+n%3,u.width=t.stopx-t.startx,u.height=s-t.starty;let f=Ct(y,u),b=(a??new Map([...i.db.getActors().values()].map((R,O)=>[R.name,O]))).get(T)??0;Tt.has(l)&&(f.style("stroke",c[b%c.length]),f.style("fill",h[b%c.length]??_))},"drawActivation"),Vr=x(async function(e,t,s,r,n){let{boxMargin:i,boxTextMargin:a,labelBoxHeight:l,labelBoxWidth:E,messageFontFamily:h,messageFontSize:c,messageFontWeight:_}=r,u=e.append("g").attr("data-et","control-structure").attr("data-id","i"+n.id),y=x(function(g,b,R,O){return u.append("line").attr("x1",g).attr("y1",b).attr("x2",R).attr("y2",O).attr("class","loopLine")},"drawLoopLine");y(t.startx,t.starty,t.stopx,t.starty),y(t.stopx,t.starty,t.stopx,t.stopy),y(t.startx,t.stopy,t.stopx,t.stopy),y(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(g){y(t.startx,g.y,t.stopx,g.y).style("stroke-dasharray","3, 3")});let T=Pt();T.text=s,T.x=t.startx,T.y=t.starty,T.fontFamily=h,T.fontSize=c,T.fontWeight=_,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=Math.max(E??0,50),T.height=l+(r.look==="neo"?15:0)||20,T.textMargin=a,T.class="labelText",sr(u,T),T=nr(),T.text=t.title,T.x=t.startx+E/2+(t.stopx-t.startx)/2,T.y=t.starty+i+a,T.anchor="middle",T.valign="middle",T.textMargin=a,T.class="loopText",T.fontFamily=h,T.fontSize=c,T.fontWeight=_,T.wrap=!0;let f=Q(T.text)?await Mt(u,T,t):yt(u,T);if(t.sectionTitles!==void 0){for(let[g,b]of Object.entries(t.sectionTitles))if(b.message){T.text=b.message,T.x=t.startx+(t.stopx-t.startx)/2,T.y=t.sections[g].y+i+a,T.class="sectionTitle",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=h,T.fontSize=c,T.fontWeight=_,T.wrap=t.wrap,Q(T.text)?(t.starty=t.sections[g].y,await Mt(u,T,t)):yt(u,T);let R=Math.round(f.map(O=>(O._groups||O)[0][0].getBBox().height).reduce((O,A)=>O+A));t.sections[g].height+=R-(i+a)}}return t.height=Math.round(t.stopy-t.starty),u},"drawLoop"),ar=x(function(e,t){Ze(e,t)},"drawBackgroundRect"),vr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),Yr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),Wr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),Kr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),Fr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),qr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),Hr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),zr=x(function(e,t){let{theme:s}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s==="redux"||s==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),nr=x(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"),Ur=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=(function(){function e(i,a,l,E,h,c,_){let u=a.append("text").attr("x",l+h/2).attr("y",E+c/2+5).style("text-anchor","middle").text(i);n(u,_)}x(e,"byText");function t(i,a,l,E,h,c,_,u){let{actorFontSize:y,actorFontFamily:T,actorFontWeight:f}=u,[g,b]=ae(y),R=i.split(k.lineBreakRegex);for(let O=0;O<R.length;O++){let A=O*g-g*(R.length-1)/2,N=a.append("text").attr("x",l+h/2).attr("y",E).style("text-anchor","middle").style("font-size",b).style("font-weight",f).style("font-family",T);N.append("tspan").attr("x",l+h/2).attr("dy",A).text(R[O]),N.attr("y",E+c/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(N,_)}}x(t,"byTspan");function s(i,a,l,E,h,c,_,u){let y=a.append("switch"),f=y.append("foreignObject").attr("x",l).attr("y",E).attr("width",h).attr("height",c).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");f.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,y,l,E,h,c,_,u),n(f,_)}x(s,"byFo");async function r(i,a,l,E,h,c,_,u){let y=await mt(i,wt()),T=a.append("switch"),g=T.append("foreignObject").attr("x",l+h/2-y.width/2).attr("y",E+c/2-y.height/2).attr("width",y.width).attr("height",y.height).append("xhtml:div").style("height","100%").style("width","100%");g.append("div").style("text-align","center").style("vertical-align","middle").html(await re(i,wt())),t(i,T,l,E,h,c,_,u),n(g,_)}x(r,"byKatex");function n(i,a){for(let l in a)a.hasOwnProperty(l)&&i.attr(l,a[l])}return x(n,"_setTextAttrs"),function(i,a=!1){return a?r:i.textPlacement==="fo"?s:i.textPlacement==="old"?e:t}})(),Gr=(function(){function e(n,i,a,l,E,h,c){let _=i.append("text").attr("x",a).attr("y",l).style("text-anchor","start").text(n);r(_,c)}x(e,"byText");function t(n,i,a,l,E,h,c,_){let{actorFontSize:u,actorFontFamily:y,actorFontWeight:T}=_,f=n.split(k.lineBreakRegex);for(let g=0;g<f.length;g++){let b=g*u-u*(f.length-1)/2,R=i.append("text").attr("x",a).attr("y",l).style("text-anchor","start").style("font-size",u).style("font-weight",T).style("font-family",y);R.append("tspan").attr("x",a).attr("dy",b).text(f[g]),R.attr("y",l+h/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(R,c)}}x(t,"byTspan");function s(n,i,a,l,E,h,c,_){let u=i.append("switch"),T=u.append("foreignObject").attr("x",a).attr("y",l).attr("width",E).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");T.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),t(n,u,a,l,E,h,c,_),r(T,c)}x(s,"byFo");function r(n,i){for(let a in i)i.hasOwnProperty(a)&&n.attr(a,i[a])}return x(r,"_setTextAttrs"),function(n){return n.textPlacement==="fo"?s:n.textPlacement==="old"?e:t}})(),Xr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),Jr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),Zr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),Qr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),K={drawRect:Ct,drawText:yt,drawLabel:sr,drawActor:Dr,drawBox:Cr,drawPopup:Rr,anchorElement:Mr,drawActivation:Br,drawLoop:Vr,drawBackgroundRect:ar,insertArrowHead:Kr,insertArrowFilledHead:Fr,insertSequenceNumber:qr,insertArrowCrossHead:Hr,insertDatabaseIcon:vr,insertComputerIcon:Yr,insertClockIcon:Wr,getTextObj:nr,getNoteRect:Ur,fixLifeLineHeights:oe,sanitizeUrl:ie.sanitizeUrl,insertDropShadow:zr,insertSolidTopArrowHead:Xr,insertSolidBottomArrowHead:Jr,insertStickTopArrowHead:Zr,insertStickBottomArrowHead:Qr};var d={},I={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:x(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(e){this.boxes.push(e)},"addBox"),addActor:x(function(e){this.actors.push(e)},"addActor"),addLoop:x(function(e){this.loops.push(e)},"addLoop"),addMessage:x(function(e){this.messages.push(e)},"addMessage"),addNote:x(function(e){this.notes.push(e)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(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,lr($())},"init"),updateVal:x(function(e,t,s,r){e[t]===void 0?e[t]=s:e[t]=r(s,e[t])},"updateVal"),updateBounds:x(function(e,t,s,r){let n=this,i=0;function a(l){return x(function(h){i++;let c=n.sequenceItems.length-i+1;n.updateVal(h,"starty",t-c*d.boxMargin,Math.min),n.updateVal(h,"stopy",r+c*d.boxMargin,Math.max),n.updateVal(I.data,"startx",e-c*d.boxMargin,Math.min),n.updateVal(I.data,"stopx",s+c*d.boxMargin,Math.max),l!=="activation"&&(n.updateVal(h,"startx",e-c*d.boxMargin,Math.min),n.updateVal(h,"stopx",s+c*d.boxMargin,Math.max),n.updateVal(I.data,"starty",t-c*d.boxMargin,Math.min),n.updateVal(I.data,"stopy",r+c*d.boxMargin,Math.max))},"updateItemBounds")}x(a,"updateFn"),this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},"updateBounds"),insert:x(function(e,t,s,r){let n=k.getMin(e,s),i=k.getMax(e,s),a=k.getMin(t,r),l=k.getMax(t,r);this.updateVal(I.data,"startx",n,Math.min),this.updateVal(I.data,"starty",a,Math.min),this.updateVal(I.data,"stopx",i,Math.max),this.updateVal(I.data,"stopy",l,Math.max),this.updateBounds(n,a,i,l)},"insert"),newActivation:x(function(e,t,s){let r=s.get(e.from),n=Ut(e.from).length||0,i=r.x+r.width/2+(n-1)*d.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+d.activationWidth,stopy:void 0,actor:e.from,anchored:K.anchorElement(t)})},"newActivation"),endActivation:x(function(e){let t=this.activations.map(function(s){return s.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:x(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:x(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:I.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=k.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},$r=x(async function(e,t,s){I.bumpVerticalPos(d.boxMargin),t.height=d.boxMargin,t.starty=I.getVerticalPos();let r=lt();r.x=t.startx,r.y=t.starty,r.width=t.width||d.width,r.class="note";let n=e.append("g");n.attr("data-et","note"),n.attr("data-id","i"+s);let i=K.drawRect(n,r),a=Pt();a.x=t.startx,a.y=t.starty,a.width=r.width,a.dy="1em",a.text=t.message,a.class="noteText",a.fontFamily=d.noteFontFamily,a.fontSize=d.noteFontSize,a.fontWeight=d.noteFontWeight,a.anchor=d.noteAlign,a.textMargin=d.noteMargin,a.valign="center";let l=Q(a.text)?await Mt(n,a):yt(n,a),E=Math.round(l.map(h=>(h._groups||h)[0][0].getBBox().height).reduce((h,c)=>h+c));i.attr("height",E+2*d.noteMargin),t.height+=E+2*d.noteMargin,I.bumpVerticalPos(E+2*d.noteMargin),t.stopy=t.starty+E+2*d.noteMargin,t.stopx=t.startx+r.width,I.insert(t.startx,t.starty,t.stopx,t.stopy),I.models.addNote(t)},"drawNote"),ir=x(function(e,t,s,r,n,i,a){let l=r.db.getActors(),E=l.get(t.from),h=l.get(t.to),c=s.sequenceVisible,_=E.x+E.width/2,u=h.x+h.width/2,y=_<=u,T=dr(t,r),f=e.append("g"),g=16.5,b=x((S,V)=>{let v=S?g:-g;return V?-v:v},"getCircleOffset"),R=x(S=>{f.append("circle").attr("cx",S).attr("cy",a).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:O,CENTRAL_CONNECTION_REVERSE:A,CENTRAL_CONNECTION_DUAL:N}=r.db.LINETYPE;if(c)switch(t.centralConnection){case O:T&&(u+=b(y,!0));break;case A:T||(_+=b(y,!1));break;case N:T?u+=b(y,!0):_+=b(y,!1);break}switch(t.centralConnection){case O:R(u);break;case A:R(_);break;case N:R(_),R(u);break}},"drawCentralConnection"),Rt=x(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Lt=x(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),le=x(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function jr(e,t){I.bumpVerticalPos(10);let{startx:s,stopx:r,message:n}=t,i=k.splitBreaks(n).length,a=Q(n),l=a?await mt(n,$()):X.calculateTextDimensions(n,Rt(d));if(!a){let _=l.height/i;t.height+=_,I.bumpVerticalPos(_)}let E,h=l.height-10,c=l.width;if(s===r){E=I.getVerticalPos()+h,d.rightAngles||(h+=d.boxMargin,E=I.getVerticalPos()+h),h+=30;let _=k.getMax(c/2,d.width/2);I.insert(s-_,I.getVerticalPos()-10+h,r+_,I.getVerticalPos()+30+h)}else h+=d.boxMargin,E=I.getVerticalPos()+h,I.insert(s,E-10,r,E);return I.bumpVerticalPos(h),t.height+=h,t.stopy=t.starty+t.height,I.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),E}x(jr,"boundMessage");var ts=x(async function(e,t,s,r,n,i){let{startx:a,stopx:l,starty:E,message:h,type:c,sequenceIndex:_,sequenceVisible:u}=t,y=X.calculateTextDimensions(h,Rt(d)),T=Pt();T.x=Math.min(a,l),T.y=E+10,T.width=Math.abs(l-a),T.class="messageText",T.dy="1em",T.text=h,T.fontFamily=d.messageFontFamily,T.fontSize=d.messageFontSize,T.fontWeight=d.messageFontWeight,T.anchor=d.messageAlign,T.valign="center",T.textMargin=d.wrapPadding,T.tspan=!1,Q(T.text)?await Mt(e,T,{startx:a,stopx:l,starty:s}):yt(e,T);let f=y.width,g;if(a===l){let R=u||d.showSequenceNumbers,O=dr(n,r),A=hs(n,r),N=a+(R&&(O||A)?10:0);d.rightAngles?g=e.append("path").attr("d",`M ${N},${s} H ${a+k.getMax(d.width/2,f/2)} V ${s+25} H ${a}`):g=e.append("path").attr("d","M "+N+","+s+" C "+(N+60)+","+(s-10)+" "+(a+60)+","+(s+30)+" "+a+","+(s+20)),ce(n,r)&&ir(e,n,t,r,a,l,s)}else g=e.append("line"),g.attr("x1",a),g.attr("y1",s),g.attr("x2",l),g.attr("y2",s),ce(n,r)&&ir(e,n,t,r,a,l,s);c===r.db.LINETYPE.DOTTED||c===r.db.LINETYPE.DOTTED_CROSS||c===r.db.LINETYPE.DOTTED_POINT||c===r.db.LINETYPE.DOTTED_OPEN||c===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||c===r.db.LINETYPE.SOLID_TOP_DOTTED||c===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||c===r.db.LINETYPE.STICK_TOP_DOTTED||c===r.db.LINETYPE.STICK_BOTTOM_DOTTED||c===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||c===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||c===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||c===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0"),g.attr("data-et","message"),g.attr("data-id","i"+t.id),g.attr("data-from",t.from),g.attr("data-to",t.to);let b="";if(d.arrowMarkerAbsolute&&(b=We(!0)),g.attr("stroke-width",2),g.attr("stroke","none"),g.style("fill","none"),(c===r.db.LINETYPE.SOLID_TOP||c===r.db.LINETYPE.SOLID_TOP_DOTTED)&&g.attr("marker-end","url("+b+"#"+i+"-solidTopArrowHead)"),(c===r.db.LINETYPE.SOLID_BOTTOM||c===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&g.attr("marker-end","url("+b+"#"+i+"-solidBottomArrowHead)"),(c===r.db.LINETYPE.STICK_TOP||c===r.db.LINETYPE.STICK_TOP_DOTTED)&&g.attr("marker-end","url("+b+"#"+i+"-stickTopArrowHead)"),(c===r.db.LINETYPE.STICK_BOTTOM||c===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&g.attr("marker-end","url("+b+"#"+i+"-stickBottomArrowHead)"),(c===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||c===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&g.attr("marker-start","url("+b+"#"+i+"-solidBottomArrowHead)"),(c===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||c===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&g.attr("marker-start","url("+b+"#"+i+"-solidTopArrowHead)"),(c===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||c===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&g.attr("marker-start","url("+b+"#"+i+"-stickBottomArrowHead)"),(c===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||c===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&g.attr("marker-start","url("+b+"#"+i+"-stickTopArrowHead)"),(c===r.db.LINETYPE.SOLID||c===r.db.LINETYPE.DOTTED)&&g.attr("marker-end","url("+b+"#"+i+"-arrowhead)"),(c===r.db.LINETYPE.BIDIRECTIONAL_SOLID||c===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(g.attr("marker-start","url("+b+"#"+i+"-arrowhead)"),g.attr("marker-end","url("+b+"#"+i+"-arrowhead)")),(c===r.db.LINETYPE.SOLID_POINT||c===r.db.LINETYPE.DOTTED_POINT)&&g.attr("marker-end","url("+b+"#"+i+"-filled-head)"),(c===r.db.LINETYPE.SOLID_CROSS||c===r.db.LINETYPE.DOTTED_CROSS)&&g.attr("marker-end","url("+b+"#"+i+"-crosshead)"),u||d.showSequenceNumbers){let R=c===r.db.LINETYPE.BIDIRECTIONAL_SOLID||c===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,O=c===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||c===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||c===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||c===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||c===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||c===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||c===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||c===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,A=6,N=ce(n,r),S=a,V=l;R?(a<l?S=a+A*2:(S=a-A+(N?-5:0),S+=n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),g.attr("x1",S)):O?(l>a?V=l-2*A:(V=l-A,S+=n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||n?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),V+=N?15:0,g.attr("x2",V),g.attr("x1",S)):g.attr("x1",a+A);let v=0,H=a===l,U=a<=l;H?v=t.fromBounds+1:O?v=U?t.toBounds-1:t.fromBounds+1:v=U?t.fromBounds+1:t.toBounds-1;let G="12px",J=_.toString().length;J>5?G="7px":J>3&&(G="9px"),e.append("line").attr("x1",v).attr("y1",s).attr("x2",v).attr("y2",s).attr("stroke-width",0).attr("marker-start","url("+b+"#"+i+"-sequencenumber)"),e.append("text").attr("x",v).attr("y",s+4).attr("font-family","sans-serif").attr("font-size",G).attr("text-anchor","middle").attr("class","sequenceNumber").text(_)}},"drawMessage"),es=x(function(e,t,s,r,n,i,a){let l=0,E=0,h,c=0;for(let _ of r){let u=t.get(_),y=u.box;h&&h!=y&&(a||I.models.addBox(h),E+=d.boxMargin+h.margin),y&&y!=h&&(a||(y.x=l+E,y.y=n),E+=y.margin),u.width=k.getMax(u.width||d.width,d.width),u.height=k.getMax(u.height||d.height,d.height),u.margin=u.margin||d.actorMargin,c=k.getMax(c,u.height),s.get(u.name)&&(E+=u.width/2),u.x=l+E,u.starty=I.getVerticalPos(),I.insert(u.x,n,u.x+u.width,u.height),l+=u.width+E,u.box&&(u.box.width=l+y.margin-u.box.x),E=u.margin,h=u.box,I.models.addActor(u)}h&&!a&&I.models.addBox(h),I.bumpVerticalPos(c)},"addActorRenderingData"),de=x(async function(e,t,s,r,n,i,a){if(r){let l=0;I.bumpVerticalPos(d.boxMargin*2);for(let E of s){let h=t.get(E);h.stopy||(h.stopy=I.getVerticalPos());let c=await K.drawActor(e,h,d,!0,n,i,a);l=k.getMax(l,c)}I.bumpVerticalPos(l+d.boxMargin)}else for(let l of s){let E=t.get(l);await K.drawActor(e,E,d,!1,n,i,a)}},"drawActors"),cr=x(function(e,t,s,r){let n=0,i=0;for(let a of s){let l=t.get(a),E=ns(l),h=K.drawPopup(e,l,E,d,d.forceMenus,r);h.height>n&&(n=h.height),h.width+l.x>i&&(i=h.width+l.x)}return{maxHeight:n,maxWidth:i}},"drawActorsPopup"),lr=x(function(e){Ye(d,e),e.fontFamily&&(d.actorFontFamily=d.noteFontFamily=d.messageFontFamily=e.fontFamily),e.fontSize&&(d.actorFontSize=d.noteFontSize=d.messageFontSize=e.fontSize),e.fontWeight&&(d.actorFontWeight=d.noteFontWeight=d.messageFontWeight=e.fontWeight)},"setConf"),Ut=x(function(e){return I.activations.filter(function(t){return t.actor===e})},"actorActivations"),or=x(function(e,t){let s=t.get(e),r=Ut(e),n=r.reduce(function(a,l){return k.getMin(a,l.startx)},s.x+s.width/2-1),i=r.reduce(function(a,l){return k.getMax(a,l.stopx)},s.x+s.width/2+1);return[n,i]},"activationBounds");function ht(e,t,s,r,n){I.bumpVerticalPos(s);let i=r;if(t.id&&t.message&&e[t.id]){let a=e[t.id].width,l=Rt(d);t.message=X.wrapLabel(`[${t.message}]`,a-2*d.wrapPadding,l),t.width=a,t.wrap=!0;let E=X.calculateTextDimensions(t.message,l),h=k.getMax(E.height,d.labelBoxHeight);i=r+h,j.debug(`${h} - ${t.message}`)}n(t),I.bumpVerticalPos(i)}x(ht,"adjustLoopHeightForWrap");function rs(e,t,s,r,n,i,a){function l(c,_){c.x<n.get(e.from).x?(I.insert(t.stopx-_,t.starty,t.startx,t.stopy+c.height/2+d.noteMargin),t.stopx=t.stopx+_):(I.insert(t.startx,t.starty,t.stopx+_,t.stopy+c.height/2+d.noteMargin),t.stopx=t.stopx-_)}x(l,"receiverAdjustment");function E(c,_){c.x<n.get(e.to).x?(I.insert(t.startx-_,t.starty,t.stopx,t.stopy+c.height/2+d.noteMargin),t.startx=t.startx+_):(I.insert(t.stopx,t.starty,t.startx+_,t.stopy+c.height/2+d.noteMargin),t.startx=t.startx-_)}x(E,"senderAdjustment");let h=[Dt.ACTOR,Dt.CONTROL,Dt.ENTITY,Dt.DATABASE];if(i.get(e.to)==r){let c=n.get(e.to),_=h.includes(c.type)?ft/2+3:c.width/2+3;l(c,_),c.starty=s-c.height/2,I.bumpVerticalPos(c.height/2)}else if(a.get(e.from)==r){let c=n.get(e.from);if(d.mirrorActors){let _=h.includes(c.type)?ft/2:c.width/2;E(c,_)}c.stopy=s-c.height/2,I.bumpVerticalPos(c.height/2)}else if(a.get(e.to)==r){let c=n.get(e.to);if(d.mirrorActors){let _=h.includes(c.type)?ft/2+3:c.width/2+3;l(c,_)}c.stopy=s-c.height/2,I.bumpVerticalPos(c.height/2)}}x(rs,"adjustCreatedDestroyedData");var ss=x(async function(e,t,s,r){let{securityLevel:n,sequence:i,look:a}=$();d=i;let l;n==="sandbox"&&(l=kt("#i"+t));let E=n==="sandbox"?kt(l.nodes()[0].contentDocument.body):kt("body"),h=n==="sandbox"?l.nodes()[0].contentDocument:document;I.init(),j.debug(r.db);let c=n==="sandbox"?E.select(`[id="${t}"]`):kt(`[id="${t}"]`),_=r.db.getActors(),u=r.db.getCreatedActors(),y=r.db.getDestroyedActors(),T=r.db.getBoxes(),f=r.db.getActorKeys(),g=r.db.getMessages(),b=r.db.getDiagramTitle(),R=r.db.hasAtLeastOneBox(),O=r.db.hasAtLeastOneBoxWithTitle(),A=await as(_,g,r);if(d.height=await is(_,A,T),K.insertComputerIcon(c,t),K.insertDatabaseIcon(c,t),K.insertClockIcon(c,t),R&&(I.bumpVerticalPos(d.boxMargin),O&&I.bumpVerticalPos(T[0].textMaxHeight)),d.hideUnusedParticipants===!0){let L=new Set;g.forEach(D=>{L.add(D.from),L.add(D.to)}),f=f.filter(D=>L.has(D))}let N=new Map(f.map((L,D)=>[_.get(L)?.name??L,D]));es(c,_,u,f,0,g,!1);let S=await Ts(g,_,A,r);K.insertArrowHead(c,t),K.insertArrowCrossHead(c,t),K.insertArrowFilledHead(c,t),K.insertSequenceNumber(c,t),K.insertSolidTopArrowHead(c,t),K.insertSolidBottomArrowHead(c,t),K.insertStickTopArrowHead(c,t),K.insertStickBottomArrowHead(c,t),a==="neo"&&K.insertDropShadow(c,d);function V(L,D){let dt=I.endActivation(L);dt.starty+18>D&&(dt.starty=D-6,D+=12),K.drawActivation(c,dt,D,d,Ut(L.from).length,r,N),I.insert(dt.startx,D-10,dt.stopx,D)}x(V,"activeEnd");let v=1,H=1,U=[],G=[],J=0;for(let L of g){let D,dt,st;switch(L.type){case r.db.LINETYPE.NOTE:I.resetVerticalPos(),dt=L.noteModel,await $r(c,dt,L.id);break;case r.db.LINETYPE.ACTIVE_START:I.newActivation(L,c,_);break;case r.db.LINETYPE.CENTRAL_CONNECTION:I.newActivation(L,c,_);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:I.newActivation(L,c,_);break;case r.db.LINETYPE.ACTIVE_END:V(L,I.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:ht(S,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case r.db.LINETYPE.LOOP_END:D=I.endLoop(),await K.drawLoop(c,D,"loop",d,L),I.bumpVerticalPos(D.stopy-I.getVerticalPos()),I.models.addLoop(D);break;case r.db.LINETYPE.RECT_START:ht(S,L,d.boxMargin,d.boxMargin,W=>I.newLoop(void 0,W.message));break;case r.db.LINETYPE.RECT_END:D=I.endLoop(),G.push(D),I.models.addLoop(D),I.bumpVerticalPos(D.stopy-I.getVerticalPos());break;case r.db.LINETYPE.OPT_START:ht(S,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case r.db.LINETYPE.OPT_END:D=I.endLoop(),await K.drawLoop(c,D,"opt",d,L),I.bumpVerticalPos(D.stopy-I.getVerticalPos()),I.models.addLoop(D);break;case r.db.LINETYPE.ALT_START:ht(S,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case r.db.LINETYPE.ALT_ELSE:ht(S,L,d.boxMargin+d.boxTextMargin,d.boxMargin,W=>I.addSectionToLoop(W));break;case r.db.LINETYPE.ALT_END:D=I.endLoop(),await K.drawLoop(c,D,"alt",d,L),I.bumpVerticalPos(D.stopy-I.getVerticalPos()),I.models.addLoop(D);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:ht(S,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W)),I.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:ht(S,L,d.boxMargin+d.boxTextMargin,d.boxMargin,W=>I.addSectionToLoop(W));break;case r.db.LINETYPE.PAR_END:D=I.endLoop(),await K.drawLoop(c,D,"par",d,L),I.bumpVerticalPos(D.stopy-I.getVerticalPos()),I.models.addLoop(D);break;case r.db.LINETYPE.AUTONUMBER:v=L.message.start||v,H=L.message.step||H,L.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:ht(S,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case r.db.LINETYPE.CRITICAL_OPTION:ht(S,L,d.boxMargin+d.boxTextMargin,d.boxMargin,W=>I.addSectionToLoop(W));break;case r.db.LINETYPE.CRITICAL_END:D=I.endLoop(),await K.drawLoop(c,D,"critical",d,L),I.bumpVerticalPos(D.stopy-I.getVerticalPos()),I.models.addLoop(D);break;case r.db.LINETYPE.BREAK_START:ht(S,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case r.db.LINETYPE.BREAK_END:D=I.endLoop(),await K.drawLoop(c,D,"break",d,L),I.bumpVerticalPos(D.stopy-I.getVerticalPos()),I.models.addLoop(D);break;default:try{st=L.msgModel,st.starty=I.getVerticalPos(),st.sequenceIndex=v,st.sequenceVisible=r.db.showSequenceNumbers(),st.id=L.id,st.from=L.from,st.to=L.to;let W=await jr(c,st);rs(L,st,W,J,_,u,y),U.push({messageModel:st,lineStartY:W,msg:L}),I.models.addMessage(st)}catch(W){j.error("error while drawing message",W)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(L.type)&&(v=Math.round((v+H)*100)/100),J++}j.debug("createdActors",u),j.debug("destroyedActors",y),await de(c,_,f,!1,t,r,N);for(let L of U)await ts(c,L.messageModel,L.lineStartY,r,L.msg,t);d.mirrorActors&&await de(c,_,f,!0,t,r,N),G.forEach(L=>K.drawBackgroundRect(c,L)),oe(c,_,f,d);for(let L of I.models.boxes){L.height=I.getVerticalPos()-L.y,I.insert(L.x,L.y,L.x+L.width,L.height);let D=d.boxMargin*2;L.startx=L.x-D,L.starty=L.y-D*.25,L.stopx=L.startx+L.width+2*D,L.stopy=L.starty+L.height+D*.75,L.stroke="rgb(0,0,0, 0.5)",K.drawBox(c,L,d)}R&&I.bumpVerticalPos(d.boxMargin);let et=cr(c,_,f,h),{bounds:z}=I.getBounds();z.startx===void 0&&(z.startx=0),z.starty===void 0&&(z.starty=0),z.stopx===void 0&&(z.stopx=0),z.stopy===void 0&&(z.stopy=0);let at=z.stopy-z.starty;at<et.maxHeight&&(at=et.maxHeight);let rt=at+2*d.diagramMarginY;d.mirrorActors&&(rt=rt-d.boxMargin+d.bottomMarginAdj);let nt=z.stopx-z.startx;nt<et.maxWidth&&(nt=et.maxWidth);let Y=nt+2*d.diagramMarginX;b&&c.append("text").text(b).attr("x",(z.stopx-z.startx)/2-2*d.diagramMarginX).attr("y",-25),Ke(c,rt,Y,d.useMaxWidth);let M=b?40:0,Bt=_.size&&a==="neo"?30:0;c.attr("viewBox",z.startx-d.diagramMarginX+" -"+(d.diagramMarginY+M)+" "+Y+" "+(rt+M+Bt)),j.debug("models:",I.models)},"draw");async function as(e,t,s){let r={};for(let n of t)if(e.get(n.to)&&e.get(n.from)){let i=e.get(n.to);if(n.placement===s.db.PLACEMENT.LEFTOF&&!i.prevActor||n.placement===s.db.PLACEMENT.RIGHTOF&&!i.nextActor)continue;let a=n.placement!==void 0,l=!a,E=a?Lt(d):Rt(d),h=n.wrap?X.wrapLabel(n.message,d.width-2*d.wrapPadding,E):n.message,_=(Q(h)?await mt(n.message,$()):X.calculateTextDimensions(h,E)).width+2*d.wrapPadding;l&&n.from===i.nextActor?r[n.to]=k.getMax(r[n.to]||0,_):l&&n.from===i.prevActor?r[n.from]=k.getMax(r[n.from]||0,_):l&&n.from===n.to?(r[n.from]=k.getMax(r[n.from]||0,_/2),r[n.to]=k.getMax(r[n.to]||0,_/2)):n.placement===s.db.PLACEMENT.RIGHTOF?r[n.from]=k.getMax(r[n.from]||0,_):n.placement===s.db.PLACEMENT.LEFTOF?r[i.prevActor]=k.getMax(r[i.prevActor]||0,_):n.placement===s.db.PLACEMENT.OVER&&(i.prevActor&&(r[i.prevActor]=k.getMax(r[i.prevActor]||0,_/2)),i.nextActor&&(r[n.from]=k.getMax(r[n.from]||0,_/2)))}return j.debug("maxMessageWidthPerActor:",r),r}x(as,"getMaxMessageWidthPerActor");var ns=x(function(e){let t=0,s=le(d);for(let r in e.links){let i=X.calculateTextDimensions(r,s).width+2*d.wrapPadding+2*d.boxMargin;t<i&&(t=i)}return t},"getRequiredPopupWidth");async function is(e,t,s){let r=0;for(let i of e.keys()){let a=e.get(i);a.wrap&&(a.description=X.wrapLabel(a.description,d.width-2*d.wrapPadding,le(d)));let l=Q(a.description)?await mt(a.description,$()):X.calculateTextDimensions(a.description,le(d));a.width=a.wrap?d.width:k.getMax(d.width,l.width+2*d.wrapPadding),a.height=a.wrap?k.getMax(l.height,d.height):d.height,r=k.getMax(r,a.height)}for(let i in t){let a=e.get(i);if(!a)continue;let l=e.get(a.nextActor);if(!l){let _=t[i]+d.actorMargin-a.width/2;a.margin=k.getMax(_,d.actorMargin);continue}let h=t[i]+d.actorMargin-a.width/2-l.width/2;a.margin=k.getMax(h,d.actorMargin)}let n=0;return s.forEach(i=>{let a=Rt(d),l=i.actorKeys.reduce((_,u)=>_+=e.get(u).width+(e.get(u).margin||0),0),E=d.boxMargin*8;l+=E,l-=2*d.boxTextMargin,i.wrap&&(i.name=X.wrapLabel(i.name,l-2*d.wrapPadding,a));let h=X.calculateTextDimensions(i.name,a);n=k.getMax(h.height,n);let c=k.getMax(l,h.width+2*d.wrapPadding);if(i.margin=d.boxTextMargin,l<c){let _=(c-l)/2;i.margin+=_}}),s.forEach(i=>i.textMaxHeight=n),k.getMax(r,d.height)}x(is,"calculateActorMargins");var os=x(async function(e,t,s){let r=t.get(e.from),n=t.get(e.to),i=r.x,a=n.x,l=e.wrap&&e.message,E=Q(e.message)?await mt(e.message,$()):X.calculateTextDimensions(l?X.wrapLabel(e.message,d.width,Lt(d)):e.message,Lt(d)),h={width:l?d.width:k.getMax(d.width,E.width+2*d.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===s.db.PLACEMENT.RIGHTOF?(h.width=l?k.getMax(d.width,E.width):k.getMax(r.width/2+n.width/2,E.width+2*d.noteMargin),h.startx=i+(r.width+d.actorMargin)/2):e.placement===s.db.PLACEMENT.LEFTOF?(h.width=l?k.getMax(d.width,E.width+2*d.noteMargin):k.getMax(r.width/2+n.width/2,E.width+2*d.noteMargin),h.startx=i-h.width+(r.width-d.actorMargin)/2):e.to===e.from?(E=X.calculateTextDimensions(l?X.wrapLabel(e.message,k.getMax(d.width,r.width),Lt(d)):e.message,Lt(d)),h.width=l?k.getMax(d.width,r.width):k.getMax(r.width,d.width,E.width+2*d.noteMargin),h.startx=i+(r.width-h.width)/2):(h.width=Math.abs(i+r.width/2-(a+n.width/2))+d.actorMargin,h.startx=i<a?i+r.width/2-d.actorMargin/2:a+n.width/2-d.actorMargin/2),l&&(h.message=X.wrapLabel(e.message,h.width-2*d.wrapPadding,Lt(d))),j.debug(`NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${e.message}]`),h},"buildNoteModel"),cs=4,ls=6,ce=x(function(e,t){let{CENTRAL_CONNECTION:s,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:n}=t.db.LINETYPE;return[s,r,n].includes(e.centralConnection)},"hasCentralConnection"),ds=x(function(e,t,s){let{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:n,BIDIRECTIONAL_SOLID:i,BIDIRECTIONAL_DOTTED:a}=t.db.LINETYPE,l=0;return(e.centralConnection===r||e.centralConnection===n)&&(l+=cs),(e.centralConnection===r||e.centralConnection===n)&&(e.type===i||e.type===a)&&(l+=s?0:-ls),l},"calculateCentralConnectionOffset"),dr=x(function(e,t){let{SOLID_ARROW_TOP_REVERSE:s,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:n,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:i,STICK_ARROW_TOP_REVERSE:a,STICK_ARROW_TOP_REVERSE_DOTTED:l,STICK_ARROW_BOTTOM_REVERSE:E,STICK_ARROW_BOTTOM_REVERSE_DOTTED:h}=t.db.LINETYPE;return[s,r,n,i,a,l,E,h].includes(e.type)},"isReverseArrowType"),hs=x(function(e,t){let{BIDIRECTIONAL_SOLID:s,BIDIRECTIONAL_DOTTED:r}=t.db.LINETYPE;return[s,r].includes(e.type)},"isBidirectionalArrowType"),ps=x(function(e,t,s){let{look:r}=$();if(![s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.SOLID_TOP,s.db.LINETYPE.SOLID_BOTTOM,s.db.LINETYPE.STICK_TOP,s.db.LINETYPE.STICK_BOTTOM,s.db.LINETYPE.SOLID_TOP_DOTTED,s.db.LINETYPE.SOLID_BOTTOM_DOTTED,s.db.LINETYPE.STICK_TOP_DOTTED,s.db.LINETYPE.STICK_BOTTOM_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};let[n,i]=or(e.from,t),[a,l]=or(e.to,t),E=n<=a,h=E?i:n,c=E?a:l;r==="neo"&&(e.type!==s.db.LINETYPE.SOLID_OPEN&&(c+=E?-3:3),(e.type===s.db.LINETYPE.BIDIRECTIONAL_SOLID||e.type===s.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(h+=E?3:-3)),h+=ds(e,s,E);let _=Math.abs(a-l)>2,u=x(g=>E?-g:g,"adjustValue");e.from===e.to?c=h:(e.activate&&!_&&(c+=u(d.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)||(c+=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)&&(h-=u(3)));let y=[n,i,a,l],T=Math.abs(h-c);e.wrap&&e.message&&(e.message=X.wrapLabel(e.message,k.getMax(T+2*d.wrapPadding,d.width),Rt(d)));let f=X.calculateTextDimensions(e.message,Rt(d));return{width:k.getMax(e.wrap?0:f.width+2*d.wrapPadding,T+2*d.wrapPadding,d.width),height:0,startx:h,stopx:c,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,y),toBounds:Math.max.apply(null,y)}},"buildMessageModel");var Ts=x(async function(e,t,s,r){let n={},i=[],a,l,E;for(let h of e){switch(h.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:i.push({id:h.id,msg:h.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:h.message&&(a=i.pop(),n[a.id]=a,n[h.id]=a,i.push(a));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:a=i.pop(),n[a.id]=a;break;case r.db.LINETYPE.ACTIVE_START:{let _=t.get(h.from?h.from:h.to.actor),u=Ut(h.from?h.from:h.to.actor).length,y=_.x+_.width/2+(u-1)*d.activationWidth/2,T={startx:y,stopx:y+d.activationWidth,actor:h.from,enabled:!0};I.activations.push(T)}break;case r.db.LINETYPE.ACTIVE_END:{let _=I.activations.map(u=>u.actor).lastIndexOf(h.from);I.activations.splice(_,1).splice(0,1)}break}h.placement!==void 0?(l=await os(h,t,r),h.noteModel=l,i.forEach(_=>{a=_,a.from=k.getMin(a.from,l.startx),a.to=k.getMax(a.to,l.startx+l.width),a.width=k.getMax(a.width,Math.abs(a.from-a.to))-d.labelBoxWidth})):(E=ps(h,t,r),h.msgModel=E,E.startx&&E.stopx&&i.length>0&&i.forEach(_=>{if(a=_,E.startx===E.stopx){let u=t.get(h.from),y=t.get(h.to);a.from=k.getMin(u.x-E.width/2,u.x-u.width/2,a.from),a.to=k.getMax(y.x+E.width/2,y.x+u.width/2,a.to),a.width=k.getMax(a.width,Math.abs(a.to-a.from))-d.labelBoxWidth}else a.from=k.getMin(E.startx,a.from),a.to=k.getMax(E.stopx,a.to),a.width=k.getMax(a.width,E.width)-d.labelBoxWidth}))}return I.activations=[],j.debug("Loop type widths:",n),n},"calculateLoopBounds"),hr={bounds:I,drawActors:de,drawActorsPopup:cr,setConf:lr,draw:ss};var Qs={parser:er,get db(){return new qt},renderer:hr,styles:rr,init:x(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,Xe({sequence:{wrap:e.wrap}}))},"init")};export{Qs as diagram};
|