local-operator-ui 0.22.7 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main/index.js +331 -50
- package/out/renderer/assets/{_basePickBy-DhQNxtlD.js → _basePickBy-_D80de5G.js} +1 -1
- package/out/renderer/assets/{_baseUniq-CX_YBd6Y.js → _baseUniq-2CVM3wP6.js} +1 -1
- package/out/renderer/assets/{agent-details-page-o4gHsKUa.js → agent-details-page-DDzWQkTU.js} +2 -2
- package/out/renderer/assets/{agent-hub-page-BzDj9IWf.js → agent-hub-page-BJZLQyGG.js} +2 -2
- package/out/renderer/assets/{agents-page-fMYF44vi.js → agents-page-DemONOpM.js} +2 -2
- package/out/renderer/assets/arc-5WLfklOA.js +1 -0
- package/out/renderer/assets/architectureDiagram-IEHRJDOE-2esPWMfK.js +36 -0
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-Djo9sUfE.js → blockDiagram-JOT3LUYC-CxEr3yHk.js} +2 -2
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-Uw8QTBf1.js → c4Diagram-VJAJSXHY-CW3c7Z5k.js} +2 -2
- package/out/renderer/assets/channel-BihnEq5U.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-BIOsyZUb.js → chunk-4BMEZGHF-D_Bp0wT-.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-DgGsJjzO.js → chunk-A2AXSNBT-DmJd08BZ.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-BIKbqRlZ.js → chunk-AEK57VVT-ujtyZ3tC.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-67ezHJSD.js → chunk-D6G4REZN-Dsw-P_RE.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-DcomjUhS.js → chunk-RZ5BOZE2-DehW_14d.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BUmWwWrV.js → chunk-XZIHB7SX-DMF0PowC.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-B-F2uCmh.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-B-F2uCmh.js +1 -0
- package/out/renderer/assets/clone-Cxm1r7GC.js +1 -0
- package/out/renderer/assets/{compact-pagination-DKIAGx25.js → compact-pagination-uDiiJTfu.js} +1 -1
- package/out/renderer/assets/dagre-OKDRZEBW-Cis1R8z2.js +4 -0
- package/out/renderer/assets/diagram-SSKATNLV-ccEDsRNu.js +43 -0
- package/out/renderer/assets/diagram-VNBRO52H-CvU-J7lk.js +24 -0
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-leIAVVl8.js → erDiagram-Q7BY3M3F-CzjCMPxk.js} +2 -2
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-BR2OLvUd.js → flowDiagram-4HSFHLVR-B54QUlmV.js} +2 -2
- package/out/renderer/assets/ganttDiagram-APWFNJXF-BGrZ0i8Q.js +257 -0
- package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-rcGPhQBW.js +65 -0
- package/out/renderer/assets/{graph-4LKx2VDu.js → graph-J0pSfXIT.js} +1 -1
- package/out/renderer/assets/icon-DC3rStnR.css +1 -0
- package/out/renderer/assets/{icon-fSzO-fSj.js → icon-mKHwnRNs.js} +33 -33
- package/out/renderer/assets/index-DdfOG3_H.js +1 -0
- package/out/renderer/assets/index-DqOACDLL.js +1424 -0
- package/out/renderer/assets/index-lFyj7RMx.js +7 -0
- package/out/renderer/assets/infoDiagram-PH2N3AL5-Bu4VJqUO.js +2 -0
- package/out/renderer/assets/{installer-CJwdaurY.js → installer-DcKqSMWJ.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-_X3MTxbJ.js → journeyDiagram-U35MCT3I-CqkMOWse.js} +2 -2
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-hUWYLG65.js → kanban-definition-NDS4AKOZ-6YsTdTHR.js} +2 -2
- package/out/renderer/assets/{layout-vfaUtLsA.js → layout-DxRkOtZA.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-iWsZC-8m.js → legacy-agents-page-B_TTtHbw.js} +5 -5
- package/out/renderer/assets/{mermaid.core-DNwsi5g_.js → mermaid.core-BGQGjyBM.js} +35 -35
- package/out/renderer/assets/mindmap-definition-ALO5MXBD-COAAKLot.js +95 -0
- package/out/renderer/assets/{page-header-qm7Wt7L1.js → page-header-DmGvvMe3.js} +1 -1
- package/out/renderer/assets/parseISO-CJIN700N.js +6 -0
- package/out/renderer/assets/pieDiagram-IB7DONF6-bDFajT15.js +30 -0
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-BOaducXa.js → quadrantDiagram-7GDLP6J5-BGbdCwMH.js} +2 -2
- package/out/renderer/assets/{radar-MK3ICKWK-BI7fIfLl.js → radar-MK3ICKWK-D61WJ-zJ.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-DL7NotAd.js → radient-auth-buttons-XAgZ5KHN.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-gVZyn5do.js → requirementDiagram-KVF5MWMF-DGNaT_h7.js} +2 -2
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-BDNzMQ43.js +10 -0
- package/out/renderer/assets/{schedules-page-DI3d_Jms.js → schedules-page-Cr0fc2A0.js} +11 -11
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-COMD731i.js → sequenceDiagram-X6HHIX6F-ByLl22wr.js} +2 -2
- package/out/renderer/assets/settings-page-DBLyEih6.js +91 -0
- package/out/renderer/assets/{square-pen-Cy0qQPr_.js → square-pen-717nTWtU.js} +1 -1
- package/out/renderer/assets/stateDiagram-DGXRK772-Cs28xqpn.js +1 -0
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CyaNxwAy.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-CCZIm-XN.js → timeline-definition-BDJGKUSR-Cc2py6Fo.js} +2 -2
- package/out/renderer/assets/use-agent-like-mutation-CIJBNaU9.js +1 -0
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-Cl5zMzgu.js → xychartDiagram-VJFVF3MP-Buajaj4y.js} +6 -6
- package/out/renderer/index.html +3 -3
- package/out/renderer/installer.html +3 -3
- package/package.json +2 -2
- package/out/renderer/assets/arc-C1_J1TYO.js +0 -1
- package/out/renderer/assets/architectureDiagram-IEHRJDOE-LYdT4n0-.js +0 -36
- package/out/renderer/assets/band-CquvqAHh.js +0 -1
- package/out/renderer/assets/channel-CcIHiTMf.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-Doib00-b.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-Doib00-b.js +0 -1
- package/out/renderer/assets/clone-B0pGWNff.js +0 -1
- package/out/renderer/assets/dagre-OKDRZEBW-D5JBej5q.js +0 -4
- package/out/renderer/assets/diagram-SSKATNLV-roVanCAj.js +0 -43
- package/out/renderer/assets/diagram-VNBRO52H-mWjYHL69.js +0 -24
- package/out/renderer/assets/ganttDiagram-APWFNJXF-BxJlkxvE.js +0 -257
- package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-CGUHtfkZ.js +0 -65
- package/out/renderer/assets/icon-DzTfuNUy.css +0 -1
- package/out/renderer/assets/index-B-nr8aEh.js +0 -7
- package/out/renderer/assets/index-BpIvhA0p.js +0 -1351
- package/out/renderer/assets/index-CD9V9hPM.js +0 -1
- package/out/renderer/assets/infoDiagram-PH2N3AL5-CeUS0GfM.js +0 -2
- package/out/renderer/assets/init-Dmth1JHB.js +0 -1
- package/out/renderer/assets/linear-BfLTrHPc.js +0 -1
- package/out/renderer/assets/mindmap-definition-ALO5MXBD-DMokx6cp.js +0 -95
- package/out/renderer/assets/ordinal-DILIJJjt.js +0 -1
- package/out/renderer/assets/parseISO-C2gtJ6YV.js +0 -6
- package/out/renderer/assets/pieDiagram-IB7DONF6-C6Cy5b3h.js +0 -30
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-BUG1W9hs.js +0 -10
- package/out/renderer/assets/settings-page-CvFjZpKU.js +0 -159
- package/out/renderer/assets/stateDiagram-DGXRK772-BOfqY0wc.js +0 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-Chyd_KPN.js +0 -1
- package/out/renderer/assets/step-DMJAOHzS.js +0 -1
- package/out/renderer/assets/time-BOTM2Tp0.js +0 -1
- package/out/renderer/assets/use-agent-like-mutation-BSnvivNQ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as fe,b as Vt,g as Pt,d as xe,c as Te,e as ye}from"./chunk-D6G4REZN-67ezHJSD.js";import{I as Ee}from"./chunk-XZIHB7SX-BUmWwWrV.js";import{_ as u,o as be,c as $,d as It,l as G,j as Jt,e as me,f as we,k as v,b as Ut,s as ve,q as Ie,a as Le,g as _e,t as Pe,z as Ae,i as Lt,u as Y,O as ot,P as Et,Q as Zt,Z as ke,R as Qt,G as Dt}from"./mermaid.core-DNwsi5g_.js";import"./index-BpIvhA0p.js";import"./icon-fSzO-fSj.js";import"./step-DMJAOHzS.js";var Ct=function(){var t=u(function(ht,w,L,P){for(L=L||{},P=ht.length;P--;L[ht[P]]=w);return L},"o"),e=[1,2],c=[1,3],s=[1,4],r=[2,4],i=[1,9],o=[1,11],h=[1,13],d=[1,14],a=[1,16],f=[1,17],E=[1,18],g=[1,24],T=[1,25],m=[1,26],I=[1,27],A=[1,28],O=[1,29],S=[1,30],B=[1,31],D=[1,32],F=[1,33],q=[1,34],X=[1,35],tt=[1,36],z=[1,37],H=[1,38],W=[1,39],M=[1,41],J=[1,42],K=[1,43],Z=[1,44],et=[1,45],N=[1,46],y=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],_=[4,5,16,50,52,53],Q=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],at=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],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,54,59,60,61,62,70],Ft=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],it=[68,69,70],ct=[1,122],kt={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:u(function(w,L,P,b,R,l,yt){var p=l.length-1;switch(R){case 3:return b.apply(l[p]),l[p];case 4:case 9:this.$=[];break;case 5:case 10:l[p-1].push(l[p]),this.$=l[p-1];break;case 6:case 7:case 11:case 12:this.$=l[p];break;case 8:case 13:this.$=[];break;case 15:l[p].type="createParticipant",this.$=l[p];break;case 16:l[p-1].unshift({type:"boxStart",boxData:b.parseBoxData(l[p-2])}),l[p-1].push({type:"boxEnd",boxText:l[p-2]}),this.$=l[p-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-2]),sequenceIndexStep:Number(l[p-1]),sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:b.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[p-1].actor};break;case 23:this.$={type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[p-1].actor};break;case 29:b.setDiagramTitle(l[p].substring(6)),this.$=l[p].substring(6);break;case 30:b.setDiagramTitle(l[p].substring(7)),this.$=l[p].substring(7);break;case 31:this.$=l[p].trim(),b.setAccTitle(this.$);break;case 32:case 33:this.$=l[p].trim(),b.setAccDescription(this.$);break;case 34:l[p-1].unshift({type:"loopStart",loopText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.LOOP_START}),l[p-1].push({type:"loopEnd",loopText:l[p-2],signalType:b.LINETYPE.LOOP_END}),this.$=l[p-1];break;case 35:l[p-1].unshift({type:"rectStart",color:b.parseMessage(l[p-2]),signalType:b.LINETYPE.RECT_START}),l[p-1].push({type:"rectEnd",color:b.parseMessage(l[p-2]),signalType:b.LINETYPE.RECT_END}),this.$=l[p-1];break;case 36:l[p-1].unshift({type:"optStart",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.OPT_START}),l[p-1].push({type:"optEnd",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.OPT_END}),this.$=l[p-1];break;case 37:l[p-1].unshift({type:"altStart",altText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.ALT_START}),l[p-1].push({type:"altEnd",signalType:b.LINETYPE.ALT_END}),this.$=l[p-1];break;case 38:l[p-1].unshift({type:"parStart",parText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.PAR_START}),l[p-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[p-1];break;case 39:l[p-1].unshift({type:"parStart",parText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.PAR_OVER_START}),l[p-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[p-1];break;case 40:l[p-1].unshift({type:"criticalStart",criticalText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.CRITICAL_START}),l[p-1].push({type:"criticalEnd",signalType:b.LINETYPE.CRITICAL_END}),this.$=l[p-1];break;case 41:l[p-1].unshift({type:"breakStart",breakText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.BREAK_START}),l[p-1].push({type:"breakEnd",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.BREAK_END}),this.$=l[p-1];break;case 43:this.$=l[p-3].concat([{type:"option",optionText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.CRITICAL_OPTION},l[p]]);break;case 45:this.$=l[p-3].concat([{type:"and",parText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.PAR_AND},l[p]]);break;case 47:this.$=l[p-3].concat([{type:"else",altText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.ALT_ELSE},l[p]]);break;case 48:l[p-3].draw="participant",l[p-3].type="addParticipant",l[p-3].description=b.parseMessage(l[p-1]),this.$=l[p-3];break;case 49:l[p-1].draw="participant",l[p-1].type="addParticipant",this.$=l[p-1];break;case 50:l[p-3].draw="actor",l[p-3].type="addParticipant",l[p-3].description=b.parseMessage(l[p-1]),this.$=l[p-3];break;case 51:l[p-1].draw="actor",l[p-1].type="addParticipant",this.$=l[p-1];break;case 52:l[p-1].type="destroyParticipant",this.$=l[p-1];break;case 53:this.$=[l[p-1],{type:"addNote",placement:l[p-2],actor:l[p-1].actor,text:l[p]}];break;case 54:l[p-2]=[].concat(l[p-1],l[p-1]).slice(0,2),l[p-2][0]=l[p-2][0].actor,l[p-2][1]=l[p-2][1].actor,this.$=[l[p-1],{type:"addNote",placement:b.PLACEMENT.OVER,actor:l[p-2].slice(0,2),text:l[p]}];break;case 55:this.$=[l[p-1],{type:"addLinks",actor:l[p-1].actor,text:l[p]}];break;case 56:this.$=[l[p-1],{type:"addALink",actor:l[p-1].actor,text:l[p]}];break;case 57:this.$=[l[p-1],{type:"addProperties",actor:l[p-1].actor,text:l[p]}];break;case 58:this.$=[l[p-1],{type:"addDetails",actor:l[p-1].actor,text:l[p]}];break;case 61:this.$=[l[p-2],l[p]];break;case 62:this.$=l[p];break;case 63:this.$=b.PLACEMENT.LEFTOF;break;case 64:this.$=b.PLACEMENT.RIGHTOF;break;case 65:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p],activate:!0},{type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[p-1].actor}];break;case 66:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p]},{type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[p-4].actor}];break;case 67:this.$=[l[p-3],l[p-1],{type:"addMessage",from:l[p-3].actor,to:l[p-1].actor,signalType:l[p-2],msg:l[p]}];break;case 68:this.$={type:"addParticipant",actor:l[p]};break;case 69:this.$=b.LINETYPE.SOLID_OPEN;break;case 70:this.$=b.LINETYPE.DOTTED_OPEN;break;case 71:this.$=b.LINETYPE.SOLID;break;case 72:this.$=b.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=b.LINETYPE.DOTTED;break;case 74:this.$=b.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=b.LINETYPE.SOLID_CROSS;break;case 76:this.$=b.LINETYPE.DOTTED_CROSS;break;case 77:this.$=b.LINETYPE.SOLID_POINT;break;case 78:this.$=b.LINETYPE.DOTTED_POINT;break;case 79:this.$=b.parseMessage(l[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:c,6:s},{1:[3]},{3:5,4:e,5:c,6:s},{3:6,4:e,5:c,6:s},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:o,8:8,9:10,12:12,13:h,14:d,17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},t(y,[2,5]),{9:47,12:12,13:h,14:d,17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},t(y,[2,7]),t(y,[2,8]),t(y,[2,14]),{12:48,50:z,52:H,53:W},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:N},{22:55,70:N},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(y,[2,29]),t(y,[2,30]),{32:[1,61]},{34:[1,62]},t(y,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:N},{22:72,70:N},{22:73,70:N},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:N},{22:90,70:N},{22:91,70:N},{22:92,70:N},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(y,[2,6]),t(y,[2,15]),t(_,[2,9],{10:93}),t(y,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(y,[2,21]),{5:[1,97]},{5:[1,98]},t(y,[2,24]),t(y,[2,25]),t(y,[2,26]),t(y,[2,27]),t(y,[2,28]),t(y,[2,31]),t(y,[2,32]),t(Q,r,{7:99}),t(Q,r,{7:100}),t(Q,r,{7:101}),t(at,r,{40:102,7:103}),t(k,r,{42:104,7:105}),t(k,r,{7:105,42:106}),t(Ft,r,{45:107,7:108}),t(Q,r,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:N},t(it,[2,69]),t(it,[2,70]),t(it,[2,71]),t(it,[2,72]),t(it,[2,73]),t(it,[2,74]),t(it,[2,75]),t(it,[2,76]),t(it,[2,77]),t(it,[2,78]),{22:118,70:N},{22:120,58:119,70:N},{70:[2,63]},{70:[2,64]},{56:121,81:ct},{56:123,81:ct},{56:124,81:ct},{56:125,81:ct},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:z,52:H,53:W},{5:[1,131]},t(y,[2,19]),t(y,[2,20]),t(y,[2,22]),t(y,[2,23]),{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,132],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,133],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,134],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,135]},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[2,46],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,49:[1,136],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,137]},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[2,44],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,48:[1,138],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,139]},{16:[1,140]},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[2,42],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,47:[1,141],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,142],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{15:[1,143]},t(y,[2,49]),{15:[1,144]},t(y,[2,51]),t(y,[2,52]),{22:145,70:N},{22:146,70:N},{56:147,81:ct},{56:148,81:ct},{56:149,81:ct},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(y,[2,16]),t(_,[2,10]),{12:151,50:z,52:H,53:W},t(_,[2,12]),t(_,[2,13]),t(y,[2,18]),t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),{15:[1,152]},t(y,[2,38]),{15:[1,153]},t(y,[2,39]),t(y,[2,40]),{15:[1,154]},t(y,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:ct},{56:158,81:ct},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:N},t(_,[2,11]),t(at,r,{7:103,40:160}),t(k,r,{7:105,42:161}),t(Ft,r,{7:108,45:162}),t(y,[2,48]),t(y,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:u(function(w,L){if(L.recoverable)this.trace(w);else{var P=new Error(w);throw P.hash=L,P}},"parseError"),parse:u(function(w){var L=this,P=[0],b=[],R=[null],l=[],yt=this.table,p="",mt=0,qt=0,de=2,zt=1,pe=l.slice.call(arguments,1),V=Object.create(this.lexer),dt={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(dt.yy[Nt]=this.yy[Nt]);V.setInput(w,dt.yy),dt.yy.lexer=V,dt.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var St=V.yylloc;l.push(St);var ue=V.options&&V.options.ranges;typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ge(j){P.length=P.length-2*j,R.length=R.length-j,l.length=l.length-j}u(ge,"popStack");function Ht(){var j;return j=b.pop()||V.lex()||zt,typeof j!="number"&&(j instanceof Array&&(b=j,j=b.pop()),j=L.symbols_[j]||j),j}u(Ht,"lex");for(var U,pt,st,Mt,ft={},wt,lt,Kt,vt;;){if(pt=P[P.length-1],this.defaultActions[pt]?st=this.defaultActions[pt]:((U===null||typeof U>"u")&&(U=Ht()),st=yt[pt]&&yt[pt][U]),typeof st>"u"||!st.length||!st[0]){var Rt="";vt=[];for(wt in yt[pt])this.terminals_[wt]&&wt>de&&vt.push("'"+this.terminals_[wt]+"'");V.showPosition?Rt="Parse error on line "+(mt+1)+`:
|
|
1
|
+
import{a as fe,b as Vt,g as Pt,d as xe,c as Te,e as ye}from"./chunk-D6G4REZN-Dsw-P_RE.js";import{I as Ee}from"./chunk-XZIHB7SX-DMF0PowC.js";import{_ as u,o as be,c as $,d as It,l as G,j as Jt,e as me,f as we,k as v,b as Ut,s as ve,q as Ie,a as Le,g as _e,t as Pe,z as Ae,i as Lt,u as Y,O as ot,P as Et,Q as Zt,Z as ke,R as Qt,G as Dt}from"./mermaid.core-BGQGjyBM.js";import"./index-DqOACDLL.js";import"./icon-mKHwnRNs.js";var Ct=function(){var t=u(function(ht,w,L,P){for(L=L||{},P=ht.length;P--;L[ht[P]]=w);return L},"o"),e=[1,2],c=[1,3],s=[1,4],r=[2,4],i=[1,9],o=[1,11],h=[1,13],d=[1,14],a=[1,16],f=[1,17],E=[1,18],g=[1,24],T=[1,25],m=[1,26],I=[1,27],A=[1,28],O=[1,29],S=[1,30],B=[1,31],D=[1,32],F=[1,33],q=[1,34],X=[1,35],tt=[1,36],z=[1,37],H=[1,38],W=[1,39],M=[1,41],J=[1,42],K=[1,43],Z=[1,44],et=[1,45],N=[1,46],y=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],_=[4,5,16,50,52,53],Q=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],at=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],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,54,59,60,61,62,70],Ft=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],it=[68,69,70],ct=[1,122],kt={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:u(function(w,L,P,b,R,l,yt){var p=l.length-1;switch(R){case 3:return b.apply(l[p]),l[p];case 4:case 9:this.$=[];break;case 5:case 10:l[p-1].push(l[p]),this.$=l[p-1];break;case 6:case 7:case 11:case 12:this.$=l[p];break;case 8:case 13:this.$=[];break;case 15:l[p].type="createParticipant",this.$=l[p];break;case 16:l[p-1].unshift({type:"boxStart",boxData:b.parseBoxData(l[p-2])}),l[p-1].push({type:"boxEnd",boxText:l[p-2]}),this.$=l[p-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-2]),sequenceIndexStep:Number(l[p-1]),sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:b.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[p-1].actor};break;case 23:this.$={type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[p-1].actor};break;case 29:b.setDiagramTitle(l[p].substring(6)),this.$=l[p].substring(6);break;case 30:b.setDiagramTitle(l[p].substring(7)),this.$=l[p].substring(7);break;case 31:this.$=l[p].trim(),b.setAccTitle(this.$);break;case 32:case 33:this.$=l[p].trim(),b.setAccDescription(this.$);break;case 34:l[p-1].unshift({type:"loopStart",loopText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.LOOP_START}),l[p-1].push({type:"loopEnd",loopText:l[p-2],signalType:b.LINETYPE.LOOP_END}),this.$=l[p-1];break;case 35:l[p-1].unshift({type:"rectStart",color:b.parseMessage(l[p-2]),signalType:b.LINETYPE.RECT_START}),l[p-1].push({type:"rectEnd",color:b.parseMessage(l[p-2]),signalType:b.LINETYPE.RECT_END}),this.$=l[p-1];break;case 36:l[p-1].unshift({type:"optStart",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.OPT_START}),l[p-1].push({type:"optEnd",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.OPT_END}),this.$=l[p-1];break;case 37:l[p-1].unshift({type:"altStart",altText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.ALT_START}),l[p-1].push({type:"altEnd",signalType:b.LINETYPE.ALT_END}),this.$=l[p-1];break;case 38:l[p-1].unshift({type:"parStart",parText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.PAR_START}),l[p-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[p-1];break;case 39:l[p-1].unshift({type:"parStart",parText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.PAR_OVER_START}),l[p-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[p-1];break;case 40:l[p-1].unshift({type:"criticalStart",criticalText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.CRITICAL_START}),l[p-1].push({type:"criticalEnd",signalType:b.LINETYPE.CRITICAL_END}),this.$=l[p-1];break;case 41:l[p-1].unshift({type:"breakStart",breakText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.BREAK_START}),l[p-1].push({type:"breakEnd",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.BREAK_END}),this.$=l[p-1];break;case 43:this.$=l[p-3].concat([{type:"option",optionText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.CRITICAL_OPTION},l[p]]);break;case 45:this.$=l[p-3].concat([{type:"and",parText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.PAR_AND},l[p]]);break;case 47:this.$=l[p-3].concat([{type:"else",altText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.ALT_ELSE},l[p]]);break;case 48:l[p-3].draw="participant",l[p-3].type="addParticipant",l[p-3].description=b.parseMessage(l[p-1]),this.$=l[p-3];break;case 49:l[p-1].draw="participant",l[p-1].type="addParticipant",this.$=l[p-1];break;case 50:l[p-3].draw="actor",l[p-3].type="addParticipant",l[p-3].description=b.parseMessage(l[p-1]),this.$=l[p-3];break;case 51:l[p-1].draw="actor",l[p-1].type="addParticipant",this.$=l[p-1];break;case 52:l[p-1].type="destroyParticipant",this.$=l[p-1];break;case 53:this.$=[l[p-1],{type:"addNote",placement:l[p-2],actor:l[p-1].actor,text:l[p]}];break;case 54:l[p-2]=[].concat(l[p-1],l[p-1]).slice(0,2),l[p-2][0]=l[p-2][0].actor,l[p-2][1]=l[p-2][1].actor,this.$=[l[p-1],{type:"addNote",placement:b.PLACEMENT.OVER,actor:l[p-2].slice(0,2),text:l[p]}];break;case 55:this.$=[l[p-1],{type:"addLinks",actor:l[p-1].actor,text:l[p]}];break;case 56:this.$=[l[p-1],{type:"addALink",actor:l[p-1].actor,text:l[p]}];break;case 57:this.$=[l[p-1],{type:"addProperties",actor:l[p-1].actor,text:l[p]}];break;case 58:this.$=[l[p-1],{type:"addDetails",actor:l[p-1].actor,text:l[p]}];break;case 61:this.$=[l[p-2],l[p]];break;case 62:this.$=l[p];break;case 63:this.$=b.PLACEMENT.LEFTOF;break;case 64:this.$=b.PLACEMENT.RIGHTOF;break;case 65:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p],activate:!0},{type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[p-1].actor}];break;case 66:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p]},{type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[p-4].actor}];break;case 67:this.$=[l[p-3],l[p-1],{type:"addMessage",from:l[p-3].actor,to:l[p-1].actor,signalType:l[p-2],msg:l[p]}];break;case 68:this.$={type:"addParticipant",actor:l[p]};break;case 69:this.$=b.LINETYPE.SOLID_OPEN;break;case 70:this.$=b.LINETYPE.DOTTED_OPEN;break;case 71:this.$=b.LINETYPE.SOLID;break;case 72:this.$=b.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=b.LINETYPE.DOTTED;break;case 74:this.$=b.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=b.LINETYPE.SOLID_CROSS;break;case 76:this.$=b.LINETYPE.DOTTED_CROSS;break;case 77:this.$=b.LINETYPE.SOLID_POINT;break;case 78:this.$=b.LINETYPE.DOTTED_POINT;break;case 79:this.$=b.parseMessage(l[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:c,6:s},{1:[3]},{3:5,4:e,5:c,6:s},{3:6,4:e,5:c,6:s},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:o,8:8,9:10,12:12,13:h,14:d,17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},t(y,[2,5]),{9:47,12:12,13:h,14:d,17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},t(y,[2,7]),t(y,[2,8]),t(y,[2,14]),{12:48,50:z,52:H,53:W},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:N},{22:55,70:N},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(y,[2,29]),t(y,[2,30]),{32:[1,61]},{34:[1,62]},t(y,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:N},{22:72,70:N},{22:73,70:N},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:N},{22:90,70:N},{22:91,70:N},{22:92,70:N},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(y,[2,6]),t(y,[2,15]),t(_,[2,9],{10:93}),t(y,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(y,[2,21]),{5:[1,97]},{5:[1,98]},t(y,[2,24]),t(y,[2,25]),t(y,[2,26]),t(y,[2,27]),t(y,[2,28]),t(y,[2,31]),t(y,[2,32]),t(Q,r,{7:99}),t(Q,r,{7:100}),t(Q,r,{7:101}),t(at,r,{40:102,7:103}),t(k,r,{42:104,7:105}),t(k,r,{7:105,42:106}),t(Ft,r,{45:107,7:108}),t(Q,r,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:N},t(it,[2,69]),t(it,[2,70]),t(it,[2,71]),t(it,[2,72]),t(it,[2,73]),t(it,[2,74]),t(it,[2,75]),t(it,[2,76]),t(it,[2,77]),t(it,[2,78]),{22:118,70:N},{22:120,58:119,70:N},{70:[2,63]},{70:[2,64]},{56:121,81:ct},{56:123,81:ct},{56:124,81:ct},{56:125,81:ct},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:z,52:H,53:W},{5:[1,131]},t(y,[2,19]),t(y,[2,20]),t(y,[2,22]),t(y,[2,23]),{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,132],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,133],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,134],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,135]},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[2,46],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,49:[1,136],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,137]},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[2,44],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,48:[1,138],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,139]},{16:[1,140]},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[2,42],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,47:[1,141],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:o,8:8,9:10,12:12,13:h,14:d,16:[1,142],17:15,18:a,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:I,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{15:[1,143]},t(y,[2,49]),{15:[1,144]},t(y,[2,51]),t(y,[2,52]),{22:145,70:N},{22:146,70:N},{56:147,81:ct},{56:148,81:ct},{56:149,81:ct},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(y,[2,16]),t(_,[2,10]),{12:151,50:z,52:H,53:W},t(_,[2,12]),t(_,[2,13]),t(y,[2,18]),t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),{15:[1,152]},t(y,[2,38]),{15:[1,153]},t(y,[2,39]),t(y,[2,40]),{15:[1,154]},t(y,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:ct},{56:158,81:ct},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:N},t(_,[2,11]),t(at,r,{7:103,40:160}),t(k,r,{7:105,42:161}),t(Ft,r,{7:108,45:162}),t(y,[2,48]),t(y,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:u(function(w,L){if(L.recoverable)this.trace(w);else{var P=new Error(w);throw P.hash=L,P}},"parseError"),parse:u(function(w){var L=this,P=[0],b=[],R=[null],l=[],yt=this.table,p="",mt=0,qt=0,de=2,zt=1,pe=l.slice.call(arguments,1),V=Object.create(this.lexer),dt={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(dt.yy[Nt]=this.yy[Nt]);V.setInput(w,dt.yy),dt.yy.lexer=V,dt.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var St=V.yylloc;l.push(St);var ue=V.options&&V.options.ranges;typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ge(j){P.length=P.length-2*j,R.length=R.length-j,l.length=l.length-j}u(ge,"popStack");function Ht(){var j;return j=b.pop()||V.lex()||zt,typeof j!="number"&&(j instanceof Array&&(b=j,j=b.pop()),j=L.symbols_[j]||j),j}u(Ht,"lex");for(var U,pt,st,Mt,ft={},wt,lt,Kt,vt;;){if(pt=P[P.length-1],this.defaultActions[pt]?st=this.defaultActions[pt]:((U===null||typeof U>"u")&&(U=Ht()),st=yt[pt]&&yt[pt][U]),typeof st>"u"||!st.length||!st[0]){var Rt="";vt=[];for(wt in yt[pt])this.terminals_[wt]&&wt>de&&vt.push("'"+this.terminals_[wt]+"'");V.showPosition?Rt="Parse error on line "+(mt+1)+`:
|
|
2
2
|
`+V.showPosition()+`
|
|
3
3
|
Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'":Rt="Parse error on line "+(mt+1)+": Unexpected "+(U==zt?"end of input":"'"+(this.terminals_[U]||U)+"'"),this.parseError(Rt,{text:V.match,token:this.terminals_[U]||U,line:V.yylineno,loc:St,expected:vt})}if(st[0]instanceof Array&&st.length>1)throw new Error("Parse Error: multiple actions possible at state: "+pt+", token: "+U);switch(st[0]){case 1:P.push(U),R.push(V.yytext),l.push(V.yylloc),P.push(st[1]),U=null,qt=V.yyleng,p=V.yytext,mt=V.yylineno,St=V.yylloc;break;case 2:if(lt=this.productions_[st[1]][1],ft.$=R[R.length-lt],ft._$={first_line:l[l.length-(lt||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(lt||1)].first_column,last_column:l[l.length-1].last_column},ue&&(ft._$.range=[l[l.length-(lt||1)].range[0],l[l.length-1].range[1]]),Mt=this.performAction.apply(ft,[p,qt,mt,dt.yy,st[1],R,l].concat(pe)),typeof Mt<"u")return Mt;lt&&(P=P.slice(0,-1*lt*2),R=R.slice(0,-1*lt),l=l.slice(0,-1*lt)),P.push(this.productions_[st[1]][0]),R.push(ft.$),l.push(ft._$),Kt=yt[P[P.length-2]][P[P.length-1]],P.push(Kt);break;case 3:return!0}}return!0},"parse")},he=function(){var ht={EOF:1,parseError:u(function(L,P){if(this.yy.parser)this.yy.parser.parseError(L,P);else throw new Error(L)},"parseError"),setInput:u(function(w,L){return this.yy=L||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var L=w.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:u(function(w){var L=w.length,P=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===b.length?this.yylloc.first_column:0)+b[b.length-P.length].length-P[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(w){this.unput(this.match.slice(w))},"less"),pastInput:u(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var w=this.pastInput(),L=new Array(w.length+1).join("-");return w+this.upcomingInput()+`
|
|
@@ -119,4 +119,4 @@ Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'":Rt="Parse error
|
|
|
119
119
|
fill: ${t.actorBkg};
|
|
120
120
|
stroke-width: 2px;
|
|
121
121
|
}
|
|
122
|
-
`,"getStyles"),Oe=Ce,ut=18*2,jt="actor-top",$t="actor-bottom",Be="actor-box",Gt="actor-man",Yt=u(function(t,e){return xe(t,e)},"drawRect"),Ve=u(function(t,e,c,s,r){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const i=e.links,o=e.actorCnt,h=e.rectData;var d="none";r&&(d="block !important");const a=t.append("g");a.attr("id","actor"+o+"_popup"),a.attr("class","actorPopupMenu"),a.attr("display",d);var f="";h.class!==void 0&&(f=" "+h.class);let E=h.width>c?h.width:c;const g=a.append("rect");if(g.attr("class","actorPopupMenuPanel"+f),g.attr("x",h.x),g.attr("y",h.height),g.attr("fill",h.fill),g.attr("stroke",h.stroke),g.attr("width",E),g.attr("height",h.height),g.attr("rx",h.rx),g.attr("ry",h.ry),i!=null){var T=20;for(let A in i){var m=a.append("a"),I=Jt.sanitizeUrl(i[A]);m.attr("xlink:href",I),m.attr("target","_blank"),es(s)(A,m,h.x+10,h.height+T,E,20,{class:"actor"},s),T+=30}}return g.attr("height",T),{height:h.height+T,width:E}},"drawPopup"),Ye=u(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),_t=u(async function(t,e,c=null){let s=t.append("foreignObject");const r=await Qt(e.text,Dt()),o=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();if(s.attr("height",Math.round(o.height)).attr("width",Math.round(o.width)),e.class==="noteText"){const h=t.node().firstChild;h.setAttribute("height",o.height+2*e.textMargin);const d=h.getBBox();s.attr("x",Math.round(d.x+d.width/2-o.width/2)).attr("y",Math.round(d.y+d.height/2-o.height/2))}else if(c){let{startx:h,stopx:d,starty:a}=c;if(h>d){const f=h;h=d,d=f}s.attr("x",Math.round(h+Math.abs(h-d)/2-o.width/2)),e.class==="loopText"?s.attr("y",Math.round(a)):s.attr("y",Math.round(a-o.height))}return[s]},"drawKatex"),Tt=u(function(t,e){let c=0,s=0;const r=e.text.split(v.lineBreakRegex),[i,o]=Zt(e.fontSize);let h=[],d=0,a=u(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":a=u(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":a=u(()=>Math.round(e.y+(c+s+e.textMargin)/2),"yfunc");break;case"bottom":case"end":a=u(()=>Math.round(e.y+(c+s+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[f,E]of r.entries()){e.textMargin!==void 0&&e.textMargin===0&&i!==void 0&&(d=f*i);const g=t.append("text");g.attr("x",e.x),g.attr("y",a()),e.anchor!==void 0&&g.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&g.style("font-family",e.fontFamily),o!==void 0&&g.style("font-size",o),e.fontWeight!==void 0&&g.style("font-weight",e.fontWeight),e.fill!==void 0&&g.attr("fill",e.fill),e.class!==void 0&&g.attr("class",e.class),e.dy!==void 0?g.attr("dy",e.dy):d!==0&&g.attr("dy",d);const T=E||ke;if(e.tspan){const m=g.append("tspan");m.attr("x",e.x),e.fill!==void 0&&m.attr("fill",e.fill),m.text(T)}else g.text(T);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(s+=(g._groups||g)[0][0].getBBox().height,c=s),h.push(g)}return h},"drawText"),te=u(function(t,e){function c(r,i,o,h,d){return r+","+i+" "+(r+o)+","+i+" "+(r+o)+","+(i+h-d)+" "+(r+o-d*1.2)+","+(i+h)+" "+r+","+(i+h)}u(c,"genPoints");const s=t.append("polygon");return s.attr("points",c(e.x,e.y,e.width,e.height,7)),s.attr("class","labelBox"),e.y=e.y+e.height/2,Tt(t,e),s},"drawLabel"),nt=-1,ee=u((t,e,c,s)=>{t.select&&c.forEach(r=>{const i=e.get(r),o=t.select("#actor"+i.actorCnt);!s.mirrorActors&&i.stopy?o.attr("y2",i.stopy+i.height/2):s.mirrorActors&&o.attr("y2",i.stopy)})},"fixLifeLineHeights"),We=u(function(t,e,c,s){const r=s?e.stopy:e.starty,i=e.x+e.width/2,o=r+e.height,h=t.append("g").lower();var d=h;s||(nt++,Object.keys(e.links||{}).length&&!c.forceMenus&&d.attr("onclick",Ye(`actor${nt}_popup`)).attr("cursor","pointer"),d.append("line").attr("id","actor"+nt).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),d=h.append("g"),e.actorCnt=nt,e.links!=null&&d.attr("id","root-"+nt));const a=Pt();var f="actor";e.properties?.class?f=e.properties.class:a.fill="#eaeaea",s?f+=` ${$t}`:f+=` ${jt}`,a.x=e.x,a.y=r,a.width=e.width,a.height=e.height,a.class=f,a.rx=3,a.ry=3,a.name=e.name;const E=Yt(d,a);if(e.rectData=a,e.properties?.icon){const T=e.properties.icon.trim();T.charAt(0)==="@"?Te(d,a.x+a.width-20,a.y+10,T.substr(1)):ye(d,a.x+a.width-20,a.y+10,T)}Wt(c,ot(e.description))(e.description,d,a.x,a.y,a.width,a.height,{class:`actor ${Be}`},c);let g=e.height;if(E.node){const T=E.node().getBBox();e.height=T.height,g=T.height}return g},"drawActorTypeParticipant"),Fe=u(function(t,e,c,s){const r=s?e.stopy:e.starty,i=e.x+e.width/2,o=r+80,h=t.append("g").lower();s||(nt++,h.append("line").attr("id","actor"+nt).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=nt);const d=t.append("g");let a=Gt;s?a+=` ${$t}`:a+=` ${jt}`,d.attr("class",a),d.attr("name",e.name);const f=Pt();f.x=e.x,f.y=r,f.fill="#eaeaea",f.width=e.width,f.height=e.height,f.class="actor",f.rx=3,f.ry=3,d.append("line").attr("id","actor-man-torso"+nt).attr("x1",i).attr("y1",r+25).attr("x2",i).attr("y2",r+45),d.append("line").attr("id","actor-man-arms"+nt).attr("x1",i-ut/2).attr("y1",r+33).attr("x2",i+ut/2).attr("y2",r+33),d.append("line").attr("x1",i-ut/2).attr("y1",r+60).attr("x2",i).attr("y2",r+45),d.append("line").attr("x1",i).attr("y1",r+45).attr("x2",i+ut/2-2).attr("y2",r+60);const E=d.append("circle");E.attr("cx",e.x+e.width/2),E.attr("cy",r+10),E.attr("r",15),E.attr("width",e.width),E.attr("height",e.height);const g=d.node().getBBox();return e.height=g.height,Wt(c,ot(e.description))(e.description,d,f.x,f.y+35,f.width,f.height,{class:`actor ${Gt}`},c),e.height},"drawActorTypeActor"),qe=u(async function(t,e,c,s){switch(e.type){case"actor":return await Fe(t,e,c,s);case"participant":return await We(t,e,c,s)}},"drawActor"),ze=u(function(t,e,c){const r=t.append("g");se(r,e),e.name&&Wt(c)(e.name,r,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},c),r.lower()},"drawBox"),He=u(function(t){return t.append("g")},"anchorElement"),Ke=u(function(t,e,c,s,r){const i=Pt(),o=e.anchored;i.x=e.startx,i.y=e.starty,i.class="activation"+r%3,i.width=e.stopx-e.startx,i.height=c-e.starty,Yt(o,i)},"drawActivation"),Ue=u(async function(t,e,c,s){const{boxMargin:r,boxTextMargin:i,labelBoxHeight:o,labelBoxWidth:h,messageFontFamily:d,messageFontSize:a,messageFontWeight:f}=s,E=t.append("g"),g=u(function(I,A,O,S){return E.append("line").attr("x1",I).attr("y1",A).attr("x2",O).attr("y2",S).attr("class","loopLine")},"drawLoopLine");g(e.startx,e.starty,e.stopx,e.starty),g(e.stopx,e.starty,e.stopx,e.stopy),g(e.startx,e.stopy,e.stopx,e.stopy),g(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(I){g(e.startx,I.y,e.stopx,I.y).style("stroke-dasharray","3, 3")});let T=Vt();T.text=c,T.x=e.startx,T.y=e.starty,T.fontFamily=d,T.fontSize=a,T.fontWeight=f,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=h||50,T.height=o||20,T.textMargin=i,T.class="labelText",te(E,T),T=ae(),T.text=e.title,T.x=e.startx+h/2+(e.stopx-e.startx)/2,T.y=e.starty+r+i,T.anchor="middle",T.valign="middle",T.textMargin=i,T.class="loopText",T.fontFamily=d,T.fontSize=a,T.fontWeight=f,T.wrap=!0;let m=ot(T.text)?await _t(E,T,e):Tt(E,T);if(e.sectionTitles!==void 0){for(const[I,A]of Object.entries(e.sectionTitles))if(A.message){T.text=A.message,T.x=e.startx+(e.stopx-e.startx)/2,T.y=e.sections[I].y+r+i,T.class="loopText",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=d,T.fontSize=a,T.fontWeight=f,T.wrap=e.wrap,ot(T.text)?(e.starty=e.sections[I].y,await _t(E,T,e)):Tt(E,T);let O=Math.round(m.map(S=>(S._groups||S)[0][0].getBBox().height).reduce((S,B)=>S+B));e.sections[I].height+=O-(r+i)}}return e.height=Math.round(e.stopy-e.starty),E},"drawLoop"),se=u(function(t,e){fe(t,e)},"drawBackgroundRect"),Ge=u(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"),Xe=u(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"),Je=u(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"),Ze=u(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"),Qe=u(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"),je=u(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"),$e=u(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),ae=u(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),ts=u(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Wt=function(){function t(i,o,h,d,a,f,E){const g=o.append("text").attr("x",h+a/2).attr("y",d+f/2+5).style("text-anchor","middle").text(i);r(g,E)}u(t,"byText");function e(i,o,h,d,a,f,E,g){const{actorFontSize:T,actorFontFamily:m,actorFontWeight:I}=g,[A,O]=Zt(T),S=i.split(v.lineBreakRegex);for(let B=0;B<S.length;B++){const D=B*A-A*(S.length-1)/2,F=o.append("text").attr("x",h+a/2).attr("y",d).style("text-anchor","middle").style("font-size",O).style("font-weight",I).style("font-family",m);F.append("tspan").attr("x",h+a/2).attr("dy",D).text(S[B]),F.attr("y",d+f/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(F,E)}}u(e,"byTspan");function c(i,o,h,d,a,f,E,g){const T=o.append("switch"),I=T.append("foreignObject").attr("x",h).attr("y",d).attr("width",a).attr("height",f).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");I.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,T,h,d,a,f,E,g),r(I,E)}u(c,"byFo");async function s(i,o,h,d,a,f,E,g){const T=await Et(i,Dt()),m=o.append("switch"),A=m.append("foreignObject").attr("x",h+a/2-T.width/2).attr("y",d+f/2-T.height/2).attr("width",T.width).attr("height",T.height).append("xhtml:div").style("height","100%").style("width","100%");A.append("div").style("text-align","center").style("vertical-align","middle").html(await Qt(i,Dt())),e(i,m,h,d,a,f,E,g),r(A,E)}u(s,"byKatex");function r(i,o){for(const h in o)o.hasOwnProperty(h)&&i.attr(h,o[h])}return u(r,"_setTextAttrs"),function(i,o=!1){return o?s:i.textPlacement==="fo"?c:i.textPlacement==="old"?t:e}}(),es=function(){function t(r,i,o,h,d,a,f){const E=i.append("text").attr("x",o).attr("y",h).style("text-anchor","start").text(r);s(E,f)}u(t,"byText");function e(r,i,o,h,d,a,f,E){const{actorFontSize:g,actorFontFamily:T,actorFontWeight:m}=E,I=r.split(v.lineBreakRegex);for(let A=0;A<I.length;A++){const O=A*g-g*(I.length-1)/2,S=i.append("text").attr("x",o).attr("y",h).style("text-anchor","start").style("font-size",g).style("font-weight",m).style("font-family",T);S.append("tspan").attr("x",o).attr("dy",O).text(I[A]),S.attr("y",h+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(S,f)}}u(e,"byTspan");function c(r,i,o,h,d,a,f,E){const g=i.append("switch"),m=g.append("foreignObject").attr("x",o).attr("y",h).attr("width",d).attr("height",a).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),e(r,g,o,h,d,a,f,E),s(m,f)}u(c,"byFo");function s(r,i){for(const o in i)i.hasOwnProperty(o)&&r.attr(o,i[o])}return u(s,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?c:r.textPlacement==="old"?t:e}}(),C={drawRect:Yt,drawText:Tt,drawLabel:te,drawActor:qe,drawBox:ze,drawPopup:Ve,anchorElement:He,drawActivation:Ke,drawLoop:Ue,drawBackgroundRect:se,insertArrowHead:Ze,insertArrowFilledHead:Qe,insertSequenceNumber:je,insertArrowCrossHead:$e,insertDatabaseIcon:Ge,insertComputerIcon:Xe,insertClockIcon:Je,getTextObj:ae,getNoteRect:ts,fixLifeLineHeights:ee,sanitizeUrl:Jt.sanitizeUrl},n={},x={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:u(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(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:u(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:u(function(t){this.boxes.push(t)},"addBox"),addActor:u(function(t){this.actors.push(t)},"addActor"),addLoop:u(function(t){this.loops.push(t)},"addLoop"),addMessage:u(function(t){this.messages.push(t)},"addMessage"),addNote:u(function(t){this.notes.push(t)},"addNote"),lastActor:u(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:u(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:u(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:u(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:u(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,ne($())},"init"),updateVal:u(function(t,e,c,s){t[e]===void 0?t[e]=c:t[e]=s(c,t[e])},"updateVal"),updateBounds:u(function(t,e,c,s){const r=this;let i=0;function o(h){return u(function(a){i++;const f=r.sequenceItems.length-i+1;r.updateVal(a,"starty",e-f*n.boxMargin,Math.min),r.updateVal(a,"stopy",s+f*n.boxMargin,Math.max),r.updateVal(x.data,"startx",t-f*n.boxMargin,Math.min),r.updateVal(x.data,"stopx",c+f*n.boxMargin,Math.max),h!=="activation"&&(r.updateVal(a,"startx",t-f*n.boxMargin,Math.min),r.updateVal(a,"stopx",c+f*n.boxMargin,Math.max),r.updateVal(x.data,"starty",e-f*n.boxMargin,Math.min),r.updateVal(x.data,"stopy",s+f*n.boxMargin,Math.max))},"updateItemBounds")}u(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:u(function(t,e,c,s){const r=v.getMin(t,c),i=v.getMax(t,c),o=v.getMin(e,s),h=v.getMax(e,s);this.updateVal(x.data,"startx",r,Math.min),this.updateVal(x.data,"starty",o,Math.min),this.updateVal(x.data,"stopx",i,Math.max),this.updateVal(x.data,"stopy",h,Math.max),this.updateBounds(r,o,i,h)},"insert"),newActivation:u(function(t,e,c){const s=c.get(t.from),r=At(t.from).length||0,i=s.x+s.width/2+(r-1)*n.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+n.activationWidth,stopy:void 0,actor:t.from,anchored:C.anchorElement(e)})},"newActivation"),endActivation:u(function(t){const e=this.activations.map(function(c){return c.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:u(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:u(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:u(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:u(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:u(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:x.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:u(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:u(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:u(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=v.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:u(function(){return this.verticalPos},"getVerticalPos"),getBounds:u(function(){return{bounds:this.data,models:this.models}},"getBounds")},ss=u(async function(t,e){x.bumpVerticalPos(n.boxMargin),e.height=n.boxMargin,e.starty=x.getVerticalPos();const c=Pt();c.x=e.startx,c.y=e.starty,c.width=e.width||n.width,c.class="note";const s=t.append("g"),r=C.drawRect(s,c),i=Vt();i.x=e.startx,i.y=e.starty,i.width=c.width,i.dy="1em",i.text=e.message,i.class="noteText",i.fontFamily=n.noteFontFamily,i.fontSize=n.noteFontSize,i.fontWeight=n.noteFontWeight,i.anchor=n.noteAlign,i.textMargin=n.noteMargin,i.valign="center";const o=ot(i.text)?await _t(s,i):Tt(s,i),h=Math.round(o.map(d=>(d._groups||d)[0][0].getBBox().height).reduce((d,a)=>d+a));r.attr("height",h+2*n.noteMargin),e.height+=h+2*n.noteMargin,x.bumpVerticalPos(h+2*n.noteMargin),e.stopy=e.starty+h+2*n.noteMargin,e.stopx=e.startx+c.width,x.insert(e.startx,e.starty,e.stopx,e.stopy),x.models.addNote(e)},"drawNote"),gt=u(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),xt=u(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Ot=u(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function re(t,e){x.bumpVerticalPos(10);const{startx:c,stopx:s,message:r}=e,i=v.splitBreaks(r).length,o=ot(r),h=o?await Et(r,$()):Y.calculateTextDimensions(r,gt(n));if(!o){const E=h.height/i;e.height+=E,x.bumpVerticalPos(E)}let d,a=h.height-10;const f=h.width;if(c===s){d=x.getVerticalPos()+a,n.rightAngles||(a+=n.boxMargin,d=x.getVerticalPos()+a),a+=30;const E=v.getMax(f/2,n.width/2);x.insert(c-E,x.getVerticalPos()-10+a,s+E,x.getVerticalPos()+30+a)}else a+=n.boxMargin,d=x.getVerticalPos()+a,x.insert(c,d-10,s,d);return x.bumpVerticalPos(a),e.height+=a,e.stopy=e.starty+e.height,x.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),d}u(re,"boundMessage");var as=u(async function(t,e,c,s){const{startx:r,stopx:i,starty:o,message:h,type:d,sequenceIndex:a,sequenceVisible:f}=e,E=Y.calculateTextDimensions(h,gt(n)),g=Vt();g.x=r,g.y=o+10,g.width=i-r,g.class="messageText",g.dy="1em",g.text=h,g.fontFamily=n.messageFontFamily,g.fontSize=n.messageFontSize,g.fontWeight=n.messageFontWeight,g.anchor=n.messageAlign,g.valign="center",g.textMargin=n.wrapPadding,g.tspan=!1,ot(g.text)?await _t(t,g,{startx:r,stopx:i,starty:c}):Tt(t,g);const T=E.width;let m;r===i?n.rightAngles?m=t.append("path").attr("d",`M ${r},${c} H ${r+v.getMax(n.width/2,T/2)} V ${c+25} H ${r}`):m=t.append("path").attr("d","M "+r+","+c+" C "+(r+60)+","+(c-10)+" "+(r+60)+","+(c+30)+" "+r+","+(c+20)):(m=t.append("line"),m.attr("x1",r),m.attr("y1",c),m.attr("x2",i),m.attr("y2",c)),d===s.db.LINETYPE.DOTTED||d===s.db.LINETYPE.DOTTED_CROSS||d===s.db.LINETYPE.DOTTED_POINT||d===s.db.LINETYPE.DOTTED_OPEN||d===s.db.LINETYPE.BIDIRECTIONAL_DOTTED?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let I="";n.arrowMarkerAbsolute&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\("),I=I.replace(/\)/g,"\\)")),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(d===s.db.LINETYPE.SOLID||d===s.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+I+"#arrowhead)"),(d===s.db.LINETYPE.BIDIRECTIONAL_SOLID||d===s.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(m.attr("marker-start","url("+I+"#arrowhead)"),m.attr("marker-end","url("+I+"#arrowhead)")),(d===s.db.LINETYPE.SOLID_POINT||d===s.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+I+"#filled-head)"),(d===s.db.LINETYPE.SOLID_CROSS||d===s.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+I+"#crosshead)"),(f||n.showSequenceNumbers)&&(m.attr("marker-start","url("+I+"#sequencenumber)"),t.append("text").attr("x",r).attr("y",c+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(a))},"drawMessage"),rs=u(function(t,e,c,s,r,i,o){let h=0,d=0,a,f=0;for(const E of s){const g=e.get(E),T=g.box;a&&a!=T&&(o||x.models.addBox(a),d+=n.boxMargin+a.margin),T&&T!=a&&(o||(T.x=h+d,T.y=r),d+=T.margin),g.width=g.width||n.width,g.height=v.getMax(g.height||n.height,n.height),g.margin=g.margin||n.actorMargin,f=v.getMax(f,g.height),c.get(g.name)&&(d+=g.width/2),g.x=h+d,g.starty=x.getVerticalPos(),x.insert(g.x,r,g.x+g.width,g.height),h+=g.width+d,g.box&&(g.box.width=h+T.margin-g.box.x),d=g.margin,a=g.box,x.models.addActor(g)}a&&!o&&x.models.addBox(a),x.bumpVerticalPos(f)},"addActorRenderingData"),Bt=u(async function(t,e,c,s){if(s){let r=0;x.bumpVerticalPos(n.boxMargin*2);for(const i of c){const o=e.get(i);o.stopy||(o.stopy=x.getVerticalPos());const h=await C.drawActor(t,o,n,!0);r=v.getMax(r,h)}x.bumpVerticalPos(r+n.boxMargin)}else for(const r of c){const i=e.get(r);await C.drawActor(t,i,n,!1)}},"drawActors"),ie=u(function(t,e,c,s){let r=0,i=0;for(const o of c){const h=e.get(o),d=ns(h),a=C.drawPopup(t,h,d,n,n.forceMenus,s);a.height>r&&(r=a.height),a.width+h.x>i&&(i=a.width+h.x)}return{maxHeight:r,maxWidth:i}},"drawActorsPopup"),ne=u(function(t){we(n,t),t.fontFamily&&(n.actorFontFamily=n.noteFontFamily=n.messageFontFamily=t.fontFamily),t.fontSize&&(n.actorFontSize=n.noteFontSize=n.messageFontSize=t.fontSize),t.fontWeight&&(n.actorFontWeight=n.noteFontWeight=n.messageFontWeight=t.fontWeight)},"setConf"),At=u(function(t){return x.activations.filter(function(e){return e.actor===t})},"actorActivations"),Xt=u(function(t,e){const c=e.get(t),s=At(t),r=s.reduce(function(o,h){return v.getMin(o,h.startx)},c.x+c.width/2-1),i=s.reduce(function(o,h){return v.getMax(o,h.stopx)},c.x+c.width/2+1);return[r,i]},"activationBounds");function rt(t,e,c,s,r){x.bumpVerticalPos(c);let i=s;if(e.id&&e.message&&t[e.id]){const o=t[e.id].width,h=gt(n);e.message=Y.wrapLabel(`[${e.message}]`,o-2*n.wrapPadding,h),e.width=o,e.wrap=!0;const d=Y.calculateTextDimensions(e.message,h),a=v.getMax(d.height,n.labelBoxHeight);i=s+a,G.debug(`${a} - ${e.message}`)}r(e),x.bumpVerticalPos(i)}u(rt,"adjustLoopHeightForWrap");function oe(t,e,c,s,r,i,o){function h(a,f){a.x<r.get(t.from).x?(x.insert(e.stopx-f,e.starty,e.startx,e.stopy+a.height/2+n.noteMargin),e.stopx=e.stopx+f):(x.insert(e.startx,e.starty,e.stopx+f,e.stopy+a.height/2+n.noteMargin),e.stopx=e.stopx-f)}u(h,"receiverAdjustment");function d(a,f){a.x<r.get(t.to).x?(x.insert(e.startx-f,e.starty,e.stopx,e.stopy+a.height/2+n.noteMargin),e.startx=e.startx+f):(x.insert(e.stopx,e.starty,e.startx+f,e.stopy+a.height/2+n.noteMargin),e.startx=e.startx-f)}if(u(d,"senderAdjustment"),i.get(t.to)==s){const a=r.get(t.to),f=a.type=="actor"?ut/2+3:a.width/2+3;h(a,f),a.starty=c-a.height/2,x.bumpVerticalPos(a.height/2)}else if(o.get(t.from)==s){const a=r.get(t.from);if(n.mirrorActors){const f=a.type=="actor"?ut/2:a.width/2;d(a,f)}a.stopy=c-a.height/2,x.bumpVerticalPos(a.height/2)}else if(o.get(t.to)==s){const a=r.get(t.to);if(n.mirrorActors){const f=a.type=="actor"?ut/2+3:a.width/2+3;h(a,f)}a.stopy=c-a.height/2,x.bumpVerticalPos(a.height/2)}}u(oe,"adjustCreatedDestroyedData");var is=u(async function(t,e,c,s){const{securityLevel:r,sequence:i}=$();n=i;let o;r==="sandbox"&&(o=It("#i"+e));const h=r==="sandbox"?It(o.nodes()[0].contentDocument.body):It("body"),d=r==="sandbox"?o.nodes()[0].contentDocument:document;x.init(),G.debug(s.db);const a=r==="sandbox"?h.select(`[id="${e}"]`):It(`[id="${e}"]`),f=s.db.getActors(),E=s.db.getCreatedActors(),g=s.db.getDestroyedActors(),T=s.db.getBoxes();let m=s.db.getActorKeys();const I=s.db.getMessages(),A=s.db.getDiagramTitle(),O=s.db.hasAtLeastOneBox(),S=s.db.hasAtLeastOneBoxWithTitle(),B=await ce(f,I,s);if(n.height=await le(f,B,T),C.insertComputerIcon(a),C.insertDatabaseIcon(a),C.insertClockIcon(a),O&&(x.bumpVerticalPos(n.boxMargin),S&&x.bumpVerticalPos(T[0].textMaxHeight)),n.hideUnusedParticipants===!0){const y=new Set;I.forEach(_=>{y.add(_.from),y.add(_.to)}),m=m.filter(_=>y.has(_))}rs(a,f,E,m,0,I,!1);const D=await ls(I,f,B,s);C.insertArrowHead(a),C.insertArrowCrossHead(a),C.insertArrowFilledHead(a),C.insertSequenceNumber(a);function F(y,_){const Q=x.endActivation(y);Q.starty+18>_&&(Q.starty=_-6,_+=12),C.drawActivation(a,Q,_,n,At(y.from).length),x.insert(Q.startx,_-10,Q.stopx,_)}u(F,"activeEnd");let q=1,X=1;const tt=[],z=[];let H=0;for(const y of I){let _,Q,at;switch(y.type){case s.db.LINETYPE.NOTE:x.resetVerticalPos(),Q=y.noteModel,await ss(a,Q);break;case s.db.LINETYPE.ACTIVE_START:x.newActivation(y,a,f);break;case s.db.LINETYPE.ACTIVE_END:F(y,x.getVerticalPos());break;case s.db.LINETYPE.LOOP_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.LOOP_END:_=x.endLoop(),await C.drawLoop(a,_,"loop",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.RECT_START:rt(D,y,n.boxMargin,n.boxMargin,k=>x.newLoop(void 0,k.message));break;case s.db.LINETYPE.RECT_END:_=x.endLoop(),z.push(_),x.models.addLoop(_),x.bumpVerticalPos(_.stopy-x.getVerticalPos());break;case s.db.LINETYPE.OPT_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.OPT_END:_=x.endLoop(),await C.drawLoop(a,_,"opt",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.ALT_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.ALT_ELSE:rt(D,y,n.boxMargin+n.boxTextMargin,n.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.ALT_END:_=x.endLoop(),await C.drawLoop(a,_,"alt",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k)),x.saveVerticalPos();break;case s.db.LINETYPE.PAR_AND:rt(D,y,n.boxMargin+n.boxTextMargin,n.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.PAR_END:_=x.endLoop(),await C.drawLoop(a,_,"par",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.AUTONUMBER:q=y.message.start||q,X=y.message.step||X,y.message.visible?s.db.enableSequenceNumbers():s.db.disableSequenceNumbers();break;case s.db.LINETYPE.CRITICAL_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.CRITICAL_OPTION:rt(D,y,n.boxMargin+n.boxTextMargin,n.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.CRITICAL_END:_=x.endLoop(),await C.drawLoop(a,_,"critical",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.BREAK_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.BREAK_END:_=x.endLoop(),await C.drawLoop(a,_,"break",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;default:try{at=y.msgModel,at.starty=x.getVerticalPos(),at.sequenceIndex=q,at.sequenceVisible=s.db.showSequenceNumbers();const k=await re(a,at);oe(y,at,k,H,f,E,g),tt.push({messageModel:at,lineStartY:k}),x.models.addMessage(at)}catch(k){G.error("error while drawing message",k)}}[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(y.type)&&(q=q+X),H++}G.debug("createdActors",E),G.debug("destroyedActors",g),await Bt(a,f,m,!1);for(const y of tt)await as(a,y.messageModel,y.lineStartY,s);n.mirrorActors&&await Bt(a,f,m,!0),z.forEach(y=>C.drawBackgroundRect(a,y)),ee(a,f,m,n);for(const y of x.models.boxes)y.height=x.getVerticalPos()-y.y,x.insert(y.x,y.y,y.x+y.width,y.height),y.startx=y.x,y.starty=y.y,y.stopx=y.startx+y.width,y.stopy=y.starty+y.height,y.stroke="rgb(0,0,0, 0.5)",C.drawBox(a,y,n);O&&x.bumpVerticalPos(n.boxMargin);const W=ie(a,f,m,d),{bounds:M}=x.getBounds();M.startx===void 0&&(M.startx=0),M.starty===void 0&&(M.starty=0),M.stopx===void 0&&(M.stopx=0),M.stopy===void 0&&(M.stopy=0);let J=M.stopy-M.starty;J<W.maxHeight&&(J=W.maxHeight);let K=J+2*n.diagramMarginY;n.mirrorActors&&(K=K-n.boxMargin+n.bottomMarginAdj);let Z=M.stopx-M.startx;Z<W.maxWidth&&(Z=W.maxWidth);const et=Z+2*n.diagramMarginX;A&&a.append("text").text(A).attr("x",(M.stopx-M.startx)/2-2*n.diagramMarginX).attr("y",-25),me(a,K,et,n.useMaxWidth);const N=A?40:0;a.attr("viewBox",M.startx-n.diagramMarginX+" -"+(n.diagramMarginY+N)+" "+et+" "+(K+N)),G.debug("models:",x.models)},"draw");async function ce(t,e,c){const s={};for(const r of e)if(t.get(r.to)&&t.get(r.from)){const i=t.get(r.to);if(r.placement===c.db.PLACEMENT.LEFTOF&&!i.prevActor||r.placement===c.db.PLACEMENT.RIGHTOF&&!i.nextActor)continue;const o=r.placement!==void 0,h=!o,d=o?xt(n):gt(n),a=r.wrap?Y.wrapLabel(r.message,n.width-2*n.wrapPadding,d):r.message,E=(ot(a)?await Et(r.message,$()):Y.calculateTextDimensions(a,d)).width+2*n.wrapPadding;h&&r.from===i.nextActor?s[r.to]=v.getMax(s[r.to]||0,E):h&&r.from===i.prevActor?s[r.from]=v.getMax(s[r.from]||0,E):h&&r.from===r.to?(s[r.from]=v.getMax(s[r.from]||0,E/2),s[r.to]=v.getMax(s[r.to]||0,E/2)):r.placement===c.db.PLACEMENT.RIGHTOF?s[r.from]=v.getMax(s[r.from]||0,E):r.placement===c.db.PLACEMENT.LEFTOF?s[i.prevActor]=v.getMax(s[i.prevActor]||0,E):r.placement===c.db.PLACEMENT.OVER&&(i.prevActor&&(s[i.prevActor]=v.getMax(s[i.prevActor]||0,E/2)),i.nextActor&&(s[r.from]=v.getMax(s[r.from]||0,E/2)))}return G.debug("maxMessageWidthPerActor:",s),s}u(ce,"getMaxMessageWidthPerActor");var ns=u(function(t){let e=0;const c=Ot(n);for(const s in t.links){const i=Y.calculateTextDimensions(s,c).width+2*n.wrapPadding+2*n.boxMargin;e<i&&(e=i)}return e},"getRequiredPopupWidth");async function le(t,e,c){let s=0;for(const i of t.keys()){const o=t.get(i);o.wrap&&(o.description=Y.wrapLabel(o.description,n.width-2*n.wrapPadding,Ot(n)));const h=ot(o.description)?await Et(o.description,$()):Y.calculateTextDimensions(o.description,Ot(n));o.width=o.wrap?n.width:v.getMax(n.width,h.width+2*n.wrapPadding),o.height=o.wrap?v.getMax(h.height,n.height):n.height,s=v.getMax(s,o.height)}for(const i in e){const o=t.get(i);if(!o)continue;const h=t.get(o.nextActor);if(!h){const E=e[i]+n.actorMargin-o.width/2;o.margin=v.getMax(E,n.actorMargin);continue}const a=e[i]+n.actorMargin-o.width/2-h.width/2;o.margin=v.getMax(a,n.actorMargin)}let r=0;return c.forEach(i=>{const o=gt(n);let h=i.actorKeys.reduce((f,E)=>f+=t.get(E).width+(t.get(E).margin||0),0);h-=2*n.boxTextMargin,i.wrap&&(i.name=Y.wrapLabel(i.name,h-2*n.wrapPadding,o));const d=Y.calculateTextDimensions(i.name,o);r=v.getMax(d.height,r);const a=v.getMax(h,d.width+2*n.wrapPadding);if(i.margin=n.boxTextMargin,h<a){const f=(a-h)/2;i.margin+=f}}),c.forEach(i=>i.textMaxHeight=r),v.getMax(s,n.height)}u(le,"calculateActorMargins");var os=u(async function(t,e,c){const s=e.get(t.from),r=e.get(t.to),i=s.x,o=r.x,h=t.wrap&&t.message;let d=ot(t.message)?await Et(t.message,$()):Y.calculateTextDimensions(h?Y.wrapLabel(t.message,n.width,xt(n)):t.message,xt(n));const a={width:h?n.width:v.getMax(n.width,d.width+2*n.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===c.db.PLACEMENT.RIGHTOF?(a.width=h?v.getMax(n.width,d.width):v.getMax(s.width/2+r.width/2,d.width+2*n.noteMargin),a.startx=i+(s.width+n.actorMargin)/2):t.placement===c.db.PLACEMENT.LEFTOF?(a.width=h?v.getMax(n.width,d.width+2*n.noteMargin):v.getMax(s.width/2+r.width/2,d.width+2*n.noteMargin),a.startx=i-a.width+(s.width-n.actorMargin)/2):t.to===t.from?(d=Y.calculateTextDimensions(h?Y.wrapLabel(t.message,v.getMax(n.width,s.width),xt(n)):t.message,xt(n)),a.width=h?v.getMax(n.width,s.width):v.getMax(s.width,n.width,d.width+2*n.noteMargin),a.startx=i+(s.width-a.width)/2):(a.width=Math.abs(i+s.width/2-(o+r.width/2))+n.actorMargin,a.startx=i<o?i+s.width/2-n.actorMargin/2:o+r.width/2-n.actorMargin/2),h&&(a.message=Y.wrapLabel(t.message,a.width-2*n.wrapPadding,xt(n))),G.debug(`NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${t.message}]`),a},"buildNoteModel"),cs=u(function(t,e,c){if(![c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN,c.db.LINETYPE.SOLID,c.db.LINETYPE.DOTTED,c.db.LINETYPE.SOLID_CROSS,c.db.LINETYPE.DOTTED_CROSS,c.db.LINETYPE.SOLID_POINT,c.db.LINETYPE.DOTTED_POINT,c.db.LINETYPE.BIDIRECTIONAL_SOLID,c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[s,r]=Xt(t.from,e),[i,o]=Xt(t.to,e),h=s<=i;let d=h?r:s,a=h?i:o;const f=Math.abs(i-o)>2,E=u(I=>h?-I:I,"adjustValue");t.from===t.to?a=d:(t.activate&&!f&&(a+=E(n.activationWidth/2-1)),[c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(a+=E(3)),[c.db.LINETYPE.BIDIRECTIONAL_SOLID,c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(d-=E(3)));const g=[s,r,i,o],T=Math.abs(d-a);t.wrap&&t.message&&(t.message=Y.wrapLabel(t.message,v.getMax(T+2*n.wrapPadding,n.width),gt(n)));const m=Y.calculateTextDimensions(t.message,gt(n));return{width:v.getMax(t.wrap?0:m.width+2*n.wrapPadding,T+2*n.wrapPadding,n.width),height:0,startx:d,stopx:a,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},"buildMessageModel"),ls=u(async function(t,e,c,s){const r={},i=[];let o,h,d;for(const a of t){switch(a.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:i.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:a.message&&(o=i.pop(),r[o.id]=o,r[a.id]=o,i.push(o));break;case s.db.LINETYPE.LOOP_END:case s.db.LINETYPE.ALT_END:case s.db.LINETYPE.OPT_END:case s.db.LINETYPE.PAR_END:case s.db.LINETYPE.CRITICAL_END:case s.db.LINETYPE.BREAK_END:o=i.pop(),r[o.id]=o;break;case s.db.LINETYPE.ACTIVE_START:{const E=e.get(a.from?a.from:a.to.actor),g=At(a.from?a.from:a.to.actor).length,T=E.x+E.width/2+(g-1)*n.activationWidth/2,m={startx:T,stopx:T+n.activationWidth,actor:a.from,enabled:!0};x.activations.push(m)}break;case s.db.LINETYPE.ACTIVE_END:{const E=x.activations.map(g=>g.actor).lastIndexOf(a.from);x.activations.splice(E,1).splice(0,1)}break}a.placement!==void 0?(h=await os(a,e,s),a.noteModel=h,i.forEach(E=>{o=E,o.from=v.getMin(o.from,h.startx),o.to=v.getMax(o.to,h.startx+h.width),o.width=v.getMax(o.width,Math.abs(o.from-o.to))-n.labelBoxWidth})):(d=cs(a,e,s),a.msgModel=d,d.startx&&d.stopx&&i.length>0&&i.forEach(E=>{if(o=E,d.startx===d.stopx){const g=e.get(a.from),T=e.get(a.to);o.from=v.getMin(g.x-d.width/2,g.x-g.width/2,o.from),o.to=v.getMax(T.x+d.width/2,T.x+g.width/2,o.to),o.width=v.getMax(o.width,Math.abs(o.to-o.from))-n.labelBoxWidth}else o.from=v.getMin(d.startx,o.from),o.to=v.getMax(d.stopx,o.to),o.width=v.getMax(o.width,d.width)-n.labelBoxWidth}))}return x.activations=[],G.debug("Loop type widths:",r),r},"calculateLoopBounds"),hs={bounds:x,drawActors:Bt,drawActorsPopup:ie,setConf:ne,draw:is},Ts={parser:Ne,get db(){return new De},renderer:hs,styles:Oe,init:u(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,be({sequence:{wrap:t.wrap}}))},"init")};export{Ts as diagram};
|
|
122
|
+
`,"getStyles"),Oe=Ce,ut=18*2,jt="actor-top",$t="actor-bottom",Be="actor-box",Gt="actor-man",Yt=u(function(t,e){return xe(t,e)},"drawRect"),Ve=u(function(t,e,c,s,r){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const i=e.links,o=e.actorCnt,h=e.rectData;var d="none";r&&(d="block !important");const a=t.append("g");a.attr("id","actor"+o+"_popup"),a.attr("class","actorPopupMenu"),a.attr("display",d);var f="";h.class!==void 0&&(f=" "+h.class);let E=h.width>c?h.width:c;const g=a.append("rect");if(g.attr("class","actorPopupMenuPanel"+f),g.attr("x",h.x),g.attr("y",h.height),g.attr("fill",h.fill),g.attr("stroke",h.stroke),g.attr("width",E),g.attr("height",h.height),g.attr("rx",h.rx),g.attr("ry",h.ry),i!=null){var T=20;for(let A in i){var m=a.append("a"),I=Jt.sanitizeUrl(i[A]);m.attr("xlink:href",I),m.attr("target","_blank"),es(s)(A,m,h.x+10,h.height+T,E,20,{class:"actor"},s),T+=30}}return g.attr("height",T),{height:h.height+T,width:E}},"drawPopup"),Ye=u(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),_t=u(async function(t,e,c=null){let s=t.append("foreignObject");const r=await Qt(e.text,Dt()),o=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();if(s.attr("height",Math.round(o.height)).attr("width",Math.round(o.width)),e.class==="noteText"){const h=t.node().firstChild;h.setAttribute("height",o.height+2*e.textMargin);const d=h.getBBox();s.attr("x",Math.round(d.x+d.width/2-o.width/2)).attr("y",Math.round(d.y+d.height/2-o.height/2))}else if(c){let{startx:h,stopx:d,starty:a}=c;if(h>d){const f=h;h=d,d=f}s.attr("x",Math.round(h+Math.abs(h-d)/2-o.width/2)),e.class==="loopText"?s.attr("y",Math.round(a)):s.attr("y",Math.round(a-o.height))}return[s]},"drawKatex"),Tt=u(function(t,e){let c=0,s=0;const r=e.text.split(v.lineBreakRegex),[i,o]=Zt(e.fontSize);let h=[],d=0,a=u(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":a=u(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":a=u(()=>Math.round(e.y+(c+s+e.textMargin)/2),"yfunc");break;case"bottom":case"end":a=u(()=>Math.round(e.y+(c+s+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[f,E]of r.entries()){e.textMargin!==void 0&&e.textMargin===0&&i!==void 0&&(d=f*i);const g=t.append("text");g.attr("x",e.x),g.attr("y",a()),e.anchor!==void 0&&g.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&g.style("font-family",e.fontFamily),o!==void 0&&g.style("font-size",o),e.fontWeight!==void 0&&g.style("font-weight",e.fontWeight),e.fill!==void 0&&g.attr("fill",e.fill),e.class!==void 0&&g.attr("class",e.class),e.dy!==void 0?g.attr("dy",e.dy):d!==0&&g.attr("dy",d);const T=E||ke;if(e.tspan){const m=g.append("tspan");m.attr("x",e.x),e.fill!==void 0&&m.attr("fill",e.fill),m.text(T)}else g.text(T);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(s+=(g._groups||g)[0][0].getBBox().height,c=s),h.push(g)}return h},"drawText"),te=u(function(t,e){function c(r,i,o,h,d){return r+","+i+" "+(r+o)+","+i+" "+(r+o)+","+(i+h-d)+" "+(r+o-d*1.2)+","+(i+h)+" "+r+","+(i+h)}u(c,"genPoints");const s=t.append("polygon");return s.attr("points",c(e.x,e.y,e.width,e.height,7)),s.attr("class","labelBox"),e.y=e.y+e.height/2,Tt(t,e),s},"drawLabel"),nt=-1,ee=u((t,e,c,s)=>{t.select&&c.forEach(r=>{const i=e.get(r),o=t.select("#actor"+i.actorCnt);!s.mirrorActors&&i.stopy?o.attr("y2",i.stopy+i.height/2):s.mirrorActors&&o.attr("y2",i.stopy)})},"fixLifeLineHeights"),We=u(function(t,e,c,s){const r=s?e.stopy:e.starty,i=e.x+e.width/2,o=r+e.height,h=t.append("g").lower();var d=h;s||(nt++,Object.keys(e.links||{}).length&&!c.forceMenus&&d.attr("onclick",Ye(`actor${nt}_popup`)).attr("cursor","pointer"),d.append("line").attr("id","actor"+nt).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),d=h.append("g"),e.actorCnt=nt,e.links!=null&&d.attr("id","root-"+nt));const a=Pt();var f="actor";e.properties?.class?f=e.properties.class:a.fill="#eaeaea",s?f+=` ${$t}`:f+=` ${jt}`,a.x=e.x,a.y=r,a.width=e.width,a.height=e.height,a.class=f,a.rx=3,a.ry=3,a.name=e.name;const E=Yt(d,a);if(e.rectData=a,e.properties?.icon){const T=e.properties.icon.trim();T.charAt(0)==="@"?Te(d,a.x+a.width-20,a.y+10,T.substr(1)):ye(d,a.x+a.width-20,a.y+10,T)}Wt(c,ot(e.description))(e.description,d,a.x,a.y,a.width,a.height,{class:`actor ${Be}`},c);let g=e.height;if(E.node){const T=E.node().getBBox();e.height=T.height,g=T.height}return g},"drawActorTypeParticipant"),Fe=u(function(t,e,c,s){const r=s?e.stopy:e.starty,i=e.x+e.width/2,o=r+80,h=t.append("g").lower();s||(nt++,h.append("line").attr("id","actor"+nt).attr("x1",i).attr("y1",o).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=nt);const d=t.append("g");let a=Gt;s?a+=` ${$t}`:a+=` ${jt}`,d.attr("class",a),d.attr("name",e.name);const f=Pt();f.x=e.x,f.y=r,f.fill="#eaeaea",f.width=e.width,f.height=e.height,f.class="actor",f.rx=3,f.ry=3,d.append("line").attr("id","actor-man-torso"+nt).attr("x1",i).attr("y1",r+25).attr("x2",i).attr("y2",r+45),d.append("line").attr("id","actor-man-arms"+nt).attr("x1",i-ut/2).attr("y1",r+33).attr("x2",i+ut/2).attr("y2",r+33),d.append("line").attr("x1",i-ut/2).attr("y1",r+60).attr("x2",i).attr("y2",r+45),d.append("line").attr("x1",i).attr("y1",r+45).attr("x2",i+ut/2-2).attr("y2",r+60);const E=d.append("circle");E.attr("cx",e.x+e.width/2),E.attr("cy",r+10),E.attr("r",15),E.attr("width",e.width),E.attr("height",e.height);const g=d.node().getBBox();return e.height=g.height,Wt(c,ot(e.description))(e.description,d,f.x,f.y+35,f.width,f.height,{class:`actor ${Gt}`},c),e.height},"drawActorTypeActor"),qe=u(async function(t,e,c,s){switch(e.type){case"actor":return await Fe(t,e,c,s);case"participant":return await We(t,e,c,s)}},"drawActor"),ze=u(function(t,e,c){const r=t.append("g");se(r,e),e.name&&Wt(c)(e.name,r,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},c),r.lower()},"drawBox"),He=u(function(t){return t.append("g")},"anchorElement"),Ke=u(function(t,e,c,s,r){const i=Pt(),o=e.anchored;i.x=e.startx,i.y=e.starty,i.class="activation"+r%3,i.width=e.stopx-e.startx,i.height=c-e.starty,Yt(o,i)},"drawActivation"),Ue=u(async function(t,e,c,s){const{boxMargin:r,boxTextMargin:i,labelBoxHeight:o,labelBoxWidth:h,messageFontFamily:d,messageFontSize:a,messageFontWeight:f}=s,E=t.append("g"),g=u(function(I,A,O,S){return E.append("line").attr("x1",I).attr("y1",A).attr("x2",O).attr("y2",S).attr("class","loopLine")},"drawLoopLine");g(e.startx,e.starty,e.stopx,e.starty),g(e.stopx,e.starty,e.stopx,e.stopy),g(e.startx,e.stopy,e.stopx,e.stopy),g(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(I){g(e.startx,I.y,e.stopx,I.y).style("stroke-dasharray","3, 3")});let T=Vt();T.text=c,T.x=e.startx,T.y=e.starty,T.fontFamily=d,T.fontSize=a,T.fontWeight=f,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=h||50,T.height=o||20,T.textMargin=i,T.class="labelText",te(E,T),T=ae(),T.text=e.title,T.x=e.startx+h/2+(e.stopx-e.startx)/2,T.y=e.starty+r+i,T.anchor="middle",T.valign="middle",T.textMargin=i,T.class="loopText",T.fontFamily=d,T.fontSize=a,T.fontWeight=f,T.wrap=!0;let m=ot(T.text)?await _t(E,T,e):Tt(E,T);if(e.sectionTitles!==void 0){for(const[I,A]of Object.entries(e.sectionTitles))if(A.message){T.text=A.message,T.x=e.startx+(e.stopx-e.startx)/2,T.y=e.sections[I].y+r+i,T.class="loopText",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=d,T.fontSize=a,T.fontWeight=f,T.wrap=e.wrap,ot(T.text)?(e.starty=e.sections[I].y,await _t(E,T,e)):Tt(E,T);let O=Math.round(m.map(S=>(S._groups||S)[0][0].getBBox().height).reduce((S,B)=>S+B));e.sections[I].height+=O-(r+i)}}return e.height=Math.round(e.stopy-e.starty),E},"drawLoop"),se=u(function(t,e){fe(t,e)},"drawBackgroundRect"),Ge=u(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"),Xe=u(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"),Je=u(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"),Ze=u(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"),Qe=u(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"),je=u(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"),$e=u(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),ae=u(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),ts=u(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Wt=function(){function t(i,o,h,d,a,f,E){const g=o.append("text").attr("x",h+a/2).attr("y",d+f/2+5).style("text-anchor","middle").text(i);r(g,E)}u(t,"byText");function e(i,o,h,d,a,f,E,g){const{actorFontSize:T,actorFontFamily:m,actorFontWeight:I}=g,[A,O]=Zt(T),S=i.split(v.lineBreakRegex);for(let B=0;B<S.length;B++){const D=B*A-A*(S.length-1)/2,F=o.append("text").attr("x",h+a/2).attr("y",d).style("text-anchor","middle").style("font-size",O).style("font-weight",I).style("font-family",m);F.append("tspan").attr("x",h+a/2).attr("dy",D).text(S[B]),F.attr("y",d+f/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(F,E)}}u(e,"byTspan");function c(i,o,h,d,a,f,E,g){const T=o.append("switch"),I=T.append("foreignObject").attr("x",h).attr("y",d).attr("width",a).attr("height",f).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");I.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,T,h,d,a,f,E,g),r(I,E)}u(c,"byFo");async function s(i,o,h,d,a,f,E,g){const T=await Et(i,Dt()),m=o.append("switch"),A=m.append("foreignObject").attr("x",h+a/2-T.width/2).attr("y",d+f/2-T.height/2).attr("width",T.width).attr("height",T.height).append("xhtml:div").style("height","100%").style("width","100%");A.append("div").style("text-align","center").style("vertical-align","middle").html(await Qt(i,Dt())),e(i,m,h,d,a,f,E,g),r(A,E)}u(s,"byKatex");function r(i,o){for(const h in o)o.hasOwnProperty(h)&&i.attr(h,o[h])}return u(r,"_setTextAttrs"),function(i,o=!1){return o?s:i.textPlacement==="fo"?c:i.textPlacement==="old"?t:e}}(),es=function(){function t(r,i,o,h,d,a,f){const E=i.append("text").attr("x",o).attr("y",h).style("text-anchor","start").text(r);s(E,f)}u(t,"byText");function e(r,i,o,h,d,a,f,E){const{actorFontSize:g,actorFontFamily:T,actorFontWeight:m}=E,I=r.split(v.lineBreakRegex);for(let A=0;A<I.length;A++){const O=A*g-g*(I.length-1)/2,S=i.append("text").attr("x",o).attr("y",h).style("text-anchor","start").style("font-size",g).style("font-weight",m).style("font-family",T);S.append("tspan").attr("x",o).attr("dy",O).text(I[A]),S.attr("y",h+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(S,f)}}u(e,"byTspan");function c(r,i,o,h,d,a,f,E){const g=i.append("switch"),m=g.append("foreignObject").attr("x",o).attr("y",h).attr("width",d).attr("height",a).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),e(r,g,o,h,d,a,f,E),s(m,f)}u(c,"byFo");function s(r,i){for(const o in i)i.hasOwnProperty(o)&&r.attr(o,i[o])}return u(s,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?c:r.textPlacement==="old"?t:e}}(),C={drawRect:Yt,drawText:Tt,drawLabel:te,drawActor:qe,drawBox:ze,drawPopup:Ve,anchorElement:He,drawActivation:Ke,drawLoop:Ue,drawBackgroundRect:se,insertArrowHead:Ze,insertArrowFilledHead:Qe,insertSequenceNumber:je,insertArrowCrossHead:$e,insertDatabaseIcon:Ge,insertComputerIcon:Xe,insertClockIcon:Je,getTextObj:ae,getNoteRect:ts,fixLifeLineHeights:ee,sanitizeUrl:Jt.sanitizeUrl},n={},x={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:u(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(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:u(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:u(function(t){this.boxes.push(t)},"addBox"),addActor:u(function(t){this.actors.push(t)},"addActor"),addLoop:u(function(t){this.loops.push(t)},"addLoop"),addMessage:u(function(t){this.messages.push(t)},"addMessage"),addNote:u(function(t){this.notes.push(t)},"addNote"),lastActor:u(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:u(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:u(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:u(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:u(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,ne($())},"init"),updateVal:u(function(t,e,c,s){t[e]===void 0?t[e]=c:t[e]=s(c,t[e])},"updateVal"),updateBounds:u(function(t,e,c,s){const r=this;let i=0;function o(h){return u(function(a){i++;const f=r.sequenceItems.length-i+1;r.updateVal(a,"starty",e-f*n.boxMargin,Math.min),r.updateVal(a,"stopy",s+f*n.boxMargin,Math.max),r.updateVal(x.data,"startx",t-f*n.boxMargin,Math.min),r.updateVal(x.data,"stopx",c+f*n.boxMargin,Math.max),h!=="activation"&&(r.updateVal(a,"startx",t-f*n.boxMargin,Math.min),r.updateVal(a,"stopx",c+f*n.boxMargin,Math.max),r.updateVal(x.data,"starty",e-f*n.boxMargin,Math.min),r.updateVal(x.data,"stopy",s+f*n.boxMargin,Math.max))},"updateItemBounds")}u(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:u(function(t,e,c,s){const r=v.getMin(t,c),i=v.getMax(t,c),o=v.getMin(e,s),h=v.getMax(e,s);this.updateVal(x.data,"startx",r,Math.min),this.updateVal(x.data,"starty",o,Math.min),this.updateVal(x.data,"stopx",i,Math.max),this.updateVal(x.data,"stopy",h,Math.max),this.updateBounds(r,o,i,h)},"insert"),newActivation:u(function(t,e,c){const s=c.get(t.from),r=At(t.from).length||0,i=s.x+s.width/2+(r-1)*n.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+n.activationWidth,stopy:void 0,actor:t.from,anchored:C.anchorElement(e)})},"newActivation"),endActivation:u(function(t){const e=this.activations.map(function(c){return c.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:u(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:u(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:u(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:u(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:u(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:x.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:u(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:u(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:u(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=v.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:u(function(){return this.verticalPos},"getVerticalPos"),getBounds:u(function(){return{bounds:this.data,models:this.models}},"getBounds")},ss=u(async function(t,e){x.bumpVerticalPos(n.boxMargin),e.height=n.boxMargin,e.starty=x.getVerticalPos();const c=Pt();c.x=e.startx,c.y=e.starty,c.width=e.width||n.width,c.class="note";const s=t.append("g"),r=C.drawRect(s,c),i=Vt();i.x=e.startx,i.y=e.starty,i.width=c.width,i.dy="1em",i.text=e.message,i.class="noteText",i.fontFamily=n.noteFontFamily,i.fontSize=n.noteFontSize,i.fontWeight=n.noteFontWeight,i.anchor=n.noteAlign,i.textMargin=n.noteMargin,i.valign="center";const o=ot(i.text)?await _t(s,i):Tt(s,i),h=Math.round(o.map(d=>(d._groups||d)[0][0].getBBox().height).reduce((d,a)=>d+a));r.attr("height",h+2*n.noteMargin),e.height+=h+2*n.noteMargin,x.bumpVerticalPos(h+2*n.noteMargin),e.stopy=e.starty+h+2*n.noteMargin,e.stopx=e.startx+c.width,x.insert(e.startx,e.starty,e.stopx,e.stopy),x.models.addNote(e)},"drawNote"),gt=u(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),xt=u(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Ot=u(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function re(t,e){x.bumpVerticalPos(10);const{startx:c,stopx:s,message:r}=e,i=v.splitBreaks(r).length,o=ot(r),h=o?await Et(r,$()):Y.calculateTextDimensions(r,gt(n));if(!o){const E=h.height/i;e.height+=E,x.bumpVerticalPos(E)}let d,a=h.height-10;const f=h.width;if(c===s){d=x.getVerticalPos()+a,n.rightAngles||(a+=n.boxMargin,d=x.getVerticalPos()+a),a+=30;const E=v.getMax(f/2,n.width/2);x.insert(c-E,x.getVerticalPos()-10+a,s+E,x.getVerticalPos()+30+a)}else a+=n.boxMargin,d=x.getVerticalPos()+a,x.insert(c,d-10,s,d);return x.bumpVerticalPos(a),e.height+=a,e.stopy=e.starty+e.height,x.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),d}u(re,"boundMessage");var as=u(async function(t,e,c,s){const{startx:r,stopx:i,starty:o,message:h,type:d,sequenceIndex:a,sequenceVisible:f}=e,E=Y.calculateTextDimensions(h,gt(n)),g=Vt();g.x=r,g.y=o+10,g.width=i-r,g.class="messageText",g.dy="1em",g.text=h,g.fontFamily=n.messageFontFamily,g.fontSize=n.messageFontSize,g.fontWeight=n.messageFontWeight,g.anchor=n.messageAlign,g.valign="center",g.textMargin=n.wrapPadding,g.tspan=!1,ot(g.text)?await _t(t,g,{startx:r,stopx:i,starty:c}):Tt(t,g);const T=E.width;let m;r===i?n.rightAngles?m=t.append("path").attr("d",`M ${r},${c} H ${r+v.getMax(n.width/2,T/2)} V ${c+25} H ${r}`):m=t.append("path").attr("d","M "+r+","+c+" C "+(r+60)+","+(c-10)+" "+(r+60)+","+(c+30)+" "+r+","+(c+20)):(m=t.append("line"),m.attr("x1",r),m.attr("y1",c),m.attr("x2",i),m.attr("y2",c)),d===s.db.LINETYPE.DOTTED||d===s.db.LINETYPE.DOTTED_CROSS||d===s.db.LINETYPE.DOTTED_POINT||d===s.db.LINETYPE.DOTTED_OPEN||d===s.db.LINETYPE.BIDIRECTIONAL_DOTTED?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let I="";n.arrowMarkerAbsolute&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\("),I=I.replace(/\)/g,"\\)")),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(d===s.db.LINETYPE.SOLID||d===s.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+I+"#arrowhead)"),(d===s.db.LINETYPE.BIDIRECTIONAL_SOLID||d===s.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(m.attr("marker-start","url("+I+"#arrowhead)"),m.attr("marker-end","url("+I+"#arrowhead)")),(d===s.db.LINETYPE.SOLID_POINT||d===s.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+I+"#filled-head)"),(d===s.db.LINETYPE.SOLID_CROSS||d===s.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+I+"#crosshead)"),(f||n.showSequenceNumbers)&&(m.attr("marker-start","url("+I+"#sequencenumber)"),t.append("text").attr("x",r).attr("y",c+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(a))},"drawMessage"),rs=u(function(t,e,c,s,r,i,o){let h=0,d=0,a,f=0;for(const E of s){const g=e.get(E),T=g.box;a&&a!=T&&(o||x.models.addBox(a),d+=n.boxMargin+a.margin),T&&T!=a&&(o||(T.x=h+d,T.y=r),d+=T.margin),g.width=g.width||n.width,g.height=v.getMax(g.height||n.height,n.height),g.margin=g.margin||n.actorMargin,f=v.getMax(f,g.height),c.get(g.name)&&(d+=g.width/2),g.x=h+d,g.starty=x.getVerticalPos(),x.insert(g.x,r,g.x+g.width,g.height),h+=g.width+d,g.box&&(g.box.width=h+T.margin-g.box.x),d=g.margin,a=g.box,x.models.addActor(g)}a&&!o&&x.models.addBox(a),x.bumpVerticalPos(f)},"addActorRenderingData"),Bt=u(async function(t,e,c,s){if(s){let r=0;x.bumpVerticalPos(n.boxMargin*2);for(const i of c){const o=e.get(i);o.stopy||(o.stopy=x.getVerticalPos());const h=await C.drawActor(t,o,n,!0);r=v.getMax(r,h)}x.bumpVerticalPos(r+n.boxMargin)}else for(const r of c){const i=e.get(r);await C.drawActor(t,i,n,!1)}},"drawActors"),ie=u(function(t,e,c,s){let r=0,i=0;for(const o of c){const h=e.get(o),d=ns(h),a=C.drawPopup(t,h,d,n,n.forceMenus,s);a.height>r&&(r=a.height),a.width+h.x>i&&(i=a.width+h.x)}return{maxHeight:r,maxWidth:i}},"drawActorsPopup"),ne=u(function(t){we(n,t),t.fontFamily&&(n.actorFontFamily=n.noteFontFamily=n.messageFontFamily=t.fontFamily),t.fontSize&&(n.actorFontSize=n.noteFontSize=n.messageFontSize=t.fontSize),t.fontWeight&&(n.actorFontWeight=n.noteFontWeight=n.messageFontWeight=t.fontWeight)},"setConf"),At=u(function(t){return x.activations.filter(function(e){return e.actor===t})},"actorActivations"),Xt=u(function(t,e){const c=e.get(t),s=At(t),r=s.reduce(function(o,h){return v.getMin(o,h.startx)},c.x+c.width/2-1),i=s.reduce(function(o,h){return v.getMax(o,h.stopx)},c.x+c.width/2+1);return[r,i]},"activationBounds");function rt(t,e,c,s,r){x.bumpVerticalPos(c);let i=s;if(e.id&&e.message&&t[e.id]){const o=t[e.id].width,h=gt(n);e.message=Y.wrapLabel(`[${e.message}]`,o-2*n.wrapPadding,h),e.width=o,e.wrap=!0;const d=Y.calculateTextDimensions(e.message,h),a=v.getMax(d.height,n.labelBoxHeight);i=s+a,G.debug(`${a} - ${e.message}`)}r(e),x.bumpVerticalPos(i)}u(rt,"adjustLoopHeightForWrap");function oe(t,e,c,s,r,i,o){function h(a,f){a.x<r.get(t.from).x?(x.insert(e.stopx-f,e.starty,e.startx,e.stopy+a.height/2+n.noteMargin),e.stopx=e.stopx+f):(x.insert(e.startx,e.starty,e.stopx+f,e.stopy+a.height/2+n.noteMargin),e.stopx=e.stopx-f)}u(h,"receiverAdjustment");function d(a,f){a.x<r.get(t.to).x?(x.insert(e.startx-f,e.starty,e.stopx,e.stopy+a.height/2+n.noteMargin),e.startx=e.startx+f):(x.insert(e.stopx,e.starty,e.startx+f,e.stopy+a.height/2+n.noteMargin),e.startx=e.startx-f)}if(u(d,"senderAdjustment"),i.get(t.to)==s){const a=r.get(t.to),f=a.type=="actor"?ut/2+3:a.width/2+3;h(a,f),a.starty=c-a.height/2,x.bumpVerticalPos(a.height/2)}else if(o.get(t.from)==s){const a=r.get(t.from);if(n.mirrorActors){const f=a.type=="actor"?ut/2:a.width/2;d(a,f)}a.stopy=c-a.height/2,x.bumpVerticalPos(a.height/2)}else if(o.get(t.to)==s){const a=r.get(t.to);if(n.mirrorActors){const f=a.type=="actor"?ut/2+3:a.width/2+3;h(a,f)}a.stopy=c-a.height/2,x.bumpVerticalPos(a.height/2)}}u(oe,"adjustCreatedDestroyedData");var is=u(async function(t,e,c,s){const{securityLevel:r,sequence:i}=$();n=i;let o;r==="sandbox"&&(o=It("#i"+e));const h=r==="sandbox"?It(o.nodes()[0].contentDocument.body):It("body"),d=r==="sandbox"?o.nodes()[0].contentDocument:document;x.init(),G.debug(s.db);const a=r==="sandbox"?h.select(`[id="${e}"]`):It(`[id="${e}"]`),f=s.db.getActors(),E=s.db.getCreatedActors(),g=s.db.getDestroyedActors(),T=s.db.getBoxes();let m=s.db.getActorKeys();const I=s.db.getMessages(),A=s.db.getDiagramTitle(),O=s.db.hasAtLeastOneBox(),S=s.db.hasAtLeastOneBoxWithTitle(),B=await ce(f,I,s);if(n.height=await le(f,B,T),C.insertComputerIcon(a),C.insertDatabaseIcon(a),C.insertClockIcon(a),O&&(x.bumpVerticalPos(n.boxMargin),S&&x.bumpVerticalPos(T[0].textMaxHeight)),n.hideUnusedParticipants===!0){const y=new Set;I.forEach(_=>{y.add(_.from),y.add(_.to)}),m=m.filter(_=>y.has(_))}rs(a,f,E,m,0,I,!1);const D=await ls(I,f,B,s);C.insertArrowHead(a),C.insertArrowCrossHead(a),C.insertArrowFilledHead(a),C.insertSequenceNumber(a);function F(y,_){const Q=x.endActivation(y);Q.starty+18>_&&(Q.starty=_-6,_+=12),C.drawActivation(a,Q,_,n,At(y.from).length),x.insert(Q.startx,_-10,Q.stopx,_)}u(F,"activeEnd");let q=1,X=1;const tt=[],z=[];let H=0;for(const y of I){let _,Q,at;switch(y.type){case s.db.LINETYPE.NOTE:x.resetVerticalPos(),Q=y.noteModel,await ss(a,Q);break;case s.db.LINETYPE.ACTIVE_START:x.newActivation(y,a,f);break;case s.db.LINETYPE.ACTIVE_END:F(y,x.getVerticalPos());break;case s.db.LINETYPE.LOOP_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.LOOP_END:_=x.endLoop(),await C.drawLoop(a,_,"loop",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.RECT_START:rt(D,y,n.boxMargin,n.boxMargin,k=>x.newLoop(void 0,k.message));break;case s.db.LINETYPE.RECT_END:_=x.endLoop(),z.push(_),x.models.addLoop(_),x.bumpVerticalPos(_.stopy-x.getVerticalPos());break;case s.db.LINETYPE.OPT_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.OPT_END:_=x.endLoop(),await C.drawLoop(a,_,"opt",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.ALT_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.ALT_ELSE:rt(D,y,n.boxMargin+n.boxTextMargin,n.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.ALT_END:_=x.endLoop(),await C.drawLoop(a,_,"alt",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k)),x.saveVerticalPos();break;case s.db.LINETYPE.PAR_AND:rt(D,y,n.boxMargin+n.boxTextMargin,n.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.PAR_END:_=x.endLoop(),await C.drawLoop(a,_,"par",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.AUTONUMBER:q=y.message.start||q,X=y.message.step||X,y.message.visible?s.db.enableSequenceNumbers():s.db.disableSequenceNumbers();break;case s.db.LINETYPE.CRITICAL_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.CRITICAL_OPTION:rt(D,y,n.boxMargin+n.boxTextMargin,n.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.CRITICAL_END:_=x.endLoop(),await C.drawLoop(a,_,"critical",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.BREAK_START:rt(D,y,n.boxMargin,n.boxMargin+n.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.BREAK_END:_=x.endLoop(),await C.drawLoop(a,_,"break",n),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;default:try{at=y.msgModel,at.starty=x.getVerticalPos(),at.sequenceIndex=q,at.sequenceVisible=s.db.showSequenceNumbers();const k=await re(a,at);oe(y,at,k,H,f,E,g),tt.push({messageModel:at,lineStartY:k}),x.models.addMessage(at)}catch(k){G.error("error while drawing message",k)}}[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(y.type)&&(q=q+X),H++}G.debug("createdActors",E),G.debug("destroyedActors",g),await Bt(a,f,m,!1);for(const y of tt)await as(a,y.messageModel,y.lineStartY,s);n.mirrorActors&&await Bt(a,f,m,!0),z.forEach(y=>C.drawBackgroundRect(a,y)),ee(a,f,m,n);for(const y of x.models.boxes)y.height=x.getVerticalPos()-y.y,x.insert(y.x,y.y,y.x+y.width,y.height),y.startx=y.x,y.starty=y.y,y.stopx=y.startx+y.width,y.stopy=y.starty+y.height,y.stroke="rgb(0,0,0, 0.5)",C.drawBox(a,y,n);O&&x.bumpVerticalPos(n.boxMargin);const W=ie(a,f,m,d),{bounds:M}=x.getBounds();M.startx===void 0&&(M.startx=0),M.starty===void 0&&(M.starty=0),M.stopx===void 0&&(M.stopx=0),M.stopy===void 0&&(M.stopy=0);let J=M.stopy-M.starty;J<W.maxHeight&&(J=W.maxHeight);let K=J+2*n.diagramMarginY;n.mirrorActors&&(K=K-n.boxMargin+n.bottomMarginAdj);let Z=M.stopx-M.startx;Z<W.maxWidth&&(Z=W.maxWidth);const et=Z+2*n.diagramMarginX;A&&a.append("text").text(A).attr("x",(M.stopx-M.startx)/2-2*n.diagramMarginX).attr("y",-25),me(a,K,et,n.useMaxWidth);const N=A?40:0;a.attr("viewBox",M.startx-n.diagramMarginX+" -"+(n.diagramMarginY+N)+" "+et+" "+(K+N)),G.debug("models:",x.models)},"draw");async function ce(t,e,c){const s={};for(const r of e)if(t.get(r.to)&&t.get(r.from)){const i=t.get(r.to);if(r.placement===c.db.PLACEMENT.LEFTOF&&!i.prevActor||r.placement===c.db.PLACEMENT.RIGHTOF&&!i.nextActor)continue;const o=r.placement!==void 0,h=!o,d=o?xt(n):gt(n),a=r.wrap?Y.wrapLabel(r.message,n.width-2*n.wrapPadding,d):r.message,E=(ot(a)?await Et(r.message,$()):Y.calculateTextDimensions(a,d)).width+2*n.wrapPadding;h&&r.from===i.nextActor?s[r.to]=v.getMax(s[r.to]||0,E):h&&r.from===i.prevActor?s[r.from]=v.getMax(s[r.from]||0,E):h&&r.from===r.to?(s[r.from]=v.getMax(s[r.from]||0,E/2),s[r.to]=v.getMax(s[r.to]||0,E/2)):r.placement===c.db.PLACEMENT.RIGHTOF?s[r.from]=v.getMax(s[r.from]||0,E):r.placement===c.db.PLACEMENT.LEFTOF?s[i.prevActor]=v.getMax(s[i.prevActor]||0,E):r.placement===c.db.PLACEMENT.OVER&&(i.prevActor&&(s[i.prevActor]=v.getMax(s[i.prevActor]||0,E/2)),i.nextActor&&(s[r.from]=v.getMax(s[r.from]||0,E/2)))}return G.debug("maxMessageWidthPerActor:",s),s}u(ce,"getMaxMessageWidthPerActor");var ns=u(function(t){let e=0;const c=Ot(n);for(const s in t.links){const i=Y.calculateTextDimensions(s,c).width+2*n.wrapPadding+2*n.boxMargin;e<i&&(e=i)}return e},"getRequiredPopupWidth");async function le(t,e,c){let s=0;for(const i of t.keys()){const o=t.get(i);o.wrap&&(o.description=Y.wrapLabel(o.description,n.width-2*n.wrapPadding,Ot(n)));const h=ot(o.description)?await Et(o.description,$()):Y.calculateTextDimensions(o.description,Ot(n));o.width=o.wrap?n.width:v.getMax(n.width,h.width+2*n.wrapPadding),o.height=o.wrap?v.getMax(h.height,n.height):n.height,s=v.getMax(s,o.height)}for(const i in e){const o=t.get(i);if(!o)continue;const h=t.get(o.nextActor);if(!h){const E=e[i]+n.actorMargin-o.width/2;o.margin=v.getMax(E,n.actorMargin);continue}const a=e[i]+n.actorMargin-o.width/2-h.width/2;o.margin=v.getMax(a,n.actorMargin)}let r=0;return c.forEach(i=>{const o=gt(n);let h=i.actorKeys.reduce((f,E)=>f+=t.get(E).width+(t.get(E).margin||0),0);h-=2*n.boxTextMargin,i.wrap&&(i.name=Y.wrapLabel(i.name,h-2*n.wrapPadding,o));const d=Y.calculateTextDimensions(i.name,o);r=v.getMax(d.height,r);const a=v.getMax(h,d.width+2*n.wrapPadding);if(i.margin=n.boxTextMargin,h<a){const f=(a-h)/2;i.margin+=f}}),c.forEach(i=>i.textMaxHeight=r),v.getMax(s,n.height)}u(le,"calculateActorMargins");var os=u(async function(t,e,c){const s=e.get(t.from),r=e.get(t.to),i=s.x,o=r.x,h=t.wrap&&t.message;let d=ot(t.message)?await Et(t.message,$()):Y.calculateTextDimensions(h?Y.wrapLabel(t.message,n.width,xt(n)):t.message,xt(n));const a={width:h?n.width:v.getMax(n.width,d.width+2*n.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===c.db.PLACEMENT.RIGHTOF?(a.width=h?v.getMax(n.width,d.width):v.getMax(s.width/2+r.width/2,d.width+2*n.noteMargin),a.startx=i+(s.width+n.actorMargin)/2):t.placement===c.db.PLACEMENT.LEFTOF?(a.width=h?v.getMax(n.width,d.width+2*n.noteMargin):v.getMax(s.width/2+r.width/2,d.width+2*n.noteMargin),a.startx=i-a.width+(s.width-n.actorMargin)/2):t.to===t.from?(d=Y.calculateTextDimensions(h?Y.wrapLabel(t.message,v.getMax(n.width,s.width),xt(n)):t.message,xt(n)),a.width=h?v.getMax(n.width,s.width):v.getMax(s.width,n.width,d.width+2*n.noteMargin),a.startx=i+(s.width-a.width)/2):(a.width=Math.abs(i+s.width/2-(o+r.width/2))+n.actorMargin,a.startx=i<o?i+s.width/2-n.actorMargin/2:o+r.width/2-n.actorMargin/2),h&&(a.message=Y.wrapLabel(t.message,a.width-2*n.wrapPadding,xt(n))),G.debug(`NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${t.message}]`),a},"buildNoteModel"),cs=u(function(t,e,c){if(![c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN,c.db.LINETYPE.SOLID,c.db.LINETYPE.DOTTED,c.db.LINETYPE.SOLID_CROSS,c.db.LINETYPE.DOTTED_CROSS,c.db.LINETYPE.SOLID_POINT,c.db.LINETYPE.DOTTED_POINT,c.db.LINETYPE.BIDIRECTIONAL_SOLID,c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[s,r]=Xt(t.from,e),[i,o]=Xt(t.to,e),h=s<=i;let d=h?r:s,a=h?i:o;const f=Math.abs(i-o)>2,E=u(I=>h?-I:I,"adjustValue");t.from===t.to?a=d:(t.activate&&!f&&(a+=E(n.activationWidth/2-1)),[c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(a+=E(3)),[c.db.LINETYPE.BIDIRECTIONAL_SOLID,c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(d-=E(3)));const g=[s,r,i,o],T=Math.abs(d-a);t.wrap&&t.message&&(t.message=Y.wrapLabel(t.message,v.getMax(T+2*n.wrapPadding,n.width),gt(n)));const m=Y.calculateTextDimensions(t.message,gt(n));return{width:v.getMax(t.wrap?0:m.width+2*n.wrapPadding,T+2*n.wrapPadding,n.width),height:0,startx:d,stopx:a,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},"buildMessageModel"),ls=u(async function(t,e,c,s){const r={},i=[];let o,h,d;for(const a of t){switch(a.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:i.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:a.message&&(o=i.pop(),r[o.id]=o,r[a.id]=o,i.push(o));break;case s.db.LINETYPE.LOOP_END:case s.db.LINETYPE.ALT_END:case s.db.LINETYPE.OPT_END:case s.db.LINETYPE.PAR_END:case s.db.LINETYPE.CRITICAL_END:case s.db.LINETYPE.BREAK_END:o=i.pop(),r[o.id]=o;break;case s.db.LINETYPE.ACTIVE_START:{const E=e.get(a.from?a.from:a.to.actor),g=At(a.from?a.from:a.to.actor).length,T=E.x+E.width/2+(g-1)*n.activationWidth/2,m={startx:T,stopx:T+n.activationWidth,actor:a.from,enabled:!0};x.activations.push(m)}break;case s.db.LINETYPE.ACTIVE_END:{const E=x.activations.map(g=>g.actor).lastIndexOf(a.from);x.activations.splice(E,1).splice(0,1)}break}a.placement!==void 0?(h=await os(a,e,s),a.noteModel=h,i.forEach(E=>{o=E,o.from=v.getMin(o.from,h.startx),o.to=v.getMax(o.to,h.startx+h.width),o.width=v.getMax(o.width,Math.abs(o.from-o.to))-n.labelBoxWidth})):(d=cs(a,e,s),a.msgModel=d,d.startx&&d.stopx&&i.length>0&&i.forEach(E=>{if(o=E,d.startx===d.stopx){const g=e.get(a.from),T=e.get(a.to);o.from=v.getMin(g.x-d.width/2,g.x-g.width/2,o.from),o.to=v.getMax(T.x+d.width/2,T.x+g.width/2,o.to),o.width=v.getMax(o.width,Math.abs(o.to-o.from))-n.labelBoxWidth}else o.from=v.getMin(d.startx,o.from),o.to=v.getMax(d.stopx,o.to),o.width=v.getMax(o.width,d.width)-n.labelBoxWidth}))}return x.activations=[],G.debug("Loop type widths:",r),r},"calculateLoopBounds"),hs={bounds:x,drawActors:Bt,drawActorsPopup:ie,setConf:ne,draw:is},xs={parser:Ne,get db(){return new De},renderer:hs,styles:Oe,init:u(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,be({sequence:{wrap:t.wrap}}))},"init")};export{xs as diagram};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import{a as A,r as i,j as e,B as w,S as z,G as $e,g as qe,t as me,A as P,I as ee,T as he,J as Be,K as Ve,M as He,N as Ye,O as pe,X as Se,u as Ke,L as se,Q as mt,c as J,U as Qe,x as ht,z as pt,V as xt,i as ft,f as Ge}from"./icon-mKHwnRNs.js";import{bG as gt,bH as Ce,bI as Te,bg as vt,g as re,bh as We,bi as ge,aq as Ze,f as yt,ab as jt,ar as bt,bJ as kt,bK as wt,bL as Nt,bM as St,bN as Je,a5 as Ct,bO as Tt,bP as H,bQ as ve,bR as Xe,bS as L,aH as At,bt as ye,bT as Ae,bu as I,bU as Et,j as xe,b as _t,d as Rt,bV as et,bm as Mt,bW as It,bX as ne,ax as Lt,bY as tt,bZ as X,aK as Pt,b_ as st,b$ as Ut,P as Dt,a9 as Ft,c0 as at,aJ as nt,c1 as Ot,c2 as zt,c3 as $t,av as qt,c4 as rt,bx as fe,bp as Bt,c5 as Vt,i as Ht,c6 as Yt,bk as Kt,c7 as Qt,c8 as Gt,c9 as Wt,bc as Ee,ca as Zt,bo as _e,cb as Jt,cc as Xt,bq as es,br as ts,bn as le,cd as ss,ce as as,cf as ns,cg as rs,ch as is,ci as os,cj as ls,ck as cs}from"./index-DqOACDLL.js";import{P as ds}from"./page-header-DmGvvMe3.js";import{S as us}from"./square-pen-717nTWtU.js";import{R as ms,N as hs}from"./radient-auth-buttons-XAgZ5KHN.js";import{a as ps,H as xs,p as ce}from"./parseISO-CJIN700N.js";/**
|
|
2
|
+
* @license lucide-react v0.507.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const fs=[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]],gs=A("audio-waveform",fs);/**
|
|
7
|
+
* @license lucide-react v0.507.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const vs=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],ys=A("chart-line",vs);/**
|
|
12
|
+
* @license lucide-react v0.507.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const js=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],bs=A("circle-plus",js);/**
|
|
17
|
+
* @license lucide-react v0.507.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const ks=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],it=A("contrast",ks);/**
|
|
22
|
+
* @license lucide-react v0.507.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const ws=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ns=A("credit-card",ws);/**
|
|
27
|
+
* @license lucide-react v0.507.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const Ss=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],Cs=A("flame",Ss);/**
|
|
32
|
+
* @license lucide-react v0.507.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Ts=[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]],As=A("hexagon",Ts);/**
|
|
37
|
+
* @license lucide-react v0.507.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Es=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],_s=A("leaf",Es);/**
|
|
42
|
+
* @license lucide-react v0.507.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Rs=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Ms=A("lock",Rs);/**
|
|
47
|
+
* @license lucide-react v0.507.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Is=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],Ls=A("messages-square",Is);/**
|
|
52
|
+
* @license lucide-react v0.507.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const Ps=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Us=A("moon",Ps);/**
|
|
57
|
+
* @license lucide-react v0.507.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const Ds=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],Fs=A("mountain",Ds);/**
|
|
62
|
+
* @license lucide-react v0.507.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Os=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],zs=A("skull",Os);/**
|
|
67
|
+
* @license lucide-react v0.507.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const $s=[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]],qs=A("snowflake",$s);/**
|
|
72
|
+
* @license lucide-react v0.507.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Bs=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Vs=A("sun",Bs);/**
|
|
77
|
+
* @license lucide-react v0.507.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const Hs=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ys=A("undo-2",Hs);/**
|
|
82
|
+
* @license lucide-react v0.507.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const Ks=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Qs=A("zap",Ks),Gs=()=>{const t="https://local-operator.com/download",[o,s]=i.useState(!1),[n,a]=i.useState(!1),[l,u]=i.useState(null),[p,h]=i.useState("info"),[m,d]=i.useState(null),[r,f]=i.useState(null),k=i.useRef(!1),x=i.useRef(!1),c=i.useRef(0),g=i.useRef(!1),j=i.useCallback((E,C)=>{x.current=!1,u(E),h(C),a(!0)},[]),_=i.useCallback(E=>{x.current=!0,u(E),h("success"),a(!0)},[]),b=i.useCallback(()=>{x.current&&(x.current=!1,a(!1),u(null))},[]),{clearDeferredUpdate:M}=gt();i.useEffect(()=>{const E=window.api.updater.onUpdateError(B=>{if(!k.current)return;const oe=["ENOENT: no such file or directory, open","Could not get code signature for running application","Cannot find latest.yml"].some(Y=>B.includes(Y));B.includes("manually")?(d({message:"The server is installed outside the app, so use the tool you installed it with - uv, pipx or pip.",command:""}),x.current=!1,u(null),h("warning"),a(!0)):oe||j(B,"danger")}),C=window.api.updater.onBackendUpdateDevMode(B=>{k.current&&j(B,"info")}),y=()=>{g.current=!0,b()},D=window.api.updater.onUpdateAvailable(y),T=window.api.updater.onUpdateNpxAvailable(y),ie=window.api.updater.onBackendUpdateAvailable(y);return()=>{E(),C(),D(),T(),ie()}},[b,j]),i.useEffect(()=>{let E=!1;const C=()=>{window.api.updater.getLastInstallAttempt().then(D=>{E||f(D)}).catch(()=>{})};C();const y=window.api.updater.onUpdateInstallFailed(()=>C());return()=>{E=!0,y()}},[]);const S=async()=>{const E=++c.current;b(),g.current=!1;try{s(!0),k.current=!0,M(Te.UI),M(Te.BACKEND);const C=await window.api.updater.checkForAllUpdates({manual:!0});if(E!==c.current)return;C?.affirmation&&!g.current?_(C.affirmation):b()}catch(C){if(E!==c.current)return;j(`Error checking for updates: ${C instanceof Error?C.message:String(C)}`,"danger")}finally{E===c.current&&s(!1),setTimeout(()=>{k.current=!1},2e3)}},F=()=>{x.current=!1,a(!1),u(null)};return e.jsxs(e.Fragment,{children:[r&&e.jsxs("div",{className:"mb-3 rounded-sm bg-sunken p-3",children:[e.jsxs("p",{className:"text-body-sm text-ink",children:["The last update to version ",r.targetVersion," didn't finish",r.attempts>1?` (${r.attempts} attempts)`:"",". Version ",r.runningVersion," is running."]}),e.jsxs("p",{className:"mt-1 text-meta text-ink-dim",children:["Detected"," ",r.detectedAt?new Date(r.detectedAt).toLocaleString():"at an unknown time",". ",r.detail]}),e.jsx(w,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(t),children:"Download a fresh copy"})]}),e.jsxs(w,{variant:"outline",onClick:()=>void S(),disabled:o,children:[o?e.jsx(z,{size:"sm"}):null,o?"Checking...":"Check for updates"]}),m&&e.jsxs(Ce,{open:n,autoHideDuration:1e4,onClose:F,variant:"warning",children:[e.jsx("p",{className:"text-body-sm",children:m.message}),m.command&&e.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:m.command})]}),l&&e.jsx(Ce,{open:n,autoHideDuration:6e3,onClose:F,variant:p,children:l})]})},ae=["system-prompt"],Ws=()=>{const{shouldEnableQuery:t}=vt();return re({enabled:t({bypassInternetCheck:!0}),queryKey:ae,queryFn:async()=>{try{const s=await We(ge.baseUrl).config.getSystemPrompt();if(s===null)return null;if(s.status>=400)throw new Error(s.message||"Failed to fetch system prompt");return s.result}catch(o){const s=o instanceof Error?o.message:"An unknown error occurred while fetching system prompt";throw Ze(s),o}},refetchOnWindowFocus:!1,staleTime:5e3})},Zs=()=>{const t=yt(),o=We(ge.baseUrl);return jt({mutationFn:async s=>{try{const n=await o.config.updateSystemPrompt(s);if(n.status>=400)throw new Error(n.message||"Failed to update system prompt");return n.result}catch(n){const a=n instanceof Error?n.message:"An unknown error occurred while updating system prompt";throw Ze(a),n}},onSuccess:async s=>{await t.invalidateQueries({queryKey:ae,refetchType:"none"}),t.setQueryData(ae,n=>n&&{...n,...s}),await t.refetchQueries({queryKey:ae,type:"all"}),bt("System prompt updated")},onError:s=>{console.error("Error updating system prompt:",s)}})},Js=({value:t,label:o,description:s,onChange:n,icon:a,isSaving:l=!1})=>{const[u,p]=i.useState(t),h=i.useId(),m=`${h}-label`,d=`${h}-description`,r=async f=>{if(!l){p(f);try{await n(f)}catch(k){p(!f),console.error("Error toggling setting:",k)}}};return e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("span",{id:m,className:"flex min-h-6 items-center gap-2 text-body text-ink",children:[a&&e.jsx(a,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim"}),o]}),s&&e.jsx("p",{id:d,className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:s})]}),e.jsx("div",{className:"flex h-6 shrink-0 items-center",children:l?e.jsx(z,{size:"md",label:`Saving ${o}`}):e.jsx($e,{checked:u,onCheckedChange:r,"aria-labelledby":m,"aria-describedby":s?d:void 0})})]})};var Xs=kt({chartName:"LineChart",GraphicalChild:Je,axisComponents:[{axisType:"xAxis",AxisComp:wt},{axisType:"yAxis",AxisComp:Nt}],formatAxisMap:St});function Re(t,o){const s=Ct(t,o?.in);if(!Tt(s))throw new RangeError("Invalid time value");const n=H(s.getDate(),2),a=H(s.getMonth()+1,2),l=s.getFullYear(),u=H(s.getHours(),2),p=H(s.getMinutes(),2),h=H(s.getSeconds(),2);let m="",d="";const r=s.getTimezoneOffset();if(r!==0){const f=Math.abs(r),k=H(Math.trunc(f/60),2),x=H(f%60,2);d=`${r<0?"+":"-"}${k}:${x}`}else d="Z";return`${l}-${a}-${n}T${u}:${p}:${h}${m}${d}`}function ea(t,o,s){return ps(t,-30,s)}const ta=["radient","creditBalance"],sa=t=>{const{user:o,isAuthenticated:s}=ve(),n=o?.account?.tenant_id,a=s&&!!n&&t?.enabled;return re({queryKey:[ta,n],queryFn:async()=>{if(!n)throw new Error("Tenant ID not available");const l=await Xe({operation:"credits",tenantId:n});if(!l||typeof l.balance!="number")throw new Error("Invalid credit balance response format");return l},enabled:a,staleTime:5*60*1e3,refetchOnWindowFocus:!0})};function aa(t,o){const[s,n]=i.useState(!1);return i.useEffect(()=>{if(!t){n(!1);return}const a=setTimeout(()=>n(!0),o);return()=>clearTimeout(a)},[t,o]),s}const na=["radient","usageRollup"],ra=(t,o)=>{const{user:s,isAuthenticated:n}=ve(),a=s?.account?.tenant_id,l=n&&!!a&&o?.enabled;return re({queryKey:[...na,a,t],queryFn:async()=>{if(!a)throw new Error("Tenant ID not available");const u={};for(const[h,m]of Object.entries(t))m!=null&&(u[h]=String(m));const p=await Xe({operation:"usage",tenantId:a,query:u});if(!p)throw new Error("Invalid usage rollup response format");return p},enabled:l,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},ia=()=>e.jsx(Gs,{}),oa=()=>{const[t,o]=i.useState("Loading..."),[s,n]=i.useState("Loading..."),[a,l]=i.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});i.useEffect(()=>{let p=!0;const h=async()=>{try{const[d,r]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);p&&(o(d),l(r))}catch(d){console.error("Error fetching app information:",d)}},m=async()=>{try{const d=await Ae.healthCheck(ge.baseUrl),r=Ae.getServerVersion(d);p&&n(r)}catch(d){console.error("Error fetching server version:",d),p&&n("Unavailable")}};return h(),m(),()=>{p=!1}},[]);const u=(p,h,m)=>e.jsx(I,{label:e.jsx(qe,{content:m,children:e.jsxs("span",{className:"inline-flex cursor-help items-center gap-1.5",children:[e.jsx(me,{size:12,className:"shrink-0"}),p]})}),value:h});return e.jsx(L,{title:"Application updates and info",icon:At,description:"Check for updates and view information about your Local Operator installation.",dataTourTag:"settings-app-updates-section",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs(ye,{children:[u("Application version",t,"The version of the Local Operator user interface application."),u("Server version",s,"The version of the Local Operator API server backend."),u("Platform",`${a.platform} (${a.arch})`,"The operating system and architecture your application is running on."),u("Node.js version",a.nodeVersion,"The JavaScript runtime environment version."),u("Electron version",a.electronVersion,"The framework version enabling this desktop application.")]}),e.jsx(ia,{})]})})},ot="__cascade__";function G(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function la(t,o){return t.kind==="cascade"?o!==ot:t.kind==="list"?o!==t.value?.join(`
|
|
87
|
+
`):o!==G(t.value)}const ca=({setting:t,scope:o,onSaved:s,children:n})=>{const[a,l]=i.useState({value:t.kind==="list"?(t.value??[]).join(`
|
|
88
|
+
`):t.kind==="cascade"?ot:G(t.value),cascadeBase:null,saving:!1,error:null}),u=la(t,a.value)||a.cascadeBase!==null,p=async()=>{let r=null,f;const k=()=>({op:"settings.edit",key:t.key,value:r,...f?{base:f}:{}});switch(t.kind){case"bool":r=a.value==="true";break;case"int":if(r=Number.parseInt(a.value,10),Number.isNaN(r)){l(x=>({...x,error:"Enter a whole number."}));return}break;case"float":{const x=Number.parseFloat(a.value);if(!Number.isFinite(x)){l(c=>({...c,error:"Enter a finite number."}));return}r=x;break}case"enum":{const x=t.choices.find(c=>G(c.value)===a.value);r=x?x.value:a.value;break}case"list":r=a.value.split(`
|
|
89
|
+
`).map(x=>x.trim()).filter(Boolean);break;case"cascade":{if(!a.cascadeBase)return;const x={};for(const[c,g]of Object.entries(a.cascadeBase))x[c]=g;r=x,f=t.value??void 0;break}default:t.empty_unsets&&a.value.trim()===""?r=null:r=a.value}l(x=>({...x,saving:!0,error:null}));try{await xe(k()),l(x=>({...x,saving:!1,cascadeBase:null})),await s?.()}catch(x){l(c=>({...c,saving:!1,error:x instanceof Error?x.message:"The setting could not be saved."}))}},h=async()=>{l(r=>({...r,saving:!0,error:null}));try{await xe({op:"settings.reset",key:t.key}),l(r=>({...r,saving:!1})),await s?.()}catch(r){l(f=>({...f,saving:!1,error:r instanceof Error?r.message:"The setting could not be reset."}))}};if(t.redacted)return e.jsx(P,{variant:"neutral",className:"w-full",children:"This value carries inline credentials or query parameters and cannot be edited here. Secrets belong in the credential manager."});if(t.kind==="readonly")return e.jsx("p",{className:"text-body-sm text-ink-muted",children:G(t.value)||"Not set"});let m;switch(t.kind){case"bool":m=e.jsx($e,{checked:a.value==="true",onCheckedChange:r=>l(f=>({...f,value:r?"true":"false"})),"aria-label":t.label});break;case"enum":m=e.jsxs(Be,{value:a.value,onValueChange:r=>l(f=>({...f,value:r})),children:[e.jsx(Ve,{"aria-label":t.label,className:"w-full",children:e.jsx(He,{})}),e.jsx(Ye,{children:t.choices.map(r=>e.jsx(pe,{value:G(r.value),children:r.label},G(r.value)))})]});break;case"int":case"float":m=e.jsx(ee,{type:"number",value:a.value,min:t.minimum??void 0,max:t.maximum??void 0,step:t.kind==="int"?1:"any",onChange:r=>l(f=>({...f,value:r.target.value})),"aria-label":t.label});break;case"list":m=e.jsx(he,{value:a.value,rows:Math.min(6,t.members.length+2),onChange:r=>l(f=>({...f,value:r.target.value})),"aria-label":t.label,className:"font-mono text-body-sm"});break;case"cascade":{const r=a.cascadeBase??t.value??{};m=e.jsxs("div",{className:"flex flex-col gap-3",children:[Object.entries(r).map(([f,k])=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-mono text-meta text-ink-dim",children:f}),e.jsx(he,{value:k.join(`
|
|
90
|
+
`),rows:Math.max(2,k.length+1),onChange:x=>l(c=>({...c,cascadeBase:{...c.cascadeBase??r,[f]:x.target.value.split(`
|
|
91
|
+
`).map(g=>g.trim()).filter(Boolean)}})),"aria-label":`${t.label}: ${f}`,className:"font-mono text-body-sm"})]},f)),e.jsx("p",{className:"text-meta text-ink-dim",children:"One hop per line, as provider/model (effort). An empty chain moves to the next provider."})]});break}default:m=e.jsx(ee,{value:a.value,onChange:r=>l(f=>({...f,value:r.target.value})),"aria-label":t.label})}const d=e.jsxs("div",{className:"flex flex-col gap-2","data-setting-key":t.key,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("span",{className:"text-body-sm text-ink",children:t.label}),t.help&&e.jsx("span",{className:"text-meta text-ink-dim",children:t.help})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[!t.is_default&&e.jsxs(w,{variant:"ghost",size:"sm",onClick:()=>void h(),disabled:a.saving,children:[e.jsx(Ys,{"aria-hidden":"true"}),"Use default"]}),u&&e.jsx(w,{variant:"primary",size:"sm",onClick:()=>void p(),disabled:a.saving,children:a.saving?"Saving":"Save"})]})]}),m,t.kind!=="bool"&&!t.is_default&&e.jsxs("p",{className:"text-meta text-ink-dim",children:["Changed from the default",o?`; ${o}`:""]}),a.error&&e.jsx(P,{variant:"danger",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:a.error}),e.jsxs(w,{variant:"secondary",size:"sm",onClick:()=>void p(),disabled:a.saving,children:[e.jsx(Et,{"aria-hidden":"true"}),"Retry"]})]})})]});return n?n(d):d},da={all:["desktop","settings"]},de={live:"Takes effect immediately","new launch":"Takes effect the next time the app starts","new sessions":"Takes effect for new conversations"},ua=({focusKey:t,initialFilter:o=""})=>{const s=_t(),n=Rt(s.data,"settings"),[a,l]=i.useState(o),[u,p]=i.useState(new Set),h=i.useRef(!1),m=re({queryKey:da.all,queryFn:()=>xe({op:"settings.list"}),enabled:n,staleTime:1e4}),d=m.data,r=i.useMemo(()=>{if(!d)return null;const c=j=>j.toLowerCase().replace(/[-_]/g," "),g=c(a.trim());return g?d.settings.filter(j=>c([j.label,j.help,j.key,j.section].join(" ")).includes(g)):d.settings},[d,a]);if(i.useEffect(()=>{if(!t||!d||h.current)return;h.current=!0;const c=d.settings.find(g=>g.key===t);c&&(p(g=>{if(!g.has(c.section))return g;const j=new Set(g);return j.delete(c.section),j}),requestAnimationFrame(()=>{const g=document.querySelector(`[data-setting-key="${CSS.escape(t)}"] input, [data-setting-key="${CSS.escape(t)}"] textarea, [data-setting-key="${CSS.escape(t)}"] button[role="switch"], [data-setting-key="${CSS.escape(t)}"] button`);g?.focus(),g?.scrollIntoView({block:"center"})}))},[t,d]),s.data&&!n)return e.jsx(P,{variant:"warning",children:"Searchable settings need a newer Local Operator server. Update the server and restart the app to manage these settings here."});if(m.isLoading||s.isLoading)return e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(z,{size:"lg",label:"Loading settings"})});const f=(s.data?null:s.error)??m.error;if(f||!d||!r){const c=s.isFetching||m.isFetching;return e.jsx(P,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:et("Your settings could not be loaded.",f)}),e.jsx(w,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{s.isError?s.refetch():m.refetch()},disabled:c,children:c?"Retrying":"Retry"})]})})}const k=d.sections.filter(c=>r.some(g=>g.section===c.name)),x=c=>p(g=>{const j=new Set(g);return j.has(c)?j.delete(c):j.add(c),j});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Mt,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-ink-dim","aria-hidden":"true"}),e.jsx(ee,{value:a,onChange:c=>l(c.target.value),placeholder:"Search settings by name, description or key","aria-label":"Search settings",className:"pl-9"}),a&&e.jsx(w,{variant:"ghost",size:"icon-sm",className:"absolute top-1/2 right-1 -translate-y-1/2",onClick:()=>l(""),"aria-label":"Clear search",children:e.jsx(Se,{"aria-hidden":"true"})})]}),r.length===0&&e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No settings match this search."}),e.jsxs(w,{variant:"secondary",size:"sm",onClick:()=>l(""),children:[e.jsx(Se,{"aria-hidden":"true"}),"Clear search"]})]}),k.map(c=>{const g=r.filter(_=>_.section===c.name),j=u.has(c.name);return e.jsxs("section",{"data-settings-section":c.name,className:"flex flex-col gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>x(c.name),"aria-expanded":!j,className:"flex items-baseline justify-between gap-3 text-left",children:[e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-heading text-ink",children:c.title}),c.description&&e.jsx("span",{className:"text-meta text-ink-dim",children:c.description})]}),de[c.scope]&&e.jsx(Ke,{variant:"neutral",children:de[c.scope]})]}),!j&&e.jsx("div",{className:"flex flex-col gap-5",children:g.map(_=>e.jsx(ca,{setting:_,scope:de[c.scope],onSaved:()=>m.refetch()},_.key))})]},c.name)})]})},Me=({credentialKey:t,isConfigured:o=!1,onEdit:s,onClear:n,onAdd:a})=>{const l=It(t),u=o?Ms:ne;return e.jsxs("div",{className:"flex flex-col rounded-md p-3 transition-colors duration-fast ease-out-quart hover:bg-elevated",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-body font-medium text-ink",children:[e.jsx(u,{className:"size-3.5 shrink-0 text-ink-dim"}),l.name]}),e.jsx("p",{className:"mt-1 break-all text-mono-sm text-ink-dim",children:t}),e.jsx("p",{className:"mt-2 text-body-sm text-ink-muted",children:l.description})]}),e.jsx("div",{className:"mt-auto flex flex-wrap items-center justify-end gap-2 pt-4",children:o?e.jsxs(e.Fragment,{children:[e.jsxs(w,{variant:"ghost",size:"sm",onClick:()=>s?.(t),children:[e.jsx(us,{}),"Update"]}),e.jsxs(w,{variant:"ghost",size:"sm",className:"text-danger hover:bg-danger-wash hover:text-danger",onClick:()=>n?.(t),children:[e.jsx(Lt,{}),"Clear"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>a?.(t),children:[e.jsx(ne,{}),"Configure"]}),l.url&&e.jsx(qe,{content:`Get your ${l.name} key`,children:e.jsx(w,{variant:"ghost",size:"icon-sm",asChild:!0,children:e.jsx("a",{href:l.url,target:"_blank",rel:"noopener noreferrer","aria-label":`Get your ${l.name} key`,children:e.jsx(tt,{})})})})]})})]})},ue="_custom_",Ie="credential-custom-key",Le="credential-custom-key-error",Pe="credential-type",Ue="credential-type-help",De="credential-value",Fe="credential-value-help",Oe=({open:t,onClose:o,onSave:s,initialKey:n="",existingKeys:a,isSaving:l,isEditMode:u})=>{const[p,h]=i.useState(n),[m,d]=i.useState(""),[r,f]=i.useState(""),[k,x]=i.useState(!1);i.useEffect(()=>{if(t){const y=X.some(T=>T.key===n),D=!u&&n&&!y;h(y?n:""),d(""),f(D?n:""),x(D||u&&!y)}},[t,n,u]);const c=()=>{let y="";if(u?y=n:y=k?r.trim():p,!y){console.error("No key provided for credential");return}if(!m.trim()){console.error("No value provided for credential");return}s({key:y,value:m})},g=y=>a.includes(y)&&y!==n,j=g(r),_=u?!0:k?r.trim()!==""&&!j:p!==""&&!g(p),b=m.trim()!=="",M=_&&b&&!l,S=X.find(y=>y.key===p),F=!!S&&!k,E=u?"Update credential":"Add new credential",C=e.jsxs(e.Fragment,{children:[e.jsx(w,{variant:"secondary",onClick:o,children:"Cancel"}),e.jsxs(w,{variant:"primary",onClick:c,disabled:!M,children:[l&&e.jsx(z,{size:"sm",className:"border-t-on-accent"}),l?"Saving...":"Save"]})]});return e.jsx(Pt,{open:t,onClose:o,title:E,actions:C,maxWidth:"sm",fullWidth:!0,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[u?e.jsx(I,{label:"Credential key",value:e.jsx("span",{className:"text-mono-sm",children:n})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(se,{htmlFor:Pe,children:"Credential type"}),e.jsxs(Be,{value:k?ue:p,onValueChange:y=>{y===ue?(x(!0),h("")):(x(!1),h(y),f(""))},children:[e.jsx(Ve,{id:Pe,"aria-describedby":F?Ue:void 0,children:e.jsx(He,{placeholder:"Select a credential type"})}),e.jsxs(Ye,{children:[X.filter(y=>!y.internal).map(y=>e.jsxs(pe,{value:y.key,disabled:g(y.key),children:[y.name,g(y.key)&&" (configured)"]},y.key)),e.jsx(pe,{value:ue,children:"Custom credential"})]})]}),F&&S&&e.jsxs("div",{id:Ue,className:"flex flex-col items-start gap-1",children:[e.jsx("p",{className:"text-meta text-ink-dim",children:S.description}),S.url&&e.jsxs("a",{href:S.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent text-meta underline-offset-4 hover:text-accent-hover hover:underline",children:["Get your ",S.name," key"]})]})]}),k&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(se,{htmlFor:Ie,children:"Custom credential key"}),e.jsx(ee,{id:Ie,value:r,onChange:y=>f(y.target.value),"aria-invalid":j||void 0,"aria-describedby":j?Le:void 0,required:!0,autoFocus:!0}),j&&e.jsx("p",{id:Le,className:"text-danger text-meta",children:"This credential already exists"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(se,{htmlFor:De,children:"Credential value"}),e.jsx(ee,{id:De,type:"password",value:m,onChange:y=>d(y.target.value),onKeyDown:y=>{y.key==="Enter"&&M&&c()},"aria-describedby":u?Fe:void 0,required:!0,autoFocus:u,placeholder:"Enter the credential value or API key"}),u&&e.jsxs("p",{id:Fe,className:"text-ink-dim text-meta",children:["Enter the new value for ",n]})]})]})})},ze=({title:t,description:o,children:s,isEmpty:n=!1,emptyStateType:a="noCredentials"})=>e.jsxs("section",{children:[e.jsx("h3",{className:"text-body font-medium text-ink",children:t}),e.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:o}),e.jsx(mt,{variant:"surface",padding:"sm",className:"mt-3",children:n?e.jsx(ma,{type:a}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(260px,1fr))] gap-2",children:s})})]}),ma=({type:t,className:o})=>{const s=t==="noCredentials",n=s?ne:Qe;return e.jsxs("div",{className:J("flex flex-col items-center px-4 py-8 text-center",o),children:[e.jsx(n,{size:20,className:"text-ink-dim","aria-hidden":!0}),e.jsx("p",{className:"mt-3 text-body font-medium text-ink",children:s?"No credentials configured":"All available credentials configured"}),e.jsx("p",{className:"mt-1 max-w-sm text-body-sm text-ink-muted",children:s?"You haven't set up any API credentials yet. Add credentials from the available options or add a custom one.":"You've configured all the common API credentials. You can still add custom credentials if needed."})]})},ha=()=>{const{data:t,isLoading:o,error:s,refetch:n}=st(),a=Ut(),[l,u]=i.useState(!1),[p,h]=i.useState(!1),[m,d]=i.useState(null),r=b=>{d(b),u(!0)},f=(b=null)=>{d(b),h(!0)},k=()=>{u(!1),h(!1),d(null)},x=async b=>{try{await a.mutateAsync(b),k(),await n()}catch(M){console.error("Error saving credential:",M)}},c=async b=>{try{await a.mutateAsync({key:b,value:""}),await n()}catch(M){console.error("Error clearing credential:",M)}},g=i.useMemo(()=>t?.keys?.filter(b=>!X.find(M=>M.key===b)?.internal)??[],[t]),j=i.useMemo(()=>X.filter(b=>!g.includes(b.key)&&!b.internal),[g]),_=()=>o?e.jsx("div",{className:"flex min-h-40 items-center justify-center",children:e.jsx(z,{size:"lg",label:"Loading credentials"})}):s||!t?e.jsxs(P,{variant:"danger",role:"alert",children:[e.jsx(ht,{children:"Could not load credentials"}),e.jsx(pt,{children:s instanceof Error?s.message:"The server did not say why. Check that Local Operator is running, then reopen this page."})]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{title:"Configured credentials",description:"These API credentials are currently configured and available for use.",isEmpty:g.length===0,emptyStateType:"noCredentials",children:g.map(b=>e.jsx(Me,{credentialKey:b,isConfigured:!0,onEdit:r,onClear:c},b))}),e.jsx(ze,{title:"Available credentials",description:"These are common API credentials you can configure to enhance functionality.",isEmpty:j.length===0,emptyStateType:"allConfigured",children:j.map(b=>e.jsx(Me,{credentialKey:b.key,isConfigured:!1,onAdd:()=>f(b.key)},b.key))}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(w,{variant:"secondary",size:"sm",onClick:()=>f(null),children:[e.jsx(Dt,{}),"Add custom credential"]})}),l&&e.jsx(Oe,{open:l,onClose:k,onSave:x,initialKey:m||"",existingKeys:g,isSaving:a.isPending,isEditMode:!0}),p&&e.jsx(Oe,{open:p,onClose:k,onSave:x,initialKey:m||"",existingKeys:g,isSaving:a.isPending,isEditMode:!1})]});return e.jsx("div",{className:"flex flex-col gap-6",children:_()})},pa=({onAfterCredentialUpdate:t})=>{const{isAuthenticated:o,user:s,isLoading:n,error:a,signOut:l}=Ft(),u=at(d=>d.isSigningOut),p=i.useCallback(async()=>{try{await l()}catch(d){console.error("Error signing out:",d)}},[l]),h=i.useMemo(()=>{if(!o||!s?.radientUser)return null;const{account:d,identity:r}=s.radientUser;return e.jsxs(e.Fragment,{children:[e.jsxs(ye,{children:[e.jsx(I,{label:"Status",value:e.jsxs("span",{className:"inline-flex items-center gap-2",children:["Connected",e.jsx(Ke,{variant:"success",className:"capitalize",children:d.status})]})}),e.jsx(I,{label:"Name",value:d.name||"Not provided"}),e.jsx(I,{label:"Email",value:d.email}),e.jsx(I,{label:"Account ID",value:e.jsx("span",{className:"text-mono-sm",children:d.id})}),e.jsx(I,{label:"Tenant ID",value:e.jsx("span",{className:"text-mono-sm",children:d.tenant_id})}),e.jsx(I,{label:"Provider",value:e.jsx("span",{className:"capitalize",children:r.provider})}),e.jsx(I,{label:"Created",value:nt(d.created_at)})]}),e.jsxs("div",{className:"mt-8",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"Need to sign out or switch accounts?"}),e.jsxs(w,{variant:"danger",className:"mt-3",onClick:p,children:[e.jsx(Ot,{}),"Sign out from Radient"]})]})]})},[o,s?.radientUser,p]),m=i.useMemo(()=>o&&s?null:e.jsxs("div",{children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"You are not currently signed in to Radient. Sign in to access your account details or sign up to get free credits and unified access to models, tools, and more with Radient Pass. Radient's automatic model router will automatically select the best model for your agents to balance cost and performance. It is often cheaper to use Radient Pass than to use single AI providers due to automatic cost optimization."}),e.jsx("div",{className:"mt-6",children:e.jsx(ms,{titleText:"",onAfterCredentialUpdate:t,descriptionText:"",onSignInSuccess:()=>{}})})]}),[o,s,t]);return n||u?e.jsx("div",{className:"flex min-h-36 items-center justify-center",children:e.jsx(z,{size:"lg",label:"Loading account"})}):o&&s?.radientUser?h:e.jsxs("div",{className:"flex flex-col gap-4",children:[a&&e.jsxs(P,{variant:"danger",children:["Error checking account status:"," ",a instanceof Error?a.message:String(a)]}),m]})};function xa({metric:t,data:o}){return e.jsx(zt,{title:"",heightClassName:"h-62",yAxisWidth:48,unit:t==="credits"?"credits":"tokens",srSummary:`${t==="credits"?"Credits consumed":"Tokens used"} over the last 30 days, plotted per day across ${o.length} days.`,xTickFormatter:s=>s,yTickFormatter:s=>t==="credits"?`$${s.toFixed(2)}`:$t(s),children:e.jsx(Xs,{data:o,children:e.jsx(Je,{type:"monotone",dataKey:"value",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:0},name:t==="credits"?"Credits consumed":"Tokens used"})})})}const fa=()=>{const{data:t,isLoading:o,error:s,refetch:n}=Ws(),a=Zs(),[l,u]=i.useState(""),[p,h]=i.useState(!1);i.useEffect(()=>{u(t?.content??""),h(!1)},[t]);const m=x=>{const c=x.target.value;u(c),h(c!==(t?.content??""))},d=async()=>{if(!(!p||a.isPending))try{const x={content:l};await a.mutateAsync(x),await n(),h(!1)}catch(x){console.error("Error updating system prompt:",x)}},r=()=>{u(t?.content??""),h(!1)},f=a.isPending,k=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(se,{htmlFor:"app-system-prompt",children:"Instructions"}),e.jsx(he,{id:"app-system-prompt",name:"systemPrompt",value:l,onChange:m,placeholder:"Enter instructions for how all agents should behave and respond to your requests...",className:"min-h-50"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(w,{variant:"primary",onClick:d,disabled:!p||f,children:[f?e.jsx(z,{size:"sm"}):e.jsx(qt,{}),f?"Saving...":"Save changes"]}),e.jsx(w,{onClick:r,disabled:!p||f,children:"Cancel"})]}),t?.last_modified&&e.jsxs("p",{className:"text-ink-dim text-meta",children:["Last modified:"," ",e.jsx("span",{className:"font-mono text-mono-sm",children:rt(t.last_modified)})]})]});return e.jsx(L,{title:"System prompt",icon:hs,description:"Every Local Operator agent receives this prompt in addition to its own instructions, so it is the place for baseline expectations and for details you want every agent to know about you, such as your name, location, or preferences. It is sent to your selected hosting provider.",children:o?e.jsx("div",{className:"flex min-h-50 items-center justify-center",children:e.jsx(z,{size:"lg",label:"Loading system prompt"})}):s?e.jsxs(P,{variant:"danger",children:["Failed to load system prompt:"," ",s instanceof Error?s.message:"Unknown error"]}):k()})},ga={localOperatorDark:Us,localOperatorLight:Vs,radient:As,dracula:zs,dune:Cs,sage:_s,monokai:ft,tokyoNight:Fs,iceberg:qs,neon:Qs,obsidian:it,synth:gs},va=({id:t})=>e.jsxs("div",{"data-theme":t,"aria-hidden":"true",className:"flex h-full bg-canvas",children:[e.jsxs("div",{className:"flex w-1/4 flex-col gap-1 bg-sunken p-1.5",children:[e.jsx("span",{className:"flex h-2.5 items-center rounded-xs bg-accent-wash px-1",children:e.jsx("span",{className:"h-1 w-full rounded-xs bg-accent"})}),e.jsx("span",{className:"mx-1 h-1 w-2/3 rounded-xs bg-ink-dim"}),e.jsx("span",{className:"mx-1 h-1 w-1/2 rounded-xs bg-ink-dim"})]}),e.jsxs("div",{className:"flex flex-1 flex-col justify-between p-2",children:[e.jsxs("div",{className:"flex flex-col gap-1.5 rounded-sm bg-surface p-2",children:[e.jsx("span",{className:"h-1.5 w-3/5 rounded-xs bg-ink"}),e.jsx("span",{className:"h-1 w-full rounded-xs bg-ink-dim"}),e.jsx("span",{className:"h-1 w-4/5 rounded-xs bg-ink-dim"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"h-3 w-9 rounded-xs bg-accent"}),e.jsx("span",{className:"h-3 w-6 rounded-xs border border-control"})]})]})]}),ya=({id:t,name:o,description:s,isSelected:n,onSelect:a})=>{const l=ga[t];return e.jsxs("button",{type:"button","aria-pressed":n,onClick:a,className:J("flex flex-col gap-2 rounded-lg p-2 text-left transition-colors duration-fast ease-out-quart",n?"bg-accent-wash":"hover:bg-surface"),children:[e.jsx("span",{className:J("block aspect-16/10 overflow-hidden rounded-md border transition-colors duration-fast ease-out-quart",n?"border-accent":"border-hairline"),children:e.jsx(va,{id:t})}),e.jsxs("span",{className:"flex items-center gap-2 px-1",children:[e.jsx(l,{size:14,className:"shrink-0 text-ink-dim","aria-hidden":"true"}),e.jsx("span",{className:J("min-w-0 flex-1 truncate text-body-sm text-ink",n&&"font-medium"),children:o}),n&&e.jsx(Qe,{size:14,className:"shrink-0 text-accent","aria-hidden":"true"})]}),e.jsx("span",{className:"px-1 pb-1 text-meta text-ink-muted",children:s})]})},ja=()=>{const{themeName:t,setTheme:o}=fe(),s=i.useMemo(()=>{const n=Object.values(xt);return[{label:"Dark",items:n.filter(a=>a.theme.palette.mode==="dark")},{label:"Light",items:n.filter(a=>a.theme.palette.mode==="light")}].filter(a=>a.items.length>0)},[]);return e.jsx("div",{className:"flex flex-col gap-6",children:s.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"px-1 pb-2 text-meta text-ink-dim",children:n.label}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2",children:n.items.map(({id:a,name:l,description:u})=>e.jsx(ya,{id:a,name:l,description:u,isSelected:a===t,onSelect:()=>o(a)},a))})]},n.label))})},ba=()=>{const{data:t,isLoading:o,error:s}=sa({enabled:!0});return e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-heading text-ink",children:[e.jsx(Ns,{size:16,className:"shrink-0 text-ink-dim"}),"Radient Pass"]}),o&&e.jsx(Ge,{className:"h-6 w-36"}),s&&e.jsxs(P,{variant:"warning",children:["Could not load your credit balance. ",s.message]}),t&&!o&&!s&&e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("p",{className:"flex-1 text-body-sm text-ink-muted",children:["Available credits"," ",e.jsx("span",{className:"font-medium text-ink",children:t.balance.toFixed(2)})]}),e.jsx(w,{variant:"secondary",size:"sm",asChild:!0,children:e.jsxs("a",{href:"https://console.radienthq.com/dashboard/billing",target:"_blank",rel:"noopener noreferrer",children:[e.jsx(bs,{}),"Add credits"]})})]})]})},ka=[{id:"credits",label:"Credits"},{id:"tokens",label:"Tokens"}],wa=()=>{const[t,o]=i.useState("credits"),s=i.useMemo(()=>{const p=new Date,h=ea(p);return{start_date:Re(h),end_date:Re(p),rollup:"daily"}},[]),{data:n,isLoading:a,error:l}=ra(s,{enabled:!0}),u=i.useMemo(()=>n?.data_points?[...n.data_points].sort((h,m)=>ce(h.timestamp).getTime()-ce(m.timestamp).getTime()).map(h=>({bucket:os(ls(ce(h.timestamp),"yyyy-MM-dd")),value:t==="credits"?Number.parseFloat(h.total_cost.toFixed(2)):h.total_tokens})):[],[n,t]);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(ys,{size:16,className:"shrink-0 text-ink-dim"}),"Usage (last 30 days)"]}),e.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:"Usage metric"}),e.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:ka.map(({id:p,label:h})=>e.jsx(w,{variant:"ghost",size:"sm","aria-pressed":t===p,onClick:()=>o(p),className:J(t===p&&"bg-surface text-ink hover:bg-surface"),children:h},p))})]})]}),a&&e.jsx(Ge,{className:"h-62 w-full"}),l&&e.jsxs(P,{variant:"warning",children:["Could not load your usage data. ",l.message]}),!a&&!l&&n&&u.length>0&&e.jsx(xa,{metric:t,data:u}),!a&&!l&&(!n||u.length===0)&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No usage recorded in the last 30 days."})]})},Na=()=>e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(cs,{size:16,className:"shrink-0 text-ink-dim"}),"Radient account"]}),e.jsx(w,{variant:"secondary",size:"sm",className:"self-start sm:self-center",asChild:!0,children:e.jsxs("a",{href:"https://console.radienthq.com",target:"_blank",rel:"noopener noreferrer",children:["Go to Radient console",e.jsx(tt,{})]})})]}),Ma=()=>{const t=fe(v=>v.showAgentReasoning),o=fe(v=>v.setShowAgentReasoning),{data:s,isLoading:n,isFetching:a,error:l,refetch:u}=Bt(),p=Vt(),[h,m]=i.useState(null),d=at(),{isAuthenticated:r,isLoading:f}=ve(),k=Ht(v=>v.activeSessionId),[x,c]=i.useState("general"),[g,j]=i.useState(!1),_=i.useRef(null),b=i.useRef(null),{startTour:M}=Yt(),S=Kt(),{data:F,refetch:E}=st(),{refreshModels:C}=Qt(),y=i.useMemo(()=>F?.keys?[...F.keys].sort():[],[F?.keys]),D=i.useRef({keys:"",hosting:void 0});i.useEffect(()=>{const v=y.join(","),R=s?.values?.hosting;(D.current.keys!==v||D.current.hosting!==R)&&(D.current={keys:v,hosting:R},C().catch(N=>{console.error("Failed to refresh models after credentials or hosting change:",N)}))},[y,s?.values?.hosting,C]);const T=i.useRef({general:i.useRef(null),radient:i.useRef(null),integrations:i.useRef(null),appearance:i.useRef(null),credentials:i.useRef(null),providers:i.useRef(null),backend:i.useRef(null),updates:i.useRef(null)}).current,ie=i.useMemo(()=>new URLSearchParams(S.search).get("setting"),[S.search]),B=i.useMemo(()=>new URLSearchParams(S.search).get("filter")??"",[S.search]),je=i.useMemo(()=>new URLSearchParams(S.search).get("mcp")??void 0,[S.search]),oe=i.useMemo(()=>new URLSearchParams(S.search).get("provider"),[S.search]),Y=i.useCallback(v=>{c(v),j(!0);const R=T[v],N=b.current;if(R?.current&&N){const U=R.current.getBoundingClientRect().top-N.getBoundingClientRect().top;N.scrollHeight>N.clientHeight?N.scrollTo({top:Math.max(0,N.scrollTop+U-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,R.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout(_.current??void 0),_.current=setTimeout(()=>{j(!1),_.current=null},800)}else j(!1)},[T]);i.useEffect(()=>{const v=setTimeout(()=>{const R=b.current;if(!R)return;const N=()=>{if(g)return;const K=R.getBoundingClientRect(),U=K.height;let $="",O=0;for(const[te,V]of Object.entries(T))if(V.current){const q=V.current.getBoundingClientRect(),Z=K.top,Q=q.top-Z,lt=q.bottom-Z,ct=q.height,dt=Math.max(0,Q),ut=Math.min(U,lt),we=Math.max(0,ut-dt)/ct,Ne=we+(Q<U*.3?.1:0);Ne>O&&we>.1&&(O=Ne,$=te)}$&&$!==x&&c($)};return N(),R.addEventListener("scroll",N,{passive:!0}),()=>{R.removeEventListener("scroll",N),clearTimeout(_.current??void 0)}},100);return()=>clearTimeout(v)},[T,x,g]),i.useEffect(()=>{const v=new URLSearchParams(S.search),R=v.get("section"),N=v.get("setting")?"backend":R,K=N?T[N]:void 0;if(!N||!K)return;let U=!1,$=Number.NaN,O=0;const te=window.setTimeout(()=>{U||(U=!0,q.disconnect(),Y(N))},2e3),V=()=>{if(U)return;const Z=K.current;if(!Z){O=requestAnimationFrame(V);return}const Q=Math.round(Z.getBoundingClientRect().top+window.scrollY);if(Q===$&&Q>0){U=!0,q.disconnect(),window.clearTimeout(te),Y(N);return}$=Q,O=requestAnimationFrame(V)},q=new ResizeObserver(()=>{U||(cancelAnimationFrame(O),O=requestAnimationFrame(V))});return b.current&&q.observe(b.current),O=requestAnimationFrame(V),()=>{U=!0,cancelAnimationFrame(O),q.disconnect(),window.clearTimeout(te)}},[S.search,T,Y]);const W=async(v,R)=>{m(v);try{await p.mutateAsync({[v]:R}),await u()}catch(N){console.error(`Error updating ${v}:`,N)}finally{m(null)}},be=n||f,ke=aa(be,4e3);return l?e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(P,{variant:"warning",className:"w-full max-w-xl",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:et("Your settings could not be loaded.",l)}),e.jsx(w,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void u(),disabled:a,children:a?"Retrying":"Retry"})]})})}):be?e.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[e.jsx(z,{size:"lg",label:ke?void 0:"Loading settings"}),ke&&e.jsx("p",{className:"max-w-sm text-center text-body-sm text-ink-muted",children:"The Local Operator server is taking longer than usual to answer. If it does not respond, you will be able to retry from here."})]}):s?e.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-canvas",children:[e.jsx("div",{className:"w-12 shrink-0 overflow-y-auto border-r border-hairline min-[1040px]:w-55",children:e.jsx(Gt,{activeSection:x,onSelectSection:Y,sections:Wt})}),e.jsx("div",{ref:b,"data-settings-content":!0,"data-tour-tag":"settings-general-section",className:"flex-1 overflow-y-auto overflow-x-hidden p-4 sm:p-6 md:p-8",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-8 pb-8",children:[e.jsx(ds,{title:"Settings",icon:Ee}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsxs("div",{ref:T.general,className:"flex flex-col gap-8",children:[e.jsx(L,{title:"User profile",icon:Zt,description:`Your user profile information displayed in the application. This information is not provided to the agents. ${r?"These details are provided through your Radient account.":""}`,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(_e,{value:d.profile.name,label:"Display name",placeholder:"Enter your name...",isSaving:h==="user_name",onSave:async v=>{m("user_name");try{d.updateName(v)}finally{m(null)}},readOnly:r}),e.jsx(_e,{value:d.profile.email,label:"Email address",placeholder:"Enter your email...",isSaving:h==="user_email",onSave:async v=>{m("user_email");try{d.updateEmail(v)}finally{m(null)}},readOnly:r})]})}),e.jsx(L,{title:"Application tour",description:"Missed the application onboarding tour or want a refresher? Start it again here.",children:e.jsxs(w,{variant:"secondary",onClick:()=>{M({forceModalCompleted:!0})},children:[e.jsx(Jt,{}),"Take the tour"]})}),e.jsx(L,{title:"Model settings",icon:Xt,description:"Configure the default AI model and hosting providers used for generating responses. This will be used for all agents that don't have a specific model or hosting provider configured. You can override these settings for individual agents in the agent settings.",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(es,{value:s.values.hosting,isSaving:h==="hosting",onSave:v=>W("hosting",v),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:"No hosting providers available. Add one in API credentials, in the list on the left."}),e.jsx(ts,{value:s.values.model_name,hostingId:s.values.hosting,isSaving:h==="model_name",onSave:v=>W("model_name",v),allowCustom:!0,allowDefault:!1}),e.jsx(P,{variant:"neutral",icon:e.jsx(me,{className:"size-4","aria-hidden":"true"}),children:"You need a Radient account or your own API keys to reach cloud providers. If you don't see more hosting providers and models here, add credentials or sign in to Radient."})]})}),e.jsx(fa,{}),e.jsx(L,{title:"History settings",icon:xs,description:"Configure how much conversation history is retained and displayed. These are tools to help balance cost and performance by controlling the amount of data used by the agents.",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(le,{value:s.values.conversation_length,label:"Maximum conversation history",description:"Number of messages to keep in conversation history for context. More messages will make the agents have longer memory but more expensive to run. Recommended: 100",min:10,max:500,step:10,unit:"msgs",icon:Ls,isSaving:h==="conversation_length",onChange:v=>W("conversation_length",v)}),e.jsx(le,{value:s.values.detail_length,label:"Detail view length",description:"Maximum number of messages to show in the detailed conversation view. Messages beyond this limit will be summarized. Shortening this will decrease costs but some important details could get lost from earlier messages. Recommended: 15",min:10,max:500,step:5,unit:"msgs",icon:ss,isSaving:h==="detail_length",onChange:v=>W("detail_length",v)}),e.jsx(le,{value:s.values.max_learnings_history,label:"Maximum learnings history",description:"Agents note down specific insights and key learnings in memory which persist beyond the maximum conversation history and summarization. This setting controls the maximum number of learning items to retain. More items will make the agents acquire a longer history of knowledge from your conversations but more expensive to run. Recommended: 50",min:10,max:200,step:10,unit:"notes",icon:as,isSaving:h==="max_learnings_history",onChange:v=>W("max_learnings_history",v)})]})}),e.jsx(L,{title:"Configuration information",icon:me,description:"System information about the current configuration.",children:e.jsxs(ye,{children:[e.jsx(I,{label:"Version",value:e.jsx("span",{className:"text-mono-sm",children:s.version})}),e.jsx(I,{label:"Created",value:nt(s.metadata.created_at)}),e.jsx(I,{label:"Last modified",value:rt(s.metadata.last_modified)}),e.jsx(I,{label:"Description",value:s.metadata.description||"No description available"})]})})]}),e.jsx(L,{title:"Appearance",icon:it,description:"Customize the look and feel of Local Operator",sectionRef:T.appearance,dataTourTag:"settings-appearance-section",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(ja,{}),e.jsx(Js,{value:t,label:"Show agent reasoning",description:"Adds the agent's Reasoning and Thinking rows to conversations. They stay closed until you open one.",onChange:async v=>o(v)})]})}),e.jsx(L,{title:"Radient account",titleComponent:e.jsx(Na,{}),description:"Manage your Radient account, Radient Pass details, and credits.",sectionRef:T.radient,dataTourTag:"settings-radient-account-section",children:e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx(pa,{onAfterCredentialUpdate:()=>{C(),E()}}),r&&e.jsxs(e.Fragment,{children:[e.jsx(ba,{}),e.jsx(wa,{})]})]})}),e.jsx(L,{title:"Providers",icon:ns,description:"Model providers, how you sign in to each, and which are connected.",sectionRef:T.providers,children:e.jsx(rs,{initialProviderId:oe})}),e.jsx(L,{title:"Backend settings",icon:Ee,description:"Every setting the backend registry owns, searchable, with typed editors and scopes.",sectionRef:T.backend,children:e.jsx(ua,{focusKey:ie,initialFilter:B})}),e.jsx(is,{sessionId:k??void 0,sectionRef:T.integrations,highlightServer:je}),e.jsx(L,{title:"API credentials",icon:ne,description:"Manage your API keys for various services and integrations",sectionRef:T.credentials,dataTourTag:"settings-api-credentials-section",children:e.jsx(ha,{})}),e.jsx("div",{ref:T.updates,children:e.jsx(oa,{})})]})]})})]}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(P,{variant:"warning",className:"w-full max-w-xl",children:"Your settings could not be loaded."})})};export{Ma as SettingsPage};
|