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