HomeDashboard/.venv/lib/python3.12/site-packages/nicegui/elements/mermaid/dist/sequenceDiagram-WYCSWKTZ-DpmzzP5a.js
2026-01-03 14:54:18 +01:00

3 lines
85 KiB
JavaScript

import{s as t}from"./chunk-VSLJSFIP-LusxAA0C.js";import{g as e,f as a,h as s,x as r,E as i,d as n}from"./chunk-AQCSOILQ-izsWdJF4.js";import{m as o,d as c,h as l,k as h,t as d,q as p,Y as g,M as u,b as x,X as y,Z as m,Q as b,j as T,K as E,J as f,l as w,D as I,I as L,ag as P,ah as _,f as A,a8 as k,ai as N,aj as v,ak as M,O}from"./index-Bd_j0xvv.js";var S=function(){var t=o(function(t,e,a,s){for(a=a||{},s=t.length;s--;a[t[s]]=e);return a},"o"),e=[1,2],a=[1,3],s=[1,4],r=[2,4],i=[1,9],n=[1,11],c=[1,13],l=[1,14],h=[1,16],d=[1,17],p=[1,18],g=[1,24],u=[1,25],x=[1,26],y=[1,27],m=[1,28],b=[1,29],T=[1,30],E=[1,31],f=[1,32],w=[1,33],I=[1,34],L=[1,35],P=[1,36],_=[1,37],A=[1,38],k=[1,39],N=[1,41],v=[1,42],M=[1,43],O=[1,44],S=[1,45],D=[1,46],R=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],C=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],Y=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],$=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],V=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],F=[68,69,70],W=[1,122],q={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:o(function(t,e,a,s,r,i,n){var o=i.length-1;switch(r){case 3:return s.apply(i[o]),i[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 11:case 12:case 62:this.$=i[o];break;case 15:i[o].type="createParticipant",this.$=i[o];break;case 16:i[o-1].unshift({type:"boxStart",boxData:s.parseBoxData(i[o-2])}),i[o-1].push({type:"boxEnd",boxText:i[o-2]}),this.$=i[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:s.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:s.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:s.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:s.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:s.LINETYPE.ACTIVE_START,actor:i[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:s.LINETYPE.ACTIVE_END,actor:i[o-1].actor};break;case 29:s.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 30:s.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 31:this.$=i[o].trim(),s.setAccTitle(this.$);break;case 32:case 33:this.$=i[o].trim(),s.setAccDescription(this.$);break;case 34:i[o-1].unshift({type:"loopStart",loopText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.LOOP_START}),i[o-1].push({type:"loopEnd",loopText:i[o-2],signalType:s.LINETYPE.LOOP_END}),this.$=i[o-1];break;case 35:i[o-1].unshift({type:"rectStart",color:s.parseMessage(i[o-2]),signalType:s.LINETYPE.RECT_START}),i[o-1].push({type:"rectEnd",color:s.parseMessage(i[o-2]),signalType:s.LINETYPE.RECT_END}),this.$=i[o-1];break;case 36:i[o-1].unshift({type:"optStart",optText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.OPT_START}),i[o-1].push({type:"optEnd",optText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.OPT_END}),this.$=i[o-1];break;case 37:i[o-1].unshift({type:"altStart",altText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.ALT_START}),i[o-1].push({type:"altEnd",signalType:s.LINETYPE.ALT_END}),this.$=i[o-1];break;case 38:i[o-1].unshift({type:"parStart",parText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.PAR_START}),i[o-1].push({type:"parEnd",signalType:s.LINETYPE.PAR_END}),this.$=i[o-1];break;case 39:i[o-1].unshift({type:"parStart",parText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.PAR_OVER_START}),i[o-1].push({type:"parEnd",signalType:s.LINETYPE.PAR_END}),this.$=i[o-1];break;case 40:i[o-1].unshift({type:"criticalStart",criticalText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.CRITICAL_START}),i[o-1].push({type:"criticalEnd",signalType:s.LINETYPE.CRITICAL_END}),this.$=i[o-1];break;case 41:i[o-1].unshift({type:"breakStart",breakText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.BREAK_START}),i[o-1].push({type:"breakEnd",optText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.BREAK_END}),this.$=i[o-1];break;case 43:this.$=i[o-3].concat([{type:"option",optionText:s.parseMessage(i[o-1]),signalType:s.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 45:this.$=i[o-3].concat([{type:"and",parText:s.parseMessage(i[o-1]),signalType:s.LINETYPE.PAR_AND},i[o]]);break;case 47:this.$=i[o-3].concat([{type:"else",altText:s.parseMessage(i[o-1]),signalType:s.LINETYPE.ALT_ELSE},i[o]]);break;case 48:i[o-3].draw="participant",i[o-3].type="addParticipant",i[o-3].description=s.parseMessage(i[o-1]),this.$=i[o-3];break;case 49:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 50:i[o-3].draw="actor",i[o-3].type="addParticipant",i[o-3].description=s.parseMessage(i[o-1]),this.$=i[o-3];break;case 51:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 52:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 53:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 54:i[o-2]=[].concat(i[o-1],i[o-1]).slice(0,2),i[o-2][0]=i[o-2][0].actor,i[o-2][1]=i[o-2][1].actor,this.$=[i[o-1],{type:"addNote",placement:s.PLACEMENT.OVER,actor:i[o-2].slice(0,2),text:i[o]}];break;case 55:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 56:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 57:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 58:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 61:this.$=[i[o-2],i[o]];break;case 63:this.$=s.PLACEMENT.LEFTOF;break;case 64:this.$=s.PLACEMENT.RIGHTOF;break;case 65:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0},{type:"activeStart",signalType:s.LINETYPE.ACTIVE_START,actor:i[o-1].actor}];break;case 66:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o]},{type:"activeEnd",signalType:s.LINETYPE.ACTIVE_END,actor:i[o-4].actor}];break;case 67:this.$=[i[o-3],i[o-1],{type:"addMessage",from:i[o-3].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o]}];break;case 68:this.$={type:"addParticipant",actor:i[o]};break;case 69:this.$=s.LINETYPE.SOLID_OPEN;break;case 70:this.$=s.LINETYPE.DOTTED_OPEN;break;case 71:this.$=s.LINETYPE.SOLID;break;case 72:this.$=s.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=s.LINETYPE.DOTTED;break;case 74:this.$=s.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=s.LINETYPE.SOLID_CROSS;break;case 76:this.$=s.LINETYPE.DOTTED_CROSS;break;case 77:this.$=s.LINETYPE.SOLID_POINT;break;case 78:this.$=s.LINETYPE.DOTTED_POINT;break;case 79:this.$=s.parseMessage(i[o].trim().substring(1))}},"anonymous"),table:[{3:1,4:e,5:a,6:s},{1:[3]},{3:5,4:e,5:a,6:s},{3:6,4:e,5:a,6:s},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},t(R,[2,5]),{9:47,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},t(R,[2,7]),t(R,[2,8]),t(R,[2,14]),{12:48,50:_,52:A,53:k},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:D},{22:55,70:D},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(R,[2,29]),t(R,[2,30]),{32:[1,61]},{34:[1,62]},t(R,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:D},{22:72,70:D},{22:73,70:D},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:D},{22:90,70:D},{22:91,70:D},{22:92,70:D},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(R,[2,6]),t(R,[2,15]),t(C,[2,9],{10:93}),t(R,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(R,[2,21]),{5:[1,97]},{5:[1,98]},t(R,[2,24]),t(R,[2,25]),t(R,[2,26]),t(R,[2,27]),t(R,[2,28]),t(R,[2,31]),t(R,[2,32]),t(B,r,{7:99}),t(B,r,{7:100}),t(B,r,{7:101}),t(Y,r,{40:102,7:103}),t($,r,{42:104,7:105}),t($,r,{7:105,42:106}),t(V,r,{45:107,7:108}),t(B,r,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:D},t(F,[2,69]),t(F,[2,70]),t(F,[2,71]),t(F,[2,72]),t(F,[2,73]),t(F,[2,74]),t(F,[2,75]),t(F,[2,76]),t(F,[2,77]),t(F,[2,78]),{22:118,70:D},{22:120,58:119,70:D},{70:[2,63]},{70:[2,64]},{56:121,81:W},{56:123,81:W},{56:124,81:W},{56:125,81:W},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:_,52:A,53:k},{5:[1,131]},t(R,[2,19]),t(R,[2,20]),t(R,[2,22]),t(R,[2,23]),{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,132],17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,133],17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,134],17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},{16:[1,135]},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[2,46],17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,49:[1,136],50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},{16:[1,137]},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[2,44],17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,48:[1,138],50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},{16:[1,139]},{16:[1,140]},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[2,42],17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,47:[1,141],50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,142],17:15,18:h,21:d,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:E,39:f,41:w,43:I,44:L,46:P,50:_,52:A,53:k,54:N,59:v,60:M,61:O,62:S,70:D},{15:[1,143]},t(R,[2,49]),{15:[1,144]},t(R,[2,51]),t(R,[2,52]),{22:145,70:D},{22:146,70:D},{56:147,81:W},{56:148,81:W},{56:149,81:W},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(R,[2,16]),t(C,[2,10]),{12:151,50:_,52:A,53:k},t(C,[2,12]),t(C,[2,13]),t(R,[2,18]),t(R,[2,34]),t(R,[2,35]),t(R,[2,36]),t(R,[2,37]),{15:[1,152]},t(R,[2,38]),{15:[1,153]},t(R,[2,39]),t(R,[2,40]),{15:[1,154]},t(R,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:W},{56:158,81:W},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:D},t(C,[2,11]),t(Y,r,{7:103,40:160}),t($,r,{7:105,42:161}),t(V,r,{7:108,45:162}),t(R,[2,48]),t(R,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:o(function(t,e){if(!e.recoverable){var a=new Error(t);throw a.hash=e,a}this.trace(t)},"parseError"),parse:o(function(t){var e=this,a=[0],s=[],r=[null],i=[],n=this.table,c="",l=0,h=0,d=i.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(g.yy[u]=this.yy[u]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var x=p.yylloc;i.push(x);var y=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||p.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){a.length=a.length-2*t,r.length=r.length-t,i.length=i.length-t},"popStack"),o(m,"lex");for(var b,T,E,f,w,I,L,P,_,A={};;){if(E=a[a.length-1],this.defaultActions[E]?f=this.defaultActions[E]:((null===b||typeof b>"u")&&(b=m()),f=n[E]&&n[E][b]),typeof f>"u"||!f.length||!f[0]){var k="";for(I in _=[],n[E])this.terminals_[I]&&I>2&&_.push("'"+this.terminals_[I]+"'");k=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[b]||b,line:p.yylineno,loc:x,expected:_})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+b);switch(f[0]){case 1:a.push(b),r.push(p.yytext),i.push(p.yylloc),a.push(f[1]),b=null,T?(b=T,T=null):(h=p.yyleng,c=p.yytext,l=p.yylineno,x=p.yylloc);break;case 2:if(L=this.productions_[f[1]][1],A.$=r[r.length-L],A._$={first_line:i[i.length-(L||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(L||1)].first_column,last_column:i[i.length-1].last_column},y&&(A._$.range=[i[i.length-(L||1)].range[0],i[i.length-1].range[1]]),typeof(w=this.performAction.apply(A,[c,h,l,g.yy,f[1],r,i].concat(d)))<"u")return w;L&&(a=a.slice(0,-1*L*2),r=r.slice(0,-1*L),i=i.slice(0,-1*L)),a.push(this.productions_[f[1]][0]),r.push(A.$),i.push(A._$),P=n[a[a.length-2]][a[a.length-1]],a.push(P);break;case 3:return!0}}return!0},"parse")},z={EOF:1,parseError:o(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:o(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===s.length?this.yylloc.first_column:0)+s[s.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:o(function(t,e){var a,s,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],a=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var i in r)this[i]=r[i];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,e,a,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),i=0;i<r.length;i++)if((a=this._input.match(this.rules[r[i]]))&&(!e||a[0].length>e[0].length)){if(e=a,s=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(a,r[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){return this.next()||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,e,a,s){switch(a){case 0:case 51:case 67:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return e.yytext=e.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:case 64:return 81;case 65:return 68;case 66:return 69;case 68:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68],inclusive:!0}}};function H(){this.yy={}}return q.lexer=z,o(H,"Parser"),H.prototype=q,q.Parser=H,new H}();S.parser=S;var D=S,R={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},C={FILLED:0,OPEN:1},B={LEFTOF:0,RIGHTOF:1,OVER:2},Y=class{constructor(){this.state=new t(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=y,this.setAccDescription=m,this.setDiagramTitle=b,this.getAccTitle=T,this.getAccDescription=E,this.getDiagramTitle=f,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(l().wrap),this.LINETYPE=R,this.ARROWTYPE=C,this.PLACEMENT=B}static{o(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,a,s){let r=this.state.records.currentBox,i=this.state.records.actors.get(t);if(i){if(this.state.records.currentBox&&i.box&&this.state.records.currentBox!==i.box)throw new Error(`A same participant should only be defined in one Box: ${i.name} can't be in '${i.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(r=i.box?i.box:this.state.records.currentBox,i.box=r,i&&e===i.name&&null==a)return}if(null==a?.text&&(a={text:e,type:s}),(null==s||null==a.text)&&(a={text:e,type:s}),this.state.records.actors.set(t,{box:r,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:s??"participant"}),this.state.records.prevActor){let e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,a=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&a++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&a--;return a}addMessage(t,e,a,s){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a.text,wrap:a.wrap??this.autoWrap(),answer:s})}addSignal(t,e,a,s,r=!1){if(s===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){let e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:s,activate:r}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();let e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:l().sequence?.wrap??!1}clear(){this.state.reset(),w()}parseMessage(t){let e=t.trim(),{wrap:a,cleanedText:s}=this.extractWrap(e),r={text:s,wrap:a};return d.debug(`parseMessage: ${JSON.stringify(r)}`),r}parseBoxData(t){let e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),a=e?.[1]?e[1].trim():"transparent",s=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",a)||(a="transparent",s=t.trim());else{let e=(new Option).style;e.color=a,e.color!==a&&(a="transparent",s=t.trim())}let{wrap:r,cleanedText:i}=this.extractWrap(s);return{text:i?I(i,l()):void 0,color:a,wrap:r}}addNote(t,e,a){let s={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()},r=[].concat(t,t);this.state.records.notes.push(s),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:r[0],to:r[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){let a=this.getActor(t);try{let t=I(e.text,l());t=t.replace(/&equals;/g,"="),t=t.replace(/&amp;/g,"&");let s=JSON.parse(t);this.insertLinks(a,s)}catch(t){d.error("error while parsing actor link text",t)}}addALink(t,e){let a=this.getActor(t);try{let t={},s=I(e.text,l()),r=s.indexOf("@");s=s.replace(/&equals;/g,"="),s=s.replace(/&amp;/g,"&");let i=s.slice(0,r-1).trim(),n=s.slice(r+1).trim();t[i]=n,this.insertLinks(a,t)}catch(t){d.error("error while parsing actor link text",t)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(let a in e)t.links[a]=e[a]}addProperties(t,e){let a=this.getActor(t);try{let t=I(e.text,l()),s=JSON.parse(t);this.insertProperties(a,s)}catch(t){d.error("error while parsing actor properties text",t)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(let a in e)t.properties[a]=e[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){let a=this.getActor(t),s=document.getElementById(e.text);try{let t=s.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(a,e.properties),e.links&&this.insertLinks(a,e.links)}catch(t){d.error("error while parsing actor details text",t)}}getActorProperty(t,e){if(void 0!==t?.properties)return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(t=>{this.apply(t)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":y(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return l().sequence}},$=o(t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`,"getStyles"),V=p(A()),F="actor-top",W="actor-bottom",q="actor-man",z=o(function(t,e){return r(t,e)},"drawRect"),H=o(function(t,e,a,s,r){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};let i=e.links,n=e.actorCnt,o=e.rectData;var c="none";r&&(c="block !important");let l=t.append("g");l.attr("id","actor"+n+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",c);var h="";void 0!==o.class&&(h=" "+o.class);let d=o.width>a?o.width:a,p=l.append("rect");if(p.attr("class","actorPopupMenuPanel"+h),p.attr("x",o.x),p.attr("y",o.height),p.attr("fill",o.fill),p.attr("stroke",o.stroke),p.attr("width",d),p.attr("height",o.height),p.attr("rx",o.rx),p.attr("ry",o.ry),null!=i){var g=20;for(let t in i){var u=l.append("a"),x=(0,V.sanitizeUrl)(i[t]);u.attr("xlink:href",x),u.attr("target","_blank"),yt(s)(t,u,o.x+10,o.height+g,d,20,{class:"actor"},s),g+=30}}return p.attr("height",g),{height:o.height+g,width:d}},"drawPopup"),j=o(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),U=o(async function(t,e,a=null){let s=t.append("foreignObject"),r=await M(e.text,O()),i=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();if(s.attr("height",Math.round(i.height)).attr("width",Math.round(i.width)),"noteText"===e.class){let a=t.node().firstChild;a.setAttribute("height",i.height+2*e.textMargin);let r=a.getBBox();s.attr("x",Math.round(r.x+r.width/2-i.width/2)).attr("y",Math.round(r.y+r.height/2-i.height/2))}else if(a){let{startx:t,stopx:r,starty:n}=a;if(t>r){let e=t;t=r,r=e}s.attr("x",Math.round(t+Math.abs(t-r)/2-i.width/2)),"loopText"===e.class?s.attr("y",Math.round(n)):s.attr("y",Math.round(n-i.height))}return[s]},"drawKatex"),K=o(function(t,e){let a=0,s=0,r=e.text.split(x.lineBreakRegex),[i,n]=k(e.fontSize),c=[],l=0,h=o(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=o(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":h=o(()=>Math.round(e.y+(a+s+e.textMargin)/2),"yfunc");break;case"bottom":case"end":h=o(()=>Math.round(e.y+(a+s+2*e.textMargin)-e.textMargin),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[o,d]of r.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==i&&(l=o*i);let r=t.append("text");r.attr("x",e.x),r.attr("y",h()),void 0!==e.anchor&&r.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&r.style("font-family",e.fontFamily),void 0!==n&&r.style("font-size",n),void 0!==e.fontWeight&&r.style("font-weight",e.fontWeight),void 0!==e.fill&&r.attr("fill",e.fill),void 0!==e.class&&r.attr("class",e.class),void 0!==e.dy?r.attr("dy",e.dy):0!==l&&r.attr("dy",l);let p=d||N;if(e.tspan){let t=r.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(p)}else r.text(p);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(s+=(r._groups||r)[0][0].getBBox().height,a=s),c.push(r)}return c},"drawText"),X=o(function(t,e){function a(t,e,a,s,r){return t+","+e+" "+(t+a)+","+e+" "+(t+a)+","+(e+s-r)+" "+(t+a-1.2*r)+","+(e+s)+" "+t+","+(e+s)}o(a,"genPoints");let s=t.append("polygon");return s.attr("points",a(e.x,e.y,e.width,e.height,7)),s.attr("class","labelBox"),e.y=e.y+e.height/2,K(t,e),s},"drawLabel"),G=-1,J=o((t,e,a,s)=>{t.select&&a.forEach(a=>{let r=e.get(a),i=t.select("#actor"+r.actorCnt);!s.mirrorActors&&r.stopy?i.attr("y2",r.stopy+r.height/2):s.mirrorActors&&i.attr("y2",r.stopy)})},"fixLifeLineHeights"),Q=o(function(t,e,a,r){let o=r?e.stopy:e.starty,c=e.x+e.width/2,l=o+e.height,h=t.append("g").lower();var d=h;r||(G++,Object.keys(e.links||{}).length&&!a.forceMenus&&d.attr("onclick",j(`actor${G}_popup`)).attr("cursor","pointer"),d.append("line").attr("id","actor"+G).attr("x1",c).attr("y1",l).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),d=h.append("g"),e.actorCnt=G,null!=e.links&&d.attr("id","root-"+G));let p=s();var g="actor";e.properties?.class?g=e.properties.class:p.fill="#eaeaea",g+=r?` ${W}`:` ${F}`,p.x=e.x,p.y=o,p.width=e.width,p.height=e.height,p.class=g,p.rx=3,p.ry=3,p.name=e.name;let u=z(d,p);if(e.rectData=p,e.properties?.icon){let t=e.properties.icon.trim();"@"===t.charAt(0)?i(d,p.x+p.width-20,p.y+10,t.substr(1)):n(d,p.x+p.width-20,p.y+10,t)}xt(a,_(e.description))(e.description,d,p.x,p.y,p.width,p.height,{class:"actor actor-box"},a);let x=e.height;if(u.node){let t=u.node().getBBox();e.height=t.height,x=t.height}return x},"drawActorTypeParticipant"),Z=o(function(t,e,a,r){let i=r?e.stopy:e.starty,n=e.x+e.width/2,o=i+80,c=t.append("g").lower();r||(G++,c.append("line").attr("id","actor"+G).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=G);let l=t.append("g"),h=q;h+=r?` ${W}`:` ${F}`,l.attr("class",h),l.attr("name",e.name);let d=s();d.x=e.x,d.y=i,d.fill="#eaeaea",d.width=e.width,d.height=e.height,d.class="actor",d.rx=3,d.ry=3,l.append("line").attr("id","actor-man-torso"+G).attr("x1",n).attr("y1",i+25).attr("x2",n).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+G).attr("x1",n-18).attr("y1",i+33).attr("x2",n+18).attr("y2",i+33),l.append("line").attr("x1",n-18).attr("y1",i+60).attr("x2",n).attr("y2",i+45),l.append("line").attr("x1",n).attr("y1",i+45).attr("x2",n+18-2).attr("y2",i+60);let p=l.append("circle");p.attr("cx",e.x+e.width/2),p.attr("cy",i+10),p.attr("r",15),p.attr("width",e.width),p.attr("height",e.height);let g=l.node().getBBox();return e.height=g.height,xt(a,_(e.description))(e.description,l,d.x,d.y+35,d.width,d.height,{class:`actor ${q}`},a),e.height},"drawActorTypeActor"),tt=o(async function(t,e,a,s){switch(e.type){case"actor":return await Z(t,e,a,s);case"participant":return await Q(t,e,a,s)}},"drawActor"),et=o(function(t,e,a){let s=t.append("g");it(s,e),e.name&&xt(a)(e.name,s,e.x,e.y+a.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),s.lower()},"drawBox"),at=o(function(t){return t.append("g")},"anchorElement"),st=o(function(t,e,a,r,i){let n=s(),o=e.anchored;n.x=e.startx,n.y=e.starty,n.class="activation"+i%3,n.width=e.stopx-e.startx,n.height=a-e.starty,z(o,n)},"drawActivation"),rt=o(async function(t,e,s,r){let{boxMargin:i,boxTextMargin:n,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:h,messageFontSize:d,messageFontWeight:p}=r,g=t.append("g"),u=o(function(t,e,a,s){return g.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",s).attr("class","loopLine")},"drawLoopLine");u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){u(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")});let x=a();x.text=s,x.x=e.startx,x.y=e.starty,x.fontFamily=h,x.fontSize=d,x.fontWeight=p,x.anchor="middle",x.valign="middle",x.tspan=!1,x.width=l||50,x.height=c||20,x.textMargin=n,x.class="labelText",X(g,x),x=gt(),x.text=e.title,x.x=e.startx+l/2+(e.stopx-e.startx)/2,x.y=e.starty+i+n,x.anchor="middle",x.valign="middle",x.textMargin=n,x.class="loopText",x.fontFamily=h,x.fontSize=d,x.fontWeight=p,x.wrap=!0;let y=_(x.text)?await U(g,x,e):K(g,x);if(void 0!==e.sectionTitles)for(let[t,a]of Object.entries(e.sectionTitles))if(a.message){x.text=a.message,x.x=e.startx+(e.stopx-e.startx)/2,x.y=e.sections[t].y+i+n,x.class="loopText",x.anchor="middle",x.valign="middle",x.tspan=!1,x.fontFamily=h,x.fontSize=d,x.fontWeight=p,x.wrap=e.wrap,_(x.text)?(e.starty=e.sections[t].y,await U(g,x,e)):K(g,x);let s=Math.round(y.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));e.sections[t].height+=s-(i+n)}return e.height=Math.round(e.stopy-e.starty),g},"drawLoop"),it=o(function(t,a){e(t,a)},"drawBackgroundRect"),nt=o(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),ot=o(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),ct=o(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),lt=o(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),ht=o(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),dt=o(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),pt=o(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),gt=o(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"),ut=o(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),xt=function(){function t(t,e,a,s,i,n,o){r(e.append("text").attr("x",a+i/2).attr("y",s+n/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,a,s,i,n,o,c){let{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,[p,g]=k(l),u=t.split(x.lineBreakRegex);for(let t=0;t<u.length;t++){let c=t*p-p*(u.length-1)/2,l=e.append("text").attr("x",a+i/2).attr("y",s).style("text-anchor","middle").style("font-size",g).style("font-weight",d).style("font-family",h);l.append("tspan").attr("x",a+i/2).attr("dy",c).text(u[t]),l.attr("y",s+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(l,o)}}function a(t,a,s,i,n,o,c,l){let h=a.append("switch"),d=h.append("foreignObject").attr("x",s).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,i,n,o,c,l),r(d,c)}async function s(t,a,s,i,n,o,c,l){let h=await P(t,O()),d=a.append("switch"),p=d.append("foreignObject").attr("x",s+n/2-h.width/2).attr("y",i+o/2-h.height/2).attr("width",h.width).attr("height",h.height).append("xhtml:div").style("height","100%").style("width","100%");p.append("div").style("text-align","center").style("vertical-align","middle").html(await M(t,O())),e(t,d,s,i,n,o,c,l),r(p,c)}function r(t,e){for(let a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return o(t,"byText"),o(e,"byTspan"),o(a,"byFo"),o(s,"byKatex"),o(r,"_setTextAttrs"),function(r,i=!1){return i?s:"fo"===r.textPlacement?a:"old"===r.textPlacement?t:e}}(),yt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").text(t),o)}function e(t,e,a,r,i,n,o,c){let{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,p=t.split(x.lineBreakRegex);for(let t=0;t<p.length;t++){let i=t*l-l*(p.length-1)/2,c=e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").style("font-size",l).style("font-weight",d).style("font-family",h);c.append("tspan").attr("x",a).attr("dy",i).text(p[t]),c.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(c,o)}}function a(t,a,r,i,n,o,c,l){let h=a.append("switch"),d=h.append("foreignObject").attr("x",r).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,r,i,0,o,c,l),s(d,c)}function s(t,e){for(let a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return o(t,"byText"),o(e,"byTspan"),o(a,"byFo"),o(s,"_setTextAttrs"),function(s){return"fo"===s.textPlacement?a:"old"===s.textPlacement?t:e}}(),mt={drawRect:z,drawText:K,drawLabel:X,drawActor:tt,drawBox:et,drawPopup:H,anchorElement:at,drawActivation:st,drawLoop:rt,drawBackgroundRect:it,insertArrowHead:lt,insertArrowFilledHead:ht,insertSequenceNumber:dt,insertArrowCrossHead:pt,insertDatabaseIcon:nt,insertComputerIcon:ot,insertClockIcon:ct,getTextObj:gt,getNoteRect:ut,fixLifeLineHeights:J,sanitizeUrl:V.sanitizeUrl},bt={},Tt={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:o(function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map(t=>t.height||0))+(0===this.loops.length?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.messages.length?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.notes.length?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:o(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:o(function(t){this.boxes.push(t)},"addBox"),addActor:o(function(t){this.actors.push(t)},"addActor"),addLoop:o(function(t){this.loops.push(t)},"addLoop"),addMessage:o(function(t){this.messages.push(t)},"addMessage"),addNote:o(function(t){this.notes.push(t)},"addNote"),lastActor:o(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:o(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:o(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:o(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o(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,Nt(l())},"init"),updateVal:o(function(t,e,a,s){void 0===t[e]?t[e]=a:t[e]=s(a,t[e])},"updateVal"),updateBounds:o(function(t,e,a,s){let r=this,i=0;function n(n){return o(function(o){i++;let c=r.sequenceItems.length-i+1;r.updateVal(o,"starty",e-c*bt.boxMargin,Math.min),r.updateVal(o,"stopy",s+c*bt.boxMargin,Math.max),r.updateVal(Tt.data,"startx",t-c*bt.boxMargin,Math.min),r.updateVal(Tt.data,"stopx",a+c*bt.boxMargin,Math.max),"activation"!==n&&(r.updateVal(o,"startx",t-c*bt.boxMargin,Math.min),r.updateVal(o,"stopx",a+c*bt.boxMargin,Math.max),r.updateVal(Tt.data,"starty",e-c*bt.boxMargin,Math.min),r.updateVal(Tt.data,"stopy",s+c*bt.boxMargin,Math.max))},"updateItemBounds")}o(n,"updateFn"),this.sequenceItems.forEach(n()),this.activations.forEach(n("activation"))},"updateBounds"),insert:o(function(t,e,a,s){let r=x.getMin(t,a),i=x.getMax(t,a),n=x.getMin(e,s),o=x.getMax(e,s);this.updateVal(Tt.data,"startx",r,Math.min),this.updateVal(Tt.data,"starty",n,Math.min),this.updateVal(Tt.data,"stopx",i,Math.max),this.updateVal(Tt.data,"stopy",o,Math.max),this.updateBounds(r,n,i,o)},"insert"),newActivation:o(function(t,e,a){let s=a.get(t.from),r=vt(t.from).length||0,i=s.x+s.width/2+(r-1)*bt.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+bt.activationWidth,stopy:void 0,actor:t.from,anchored:mt.anchorElement(e)})},"newActivation"),endActivation:o(function(t){let e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:o(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:o(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:o(function(t){let e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Tt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:o(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:o(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:o(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=x.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:o(function(){return this.verticalPos},"getVerticalPos"),getBounds:o(function(){return{bounds:this.data,models:this.models}},"getBounds")},Et=o(async function(t,e){Tt.bumpVerticalPos(bt.boxMargin),e.height=bt.boxMargin,e.starty=Tt.getVerticalPos();let r=s();r.x=e.startx,r.y=e.starty,r.width=e.width||bt.width,r.class="note";let i=t.append("g"),n=mt.drawRect(i,r),o=a();o.x=e.startx,o.y=e.starty,o.width=r.width,o.dy="1em",o.text=e.message,o.class="noteText",o.fontFamily=bt.noteFontFamily,o.fontSize=bt.noteFontSize,o.fontWeight=bt.noteFontWeight,o.anchor=bt.noteAlign,o.textMargin=bt.noteMargin,o.valign="center";let c=_(o.text)?await U(i,o):K(i,o),l=Math.round(c.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));n.attr("height",l+2*bt.noteMargin),e.height+=l+2*bt.noteMargin,Tt.bumpVerticalPos(l+2*bt.noteMargin),e.stopy=e.starty+l+2*bt.noteMargin,e.stopx=e.startx+r.width,Tt.insert(e.startx,e.starty,e.stopx,e.stopy),Tt.models.addNote(e)},"drawNote"),ft=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),wt=o(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),It=o(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Lt(t,e){Tt.bumpVerticalPos(10);let{startx:a,stopx:s,message:r}=e,i=x.splitBreaks(r).length,n=_(r),o=n?await P(r,l()):L.calculateTextDimensions(r,ft(bt));if(!n){let t=o.height/i;e.height+=t,Tt.bumpVerticalPos(t)}let c,h=o.height-10,d=o.width;if(a===s){c=Tt.getVerticalPos()+h,bt.rightAngles||(h+=bt.boxMargin,c=Tt.getVerticalPos()+h),h+=30;let t=x.getMax(d/2,bt.width/2);Tt.insert(a-t,Tt.getVerticalPos()-10+h,s+t,Tt.getVerticalPos()+30+h)}else h+=bt.boxMargin,c=Tt.getVerticalPos()+h,Tt.insert(a,c-10,s,c);return Tt.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,Tt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),c}o(Lt,"boundMessage");var Pt=o(async function(t,e,s,r){let{startx:i,stopx:n,starty:o,message:c,type:l,sequenceIndex:h,sequenceVisible:d}=e,p=L.calculateTextDimensions(c,ft(bt)),g=a();g.x=i,g.y=o+10,g.width=n-i,g.class="messageText",g.dy="1em",g.text=c,g.fontFamily=bt.messageFontFamily,g.fontSize=bt.messageFontSize,g.fontWeight=bt.messageFontWeight,g.anchor=bt.messageAlign,g.valign="center",g.textMargin=bt.wrapPadding,g.tspan=!1,_(g.text)?await U(t,g,{startx:i,stopx:n,starty:s}):K(t,g);let u,y=p.width;i===n?u=bt.rightAngles?t.append("path").attr("d",`M ${i},${s} H ${i+x.getMax(bt.width/2,y/2)} V ${s+25} H ${i}`):t.append("path").attr("d","M "+i+","+s+" C "+(i+60)+","+(s-10)+" "+(i+60)+","+(s+30)+" "+i+","+(s+20)):(u=t.append("line"),u.attr("x1",i),u.attr("y1",s),u.attr("x2",n),u.attr("y2",s)),l===r.db.LINETYPE.DOTTED||l===r.db.LINETYPE.DOTTED_CROSS||l===r.db.LINETYPE.DOTTED_POINT||l===r.db.LINETYPE.DOTTED_OPEN||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED?(u.style("stroke-dasharray","3, 3"),u.attr("class","messageLine1")):u.attr("class","messageLine0");let m="";bt.arrowMarkerAbsolute&&(m=v(!0)),u.attr("stroke-width",2),u.attr("stroke","none"),u.style("fill","none"),(l===r.db.LINETYPE.SOLID||l===r.db.LINETYPE.DOTTED)&&u.attr("marker-end","url("+m+"#arrowhead)"),(l===r.db.LINETYPE.BIDIRECTIONAL_SOLID||l===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(u.attr("marker-start","url("+m+"#arrowhead)"),u.attr("marker-end","url("+m+"#arrowhead)")),(l===r.db.LINETYPE.SOLID_POINT||l===r.db.LINETYPE.DOTTED_POINT)&&u.attr("marker-end","url("+m+"#filled-head)"),(l===r.db.LINETYPE.SOLID_CROSS||l===r.db.LINETYPE.DOTTED_CROSS)&&u.attr("marker-end","url("+m+"#crosshead)"),(d||bt.showSequenceNumbers)&&(u.attr("marker-start","url("+m+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",s+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h))},"drawMessage"),_t=o(function(t,e,a,s,r,i,n){let o,c=0,l=0,h=0;for(let t of s){let s=e.get(t),i=s.box;o&&o!=i&&(n||Tt.models.addBox(o),l+=bt.boxMargin+o.margin),i&&i!=o&&(n||(i.x=c+l,i.y=r),l+=i.margin),s.width=s.width||bt.width,s.height=x.getMax(s.height||bt.height,bt.height),s.margin=s.margin||bt.actorMargin,h=x.getMax(h,s.height),a.get(s.name)&&(l+=s.width/2),s.x=c+l,s.starty=Tt.getVerticalPos(),Tt.insert(s.x,r,s.x+s.width,s.height),c+=s.width+l,s.box&&(s.box.width=c+i.margin-s.box.x),l=s.margin,o=s.box,Tt.models.addActor(s)}o&&!n&&Tt.models.addBox(o),Tt.bumpVerticalPos(h)},"addActorRenderingData"),At=o(async function(t,e,a,s){if(s){let s=0;Tt.bumpVerticalPos(2*bt.boxMargin);for(let r of a){let a=e.get(r);a.stopy||(a.stopy=Tt.getVerticalPos());let i=await mt.drawActor(t,a,bt,!0);s=x.getMax(s,i)}Tt.bumpVerticalPos(s+bt.boxMargin)}else for(let s of a){let a=e.get(s);await mt.drawActor(t,a,bt,!1)}},"drawActors"),kt=o(function(t,e,a,s){let r=0,i=0;for(let n of a){let a=e.get(n),o=Ct(a),c=mt.drawPopup(t,a,o,bt,bt.forceMenus,s);c.height>r&&(r=c.height),c.width+a.x>i&&(i=c.width+a.x)}return{maxHeight:r,maxWidth:i}},"drawActorsPopup"),Nt=o(function(t){u(bt,t),t.fontFamily&&(bt.actorFontFamily=bt.noteFontFamily=bt.messageFontFamily=t.fontFamily),t.fontSize&&(bt.actorFontSize=bt.noteFontSize=bt.messageFontSize=t.fontSize),t.fontWeight&&(bt.actorFontWeight=bt.noteFontWeight=bt.messageFontWeight=t.fontWeight)},"setConf"),vt=o(function(t){return Tt.activations.filter(function(e){return e.actor===t})},"actorActivations"),Mt=o(function(t,e){let a=e.get(t),s=vt(t),r=s.reduce(function(t,e){return x.getMin(t,e.startx)},a.x+a.width/2-1),i=s.reduce(function(t,e){return x.getMax(t,e.stopx)},a.x+a.width/2+1);return[r,i]},"activationBounds");function Ot(t,e,a,s,r){Tt.bumpVerticalPos(a);let i=s;if(e.id&&e.message&&t[e.id]){let a=t[e.id].width,r=ft(bt);e.message=L.wrapLabel(`[${e.message}]`,a-2*bt.wrapPadding,r),e.width=a,e.wrap=!0;let n=L.calculateTextDimensions(e.message,r),o=x.getMax(n.height,bt.labelBoxHeight);i=s+o,d.debug(`${o} - ${e.message}`)}r(e),Tt.bumpVerticalPos(i)}function St(t,e,a,s,r,i,n){function c(a,s){a.x<r.get(t.from).x?(Tt.insert(e.stopx-s,e.starty,e.startx,e.stopy+a.height/2+bt.noteMargin),e.stopx=e.stopx+s):(Tt.insert(e.startx,e.starty,e.stopx+s,e.stopy+a.height/2+bt.noteMargin),e.stopx=e.stopx-s)}function l(a,s){a.x<r.get(t.to).x?(Tt.insert(e.startx-s,e.starty,e.stopx,e.stopy+a.height/2+bt.noteMargin),e.startx=e.startx+s):(Tt.insert(e.stopx,e.starty,e.startx+s,e.stopy+a.height/2+bt.noteMargin),e.startx=e.startx-s)}if(o(c,"receiverAdjustment"),o(l,"senderAdjustment"),i.get(t.to)==s){let e=r.get(t.to);c(e,"actor"==e.type?21:e.width/2+3),e.starty=a-e.height/2,Tt.bumpVerticalPos(e.height/2)}else if(n.get(t.from)==s){let e=r.get(t.from);if(bt.mirrorActors){l(e,"actor"==e.type?18:e.width/2)}e.stopy=a-e.height/2,Tt.bumpVerticalPos(e.height/2)}else if(n.get(t.to)==s){let e=r.get(t.to);if(bt.mirrorActors){c(e,"actor"==e.type?21:e.width/2+3)}e.stopy=a-e.height/2,Tt.bumpVerticalPos(e.height/2)}}o(Ot,"adjustLoopHeightForWrap"),o(St,"adjustCreatedDestroyedData");var Dt=o(async function(t,e,a,s){let r,{securityLevel:i,sequence:n}=l();bt=n,"sandbox"===i&&(r=h("#i"+e));let c=h("sandbox"===i?r.nodes()[0].contentDocument.body:"body"),p="sandbox"===i?r.nodes()[0].contentDocument:document;Tt.init(),d.debug(s.db);let u="sandbox"===i?c.select(`[id="${e}"]`):h(`[id="${e}"]`),x=s.db.getActors(),y=s.db.getCreatedActors(),m=s.db.getDestroyedActors(),b=s.db.getBoxes(),T=s.db.getActorKeys(),E=s.db.getMessages(),f=s.db.getDiagramTitle(),w=s.db.hasAtLeastOneBox(),I=s.db.hasAtLeastOneBoxWithTitle(),L=await Rt(x,E,s);if(bt.height=await Bt(x,L,b),mt.insertComputerIcon(u),mt.insertDatabaseIcon(u),mt.insertClockIcon(u),w&&(Tt.bumpVerticalPos(bt.boxMargin),I&&Tt.bumpVerticalPos(b[0].textMaxHeight)),!0===bt.hideUnusedParticipants){let t=new Set;E.forEach(e=>{t.add(e.from),t.add(e.to)}),T=T.filter(e=>t.has(e))}_t(u,x,y,T,0,E,!1);let P=await Vt(E,x,L,s);function _(t,e){let a=Tt.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),mt.drawActivation(u,a,e,bt,vt(t.from).length),Tt.insert(a.startx,e-10,a.stopx,e)}mt.insertArrowHead(u),mt.insertArrowCrossHead(u),mt.insertArrowFilledHead(u),mt.insertSequenceNumber(u),o(_,"activeEnd");let A=1,k=1,N=[],v=[],M=0;for(let t of E){let e,a,r;switch(t.type){case s.db.LINETYPE.NOTE:Tt.resetVerticalPos(),a=t.noteModel,await Et(u,a);break;case s.db.LINETYPE.ACTIVE_START:Tt.newActivation(t,u,x);break;case s.db.LINETYPE.ACTIVE_END:_(t,Tt.getVerticalPos());break;case s.db.LINETYPE.LOOP_START:Ot(P,t,bt.boxMargin,bt.boxMargin+bt.boxTextMargin,t=>Tt.newLoop(t));break;case s.db.LINETYPE.LOOP_END:e=Tt.endLoop(),await mt.drawLoop(u,e,"loop",bt),Tt.bumpVerticalPos(e.stopy-Tt.getVerticalPos()),Tt.models.addLoop(e);break;case s.db.LINETYPE.RECT_START:Ot(P,t,bt.boxMargin,bt.boxMargin,t=>Tt.newLoop(void 0,t.message));break;case s.db.LINETYPE.RECT_END:e=Tt.endLoop(),v.push(e),Tt.models.addLoop(e),Tt.bumpVerticalPos(e.stopy-Tt.getVerticalPos());break;case s.db.LINETYPE.OPT_START:Ot(P,t,bt.boxMargin,bt.boxMargin+bt.boxTextMargin,t=>Tt.newLoop(t));break;case s.db.LINETYPE.OPT_END:e=Tt.endLoop(),await mt.drawLoop(u,e,"opt",bt),Tt.bumpVerticalPos(e.stopy-Tt.getVerticalPos()),Tt.models.addLoop(e);break;case s.db.LINETYPE.ALT_START:Ot(P,t,bt.boxMargin,bt.boxMargin+bt.boxTextMargin,t=>Tt.newLoop(t));break;case s.db.LINETYPE.ALT_ELSE:Ot(P,t,bt.boxMargin+bt.boxTextMargin,bt.boxMargin,t=>Tt.addSectionToLoop(t));break;case s.db.LINETYPE.ALT_END:e=Tt.endLoop(),await mt.drawLoop(u,e,"alt",bt),Tt.bumpVerticalPos(e.stopy-Tt.getVerticalPos()),Tt.models.addLoop(e);break;case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:Ot(P,t,bt.boxMargin,bt.boxMargin+bt.boxTextMargin,t=>Tt.newLoop(t)),Tt.saveVerticalPos();break;case s.db.LINETYPE.PAR_AND:Ot(P,t,bt.boxMargin+bt.boxTextMargin,bt.boxMargin,t=>Tt.addSectionToLoop(t));break;case s.db.LINETYPE.PAR_END:e=Tt.endLoop(),await mt.drawLoop(u,e,"par",bt),Tt.bumpVerticalPos(e.stopy-Tt.getVerticalPos()),Tt.models.addLoop(e);break;case s.db.LINETYPE.AUTONUMBER:A=t.message.start||A,k=t.message.step||k,t.message.visible?s.db.enableSequenceNumbers():s.db.disableSequenceNumbers();break;case s.db.LINETYPE.CRITICAL_START:Ot(P,t,bt.boxMargin,bt.boxMargin+bt.boxTextMargin,t=>Tt.newLoop(t));break;case s.db.LINETYPE.CRITICAL_OPTION:Ot(P,t,bt.boxMargin+bt.boxTextMargin,bt.boxMargin,t=>Tt.addSectionToLoop(t));break;case s.db.LINETYPE.CRITICAL_END:e=Tt.endLoop(),await mt.drawLoop(u,e,"critical",bt),Tt.bumpVerticalPos(e.stopy-Tt.getVerticalPos()),Tt.models.addLoop(e);break;case s.db.LINETYPE.BREAK_START:Ot(P,t,bt.boxMargin,bt.boxMargin+bt.boxTextMargin,t=>Tt.newLoop(t));break;case s.db.LINETYPE.BREAK_END:e=Tt.endLoop(),await mt.drawLoop(u,e,"break",bt),Tt.bumpVerticalPos(e.stopy-Tt.getVerticalPos()),Tt.models.addLoop(e);break;default:try{r=t.msgModel,r.starty=Tt.getVerticalPos(),r.sequenceIndex=A,r.sequenceVisible=s.db.showSequenceNumbers();let e=await Lt(0,r);St(t,r,e,M,x,y,m),N.push({messageModel:r,lineStartY:e}),Tt.models.addMessage(r)}catch(t){d.error("error while drawing message",t)}}[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(A+=k),M++}d.debug("createdActors",y),d.debug("destroyedActors",m),await At(u,x,T,!1);for(let t of N)await Pt(u,t.messageModel,t.lineStartY,s);bt.mirrorActors&&await At(u,x,T,!0),v.forEach(t=>mt.drawBackgroundRect(u,t)),J(u,x,T,bt);for(let t of Tt.models.boxes)t.height=Tt.getVerticalPos()-t.y,Tt.insert(t.x,t.y,t.x+t.width,t.height),t.startx=t.x,t.starty=t.y,t.stopx=t.startx+t.width,t.stopy=t.starty+t.height,t.stroke="rgb(0,0,0, 0.5)",mt.drawBox(u,t,bt);w&&Tt.bumpVerticalPos(bt.boxMargin);let O=kt(u,x,T,p),{bounds:S}=Tt.getBounds();void 0===S.startx&&(S.startx=0),void 0===S.starty&&(S.starty=0),void 0===S.stopx&&(S.stopx=0),void 0===S.stopy&&(S.stopy=0);let D=S.stopy-S.starty;D<O.maxHeight&&(D=O.maxHeight);let R=D+2*bt.diagramMarginY;bt.mirrorActors&&(R=R-bt.boxMargin+bt.bottomMarginAdj);let C=S.stopx-S.startx;C<O.maxWidth&&(C=O.maxWidth);let B=C+2*bt.diagramMarginX;f&&u.append("text").text(f).attr("x",(S.stopx-S.startx)/2-2*bt.diagramMarginX).attr("y",-25),g(u,R,B,bt.useMaxWidth);let Y=f?40:0;u.attr("viewBox",S.startx-bt.diagramMarginX+" -"+(bt.diagramMarginY+Y)+" "+B+" "+(R+Y)),d.debug("models:",Tt.models)},"draw");async function Rt(t,e,a){let s={};for(let r of e)if(t.get(r.to)&&t.get(r.from)){let e=t.get(r.to);if(r.placement===a.db.PLACEMENT.LEFTOF&&!e.prevActor||r.placement===a.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;let i=void 0!==r.placement,n=!i,o=i?wt(bt):ft(bt),c=r.wrap?L.wrapLabel(r.message,bt.width-2*bt.wrapPadding,o):r.message,h=(_(c)?await P(r.message,l()):L.calculateTextDimensions(c,o)).width+2*bt.wrapPadding;n&&r.from===e.nextActor?s[r.to]=x.getMax(s[r.to]||0,h):n&&r.from===e.prevActor?s[r.from]=x.getMax(s[r.from]||0,h):n&&r.from===r.to?(s[r.from]=x.getMax(s[r.from]||0,h/2),s[r.to]=x.getMax(s[r.to]||0,h/2)):r.placement===a.db.PLACEMENT.RIGHTOF?s[r.from]=x.getMax(s[r.from]||0,h):r.placement===a.db.PLACEMENT.LEFTOF?s[e.prevActor]=x.getMax(s[e.prevActor]||0,h):r.placement===a.db.PLACEMENT.OVER&&(e.prevActor&&(s[e.prevActor]=x.getMax(s[e.prevActor]||0,h/2)),e.nextActor&&(s[r.from]=x.getMax(s[r.from]||0,h/2)))}return d.debug("maxMessageWidthPerActor:",s),s}o(Rt,"getMaxMessageWidthPerActor");var Ct=o(function(t){let e=0,a=It(bt);for(let s in t.links){let t=L.calculateTextDimensions(s,a).width+2*bt.wrapPadding+2*bt.boxMargin;e<t&&(e=t)}return e},"getRequiredPopupWidth");async function Bt(t,e,a){let s=0;for(let e of t.keys()){let a=t.get(e);a.wrap&&(a.description=L.wrapLabel(a.description,bt.width-2*bt.wrapPadding,It(bt)));let r=_(a.description)?await P(a.description,l()):L.calculateTextDimensions(a.description,It(bt));a.width=a.wrap?bt.width:x.getMax(bt.width,r.width+2*bt.wrapPadding),a.height=a.wrap?x.getMax(r.height,bt.height):bt.height,s=x.getMax(s,a.height)}for(let a in e){let s=t.get(a);if(!s)continue;let r=t.get(s.nextActor);if(!r){let t=e[a]+bt.actorMargin-s.width/2;s.margin=x.getMax(t,bt.actorMargin);continue}let i=e[a]+bt.actorMargin-s.width/2-r.width/2;s.margin=x.getMax(i,bt.actorMargin)}let r=0;return a.forEach(e=>{let a=ft(bt),s=e.actorKeys.reduce((e,a)=>e+(t.get(a).width+(t.get(a).margin||0)),0);s-=2*bt.boxTextMargin,e.wrap&&(e.name=L.wrapLabel(e.name,s-2*bt.wrapPadding,a));let i=L.calculateTextDimensions(e.name,a);r=x.getMax(i.height,r);let n=x.getMax(s,i.width+2*bt.wrapPadding);if(e.margin=bt.boxTextMargin,s<n){let t=(n-s)/2;e.margin+=t}}),a.forEach(t=>t.textMaxHeight=r),x.getMax(s,bt.height)}o(Bt,"calculateActorMargins");var Yt=o(async function(t,e,a){let s=e.get(t.from),r=e.get(t.to),i=s.x,n=r.x,o=t.wrap&&t.message,c=_(t.message)?await P(t.message,l()):L.calculateTextDimensions(o?L.wrapLabel(t.message,bt.width,wt(bt)):t.message,wt(bt)),h={width:o?bt.width:x.getMax(bt.width,c.width+2*bt.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(h.width=o?x.getMax(bt.width,c.width):x.getMax(s.width/2+r.width/2,c.width+2*bt.noteMargin),h.startx=i+(s.width+bt.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(h.width=o?x.getMax(bt.width,c.width+2*bt.noteMargin):x.getMax(s.width/2+r.width/2,c.width+2*bt.noteMargin),h.startx=i-h.width+(s.width-bt.actorMargin)/2):t.to===t.from?(c=L.calculateTextDimensions(o?L.wrapLabel(t.message,x.getMax(bt.width,s.width),wt(bt)):t.message,wt(bt)),h.width=o?x.getMax(bt.width,s.width):x.getMax(s.width,bt.width,c.width+2*bt.noteMargin),h.startx=i+(s.width-h.width)/2):(h.width=Math.abs(i+s.width/2-(n+r.width/2))+bt.actorMargin,h.startx=i<n?i+s.width/2-bt.actorMargin/2:n+r.width/2-bt.actorMargin/2),o&&(h.message=L.wrapLabel(t.message,h.width-2*bt.wrapPadding,wt(bt))),d.debug(`NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${t.message}]`),h},"buildNoteModel"),$t=o(function(t,e,a){if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};let[s,r]=Mt(t.from,e),[i,n]=Mt(t.to,e),c=s<=i,l=c?r:s,h=c?i:n,d=Math.abs(i-n)>2,p=o(t=>c?-t:t,"adjustValue");t.from===t.to?h=l:(t.activate&&!d&&(h+=p(bt.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=p(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=p(3)));let g=[s,r,i,n],u=Math.abs(l-h);t.wrap&&t.message&&(t.message=L.wrapLabel(t.message,x.getMax(u+2*bt.wrapPadding,bt.width),ft(bt)));let y=L.calculateTextDimensions(t.message,ft(bt));return{width:x.getMax(t.wrap?0:y.width+2*bt.wrapPadding,u+2*bt.wrapPadding,bt.width),height:0,startx:l,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},"buildMessageModel"),Vt=o(async function(t,e,a,s){let r,i,n,o={},c=[];for(let a of t){switch(a.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:c.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:a.message&&(r=c.pop(),o[r.id]=r,o[a.id]=r,c.push(r));break;case s.db.LINETYPE.LOOP_END:case s.db.LINETYPE.ALT_END:case s.db.LINETYPE.OPT_END:case s.db.LINETYPE.PAR_END:case s.db.LINETYPE.CRITICAL_END:case s.db.LINETYPE.BREAK_END:r=c.pop(),o[r.id]=r;break;case s.db.LINETYPE.ACTIVE_START:{let t=e.get(a.from?a.from:a.to.actor),s=vt(a.from?a.from:a.to.actor).length,r=t.x+t.width/2+(s-1)*bt.activationWidth/2,i={startx:r,stopx:r+bt.activationWidth,actor:a.from,enabled:!0};Tt.activations.push(i)}break;case s.db.LINETYPE.ACTIVE_END:{let t=Tt.activations.map(t=>t.actor).lastIndexOf(a.from);Tt.activations.splice(t,1).splice(0,1)}}void 0!==a.placement?(i=await Yt(a,e,s),a.noteModel=i,c.forEach(t=>{r=t,r.from=x.getMin(r.from,i.startx),r.to=x.getMax(r.to,i.startx+i.width),r.width=x.getMax(r.width,Math.abs(r.from-r.to))-bt.labelBoxWidth})):(n=$t(a,e,s),a.msgModel=n,n.startx&&n.stopx&&c.length>0&&c.forEach(t=>{if(r=t,n.startx===n.stopx){let t=e.get(a.from),s=e.get(a.to);r.from=x.getMin(t.x-n.width/2,t.x-t.width/2,r.from),r.to=x.getMax(s.x+n.width/2,s.x+t.width/2,r.to),r.width=x.getMax(r.width,Math.abs(r.to-r.from))-bt.labelBoxWidth}else r.from=x.getMin(n.startx,r.from),r.to=x.getMax(n.stopx,r.to),r.width=x.getMax(r.width,n.width)-bt.labelBoxWidth}))}return Tt.activations=[],d.debug("Loop type widths:",o),o},"calculateLoopBounds"),Ft={bounds:Tt,drawActors:At,drawActorsPopup:kt,setConf:Nt,draw:Dt},Wt={parser:D,get db(){return new Y},renderer:Ft,styles:$,init:o(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,c({sequence:{wrap:t.wrap}}))},"init")};export{Wt as diagram};
//# sourceMappingURL=sequenceDiagram-WYCSWKTZ-DpmzzP5a.js.map