Files
Thesis/share/jupyter/lab/static/8310.518ea428891488065bd3.js

1 line
102 KiB
JavaScript

"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8310],{75463:(t,e,a)=>{a.d(e,{m:()=>s});var r=a(70416);var s=class{constructor(t){this.init=t;this.records=this.init()}static{(0,r.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},30242:(t,e,a)=>{a.d(e,{CP:()=>d,HT:()=>p,PB:()=>h,aC:()=>l,lC:()=>o,m:()=>c,tk:()=>n});var r=a(42418);var s=a(70416);var i=a(16750);var n=(0,s.K2)(((t,e)=>{const a=t.append("rect");a.attr("x",e.x);a.attr("y",e.y);a.attr("fill",e.fill);a.attr("stroke",e.stroke);a.attr("width",e.width);a.attr("height",e.height);if(e.name){a.attr("name",e.name)}if(e.rx){a.attr("rx",e.rx)}if(e.ry){a.attr("ry",e.ry)}if(e.attrs!==void 0){for(const t in e.attrs){a.attr(t,e.attrs[t])}}if(e.class){a.attr("class",e.class)}return a}),"drawRect");var o=(0,s.K2)(((t,e)=>{const a={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};const r=n(t,a);r.lower()}),"drawBackgroundRect");var c=(0,s.K2)(((t,e)=>{const a=e.text.replace(r.H1," ");const s=t.append("text");s.attr("x",e.x);s.attr("y",e.y);s.attr("class","legend");s.style("text-anchor",e.anchor);if(e.class){s.attr("class",e.class)}const i=s.append("tspan");i.attr("x",e.x+e.textMargin*2);i.text(a);return s}),"drawText");var l=(0,s.K2)(((t,e,a,r)=>{const s=t.append("image");s.attr("x",e);s.attr("y",a);const n=(0,i.J)(r);s.attr("xlink:href",n)}),"drawImage");var d=(0,s.K2)(((t,e,a,r)=>{const s=t.append("use");s.attr("x",e);s.attr("y",a);const n=(0,i.J)(r);s.attr("xlink:href",`#${n}`)}),"drawEmbeddedImage");var h=(0,s.K2)((()=>{const t={x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0};return t}),"getNoteRect");var p=(0,s.K2)((()=>{const t={x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:true};return t}),"getTextObj")},65929:(t,e,a)=>{a.d(e,{diagram:()=>At});var r=a(30242);var s=a(57028);var i=a(75463);var n=a(29131);var o=a(42418);var c=a(70416);var l=a(1218);var d=a(16750);var h=function(){var t=(0,c.K2)((function(t,e,a,r){for(a=a||{},r=t.length;r--;a[t[r]]=e);return a}),"o"),e=[1,2],a=[1,3],r=[1,4],s=[2,4],i=[1,9],n=[1,11],o=[1,13],l=[1,14],d=[1,16],h=[1,17],p=[1,18],g=[1,24],u=[1,25],x=[1,26],f=[1,27],y=[1,28],b=[1,29],m=[1,30],T=[1,31],E=[1,32],w=[1,33],k=[1,34],v=[1,35],I=[1,36],L=[1,37],_=[1,38],P=[1,39],A=[1,41],N=[1,42],M=[1,43],O=[1,44],D=[1,45],S=[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,55,60,61,62,63,71],$=[2,71],C=[4,5,16,50,52,53],Y=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],B=[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,55,60,61,62,63,71],K=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],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,55,60,61,62,63,71],F=[69,70,71],W=[1,127];var q={trace:(0,c.K2)((function t(){}),"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,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$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",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"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],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:(0,c.K2)((function t(e,a,r,s,i,n,o){var c=n.length-1;switch(i){case 3:s.apply(n[c]);return n[c];break;case 4:case 9:this.$=[];break;case 5:case 10:n[c-1].push(n[c]);this.$=n[c-1];break;case 6:case 7:case 11:case 12:this.$=n[c];break;case 8:case 13:this.$=[];break;case 15:n[c].type="createParticipant";this.$=n[c];break;case 16:n[c-1].unshift({type:"boxStart",boxData:s.parseBoxData(n[c-2])});n[c-1].push({type:"boxEnd",boxText:n[c-2]});this.$=n[c-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(n[c-2]),sequenceIndexStep:Number(n[c-1]),sequenceVisible:true,signalType:s.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(n[c-1]),sequenceIndexStep:1,sequenceVisible:true,signalType:s.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:false,signalType:s.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:true,signalType:s.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:s.LINETYPE.ACTIVE_START,actor:n[c-1].actor};break;case 23:this.$={type:"activeEnd",signalType:s.LINETYPE.ACTIVE_END,actor:n[c-1].actor};break;case 29:s.setDiagramTitle(n[c].substring(6));this.$=n[c].substring(6);break;case 30:s.setDiagramTitle(n[c].substring(7));this.$=n[c].substring(7);break;case 31:this.$=n[c].trim();s.setAccTitle(this.$);break;case 32:case 33:this.$=n[c].trim();s.setAccDescription(this.$);break;case 34:n[c-1].unshift({type:"loopStart",loopText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.LOOP_START});n[c-1].push({type:"loopEnd",loopText:n[c-2],signalType:s.LINETYPE.LOOP_END});this.$=n[c-1];break;case 35:n[c-1].unshift({type:"rectStart",color:s.parseMessage(n[c-2]),signalType:s.LINETYPE.RECT_START});n[c-1].push({type:"rectEnd",color:s.parseMessage(n[c-2]),signalType:s.LINETYPE.RECT_END});this.$=n[c-1];break;case 36:n[c-1].unshift({type:"optStart",optText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.OPT_START});n[c-1].push({type:"optEnd",optText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.OPT_END});this.$=n[c-1];break;case 37:n[c-1].unshift({type:"altStart",altText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.ALT_START});n[c-1].push({type:"altEnd",signalType:s.LINETYPE.ALT_END});this.$=n[c-1];break;case 38:n[c-1].unshift({type:"parStart",parText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.PAR_START});n[c-1].push({type:"parEnd",signalType:s.LINETYPE.PAR_END});this.$=n[c-1];break;case 39:n[c-1].unshift({type:"parStart",parText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.PAR_OVER_START});n[c-1].push({type:"parEnd",signalType:s.LINETYPE.PAR_END});this.$=n[c-1];break;case 40:n[c-1].unshift({type:"criticalStart",criticalText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.CRITICAL_START});n[c-1].push({type:"criticalEnd",signalType:s.LINETYPE.CRITICAL_END});this.$=n[c-1];break;case 41:n[c-1].unshift({type:"breakStart",breakText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.BREAK_START});n[c-1].push({type:"breakEnd",optText:s.parseMessage(n[c-2]),signalType:s.LINETYPE.BREAK_END});this.$=n[c-1];break;case 43:this.$=n[c-3].concat([{type:"option",optionText:s.parseMessage(n[c-1]),signalType:s.LINETYPE.CRITICAL_OPTION},n[c]]);break;case 45:this.$=n[c-3].concat([{type:"and",parText:s.parseMessage(n[c-1]),signalType:s.LINETYPE.PAR_AND},n[c]]);break;case 47:this.$=n[c-3].concat([{type:"else",altText:s.parseMessage(n[c-1]),signalType:s.LINETYPE.ALT_ELSE},n[c]]);break;case 48:n[c-3].draw="participant";n[c-3].type="addParticipant";n[c-3].description=s.parseMessage(n[c-1]);this.$=n[c-3];break;case 49:n[c-1].draw="participant";n[c-1].type="addParticipant";this.$=n[c-1];break;case 50:n[c-3].draw="actor";n[c-3].type="addParticipant";n[c-3].description=s.parseMessage(n[c-1]);this.$=n[c-3];break;case 51:n[c-1].draw="actor";n[c-1].type="addParticipant";this.$=n[c-1];break;case 52:n[c-1].type="destroyParticipant";this.$=n[c-1];break;case 53:n[c-1].draw="participant";n[c-1].type="addParticipant";this.$=n[c-1];break;case 54:this.$=[n[c-1],{type:"addNote",placement:n[c-2],actor:n[c-1].actor,text:n[c]}];break;case 55:n[c-2]=[].concat(n[c-1],n[c-1]).slice(0,2);n[c-2][0]=n[c-2][0].actor;n[c-2][1]=n[c-2][1].actor;this.$=[n[c-1],{type:"addNote",placement:s.PLACEMENT.OVER,actor:n[c-2].slice(0,2),text:n[c]}];break;case 56:this.$=[n[c-1],{type:"addLinks",actor:n[c-1].actor,text:n[c]}];break;case 57:this.$=[n[c-1],{type:"addALink",actor:n[c-1].actor,text:n[c]}];break;case 58:this.$=[n[c-1],{type:"addProperties",actor:n[c-1].actor,text:n[c]}];break;case 59:this.$=[n[c-1],{type:"addDetails",actor:n[c-1].actor,text:n[c]}];break;case 62:this.$=[n[c-2],n[c]];break;case 63:this.$=n[c];break;case 64:this.$=s.PLACEMENT.LEFTOF;break;case 65:this.$=s.PLACEMENT.RIGHTOF;break;case 66:this.$=[n[c-4],n[c-1],{type:"addMessage",from:n[c-4].actor,to:n[c-1].actor,signalType:n[c-3],msg:n[c],activate:true},{type:"activeStart",signalType:s.LINETYPE.ACTIVE_START,actor:n[c-1].actor}];break;case 67:this.$=[n[c-4],n[c-1],{type:"addMessage",from:n[c-4].actor,to:n[c-1].actor,signalType:n[c-3],msg:n[c]},{type:"activeEnd",signalType:s.LINETYPE.ACTIVE_END,actor:n[c-4].actor}];break;case 68:this.$=[n[c-3],n[c-1],{type:"addMessage",from:n[c-3].actor,to:n[c-1].actor,signalType:n[c-2],msg:n[c]}];break;case 69:this.$={type:"addParticipant",actor:n[c-1],config:n[c]};break;case 70:this.$=n[c-1].trim();break;case 71:this.$={type:"addParticipant",actor:n[c]};break;case 72:this.$=s.LINETYPE.SOLID_OPEN;break;case 73:this.$=s.LINETYPE.DOTTED_OPEN;break;case 74:this.$=s.LINETYPE.SOLID;break;case 75:this.$=s.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=s.LINETYPE.DOTTED;break;case 77:this.$=s.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=s.LINETYPE.SOLID_CROSS;break;case 79:this.$=s.LINETYPE.DOTTED_CROSS;break;case 80:this.$=s.LINETYPE.SOLID_POINT;break;case 81:this.$=s.LINETYPE.DOTTED_POINT;break;case 82:this.$=s.parseMessage(n[c].trim().substring(1));break}}),"anonymous"),table:[{3:1,4:e,5:a,6:r},{1:[3]},{3:5,4:e,5:a,6:r},{3:6,4:e,5:a,6:r},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,55,60,61,62,63,71],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,12:12,13:o,14:l,17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},t(R,[2,5]),{9:47,12:12,13:o,14:l,17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},t(R,[2,7]),t(R,[2,8]),t(R,[2,14]),{12:48,50:L,52:_,53:P},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:S},{22:55,71:S},{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,54:72,71:[1,73]},{22:74,71:S},{22:75,71:S},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:S},{22:92,71:S},{22:93,71:S},{22:94,71:S},t([5,51,65,76,77,78,79,80,81,82,83,84,85,86],$),t(R,[2,6]),t(R,[2,15]),t(C,[2,9],{10:95}),t(R,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},t(R,[2,21]),{5:[1,99]},{5:[1,100]},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(Y,s,{7:101}),t(Y,s,{7:102}),t(Y,s,{7:103}),t(B,s,{40:104,7:105}),t(K,s,{42:106,7:107}),t(K,s,{7:107,42:108}),t(V,s,{45:109,7:110}),t(Y,s,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},t([5,51],$,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:S},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]),t(F,[2,79]),t(F,[2,80]),t(F,[2,81]),{22:123,71:S},{22:125,59:124,71:S},{71:[2,64]},{71:[2,65]},{57:126,86:W},{57:128,86:W},{57:129,86:W},{57:130,86:W},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:L,52:_,53:P},{5:[1,136]},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:o,14:l,16:[1,137],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},{4:i,5:n,8:8,9:10,12:12,13:o,14:l,16:[1,138],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},{4:i,5:n,8:8,9:10,12:12,13:o,14:l,16:[1,139],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},{16:[1,140]},{4:i,5:n,8:8,9:10,12:12,13:o,14:l,16:[2,46],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,49:[1,141],50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},{16:[1,142]},{4:i,5:n,8:8,9:10,12:12,13:o,14:l,16:[2,44],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,48:[1,143],50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},{16:[1,144]},{16:[1,145]},{4:i,5:n,8:8,9:10,12:12,13:o,14:l,16:[2,42],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,47:[1,146],50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},{4:i,5:n,8:8,9:10,12:12,13:o,14:l,16:[1,147],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:f,35:y,36:b,37:m,38:T,39:E,41:w,43:k,44:v,46:I,50:L,52:_,53:P,55:A,60:N,61:M,62:O,63:D,71:S},{15:[1,148]},t(R,[2,49]),t(R,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},t(R,[2,51]),t(R,[2,52]),{22:151,71:S},{22:152,71:S},{57:153,86:W},{57:154,86:W},{57:155,86:W},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},t(R,[2,16]),t(C,[2,10]),{12:157,50:L,52:_,53:P},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,158]},t(R,[2,38]),{15:[1,159]},t(R,[2,39]),t(R,[2,40]),{15:[1,160]},t(R,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:W},{57:165,86:W},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:S},t(C,[2,11]),t(B,s,{7:105,40:167}),t(K,s,{7:107,42:168}),t(V,s,{7:110,45:169}),t(R,[2,48]),{5:[2,70]},t(R,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:(0,c.K2)((function t(e,a){if(a.recoverable){this.trace(e)}else{var r=new Error(e);r.hash=a;throw r}}),"parseError"),parse:(0,c.K2)((function t(e){var a=this,r=[0],s=[],i=[null],n=[],o=this.table,l="",d=0,h=0,p=0,g=2,u=1;var x=n.slice.call(arguments,1);var f=Object.create(this.lexer);var y={yy:{}};for(var b in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,b)){y.yy[b]=this.yy[b]}}f.setInput(e,y.yy);y.yy.lexer=f;y.yy.parser=this;if(typeof f.yylloc=="undefined"){f.yylloc={}}var m=f.yylloc;n.push(m);var T=f.options&&f.options.ranges;if(typeof y.yy.parseError==="function"){this.parseError=y.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function E(t){r.length=r.length-2*t;i.length=i.length-t;n.length=n.length-t}(0,c.K2)(E,"popStack");function w(){var t;t=s.pop()||f.lex()||u;if(typeof t!=="number"){if(t instanceof Array){s=t;t=s.pop()}t=a.symbols_[t]||t}return t}(0,c.K2)(w,"lex");var k,v,I,L,_,P,A={},N,M,O,D;while(true){I=r[r.length-1];if(this.defaultActions[I]){L=this.defaultActions[I]}else{if(k===null||typeof k=="undefined"){k=w()}L=o[I]&&o[I][k]}if(typeof L==="undefined"||!L.length||!L[0]){var S="";D=[];for(N in o[I]){if(this.terminals_[N]&&N>g){D.push("'"+this.terminals_[N]+"'")}}if(f.showPosition){S="Parse error on line "+(d+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[k]||k)+"'"}else{S="Parse error on line "+(d+1)+": Unexpected "+(k==u?"end of input":"'"+(this.terminals_[k]||k)+"'")}this.parseError(S,{text:f.match,token:this.terminals_[k]||k,line:f.yylineno,loc:m,expected:D})}if(L[0]instanceof Array&&L.length>1){throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+k)}switch(L[0]){case 1:r.push(k);i.push(f.yytext);n.push(f.yylloc);r.push(L[1]);k=null;if(!v){h=f.yyleng;l=f.yytext;d=f.yylineno;m=f.yylloc;if(p>0){p--}}else{k=v;v=null}break;case 2:M=this.productions_[L[1]][1];A.$=i[i.length-M];A._$={first_line:n[n.length-(M||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(M||1)].first_column,last_column:n[n.length-1].last_column};if(T){A._$.range=[n[n.length-(M||1)].range[0],n[n.length-1].range[1]]}P=this.performAction.apply(A,[l,h,d,y.yy,L[1],i,n].concat(x));if(typeof P!=="undefined"){return P}if(M){r=r.slice(0,-1*M*2);i=i.slice(0,-1*M);n=n.slice(0,-1*M)}r.push(this.productions_[L[1]][0]);i.push(A.$);n.push(A._$);O=o[r[r.length-2]][r[r.length-1]];r.push(O);break;case 3:return true}}return true}),"parse")};var z=function(){var t={EOF:1,parseError:(0,c.K2)((function t(e,a){if(this.yy.parser){this.yy.parser.parseError(e,a)}else{throw new Error(e)}}),"parseError"),setInput:(0,c.K2)((function(t,e){this.yy=e||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;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};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,c.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);if(e){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,c.K2)((function(t){var e=t.length;var 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 r=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);if(a.length-1){this.yylineno-=a.length-1}var s=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===r.length?this.yylloc.first_column:0)+r[r.length-a.length].length-a[0].length:this.yylloc.first_column-e};if(this.options.ranges){this.yylloc.range=[s[0],s[0]+this.yyleng-e]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,c.K2)((function(){this._more=true;return this}),"more"),reject:(0,c.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,c.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,c.K2)((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:(0,c.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,c.K2)((function(){var t=this.pastInput();var e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:(0,c.K2)((function(t,e){var a,r,s;if(this.options.backtrack_lexer){s={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};if(this.options.ranges){s.yylloc.range=this.yylloc.range.slice(0)}}r=t[0].match(/(?:\r\n?|\n).*/g);if(r){this.yylineno+=r.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;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]);if(this.done&&this._input){this.done=false}if(a){return a}else if(this._backtrack){for(var i in s){this[i]=s[i]}return false}return false}),"test_match"),next:(0,c.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,e,a,r;if(!this._more){this.yytext="";this.match=""}var s=this._currentRules();for(var i=0;i<s.length;i++){a=this._input.match(this.rules[s[i]]);if(a&&(!e||a[0].length>e[0].length)){e=a;r=i;if(this.options.backtrack_lexer){t=this.test_match(a,s[i]);if(t!==false){return t}else if(this._backtrack){e=false;continue}else{return false}}else if(!this.options.flex){break}}}if(e){t=this.test_match(e,s[r]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,c.K2)((function t(){var e=this.next();if(e){return e}else{return this.lex()}}),"lex"),begin:(0,c.K2)((function t(e){this.conditionStack.push(e)}),"begin"),popState:(0,c.K2)((function t(){var e=this.conditionStack.length-1;if(e>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,c.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,c.K2)((function t(e){e=this.conditionStack.length-1-Math.abs(e||0);if(e>=0){return this.conditionStack[e]}else{return"INITIAL"}}),"topState"),pushState:(0,c.K2)((function t(e){this.begin(e)}),"pushState"),stateStackSize:(0,c.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,c.K2)((function t(e,a,r,s){var i=s;switch(r){case 0:return 5;break;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;break;case 7:this.begin("CONFIG");return 73;break;case 8:return 74;break;case 9:this.popState();this.popState();return 75;break;case 10:a.yytext=a.yytext.trim();return 71;break;case 11:a.yytext=a.yytext.trim();this.begin("ALIAS");return 71;break;case 12:this.begin("LINE");return 14;break;case 13:this.begin("ID");return 50;break;case 14:this.begin("ID");return 52;break;case 15:return 13;break;case 16:this.begin("ID");return 53;break;case 17:a.yytext=a.yytext.trim();this.begin("ALIAS");return 71;break;case 18:this.popState();this.popState();this.begin("LINE");return 51;break;case 19:this.popState();this.popState();return 5;break;case 20:this.begin("LINE");return 36;break;case 21:this.begin("LINE");return 37;break;case 22:this.begin("LINE");return 38;break;case 23:this.begin("LINE");return 39;break;case 24:this.begin("LINE");return 49;break;case 25:this.begin("LINE");return 41;break;case 26:this.begin("LINE");return 43;break;case 27:this.begin("LINE");return 48;break;case 28:this.begin("LINE");return 44;break;case 29:this.begin("LINE");return 47;break;case 30:this.begin("LINE");return 46;break;case 31:this.popState();return 15;break;case 32:return 16;break;case 33:return 66;break;case 34:return 67;break;case 35:return 60;break;case 36:return 61;break;case 37:return 62;break;case 38:return 63;break;case 39:return 58;break;case 40:return 55;break;case 41:this.begin("ID");return 21;break;case 42:this.begin("ID");return 23;break;case 43:return 29;break;case 44:return 30;break;case 45:this.begin("acc_title");return 31;break;case 46:this.popState();return"acc_title_value";break;case 47:this.begin("acc_descr");return 33;break;case 48:this.popState();return"acc_descr_value";break;case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";break;case 52:return 6;break;case 53:return 18;break;case 54:return 20;break;case 55:return 65;break;case 56:return 5;break;case 57:a.yytext=a.yytext.trim();return 71;break;case 58:return 78;break;case 59:return 79;break;case 60:return 80;break;case 61:return 81;break;case 62:return 76;break;case 63:return 77;break;case 64:return 82;break;case 65:return 83;break;case 66:return 84;break;case 67:return 85;break;case 68:return 86;break;case 69:return 86;break;case 70:return 69;break;case 71:return 70;break;case 72:return 5;break;case 73:return"INVALID";break}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\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:[50,51],inclusive:false},acc_descr:{rules:[48],inclusive:false},acc_title:{rules:[46],inclusive:false},ID:{rules:[2,3,7,10,11,17],inclusive:false},ALIAS:{rules:[2,3,18,19],inclusive:false},LINE:{rules:[2,3,31],inclusive:false},CONFIG:{rules:[8,9],inclusive:false},CONFIG_DATA:{rules:[],inclusive:false},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:true}}};return t}();q.lexer=z;function H(){this.yy={}}(0,c.K2)(H,"Parser");H.prototype=q;q.Parser=H;return new H}();h.parser=h;var p=h;var g={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};var u={FILLED:0,OPEN:1};var x={LEFTOF:0,RIGHTOF:1,OVER:2};var f={ACTOR:"actor",BOUNDARY:"boundary",COLLECTIONS:"collections",CONTROL:"control",DATABASE:"database",ENTITY:"entity",PARTICIPANT:"participant",QUEUE:"queue"};var y=class{constructor(){this.state=new i.m((()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:false,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})));this.setAccTitle=o.SV;this.setAccDescription=o.EI;this.setDiagramTitle=o.ke;this.getAccTitle=o.iN;this.getAccDescription=o.m7;this.getDiagramTitle=o.ab;this.apply=this.apply.bind(this);this.parseBoxData=this.parseBoxData.bind(this);this.parseMessage=this.parseMessage.bind(this);this.clear();this.setWrap((0,o.D7)().wrap);this.LINETYPE=g;this.ARROWTYPE=u;this.PLACEMENT=x}static{(0,c.K2)(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,r,i){let n=this.state.records.currentBox;let o;if(i!==void 0){let t;if(!i.includes("\n")){t="{\n"+i+"\n}"}else{t=i+"\n"}o=(0,s.H)(t,{schema:s.r})}r=o?.type??r;const c=this.state.records.actors.get(t);if(c){if(this.state.records.currentBox&&c.box&&this.state.records.currentBox!==c.box){throw new Error(`A same participant should only be defined in one Box: ${c.name} can't be in '${c.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`)}n=c.box?c.box:this.state.records.currentBox;c.box=n;if(c&&e===c.name&&a==null){return}}if(a?.text==null){a={text:e,type:r}}if(r==null||a.text==null){a={text:e,type:r}}this.state.records.actors.set(t,{box:n,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"});if(this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);if(e){e.nextActor=t}}if(this.state.records.currentBox){this.state.records.currentBox.actorKeys.push(t)}this.state.records.prevActor=t}activationCount(t){let e;let a=0;if(!t){return 0}for(e=0;e<this.state.records.messages.length;e++){if(this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t){a++}if(this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t){a--}}return a}addMessage(t,e,a,r){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:r})}addSignal(t,e,a,r,s=false){if(r===this.LINETYPE.ACTIVE_END){const e=this.activationCount(t??"");if(e<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]};throw e}}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:r,activate:s});return true}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=true}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=false}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0){return{}}t=t.trim();const e=/^:?wrap:/.exec(t)!==null?true:/^:?nowrap:/.exec(t)!==null?false:void 0;const a=(e===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim();return{cleanedText:a,wrap:e}}autoWrap(){if(this.state.records.wrapEnabled!==void 0){return this.state.records.wrapEnabled}return(0,o.D7)().sequence?.wrap??false}clear(){this.state.reset();(0,o.IU)()}parseMessage(t){const e=t.trim();const{wrap:a,cleanedText:r}=this.extractWrap(e);const s={text:r,wrap:a};c.Rm.debug(`parseMessage: ${JSON.stringify(s)}`);return s}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let a=e?.[1]?e[1].trim():"transparent";let r=e?.[2]?e[2].trim():void 0;if(window?.CSS){if(!window.CSS.supports("color",a)){a="transparent";r=t.trim()}}else{const e=(new Option).style;e.color=a;if(e.color!==a){a="transparent";r=t.trim()}}const{wrap:s,cleanedText:i}=this.extractWrap(r);return{text:i?(0,o.jZ)(i,(0,o.D7)()):void 0,color:a,wrap:s}}addNote(t,e,a){const r={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()};const s=[].concat(t,t);this.state.records.notes.push(r);this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const a=this.getActor(t);try{let t=(0,o.jZ)(e.text,(0,o.D7)());t=t.replace(/&equals;/g,"=");t=t.replace(/&amp;/g,"&");const r=JSON.parse(t);this.insertLinks(a,r)}catch(r){c.Rm.error("error while parsing actor link text",r)}}addALink(t,e){const a=this.getActor(t);try{const t={};let r=(0,o.jZ)(e.text,(0,o.D7)());const s=r.indexOf("@");r=r.replace(/&equals;/g,"=");r=r.replace(/&amp;/g,"&");const i=r.slice(0,s-1).trim();const n=r.slice(s+1).trim();t[i]=n;this.insertLinks(a,t)}catch(r){c.Rm.error("error while parsing actor link text",r)}}insertLinks(t,e){if(t.links==null){t.links=e}else{for(const a in e){t.links[a]=e[a]}}}addProperties(t,e){const a=this.getActor(t);try{const t=(0,o.jZ)(e.text,(0,o.D7)());const r=JSON.parse(t);this.insertProperties(a,r)}catch(r){c.Rm.error("error while parsing actor properties text",r)}}insertProperties(t,e){if(t.properties==null){t.properties=e}else{for(const a in e){t.properties[a]=e[a]}}}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const a=this.getActor(t);const r=document.getElementById(e.text);try{const t=r.innerHTML;const e=JSON.parse(t);if(e.properties){this.insertProperties(a,e.properties)}if(e.links){this.insertLinks(a,e.links)}}catch(s){c.Rm.error("error while parsing actor details text",s)}}getActorProperty(t,e){if(t?.properties!==void 0){return t.properties[e]}return void 0}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:false,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"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.")}else{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.")}else{this.state.records.lastDestroyed=void 0}}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":(0,o.SV)(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(0,o.D7)().sequence}};var b=(0,c.K2)((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 .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\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\n`),"getStyles");var m=b;var T=18*2;var E="actor-top";var w="actor-bottom";var k="actor-box";var v="actor-man";var I=(0,c.K2)((function(t,e){return(0,r.tk)(t,e)}),"drawRect");var L=(0,c.K2)((function(t,e,a,r,s){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0){return{height:0,width:0}}const i=e.links;const n=e.actorCnt;const o=e.rectData;var c="none";if(s){c="block !important"}const l=t.append("g");l.attr("id","actor"+n+"_popup");l.attr("class","actorPopupMenu");l.attr("display",c);var h="";if(o.class!==void 0){h=" "+o.class}let p=o.width>a?o.width:a;const g=l.append("rect");g.attr("class","actorPopupMenuPanel"+h);g.attr("x",o.x);g.attr("y",o.height);g.attr("fill",o.fill);g.attr("stroke",o.stroke);g.attr("width",p);g.attr("height",o.height);g.attr("rx",o.rx);g.attr("ry",o.ry);if(i!=null){var u=20;for(let t in i){var x=l.append("a");var f=(0,d.J)(i[t]);x.attr("xlink:href",f);x.attr("target","_blank");rt(r)(t,x,o.x+10,o.height+u,p,20,{class:"actor"},r);u+=30}}g.attr("height",u);return{height:o.height+u,width:p}}),"drawPopup");var _=(0,c.K2)((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle");var P=(0,c.K2)((async function(t,e,a=null){let r=t.append("foreignObject");const s=await(0,o.dj)(e.text,(0,o.zj)());const i=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s);const n=i.node().getBoundingClientRect();r.attr("height",Math.round(n.height)).attr("width",Math.round(n.width));if(e.class==="noteText"){const a=t.node().firstChild;a.setAttribute("height",n.height+2*e.textMargin);const s=a.getBBox();r.attr("x",Math.round(s.x+s.width/2-n.width/2)).attr("y",Math.round(s.y+s.height/2-n.height/2))}else if(a){let{startx:t,stopx:s,starty:i}=a;if(t>s){const e=t;t=s;s=e}r.attr("x",Math.round(t+Math.abs(t-s)/2-n.width/2));if(e.class==="loopText"){r.attr("y",Math.round(i))}else{r.attr("y",Math.round(i-n.height))}}return[r]}),"drawKatex");var A=(0,c.K2)((function(t,e){let a=0;let r=0;const s=e.text.split(o.Y2.lineBreakRegex);const[i,l]=(0,n.I5)(e.fontSize);let d=[];let h=0;let p=(0,c.K2)((()=>e.y),"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0){switch(e.valign){case"top":case"start":p=(0,c.K2)((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":p=(0,c.K2)((()=>Math.round(e.y+(a+r+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":p=(0,c.K2)((()=>Math.round(e.y+(a+r+2*e.textMargin)-e.textMargin)),"yfunc");break}}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0){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";break}}for(let[o,c]of s.entries()){if(e.textMargin!==void 0&&e.textMargin===0&&i!==void 0){h=o*i}const s=t.append("text");s.attr("x",e.x);s.attr("y",p());if(e.anchor!==void 0){s.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline)}if(e.fontFamily!==void 0){s.style("font-family",e.fontFamily)}if(l!==void 0){s.style("font-size",l)}if(e.fontWeight!==void 0){s.style("font-weight",e.fontWeight)}if(e.fill!==void 0){s.attr("fill",e.fill)}if(e.class!==void 0){s.attr("class",e.class)}if(e.dy!==void 0){s.attr("dy",e.dy)}else if(h!==0){s.attr("dy",h)}const g=c||n.pe;if(e.tspan){const t=s.append("tspan");t.attr("x",e.x);if(e.fill!==void 0){t.attr("fill",e.fill)}t.text(g)}else{s.text(g)}if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0){r+=(s._groups||s)[0][0].getBBox().height;a=r}d.push(s)}return d}),"drawText");var N=(0,c.K2)((function(t,e){function a(t,e,a,r,s){return t+","+e+" "+(t+a)+","+e+" "+(t+a)+","+(e+r-s)+" "+(t+a-s*1.2)+","+(e+r)+" "+t+","+(e+r)}(0,c.K2)(a,"genPoints");const r=t.append("polygon");r.attr("points",a(e.x,e.y,e.width,e.height,7));r.attr("class","labelBox");e.y=e.y+e.height/2;A(t,e);return r}),"drawLabel");var M=-1;var O=(0,c.K2)(((t,e,a,r)=>{if(!t.select){return}a.forEach((a=>{const s=e.get(a);const i=t.select("#actor"+s.actorCnt);if(!r.mirrorActors&&s.stopy){i.attr("y2",s.stopy+s.height/2)}else if(r.mirrorActors){i.attr("y2",s.stopy)}}))}),"fixLifeLineHeights");var D=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+e.height;const l=t.append("g").lower();var d=l;if(!s){M++;if(Object.keys(e.links||{}).length&&!a.forceMenus){d.attr("onclick",_(`actor${M}_popup`)).attr("cursor","pointer")}d.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name);d=l.append("g");e.actorCnt=M;if(e.links!=null){d.attr("id","root-"+M)}}const h=(0,r.PB)();var p="actor";if(e.properties?.class){p=e.properties.class}else{h.fill="#eaeaea"}if(s){p+=` ${w}`}else{p+=` ${E}`}h.x=e.x;h.y=i;h.width=e.width;h.height=e.height;h.class=p;h.rx=3;h.ry=3;h.name=e.name;const g=I(d,h);e.rectData=h;if(e.properties?.icon){const t=e.properties.icon.trim();if(t.charAt(0)==="@"){(0,r.CP)(d,h.x+h.width-20,h.y+10,t.substr(1))}else{(0,r.aC)(d,h.x+h.width-20,h.y+10,t)}}at(a,(0,o.Wi)(e.description))(e.description,d,h.x,h.y,h.width,h.height,{class:`actor ${k}`},a);let u=e.height;if(g.node){const t=g.node().getBBox();e.height=t.height;u=t.height}return u}),"drawActorTypeParticipant");var S=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+e.height;const l=t.append("g").lower();var d=l;if(!s){M++;if(Object.keys(e.links||{}).length&&!a.forceMenus){d.attr("onclick",_(`actor${M}_popup`)).attr("cursor","pointer")}d.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name);d=l.append("g");e.actorCnt=M;if(e.links!=null){d.attr("id","root-"+M)}}const h=(0,r.PB)();var p="actor";if(e.properties?.class){p=e.properties.class}else{h.fill="#eaeaea"}if(s){p+=` ${w}`}else{p+=` ${E}`}h.x=e.x;h.y=i;h.width=e.width;h.height=e.height;h.class=p;h.name=e.name;const g=6;const u={...h,x:h.x+(s?-g:-g),y:h.y+(s?+g:+g),class:"actor"};const x=I(d,h);I(d,u);e.rectData=h;if(e.properties?.icon){const t=e.properties.icon.trim();if(t.charAt(0)==="@"){(0,r.CP)(d,h.x+h.width-20,h.y+10,t.substr(1))}else{(0,r.aC)(d,h.x+h.width-20,h.y+10,t)}}at(a,(0,o.Wi)(e.description))(e.description,d,h.x-g,h.y+g,h.width,h.height,{class:`actor ${k}`},a);let f=e.height;if(x.node){const t=x.node().getBBox();e.height=t.height;f=t.height}return f}),"drawActorTypeCollections");var R=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+e.height;const l=t.append("g").lower();let d=l;if(!s){M++;if(Object.keys(e.links||{}).length&&!a.forceMenus){d.attr("onclick",_(`actor${M}_popup`)).attr("cursor","pointer")}d.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name);d=l.append("g");e.actorCnt=M;if(e.links!=null){d.attr("id","root-"+M)}}const h=(0,r.PB)();let p="actor";if(e.properties?.class){p=e.properties.class}else{h.fill="#eaeaea"}if(s){p+=` ${w}`}else{p+=` ${E}`}h.x=e.x;h.y=i;h.width=e.width;h.height=e.height;h.class=p;h.name=e.name;const g=h.height/2;const u=g/(2.5+h.height/50);const x=d.append("g");const f=d.append("g");x.append("path").attr("d",`M ${h.x},${h.y+g}\n a ${u},${g} 0 0 0 0,${h.height}\n h ${h.width-2*u}\n a ${u},${g} 0 0 0 0,-${h.height}\n Z\n `).attr("class",p);f.append("path").attr("d",`M ${h.x},${h.y+g}\n a ${u},${g} 0 0 0 0,${h.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",p);x.attr("transform",`translate(${u}, ${-(h.height/2)})`);f.attr("transform",`translate(${h.width-u}, ${-h.height/2})`);e.rectData=h;if(e.properties?.icon){const t=e.properties.icon.trim();const a=h.x+h.width-20;const s=h.y+10;if(t.charAt(0)==="@"){(0,r.CP)(d,a,s,t.substr(1))}else{(0,r.aC)(d,a,s,t)}}at(a,(0,o.Wi)(e.description))(e.description,d,h.x,h.y,h.width,h.height,{class:`actor ${k}`},a);let y=e.height;const b=x.select("path:last-child");if(b.node()){const t=b.node().getBBox();e.height=t.height;y=t.height}return y}),"drawActorTypeQueue");var $=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+75;const l=t.append("g").lower();if(!s){M++;l.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).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=M}const d=t.append("g");let h=v;if(s){h+=` ${w}`}else{h+=` ${E}`}d.attr("class",h);d.attr("name",e.name);const p=(0,r.PB)();p.x=e.x;p.y=i;p.fill="#eaeaea";p.width=e.width;p.height=e.height;p.class="actor";const g=e.x+e.width/2;const u=i+30;const x=18;d.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z");d.append("circle").attr("cx",g).attr("cy",u).attr("r",x).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2);d.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${g}, ${u-x})`);const f=d.node().getBBox();e.height=f.height+2*(a?.sequence?.labelBoxHeight??0);at(a,(0,o.Wi)(e.description))(e.description,d,p.x,p.y+x+(s?5:10),p.width,p.height,{class:`actor ${v}`},a);return e.height}),"drawActorTypeControl");var C=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+75;const l=t.append("g").lower();const d=t.append("g");let h=v;if(s){h+=` ${w}`}else{h+=` ${E}`}d.attr("class",h);d.attr("name",e.name);const p=(0,r.PB)();p.x=e.x;p.y=i;p.fill="#eaeaea";p.width=e.width;p.height=e.height;p.class="actor";const g=e.x+e.width/2;const u=i+(!s?25:10);const x=18;d.append("circle").attr("cx",g).attr("cy",u).attr("r",x).attr("width",e.width).attr("height",e.height);d.append("line").attr("x1",g-x).attr("x2",g+x).attr("y1",u+x).attr("y2",u+x).attr("stroke","#333").attr("stroke-width",2);const f=d.node().getBBox();e.height=f.height+(a?.sequence?.labelBoxHeight??0);if(!s){M++;l.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).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=M}at(a,(0,o.Wi)(e.description))(e.description,d,p.x,p.y+(!s?(u+x-i)/2:(u-i+x-5)/2),p.width,p.height,{class:`actor ${v}`},a);if(!s){d.attr("transform",`translate(${0}, ${x/2})`)}else{d.attr("transform",`translate(${0}, ${x/2})`)}return e.height}),"drawActorTypeEntity");var Y=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+e.height+2*a.boxTextMargin;const l=t.append("g").lower();let d=l;if(!s){M++;if(Object.keys(e.links||{}).length&&!a.forceMenus){d.attr("onclick",_(`actor${M}_popup`)).attr("cursor","pointer")}d.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name);d=l.append("g");e.actorCnt=M;if(e.links!=null){d.attr("id","root-"+M)}}const h=(0,r.PB)();let p="actor";if(e.properties?.class){p=e.properties.class}else{h.fill="#eaeaea"}if(s){p+=` ${w}`}else{p+=` ${E}`}h.x=e.x;h.y=i;h.width=e.width;h.height=e.height;h.class=p;h.name=e.name;h.x=e.x;h.y=i;const g=h.width/4;const u=h.width/4;const x=g/2;const f=x/(2.5+g/50);const y=d.append("g");const b=`\n M ${h.x},${h.y+f}\n a ${x},${f} 0 0 0 ${g},0\n a ${x},${f} 0 0 0 -${g},0\n l 0,${u-2*f}\n a ${x},${f} 0 0 0 ${g},0\n l 0,-${u-2*f}\n`;y.append("path").attr("d",b).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",p);if(!s){y.attr("transform",`translate(${g*1.5}, ${(h.height+f)/4})`)}else{y.attr("transform",`translate(${g*1.5}, ${h.height/4-2*f})`)}e.rectData=h;at(a,(0,o.Wi)(e.description))(e.description,d,h.x,h.y+(!s?(h.height+f)/2:(h.height+u)/4),h.width,h.height,{class:`actor ${k}`},a);const m=y.select("path:last-child");if(m.node()){const t=m.node().getBBox();e.height=t.height+(a.sequence.labelBoxHeight??0)}return e.height}),"drawActorTypeDatabase");var B=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+80;const l=30;const d=t.append("g").lower();if(!s){M++;d.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).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=M}const h=t.append("g");let p=v;if(s){p+=` ${w}`}else{p+=` ${E}`}h.attr("class",p);h.attr("name",e.name);const g=(0,r.PB)();g.x=e.x;g.y=i;g.fill="#eaeaea";g.width=e.width;g.height=e.height;g.class="actor";h.append("line").attr("id","actor-man-torso"+M).attr("x1",e.x+e.width/2-l*2.5).attr("y1",i+10).attr("x2",e.x+e.width/2-15).attr("y2",i+10);h.append("line").attr("id","actor-man-arms"+M).attr("x1",e.x+e.width/2-l*2.5).attr("y1",i+0).attr("x2",e.x+e.width/2-l*2.5).attr("y2",i+20);h.append("circle").attr("cx",e.x+e.width/2).attr("cy",i+10).attr("r",l);const u=h.node().getBBox();e.height=u.height+(a.sequence.labelBoxHeight??0);at(a,(0,o.Wi)(e.description))(e.description,h,g.x,g.y+(!s?l/2+3:l/2-4),g.width,g.height,{class:`actor ${v}`},a);if(!s){h.attr("transform",`translate(0,${l/2+7})`)}else{h.attr("transform",`translate(0,${l/2+7})`)}return e.height}),"drawActorTypeBoundary");var K=(0,c.K2)((function(t,e,a,s){const i=s?e.stopy:e.starty;const n=e.x+e.width/2;const c=i+80;const l=t.append("g").lower();if(!s){M++;l.append("line").attr("id","actor"+M).attr("x1",n).attr("y1",c).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=M}const d=t.append("g");let h=v;if(s){h+=` ${w}`}else{h+=` ${E}`}d.attr("class",h);d.attr("name",e.name);const p=(0,r.PB)();p.x=e.x;p.y=i;p.fill="#eaeaea";p.width=e.width;p.height=e.height;p.class="actor";p.rx=3;p.ry=3;d.append("line").attr("id","actor-man-torso"+M).attr("x1",n).attr("y1",i+25).attr("x2",n).attr("y2",i+45);d.append("line").attr("id","actor-man-arms"+M).attr("x1",n-T/2).attr("y1",i+33).attr("x2",n+T/2).attr("y2",i+33);d.append("line").attr("x1",n-T/2).attr("y1",i+60).attr("x2",n).attr("y2",i+45);d.append("line").attr("x1",n).attr("y1",i+45).attr("x2",n+T/2-2).attr("y2",i+60);const g=d.append("circle");g.attr("cx",e.x+e.width/2);g.attr("cy",i+10);g.attr("r",15);g.attr("width",e.width);g.attr("height",e.height);const u=d.node().getBBox();e.height=u.height;at(a,(0,o.Wi)(e.description))(e.description,d,p.x,p.y+35,p.width,p.height,{class:`actor ${v}`},a);return e.height}),"drawActorTypeActor");var V=(0,c.K2)((async function(t,e,a,r){switch(e.type){case"actor":return await K(t,e,a,r);case"participant":return await D(t,e,a,r);case"boundary":return await B(t,e,a,r);case"control":return await $(t,e,a,r);case"entity":return await C(t,e,a,r);case"database":return await Y(t,e,a,r);case"collections":return await S(t,e,a,r);case"queue":return await R(t,e,a,r)}}),"drawActor");var F=(0,c.K2)((function(t,e,a){const r=t.append("g");const s=r;H(s,e);if(e.name){at(a)(e.name,s,e.x,e.y+a.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a)}s.lower()}),"drawBox");var W=(0,c.K2)((function(t){return t.append("g")}),"anchorElement");var q=(0,c.K2)((function(t,e,a,s,i){const n=(0,r.PB)();const 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;I(o,n)}),"drawActivation");var z=(0,c.K2)((async function(t,e,a,s){const{boxMargin:i,boxTextMargin:n,labelBoxHeight:l,labelBoxWidth:d,messageFontFamily:h,messageFontSize:p,messageFontWeight:g}=s;const u=t.append("g");const x=(0,c.K2)((function(t,e,a,r){return u.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",r).attr("class","loopLine")}),"drawLoopLine");x(e.startx,e.starty,e.stopx,e.starty);x(e.stopx,e.starty,e.stopx,e.stopy);x(e.startx,e.stopy,e.stopx,e.stopy);x(e.startx,e.starty,e.startx,e.stopy);if(e.sections!==void 0){e.sections.forEach((function(t){x(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}))}let f=(0,r.HT)();f.text=a;f.x=e.startx;f.y=e.starty;f.fontFamily=h;f.fontSize=p;f.fontWeight=g;f.anchor="middle";f.valign="middle";f.tspan=false;f.width=d||50;f.height=l||20;f.textMargin=n;f.class="labelText";N(u,f);f=tt();f.text=e.title;f.x=e.startx+d/2+(e.stopx-e.startx)/2;f.y=e.starty+i+n;f.anchor="middle";f.valign="middle";f.textMargin=n;f.class="loopText";f.fontFamily=h;f.fontSize=p;f.fontWeight=g;f.wrap=true;let y=(0,o.Wi)(f.text)?await P(u,f,e):A(u,f);if(e.sectionTitles!==void 0){for(const[t,a]of Object.entries(e.sectionTitles)){if(a.message){f.text=a.message;f.x=e.startx+(e.stopx-e.startx)/2;f.y=e.sections[t].y+i+n;f.class="loopText";f.anchor="middle";f.valign="middle";f.tspan=false;f.fontFamily=h;f.fontSize=p;f.fontWeight=g;f.wrap=e.wrap;if((0,o.Wi)(f.text)){e.starty=e.sections[t].y;await P(u,f,e)}else{A(u,f)}let r=Math.round(y.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[t].height+=r-(i+n)}}}e.height=Math.round(e.stopy-e.starty);return u}),"drawLoop");var H=(0,c.K2)((function(t,e){(0,r.lC)(t,e)}),"drawBackgroundRect");var j=(0,c.K2)((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");var U=(0,c.K2)((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");var G=(0,c.K2)((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");var X=(0,c.K2)((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");var J=(0,c.K2)((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");var Z=(0,c.K2)((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");var Q=(0,c.K2)((function(t){const e=t.append("defs");const a=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5);a.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");var tt=(0,c.K2)((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:true,valign:void 0}}),"getTextObj");var et=(0,c.K2)((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect");var at=function(){function t(t,e,a,r,i,n,o){const c=e.append("text").attr("x",a+i/2).attr("y",r+n/2+5).style("text-anchor","middle").text(t);s(c,o)}(0,c.K2)(t,"byText");function e(t,e,a,r,i,c,l,d){const{actorFontSize:h,actorFontFamily:p,actorFontWeight:g}=d;const[u,x]=(0,n.I5)(h);const f=t.split(o.Y2.lineBreakRegex);for(let n=0;n<f.length;n++){const t=n*u-u*(f.length-1)/2;const o=e.append("text").attr("x",a+i/2).attr("y",r).style("text-anchor","middle").style("font-size",x).style("font-weight",g).style("font-family",p);o.append("tspan").attr("x",a+i/2).attr("dy",t).text(f[n]);o.attr("y",r+c/2).attr("dominant-baseline","central").attr("alignment-baseline","central");s(o,l)}}(0,c.K2)(e,"byTspan");function a(t,a,r,i,n,o,c,l){const d=a.append("switch");const h=d.append("foreignObject").attr("x",r).attr("y",i).attr("width",n).attr("height",o);const p=h.append("xhtml:div").style("display","table").style("height","100%").style("width","100%");p.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t);e(t,d,r,i,n,o,c,l);s(p,c)}(0,c.K2)(a,"byFo");async function r(t,a,r,i,n,c,l,d){const h=await(0,o.Dl)(t,(0,o.zj)());const p=a.append("switch");const g=p.append("foreignObject").attr("x",r+n/2-h.width/2).attr("y",i+c/2-h.height/2).attr("width",h.width).attr("height",h.height);const u=g.append("xhtml:div").style("height","100%").style("width","100%");u.append("div").style("text-align","center").style("vertical-align","middle").html(await(0,o.dj)(t,(0,o.zj)()));e(t,p,r,i,n,c,l,d);s(u,l)}(0,c.K2)(r,"byKatex");function s(t,e){for(const a in e){if(e.hasOwnProperty(a)){t.attr(a,e[a])}}}(0,c.K2)(s,"_setTextAttrs");return function(s,i=false){if(i){return r}return s.textPlacement==="fo"?a:s.textPlacement==="old"?t:e}}();var rt=function(){function t(t,e,a,s,i,n,o){const c=e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").text(t);r(c,o)}(0,c.K2)(t,"byText");function e(t,e,a,s,i,n,c,l){const{actorFontSize:d,actorFontFamily:h,actorFontWeight:p}=l;const g=t.split(o.Y2.lineBreakRegex);for(let o=0;o<g.length;o++){const t=o*d-d*(g.length-1)/2;const i=e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").style("font-size",d).style("font-weight",p).style("font-family",h);i.append("tspan").attr("x",a).attr("dy",t).text(g[o]);i.attr("y",s+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central");r(i,c)}}(0,c.K2)(e,"byTspan");function a(t,a,s,i,n,o,c,l){const d=a.append("switch");const h=d.append("foreignObject").attr("x",s).attr("y",i).attr("width",n).attr("height",o);const p=h.append("xhtml:div").style("display","table").style("height","100%").style("width","100%");p.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t);e(t,d,s,i,n,o,c,l);r(p,c)}(0,c.K2)(a,"byFo");function r(t,e){for(const a in e){if(e.hasOwnProperty(a)){t.attr(a,e[a])}}}(0,c.K2)(r,"_setTextAttrs");return function(r){return r.textPlacement==="fo"?a:r.textPlacement==="old"?t:e}}();var st={drawRect:I,drawText:A,drawLabel:N,drawActor:V,drawBox:F,drawPopup:L,anchorElement:W,drawActivation:q,drawLoop:z,drawBackgroundRect:H,insertArrowHead:X,insertArrowFilledHead:J,insertSequenceNumber:Z,insertArrowCrossHead:Q,insertDatabaseIcon:j,insertComputerIcon:U,insertClockIcon:G,getTextObj:tt,getNoteRect:et,fixLifeLineHeights:O,sanitizeUrl:d.J};var it={};var nt={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:(0,c.K2)((function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map((t=>t.height||0)))+(this.loops.length===0?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(this.messages.length===0?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(this.notes.length===0?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:(0,c.K2)((function(){this.actors=[];this.boxes=[];this.loops=[];this.messages=[];this.notes=[]}),"clear"),addBox:(0,c.K2)((function(t){this.boxes.push(t)}),"addBox"),addActor:(0,c.K2)((function(t){this.actors.push(t)}),"addActor"),addLoop:(0,c.K2)((function(t){this.loops.push(t)}),"addLoop"),addMessage:(0,c.K2)((function(t){this.messages.push(t)}),"addMessage"),addNote:(0,c.K2)((function(t){this.notes.push(t)}),"addNote"),lastActor:(0,c.K2)((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:(0,c.K2)((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:(0,c.K2)((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:(0,c.K2)((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:(0,c.K2)((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;ft((0,o.D7)())}),"init"),updateVal:(0,c.K2)((function(t,e,a,r){if(t[e]===void 0){t[e]=a}else{t[e]=r(a,t[e])}}),"updateVal"),updateBounds:(0,c.K2)((function(t,e,a,r){const s=this;let i=0;function n(n){return(0,c.K2)((function o(c){i++;const l=s.sequenceItems.length-i+1;s.updateVal(c,"starty",e-l*it.boxMargin,Math.min);s.updateVal(c,"stopy",r+l*it.boxMargin,Math.max);s.updateVal(nt.data,"startx",t-l*it.boxMargin,Math.min);s.updateVal(nt.data,"stopx",a+l*it.boxMargin,Math.max);if(!(n==="activation")){s.updateVal(c,"startx",t-l*it.boxMargin,Math.min);s.updateVal(c,"stopx",a+l*it.boxMargin,Math.max);s.updateVal(nt.data,"starty",e-l*it.boxMargin,Math.min);s.updateVal(nt.data,"stopy",r+l*it.boxMargin,Math.max)}}),"updateItemBounds")}(0,c.K2)(n,"updateFn");this.sequenceItems.forEach(n());this.activations.forEach(n("activation"))}),"updateBounds"),insert:(0,c.K2)((function(t,e,a,r){const s=o.Y2.getMin(t,a);const i=o.Y2.getMax(t,a);const n=o.Y2.getMin(e,r);const c=o.Y2.getMax(e,r);this.updateVal(nt.data,"startx",s,Math.min);this.updateVal(nt.data,"starty",n,Math.min);this.updateVal(nt.data,"stopx",i,Math.max);this.updateVal(nt.data,"stopy",c,Math.max);this.updateBounds(s,n,i,c)}),"insert"),newActivation:(0,c.K2)((function(t,e,a){const r=a.get(t.from);const s=yt(t.from).length||0;const i=r.x+r.width/2+(s-1)*it.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+it.activationWidth,stopy:void 0,actor:t.from,anchored:st.anchorElement(e)})}),"newActivation"),endActivation:(0,c.K2)((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:(0,c.K2)((function(t={message:void 0,wrap:false,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:(0,c.K2)((function(t={message:void 0,wrap:false,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:(0,c.K2)((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:(0,c.K2)((function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:false}),"isLoopOverlap"),addSectionToLoop:(0,c.K2)((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[];e.sectionTitles=e.sectionTitles||[];e.sections.push({y:nt.getVerticalPos(),height:0});e.sectionTitles.push(t);this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:(0,c.K2)((function(){if(this.isLoopOverlap()){this.savedVerticalPos=this.verticalPos}}),"saveVerticalPos"),resetVerticalPos:(0,c.K2)((function(){if(this.isLoopOverlap()){this.verticalPos=this.savedVerticalPos}}),"resetVerticalPos"),bumpVerticalPos:(0,c.K2)((function(t){this.verticalPos=this.verticalPos+t;this.data.stopy=o.Y2.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:(0,c.K2)((function(){return this.verticalPos}),"getVerticalPos"),getBounds:(0,c.K2)((function(){return{bounds:this.data,models:this.models}}),"getBounds")};var ot=(0,c.K2)((async function(t,e){nt.bumpVerticalPos(it.boxMargin);e.height=it.boxMargin;e.starty=nt.getVerticalPos();const a=(0,r.PB)();a.x=e.startx;a.y=e.starty;a.width=e.width||it.width;a.class="note";const s=t.append("g");const i=st.drawRect(s,a);const n=(0,r.HT)();n.x=e.startx;n.y=e.starty;n.width=a.width;n.dy="1em";n.text=e.message;n.class="noteText";n.fontFamily=it.noteFontFamily;n.fontSize=it.noteFontSize;n.fontWeight=it.noteFontWeight;n.anchor=it.noteAlign;n.textMargin=it.noteMargin;n.valign="center";const c=(0,o.Wi)(n.text)?await P(s,n):A(s,n);const l=Math.round(c.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));i.attr("height",l+2*it.noteMargin);e.height+=l+2*it.noteMargin;nt.bumpVerticalPos(l+2*it.noteMargin);e.stopy=e.starty+l+2*it.noteMargin;e.stopx=e.startx+a.width;nt.insert(e.startx,e.starty,e.stopx,e.stopy);nt.models.addNote(e)}),"drawNote");var ct=(0,c.K2)((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont");var lt=(0,c.K2)((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont");var dt=(0,c.K2)((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function ht(t,e){nt.bumpVerticalPos(10);const{startx:a,stopx:r,message:s}=e;const i=o.Y2.splitBreaks(s).length;const c=(0,o.Wi)(s);const l=c?await(0,o.Dl)(s,(0,o.D7)()):n._K.calculateTextDimensions(s,ct(it));if(!c){const t=l.height/i;e.height+=t;nt.bumpVerticalPos(t)}let d;let h=l.height-10;const p=l.width;if(a===r){d=nt.getVerticalPos()+h;if(!it.rightAngles){h+=it.boxMargin;d=nt.getVerticalPos()+h}h+=30;const t=o.Y2.getMax(p/2,it.width/2);nt.insert(a-t,nt.getVerticalPos()-10+h,r+t,nt.getVerticalPos()+30+h)}else{h+=it.boxMargin;d=nt.getVerticalPos()+h;nt.insert(a,d-10,r,d)}nt.bumpVerticalPos(h);e.height+=h;e.stopy=e.starty+e.height;nt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy);return d}(0,c.K2)(ht,"boundMessage");var pt=(0,c.K2)((async function(t,e,a,s){const{startx:i,stopx:c,starty:l,message:d,type:h,sequenceIndex:p,sequenceVisible:g}=e;const u=n._K.calculateTextDimensions(d,ct(it));const x=(0,r.HT)();x.x=i;x.y=l+10;x.width=c-i;x.class="messageText";x.dy="1em";x.text=d;x.fontFamily=it.messageFontFamily;x.fontSize=it.messageFontSize;x.fontWeight=it.messageFontWeight;x.anchor=it.messageAlign;x.valign="center";x.textMargin=it.wrapPadding;x.tspan=false;if((0,o.Wi)(x.text)){await P(t,x,{startx:i,stopx:c,starty:a})}else{A(t,x)}const f=u.width;let y;if(i===c){if(it.rightAngles){y=t.append("path").attr("d",`M ${i},${a} H ${i+o.Y2.getMax(it.width/2,f/2)} V ${a+25} H ${i}`)}else{y=t.append("path").attr("d","M "+i+","+a+" C "+(i+60)+","+(a-10)+" "+(i+60)+","+(a+30)+" "+i+","+(a+20))}}else{y=t.append("line");y.attr("x1",i);y.attr("y1",a);y.attr("x2",c);y.attr("y2",a)}if(h===s.db.LINETYPE.DOTTED||h===s.db.LINETYPE.DOTTED_CROSS||h===s.db.LINETYPE.DOTTED_POINT||h===s.db.LINETYPE.DOTTED_OPEN||h===s.db.LINETYPE.BIDIRECTIONAL_DOTTED){y.style("stroke-dasharray","3, 3");y.attr("class","messageLine1")}else{y.attr("class","messageLine0")}let b="";if(it.arrowMarkerAbsolute){b=(0,o.ID)(true)}y.attr("stroke-width",2);y.attr("stroke","none");y.style("fill","none");if(h===s.db.LINETYPE.SOLID||h===s.db.LINETYPE.DOTTED){y.attr("marker-end","url("+b+"#arrowhead)")}if(h===s.db.LINETYPE.BIDIRECTIONAL_SOLID||h===s.db.LINETYPE.BIDIRECTIONAL_DOTTED){y.attr("marker-start","url("+b+"#arrowhead)");y.attr("marker-end","url("+b+"#arrowhead)")}if(h===s.db.LINETYPE.SOLID_POINT||h===s.db.LINETYPE.DOTTED_POINT){y.attr("marker-end","url("+b+"#filled-head)")}if(h===s.db.LINETYPE.SOLID_CROSS||h===s.db.LINETYPE.DOTTED_CROSS){y.attr("marker-end","url("+b+"#crosshead)")}if(g||it.showSequenceNumbers){const e=h===s.db.LINETYPE.BIDIRECTIONAL_SOLID||h===s.db.LINETYPE.BIDIRECTIONAL_DOTTED;if(e){const t=6;if(i<c){y.attr("x1",i+2*t)}else{y.attr("x1",i+t)}}t.append("line").attr("x1",i).attr("y1",a).attr("x2",i).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+b+"#sequencenumber)");t.append("text").attr("x",i).attr("y",a+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(p)}}),"drawMessage");var gt=(0,c.K2)((function(t,e,a,r,s,i,n){let c=0;let l=0;let d=void 0;let h=0;for(const p of r){const t=e.get(p);const r=t.box;if(d&&d!=r){if(!n){nt.models.addBox(d)}l+=it.boxMargin+d.margin}if(r&&r!=d){if(!n){r.x=c+l;r.y=s}l+=r.margin}t.width=t.width||it.width;t.height=o.Y2.getMax(t.height||it.height,it.height);t.margin=t.margin||it.actorMargin;h=o.Y2.getMax(h,t.height);if(a.get(t.name)){l+=t.width/2}t.x=c+l;t.starty=nt.getVerticalPos();nt.insert(t.x,s,t.x+t.width,t.height);c+=t.width+l;if(t.box){t.box.width=c+r.margin-t.box.x}l=t.margin;d=t.box;nt.models.addActor(t)}if(d&&!n){nt.models.addBox(d)}nt.bumpVerticalPos(h)}),"addActorRenderingData");var ut=(0,c.K2)((async function(t,e,a,r){if(!r){for(const r of a){const a=e.get(r);await st.drawActor(t,a,it,false)}}else{let r=0;nt.bumpVerticalPos(it.boxMargin*2);for(const s of a){const a=e.get(s);if(!a.stopy){a.stopy=nt.getVerticalPos()}const i=await st.drawActor(t,a,it,true);r=o.Y2.getMax(r,i)}nt.bumpVerticalPos(r+it.boxMargin)}}),"drawActors");var xt=(0,c.K2)((function(t,e,a,r){let s=0;let i=0;for(const n of a){const a=e.get(n);const o=kt(a);const c=st.drawPopup(t,a,o,it,it.forceMenus,r);if(c.height>s){s=c.height}if(c.width+a.x>i){i=c.width+a.x}}return{maxHeight:s,maxWidth:i}}),"drawActorsPopup");var ft=(0,c.K2)((function(t){(0,o.hH)(it,t);if(t.fontFamily){it.actorFontFamily=it.noteFontFamily=it.messageFontFamily=t.fontFamily}if(t.fontSize){it.actorFontSize=it.noteFontSize=it.messageFontSize=t.fontSize}if(t.fontWeight){it.actorFontWeight=it.noteFontWeight=it.messageFontWeight=t.fontWeight}}),"setConf");var yt=(0,c.K2)((function(t){return nt.activations.filter((function(e){return e.actor===t}))}),"actorActivations");var bt=(0,c.K2)((function(t,e){const a=e.get(t);const r=yt(t);const s=r.reduce((function(t,e){return o.Y2.getMin(t,e.startx)}),a.x+a.width/2-1);const i=r.reduce((function(t,e){return o.Y2.getMax(t,e.stopx)}),a.x+a.width/2+1);return[s,i]}),"activationBounds");function mt(t,e,a,r,s){nt.bumpVerticalPos(a);let i=r;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width;const s=ct(it);e.message=n._K.wrapLabel(`[${e.message}]`,a-2*it.wrapPadding,s);e.width=a;e.wrap=true;const l=n._K.calculateTextDimensions(e.message,s);const d=o.Y2.getMax(l.height,it.labelBoxHeight);i=r+d;c.Rm.debug(`${d} - ${e.message}`)}s(e);nt.bumpVerticalPos(i)}(0,c.K2)(mt,"adjustLoopHeightForWrap");function Tt(t,e,a,r,s,i,n){function o(a,r){if(a.x<s.get(t.from).x){nt.insert(e.stopx-r,e.starty,e.startx,e.stopy+a.height/2+it.noteMargin);e.stopx=e.stopx+r}else{nt.insert(e.startx,e.starty,e.stopx+r,e.stopy+a.height/2+it.noteMargin);e.stopx=e.stopx-r}}(0,c.K2)(o,"receiverAdjustment");function l(a,r){if(a.x<s.get(t.to).x){nt.insert(e.startx-r,e.starty,e.stopx,e.stopy+a.height/2+it.noteMargin);e.startx=e.startx+r}else{nt.insert(e.stopx,e.starty,e.startx+r,e.stopy+a.height/2+it.noteMargin);e.startx=e.startx-r}}(0,c.K2)(l,"senderAdjustment");const d=[f.ACTOR,f.CONTROL,f.ENTITY,f.DATABASE];if(i.get(t.to)==r){const e=s.get(t.to);const r=d.includes(e.type)?T/2+3:e.width/2+3;o(e,r);e.starty=a-e.height/2;nt.bumpVerticalPos(e.height/2)}else if(n.get(t.from)==r){const e=s.get(t.from);if(it.mirrorActors){const t=d.includes(e.type)?T/2:e.width/2;l(e,t)}e.stopy=a-e.height/2;nt.bumpVerticalPos(e.height/2)}else if(n.get(t.to)==r){const e=s.get(t.to);if(it.mirrorActors){const t=d.includes(e.type)?T/2+3:e.width/2+3;o(e,t)}e.stopy=a-e.height/2;nt.bumpVerticalPos(e.height/2)}}(0,c.K2)(Tt,"adjustCreatedDestroyedData");var Et=(0,c.K2)((async function(t,e,a,r){const{securityLevel:s,sequence:i}=(0,o.D7)();it=i;let n;if(s==="sandbox"){n=(0,l.Ltv)("#i"+e)}const d=s==="sandbox"?(0,l.Ltv)(n.nodes()[0].contentDocument.body):(0,l.Ltv)("body");const h=s==="sandbox"?n.nodes()[0].contentDocument:document;nt.init();c.Rm.debug(r.db);const p=s==="sandbox"?d.select(`[id="${e}"]`):(0,l.Ltv)(`[id="${e}"]`);const g=r.db.getActors();const u=r.db.getCreatedActors();const x=r.db.getDestroyedActors();const f=r.db.getBoxes();let y=r.db.getActorKeys();const b=r.db.getMessages();const m=r.db.getDiagramTitle();const T=r.db.hasAtLeastOneBox();const E=r.db.hasAtLeastOneBoxWithTitle();const w=await wt(g,b,r);it.height=await vt(g,w,f);st.insertComputerIcon(p);st.insertDatabaseIcon(p);st.insertClockIcon(p);if(T){nt.bumpVerticalPos(it.boxMargin);if(E){nt.bumpVerticalPos(f[0].textMaxHeight)}}if(it.hideUnusedParticipants===true){const t=new Set;b.forEach((e=>{t.add(e.from);t.add(e.to)}));y=y.filter((e=>t.has(e)))}gt(p,g,u,y,0,b,false);const k=await _t(b,g,w,r);st.insertArrowHead(p);st.insertArrowCrossHead(p);st.insertArrowFilledHead(p);st.insertSequenceNumber(p);function v(t,e){const a=nt.endActivation(t);if(a.starty+18>e){a.starty=e-6;e+=12}st.drawActivation(p,a,e,it,yt(t.from).length);nt.insert(a.startx,e-10,a.stopx,e)}(0,c.K2)(v,"activeEnd");let I=1;let L=1;const _=[];const P=[];let A=0;for(const o of b){let t,e,a;switch(o.type){case r.db.LINETYPE.NOTE:nt.resetVerticalPos();e=o.noteModel;await ot(p,e);break;case r.db.LINETYPE.ACTIVE_START:nt.newActivation(o,p,g);break;case r.db.LINETYPE.ACTIVE_END:v(o,nt.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:mt(k,o,it.boxMargin,it.boxMargin+it.boxTextMargin,(t=>nt.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:t=nt.endLoop();await st.drawLoop(p,t,"loop",it);nt.bumpVerticalPos(t.stopy-nt.getVerticalPos());nt.models.addLoop(t);break;case r.db.LINETYPE.RECT_START:mt(k,o,it.boxMargin,it.boxMargin,(t=>nt.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:t=nt.endLoop();P.push(t);nt.models.addLoop(t);nt.bumpVerticalPos(t.stopy-nt.getVerticalPos());break;case r.db.LINETYPE.OPT_START:mt(k,o,it.boxMargin,it.boxMargin+it.boxTextMargin,(t=>nt.newLoop(t)));break;case r.db.LINETYPE.OPT_END:t=nt.endLoop();await st.drawLoop(p,t,"opt",it);nt.bumpVerticalPos(t.stopy-nt.getVerticalPos());nt.models.addLoop(t);break;case r.db.LINETYPE.ALT_START:mt(k,o,it.boxMargin,it.boxMargin+it.boxTextMargin,(t=>nt.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:mt(k,o,it.boxMargin+it.boxTextMargin,it.boxMargin,(t=>nt.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:t=nt.endLoop();await st.drawLoop(p,t,"alt",it);nt.bumpVerticalPos(t.stopy-nt.getVerticalPos());nt.models.addLoop(t);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:mt(k,o,it.boxMargin,it.boxMargin+it.boxTextMargin,(t=>nt.newLoop(t)));nt.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:mt(k,o,it.boxMargin+it.boxTextMargin,it.boxMargin,(t=>nt.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:t=nt.endLoop();await st.drawLoop(p,t,"par",it);nt.bumpVerticalPos(t.stopy-nt.getVerticalPos());nt.models.addLoop(t);break;case r.db.LINETYPE.AUTONUMBER:I=o.message.start||I;L=o.message.step||L;if(o.message.visible){r.db.enableSequenceNumbers()}else{r.db.disableSequenceNumbers()}break;case r.db.LINETYPE.CRITICAL_START:mt(k,o,it.boxMargin,it.boxMargin+it.boxTextMargin,(t=>nt.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:mt(k,o,it.boxMargin+it.boxTextMargin,it.boxMargin,(t=>nt.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:t=nt.endLoop();await st.drawLoop(p,t,"critical",it);nt.bumpVerticalPos(t.stopy-nt.getVerticalPos());nt.models.addLoop(t);break;case r.db.LINETYPE.BREAK_START:mt(k,o,it.boxMargin,it.boxMargin+it.boxTextMargin,(t=>nt.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:t=nt.endLoop();await st.drawLoop(p,t,"break",it);nt.bumpVerticalPos(t.stopy-nt.getVerticalPos());nt.models.addLoop(t);break;default:try{a=o.msgModel;a.starty=nt.getVerticalPos();a.sequenceIndex=I;a.sequenceVisible=r.db.showSequenceNumbers();const t=await ht(p,a);Tt(o,a,t,A,g,u,x);_.push({messageModel:a,lineStartY:t});nt.models.addMessage(a)}catch(Y){c.Rm.error("error while drawing message",Y)}}if([r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,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(o.type)){I=I+L}A++}c.Rm.debug("createdActors",u);c.Rm.debug("destroyedActors",x);await ut(p,g,y,false);for(const o of _){await pt(p,o.messageModel,o.lineStartY,r)}if(it.mirrorActors){await ut(p,g,y,true)}P.forEach((t=>st.drawBackgroundRect(p,t)));O(p,g,y,it);for(const o of nt.models.boxes){o.height=nt.getVerticalPos()-o.y;nt.insert(o.x,o.y,o.x+o.width,o.height);const t=it.boxMargin*2;o.startx=o.x-t;o.starty=o.y-t*.25;o.stopx=o.startx+o.width+2*t;o.stopy=o.starty+o.height+t*.75;o.stroke="rgb(0,0,0, 0.5)";st.drawBox(p,o,it)}if(T){nt.bumpVerticalPos(it.boxMargin)}const N=xt(p,g,y,h);const{bounds:M}=nt.getBounds();if(M.startx===void 0){M.startx=0}if(M.starty===void 0){M.starty=0}if(M.stopx===void 0){M.stopx=0}if(M.stopy===void 0){M.stopy=0}let D=M.stopy-M.starty;if(D<N.maxHeight){D=N.maxHeight}let S=D+2*it.diagramMarginY;if(it.mirrorActors){S=S-it.boxMargin+it.bottomMarginAdj}let R=M.stopx-M.startx;if(R<N.maxWidth){R=N.maxWidth}const $=R+2*it.diagramMarginX;if(m){p.append("text").text(m).attr("x",(M.stopx-M.startx)/2-2*it.diagramMarginX).attr("y",-25)}(0,o.a$)(p,S,$,it.useMaxWidth);const C=m?40:0;p.attr("viewBox",M.startx-it.diagramMarginX+" -"+(it.diagramMarginY+C)+" "+$+" "+(S+C));c.Rm.debug(`models:`,nt.models)}),"draw");async function wt(t,e,a){const r={};for(const s of e){if(t.get(s.to)&&t.get(s.from)){const e=t.get(s.to);if(s.placement===a.db.PLACEMENT.LEFTOF&&!e.prevActor){continue}if(s.placement===a.db.PLACEMENT.RIGHTOF&&!e.nextActor){continue}const i=s.placement!==void 0;const c=!i;const l=i?lt(it):ct(it);const d=s.wrap?n._K.wrapLabel(s.message,it.width-2*it.wrapPadding,l):s.message;const h=(0,o.Wi)(d)?await(0,o.Dl)(s.message,(0,o.D7)()):n._K.calculateTextDimensions(d,l);const p=h.width+2*it.wrapPadding;if(c&&s.from===e.nextActor){r[s.to]=o.Y2.getMax(r[s.to]||0,p)}else if(c&&s.from===e.prevActor){r[s.from]=o.Y2.getMax(r[s.from]||0,p)}else if(c&&s.from===s.to){r[s.from]=o.Y2.getMax(r[s.from]||0,p/2);r[s.to]=o.Y2.getMax(r[s.to]||0,p/2)}else if(s.placement===a.db.PLACEMENT.RIGHTOF){r[s.from]=o.Y2.getMax(r[s.from]||0,p)}else if(s.placement===a.db.PLACEMENT.LEFTOF){r[e.prevActor]=o.Y2.getMax(r[e.prevActor]||0,p)}else if(s.placement===a.db.PLACEMENT.OVER){if(e.prevActor){r[e.prevActor]=o.Y2.getMax(r[e.prevActor]||0,p/2)}if(e.nextActor){r[s.from]=o.Y2.getMax(r[s.from]||0,p/2)}}}}c.Rm.debug("maxMessageWidthPerActor:",r);return r}(0,c.K2)(wt,"getMaxMessageWidthPerActor");var kt=(0,c.K2)((function(t){let e=0;const a=dt(it);for(const r in t.links){const t=n._K.calculateTextDimensions(r,a);const s=t.width+2*it.wrapPadding+2*it.boxMargin;if(e<s){e=s}}return e}),"getRequiredPopupWidth");async function vt(t,e,a){let r=0;for(const i of t.keys()){const e=t.get(i);if(e.wrap){e.description=n._K.wrapLabel(e.description,it.width-2*it.wrapPadding,dt(it))}const a=(0,o.Wi)(e.description)?await(0,o.Dl)(e.description,(0,o.D7)()):n._K.calculateTextDimensions(e.description,dt(it));e.width=e.wrap?it.width:o.Y2.getMax(it.width,a.width+2*it.wrapPadding);e.height=e.wrap?o.Y2.getMax(a.height,it.height):it.height;r=o.Y2.getMax(r,e.height)}for(const i in e){const a=t.get(i);if(!a){continue}const r=t.get(a.nextActor);if(!r){const t=e[i];const r=t+it.actorMargin-a.width/2;a.margin=o.Y2.getMax(r,it.actorMargin);continue}const s=e[i];const n=s+it.actorMargin-a.width/2-r.width/2;a.margin=o.Y2.getMax(n,it.actorMargin)}let s=0;a.forEach((e=>{const a=ct(it);let r=e.actorKeys.reduce(((e,a)=>e+=t.get(a).width+(t.get(a).margin||0)),0);const i=it.boxMargin*8;r+=i;r-=2*it.boxTextMargin;if(e.wrap){e.name=n._K.wrapLabel(e.name,r-2*it.wrapPadding,a)}const c=n._K.calculateTextDimensions(e.name,a);s=o.Y2.getMax(c.height,s);const l=o.Y2.getMax(r,c.width+2*it.wrapPadding);e.margin=it.boxTextMargin;if(r<l){const t=(l-r)/2;e.margin+=t}}));a.forEach((t=>t.textMaxHeight=s));return o.Y2.getMax(r,it.height)}(0,c.K2)(vt,"calculateActorMargins");var It=(0,c.K2)((async function(t,e,a){const r=e.get(t.from);const s=e.get(t.to);const i=r.x;const l=s.x;const d=t.wrap&&t.message;let h=(0,o.Wi)(t.message)?await(0,o.Dl)(t.message,(0,o.D7)()):n._K.calculateTextDimensions(d?n._K.wrapLabel(t.message,it.width,lt(it)):t.message,lt(it));const p={width:d?it.width:o.Y2.getMax(it.width,h.width+2*it.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};if(t.placement===a.db.PLACEMENT.RIGHTOF){p.width=d?o.Y2.getMax(it.width,h.width):o.Y2.getMax(r.width/2+s.width/2,h.width+2*it.noteMargin);p.startx=i+(r.width+it.actorMargin)/2}else if(t.placement===a.db.PLACEMENT.LEFTOF){p.width=d?o.Y2.getMax(it.width,h.width+2*it.noteMargin):o.Y2.getMax(r.width/2+s.width/2,h.width+2*it.noteMargin);p.startx=i-p.width+(r.width-it.actorMargin)/2}else if(t.to===t.from){h=n._K.calculateTextDimensions(d?n._K.wrapLabel(t.message,o.Y2.getMax(it.width,r.width),lt(it)):t.message,lt(it));p.width=d?o.Y2.getMax(it.width,r.width):o.Y2.getMax(r.width,it.width,h.width+2*it.noteMargin);p.startx=i+(r.width-p.width)/2}else{p.width=Math.abs(i+r.width/2-(l+s.width/2))+it.actorMargin;p.startx=i<l?i+r.width/2-it.actorMargin/2:l+s.width/2-it.actorMargin/2}if(d){p.message=n._K.wrapLabel(t.message,p.width-2*it.wrapPadding,lt(it))}c.Rm.debug(`NM:[${p.startx},${p.stopx},${p.starty},${p.stopy}:${p.width},${p.height}=${t.message}]`);return p}),"buildNoteModel");var Lt=(0,c.K2)((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{}}const[r,s]=bt(t.from,e);const[i,l]=bt(t.to,e);const d=r<=i;let h=d?s:r;let p=d?i:l;const g=Math.abs(i-l)>2;const u=(0,c.K2)((t=>d?-t:t),"adjustValue");if(t.from===t.to){p=h}else{if(t.activate&&!g){p+=u(it.activationWidth/2-1)}if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN].includes(t.type)){p+=u(3)}if([a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)){h-=u(3)}}const x=[r,s,i,l];const f=Math.abs(h-p);if(t.wrap&&t.message){t.message=n._K.wrapLabel(t.message,o.Y2.getMax(f+2*it.wrapPadding,it.width),ct(it))}const y=n._K.calculateTextDimensions(t.message,ct(it));return{width:o.Y2.getMax(t.wrap?0:y.width+2*it.wrapPadding,f+2*it.wrapPadding,it.width),height:0,startx:h,stopx:p,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,x),toBounds:Math.max.apply(null,x)}}),"buildMessageModel");var _t=(0,c.K2)((async function(t,e,a,r){const s={};const i=[];let n,l,d;for(const c of t){switch(c.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:i.push({id:c.id,msg:c.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:if(c.message){n=i.pop();s[n.id]=n;s[c.id]=n;i.push(n)}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:n=i.pop();s[n.id]=n;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(c.from?c.from:c.to.actor);const a=yt(c.from?c.from:c.to.actor).length;const r=t.x+t.width/2+(a-1)*it.activationWidth/2;const s={startx:r,stopx:r+it.activationWidth,actor:c.from,enabled:true};nt.activations.push(s)}break;case r.db.LINETYPE.ACTIVE_END:{const t=nt.activations.map((t=>t.actor)).lastIndexOf(c.from);nt.activations.splice(t,1).splice(0,1)}break}const t=c.placement!==void 0;if(t){l=await It(c,e,r);c.noteModel=l;i.forEach((t=>{n=t;n.from=o.Y2.getMin(n.from,l.startx);n.to=o.Y2.getMax(n.to,l.startx+l.width);n.width=o.Y2.getMax(n.width,Math.abs(n.from-n.to))-it.labelBoxWidth}))}else{d=Lt(c,e,r);c.msgModel=d;if(d.startx&&d.stopx&&i.length>0){i.forEach((t=>{n=t;if(d.startx===d.stopx){const t=e.get(c.from);const a=e.get(c.to);n.from=o.Y2.getMin(t.x-d.width/2,t.x-t.width/2,n.from);n.to=o.Y2.getMax(a.x+d.width/2,a.x+t.width/2,n.to);n.width=o.Y2.getMax(n.width,Math.abs(n.to-n.from))-it.labelBoxWidth}else{n.from=o.Y2.getMin(d.startx,n.from);n.to=o.Y2.getMax(d.stopx,n.to);n.width=o.Y2.getMax(n.width,d.width)-it.labelBoxWidth}}))}}}nt.activations=[];c.Rm.debug("Loop type widths:",s);return s}),"calculateLoopBounds");var Pt={bounds:nt,drawActors:ut,drawActorsPopup:xt,setConf:ft,draw:Et};var At={parser:p,get db(){return new y},renderer:Pt,styles:m,init:(0,c.K2)((t=>{if(!t.sequence){t.sequence={}}if(t.wrap){t.sequence.wrap=t.wrap;(0,o.XV)({sequence:{wrap:t.wrap}})}}),"init")}}}]);