@plaso-infi/whiteboard-sdk 0.9.9-alpha1.1 → 0.9.10-alpha1.2

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.
Files changed (85) hide show
  1. package/dist/esm/arc-f453aa24-001bbdd5.js +1 -0
  2. package/dist/esm/blockDiagram-38ab4fdb-5054d111-916200b0.js +1 -0
  3. package/dist/esm/c4Diagram-3d4e48cf-5c418a03-d69b6a9c.js +1 -0
  4. package/dist/esm/channel-d0c23f49-f259a6d1.js +1 -0
  5. package/dist/esm/classDiagram-70f12bd4-491ee226-467aef5f.js +1 -0
  6. package/dist/esm/classDiagram-v2-f2320105-e90ceb2f-abf81ed0.js +1 -0
  7. package/dist/esm/clone-f55b0cc7-e67cd753.js +1 -0
  8. package/dist/esm/createText-2e5e7dd3-dcc34ae8-3c64ca2d.js +1 -0
  9. package/dist/esm/edges-e0da2a9e-8abaed90-a3e3f930.js +1 -0
  10. package/dist/esm/erDiagram-9861fffd-20c9cea5-06108c89.js +1 -0
  11. package/dist/esm/{flowDb-956e92f1-05858601-f0b0a431.js → flowDb-956e92f1-3b9320a7-67f62d02.js} +1 -1
  12. package/dist/esm/flowDiagram-66a62f08-08a6f0e7-acbc8998.js +1 -0
  13. package/dist/esm/flowDiagram-v2-96b9c2cf-6b10acd5-d6f5b177.js +1 -0
  14. package/dist/esm/flowchart-elk-definition-4a651766-e5b3ba00-a86e3534.js +1 -0
  15. package/dist/esm/ganttDiagram-c361ad54-be9f4bb3-9fd6d707.js +1 -0
  16. package/dist/esm/{gitGraphDiagram-72cf32ee-6962610d-ce66735c.js → gitGraphDiagram-72cf32ee-a0e338f3-fedb2c3a.js} +1 -1
  17. package/dist/esm/graph-afe27007-8e18cc75.js +1 -0
  18. package/dist/esm/hls-8060cc31-cbc4e4b4.js +1 -0
  19. package/dist/esm/{index-0c25c9f2.js → index-167f08a0.js} +10 -10
  20. package/dist/esm/index-3862675e-87ca6a66-f6d07d04.js +1 -0
  21. package/dist/esm/index-43b715ff-0a40eb86.js +7 -0
  22. package/dist/esm/index.css +27675 -31377
  23. package/dist/esm/index.d.ts +6 -143
  24. package/dist/esm/index.js +1 -1
  25. package/dist/esm/{infoDiagram-f8f76790-ff02a986-1c2bb5a5.js → infoDiagram-f8f76790-4379e779-22c1733f.js} +1 -1
  26. package/dist/esm/journeyDiagram-49397b02-2cca535b-67946860.js +1 -0
  27. package/dist/esm/layout-ae3a065f-6e640144.js +1 -0
  28. package/dist/esm/{line-8bf27c33-c9dee662.js → line-7161536c-1eab81ab.js} +1 -1
  29. package/dist/esm/linear-5dc481fe-05c0f51e.js +1 -0
  30. package/dist/esm/lottie-e933e82b-ded8d0d3.js +1 -0
  31. package/dist/esm/mindmap-definition-fc14e90a-5dcd2e6e-eef8a18b.js +9 -0
  32. package/dist/esm/{ordinal-9e8754c0-c9285688.js → ordinal-03018387-faf5bec3.js} +1 -1
  33. package/dist/esm/pdf_lib-55fc68be-7c552411.js +1 -0
  34. package/dist/esm/{pieDiagram-8a3498a8-95075175-f271e7e0.js → pieDiagram-8a3498a8-6c705dfb-ac29777a.js} +1 -1
  35. package/dist/esm/quadrantDiagram-120e2f19-ce717132-2ca6a80f.js +1 -0
  36. package/dist/esm/{requirementDiagram-deff3bca-29300a5c-74399573.js → requirementDiagram-deff3bca-94ff9b49-53ba3062.js} +1 -1
  37. package/dist/esm/sankeyDiagram-04a897e0-7f5565ac-73d22dce.js +1 -0
  38. package/dist/esm/sequenceDiagram-704730f1-65919a25-99547f7a.js +1 -0
  39. package/dist/esm/stateDiagram-587899a1-2d298c91-69f94d43.js +1 -0
  40. package/dist/esm/stateDiagram-v2-d93cdb3a-d0d0a3cb-c5f54ac0.js +1 -0
  41. package/dist/esm/{styles-6aaf32cf-27c06757-9924063a.js → styles-6aaf32cf-9dfc64a7-73ae2457.js} +1 -1
  42. package/dist/esm/{styles-9a916d00-db7a32f0-40cad9b3.js → styles-9a916d00-f70df3fd-82031337.js} +1 -1
  43. package/dist/esm/styles-c10674c1-9ccf4241-d16c7c7b.js +1 -0
  44. package/dist/esm/{svgDrawCommon-08f97a94-12aefbff-7bed41c9.js → svgDrawCommon-08f97a94-6a32c869-fc129345.js} +1 -1
  45. package/dist/esm/{timeline-definition-85554ec2-475c323b-17118daa.js → timeline-definition-85554ec2-0d0b57da-737d18f2.js} +1 -1
  46. package/dist/esm/web-pinyin-dbdcf553.js +1 -0
  47. package/dist/esm/xychartDiagram-e933f94c-d01b914a-f5a15a41.js +1 -0
  48. package/package.json +2 -6
  49. package/dist/esm/arc-0fffff1f-cb15888d.js +0 -1
  50. package/dist/esm/blockDiagram-38ab4fdb-b22c3166-94cafbe4.js +0 -1
  51. package/dist/esm/c4Diagram-3d4e48cf-ab3a2217-04f37a60.js +0 -1
  52. package/dist/esm/channel-ff3e58f7-441d1956.js +0 -1
  53. package/dist/esm/classDiagram-70f12bd4-b7cecb7d-02f67aec.js +0 -1
  54. package/dist/esm/classDiagram-v2-f2320105-88330ff5-f9e02a46.js +0 -1
  55. package/dist/esm/clone-e72fc4b8-e0d9c611.js +0 -1
  56. package/dist/esm/createText-2e5e7dd3-3d197991-1dc23da3.js +0 -1
  57. package/dist/esm/edges-e0da2a9e-fba3c3a7-06d257f8.js +0 -1
  58. package/dist/esm/erDiagram-9861fffd-3dedc17c-b3410b98.js +0 -1
  59. package/dist/esm/export_as_markdown-b48293a8-00bd7ea7.js +0 -1
  60. package/dist/esm/flowDiagram-66a62f08-b3c97779-70248993.js +0 -1
  61. package/dist/esm/flowDiagram-v2-96b9c2cf-58d3ab5f-20c5bbe1.js +0 -1
  62. package/dist/esm/flowchart-elk-definition-4a651766-4ec085d8-a42f0ee1.js +0 -1
  63. package/dist/esm/ganttDiagram-c361ad54-25aec23c-d8a3f436.js +0 -1
  64. package/dist/esm/graph-a2efb7be-713af9a6.js +0 -1
  65. package/dist/esm/hls-2930c8f9-d0274088.js +0 -1
  66. package/dist/esm/index-069d79ba-7af162da.js +0 -7
  67. package/dist/esm/index-3862675e-b2881445-8d90f1dc.js +0 -1
  68. package/dist/esm/journeyDiagram-49397b02-8ee31d6c-be9e21a6.js +0 -1
  69. package/dist/esm/layout-f41a9481-b65a914c.js +0 -1
  70. package/dist/esm/linear-bf7a4ead-aef02647.js +0 -1
  71. package/dist/esm/lottie-b2af09ef-63710b41.js +0 -1
  72. package/dist/esm/mindmap-definition-fc14e90a-5d304050-073c89e4.js +0 -9
  73. package/dist/esm/pdf_lib-759c3824-5535ffeb.js +0 -1
  74. package/dist/esm/quadrantDiagram-120e2f19-8bb878d9-47628e3e.js +0 -1
  75. package/dist/esm/sankeyDiagram-04a897e0-8e1ff3ae-7e61ab0d.js +0 -1
  76. package/dist/esm/sequenceDiagram-704730f1-6a89eb72-b6d29a75.js +0 -1
  77. package/dist/esm/stateDiagram-587899a1-615f787b-70f1fbc3.js +0 -1
  78. package/dist/esm/stateDiagram-v2-d93cdb3a-0da1e02b-9d5b2272.js +0 -1
  79. package/dist/esm/styles-c10674c1-3e724aac-5b3a371b.js +0 -1
  80. package/dist/esm/web-pinyin-cc77b789.js +0 -1
  81. package/dist/esm/xychartDiagram-e933f94c-43d0ec04-d4af0981.js +0 -1
  82. /package/dist/esm/{Tableau10-0d093dcf-a3138301.js → Tableau10-e8b1eccc-4cef513c.js} +0 -0
  83. /package/dist/esm/{array-75b204b6-7055adac.js → array-5c028890-e9486e2e.js} +0 -0
  84. /package/dist/esm/{init-7e0ff151-92a0ac09.js → init-426b8023-e9aac3aa.js} +0 -0
  85. /package/dist/esm/{path-5bb65086-3ae6d6fa.js → path-a3e377ce-ded30e71.js} +0 -0
@@ -1 +1 @@
1
- import{Y as t,r as e,D as i,P as n,A as s,M as r,N as a,R as l,u as o,F as c,i as h,Z as u,W as y,$ as p,E as f,a0 as g}from"./index-0c25c9f2.js";import{T as d}from"./arc-0fffff1f-cb15888d.js";import{u as m}from"./ordinal-9e8754c0-c9285688.js";import{r as _}from"./array-75b204b6-7055adac.js";import{_ as b}from"./path-5bb65086-3ae6d6fa.js";import"react";import"react-dom";import"stream";import"./init-7e0ff151-92a0ac09.js";function x(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function k(t){return t}var v=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,3],i=[1,4],n=[1,5],s=[1,6],r=[1,10,12,14,16,18,19,20,21,22],a=[2,4],l=[1,5,10,12,14,16,18,19,20,21,22],o=[20,21,22],c=[2,7],h=[1,12],u=[1,13],y=[1,14],p=[1,15],f=[1,16],g=[1,17],d={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,PIE:5,document:6,showData:7,line:8,statement:9,txt:10,value:11,title:12,title_value:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,section:19,NEWLINE:20,";":21,EOF:22,$accept:0,$end:1},terminals_:{2:"error",5:"PIE",7:"showData",10:"txt",11:"value",12:"title",13:"title_value",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"section",20:"NEWLINE",21:";",22:"EOF"},productions_:[0,[3,2],[3,2],[3,3],[6,0],[6,2],[8,2],[9,0],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[4,1],[4,1],[4,1]],performAction:function(t,e,i,n,s,r,a){var l=r.length-1;switch(s){case 3:n.setShowData(!0);break;case 6:this.$=r[l-1];break;case 8:n.addSection(r[l-1],n.cleanupValue(r[l]));break;case 9:this.$=r[l].trim(),n.setDiagramTitle(this.$);break;case 10:this.$=r[l].trim(),n.setAccTitle(this.$);break;case 11:case 12:this.$=r[l].trim(),n.setAccDescription(this.$);break;case 13:n.addSection(r[l].substr(8)),this.$=r[l].substr(8)}},table:[{3:1,4:2,5:e,20:i,21:n,22:s},{1:[3]},{3:7,4:2,5:e,20:i,21:n,22:s},t(r,a,{6:8,7:[1,9]}),t(l,[2,14]),t(l,[2,15]),t(l,[2,16]),{1:[2,1]},t(o,c,{8:10,9:11,1:[2,2],10:h,12:u,14:y,16:p,18:f,19:g}),t(r,a,{6:18}),t(r,[2,5]),{4:19,20:i,21:n,22:s},{11:[1,20]},{13:[1,21]},{15:[1,22]},{17:[1,23]},t(o,[2,12]),t(o,[2,13]),t(o,c,{8:10,9:11,1:[2,3],10:h,12:u,14:y,16:p,18:f,19:g}),t(r,[2,6]),t(o,[2,8]),t(o,[2,9]),t(o,[2,10]),t(o,[2,11])],defaultActions:{7:[2,1]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=[0],i=[],n=[null],s=[],r=this.table,a="",l=0,o=0,c=s.slice.call(arguments,1),h=Object.create(this.lexer),u={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(u.yy[y]=this.yy[y]);h.setInput(t,u.yy),u.yy.lexer=h,u.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var p=h.yylloc;s.push(p);var f=h.options&&h.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,d,m,_,b,x,k,v,S,w={};;){if(d=e[e.length-1],this.defaultActions[d]?m=this.defaultActions[d]:(null==g&&(S=void 0,"number"!=typeof(S=i.pop()||h.lex()||1)&&(S instanceof Array&&(S=(i=S).pop()),S=this.symbols_[S]||S),g=S),m=r[d]&&r[d][g]),void 0===m||!m.length||!m[0]){var $;for(b in v=[],r[d])this.terminals_[b]&&b>2&&v.push("'"+this.terminals_[b]+"'");$=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError($,{text:h.match,token:this.terminals_[g]||g,line:h.yylineno,loc:p,expected:v})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+d+", token: "+g);switch(m[0]){case 1:e.push(g),n.push(h.yytext),s.push(h.yylloc),e.push(m[1]),g=null,o=h.yyleng,a=h.yytext,l=h.yylineno,p=h.yylloc;break;case 2:if(x=this.productions_[m[1]][1],w.$=n[n.length-x],w._$={first_line:s[s.length-(x||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(x||1)].first_column,last_column:s[s.length-1].last_column},f&&(w._$.range=[s[s.length-(x||1)].range[0],s[s.length-1].range[1]]),void 0!==(_=this.performAction.apply(w,[a,o,l,u.yy,m[1],n,s].concat(c))))return _;x&&(e=e.slice(0,-1*x*2),n=n.slice(0,-1*x),s=s.slice(0,-1*x)),e.push(this.productions_[m[1]][0]),n.push(w.$),s.push(w._$),k=r[e[e.length-2]][e[e.length-1]],e.push(k);break;case 3:return!0}}return!0}},m={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.length-1);var s=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:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((i=this._input.match(this.rules[s[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,n){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 20;case 5:return this.begin("title"),12;case 6:return this.popState(),"title_value";case 7:return this.begin("acc_title"),14;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),16;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:case 15:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:this.begin("string");break;case 16:return"txt";case 17:return 5;case 18:return 7;case 19:return"value";case 20:return 22}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[6],inclusive:!1},string:{rules:[15,16],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,7,9,11,14,17,18,19,20],inclusive:!0}}};function _(){this.yy={}}return d.lexer=m,_.prototype=d,d.Parser=_,new _}();v.parser=v;const S=v,w=t.pie,$={},A=!1;let E=$,T=A;const I=structuredClone(w),O=t=>{const e=Object.entries(t).map(t=>({label:t[0],value:t[1]})).sort((t,e)=>e.value-t.value),i=function(){var t=k,e=x,i=null,n=b(0),s=b(g),r=b(0);function a(a){var l,o,c,h,u,y=(a=_(a)).length,p=0,f=new Array(y),d=new Array(y),m=+n.apply(this,arguments),b=Math.min(g,Math.max(-g,s.apply(this,arguments)-m)),x=Math.min(Math.abs(b)/y,r.apply(this,arguments)),k=x*(b<0?-1:1);for(l=0;l<y;++l)(u=d[f[l]=l]=+t(a[l],l,a))>0&&(p+=u);for(null!=e?f.sort(function(t,i){return e(d[t],d[i])}):null!=i&&f.sort(function(t,e){return i(a[t],a[e])}),l=0,c=p?(b-y*k)/p:0;l<y;++l,m=h)o=f[l],h=m+((u=d[o])>0?u*c:0)+k,d[o]={data:a[o],index:l,value:u,startAngle:m,endAngle:h,padAngle:x};return d}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:b(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,i=null,a):e},a.sort=function(t){return arguments.length?(i=t,e=null,a):i},a.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:b(+t),a):n},a.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:b(+t),a):s},a.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:b(+t),a):r},a}().value(t=>t.value);return i(e)},D={parser:S,db:{getConfig:()=>structuredClone(I),clear:()=>{E=structuredClone($),T=A,e()},setDiagramTitle:i,getDiagramTitle:n,setAccTitle:s,getAccTitle:r,setAccDescription:a,getAccDescription:l,addSection:(t,e)=>{t=o(t,c()),void 0===E[t]&&(E[t]=e,h.debug(`added new section: ${t}, with value: ${e}`))},getSections:()=>E,cleanupValue:t=>(":"===t.substring(0,1)&&(t=t.substring(1).trim()),Number(t.trim())),setShowData:t=>{T=t},getShowData:()=>T},renderer:{draw:(t,e,i,n)=>{h.debug("rendering pie chart\n"+t);const s=n.db,r=c(),a=u(s.getConfig(),r.pie),l=y(e),o=l.append("g"),g=s.getSections();o.attr("transform","translate(225,225)");const{themeVariables:_}=r;let[b]=p(_.pieOuterStrokeWidth);b??(b=2);const x=a.textPosition,k=Math.min(450,450)/2-40,v=d().innerRadius(0).outerRadius(k),S=d().innerRadius(k*x).outerRadius(k*x);o.append("circle").attr("cx",0).attr("cy",0).attr("r",k+b/2).attr("class","pieOuterCircle");const w=O(g),$=[_.pie1,_.pie2,_.pie3,_.pie4,_.pie5,_.pie6,_.pie7,_.pie8,_.pie9,_.pie10,_.pie11,_.pie12],A=m($);o.selectAll("mySlices").data(w).enter().append("path").attr("d",v).attr("fill",t=>A(t.data.label)).attr("class","pieCircle");let E=0;Object.keys(g).forEach(t=>{E+=g[t]}),o.selectAll("mySlices").data(w).enter().append("text").text(t=>(t.data.value/E*100).toFixed(0)+"%").attr("transform",t=>"translate("+S.centroid(t)+")").style("text-anchor","middle").attr("class","slice"),o.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const T=o.selectAll(".legend").data(A.domain()).enter().append("g").attr("class","legend").attr("transform",(t,e)=>"translate(216,"+(22*e-22*A.domain().length/2)+")");T.append("rect").attr("width",18).attr("height",18).style("fill",A).style("stroke",A),T.data(w).append("text").attr("x",22).attr("y",14).text(t=>{const{label:e,value:i}=t.data;return s.getShowData()?`${e} [${i}]`:e});const I=512+Math.max(...T.selectAll("text").nodes().map(t=>(null==t?void 0:t.getBoundingClientRect().width)??0));l.attr("viewBox",`0 0 ${I} 450`),f(l,450,I,a.useMaxWidth)}},styles:t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`};export{D as diagram};
1
+ import{P as t,Q as e,t as i,o as n,X as s,$ as r,J as a,e as l,R as o,a as c,b as h,Y as u,M as y,Z as p,V as f,a0 as g}from"./index-167f08a0.js";import{b as d}from"./arc-f453aa24-001bbdd5.js";import{u as m}from"./ordinal-03018387-faf5bec3.js";import{r as _}from"./array-5c028890-e9486e2e.js";import{_ as x}from"./path-a3e377ce-ded30e71.js";import"react";import"react-dom";import"stream";import"./init-426b8023-e9aac3aa.js";function b(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function k(t){return t}var v=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,3],i=[1,4],n=[1,5],s=[1,6],r=[1,10,12,14,16,18,19,20,21,22],a=[2,4],l=[1,5,10,12,14,16,18,19,20,21,22],o=[20,21,22],c=[2,7],h=[1,12],u=[1,13],y=[1,14],p=[1,15],f=[1,16],g=[1,17],d={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,PIE:5,document:6,showData:7,line:8,statement:9,txt:10,value:11,title:12,title_value:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,section:19,NEWLINE:20,";":21,EOF:22,$accept:0,$end:1},terminals_:{2:"error",5:"PIE",7:"showData",10:"txt",11:"value",12:"title",13:"title_value",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"section",20:"NEWLINE",21:";",22:"EOF"},productions_:[0,[3,2],[3,2],[3,3],[6,0],[6,2],[8,2],[9,0],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[4,1],[4,1],[4,1]],performAction:function(t,e,i,n,s,r,a){var l=r.length-1;switch(s){case 3:n.setShowData(!0);break;case 6:this.$=r[l-1];break;case 8:n.addSection(r[l-1],n.cleanupValue(r[l]));break;case 9:this.$=r[l].trim(),n.setDiagramTitle(this.$);break;case 10:this.$=r[l].trim(),n.setAccTitle(this.$);break;case 11:case 12:this.$=r[l].trim(),n.setAccDescription(this.$);break;case 13:n.addSection(r[l].substr(8)),this.$=r[l].substr(8)}},table:[{3:1,4:2,5:e,20:i,21:n,22:s},{1:[3]},{3:7,4:2,5:e,20:i,21:n,22:s},t(r,a,{6:8,7:[1,9]}),t(l,[2,14]),t(l,[2,15]),t(l,[2,16]),{1:[2,1]},t(o,c,{8:10,9:11,1:[2,2],10:h,12:u,14:y,16:p,18:f,19:g}),t(r,a,{6:18}),t(r,[2,5]),{4:19,20:i,21:n,22:s},{11:[1,20]},{13:[1,21]},{15:[1,22]},{17:[1,23]},t(o,[2,12]),t(o,[2,13]),t(o,c,{8:10,9:11,1:[2,3],10:h,12:u,14:y,16:p,18:f,19:g}),t(r,[2,6]),t(o,[2,8]),t(o,[2,9]),t(o,[2,10]),t(o,[2,11])],defaultActions:{7:[2,1]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=[0],i=[],n=[null],s=[],r=this.table,a="",l=0,o=0,c=s.slice.call(arguments,1),h=Object.create(this.lexer),u={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(u.yy[y]=this.yy[y]);h.setInput(t,u.yy),u.yy.lexer=h,u.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var p=h.yylloc;s.push(p);var f=h.options&&h.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,d,m,_,x,b,k,v,S,w={};;){if(d=e[e.length-1],this.defaultActions[d]?m=this.defaultActions[d]:(null==g&&(S=void 0,"number"!=typeof(S=i.pop()||h.lex()||1)&&(S instanceof Array&&(S=(i=S).pop()),S=this.symbols_[S]||S),g=S),m=r[d]&&r[d][g]),void 0===m||!m.length||!m[0]){var $;for(x in v=[],r[d])this.terminals_[x]&&x>2&&v.push("'"+this.terminals_[x]+"'");$=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError($,{text:h.match,token:this.terminals_[g]||g,line:h.yylineno,loc:p,expected:v})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+d+", token: "+g);switch(m[0]){case 1:e.push(g),n.push(h.yytext),s.push(h.yylloc),e.push(m[1]),g=null,o=h.yyleng,a=h.yytext,l=h.yylineno,p=h.yylloc;break;case 2:if(b=this.productions_[m[1]][1],w.$=n[n.length-b],w._$={first_line:s[s.length-(b||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(b||1)].first_column,last_column:s[s.length-1].last_column},f&&(w._$.range=[s[s.length-(b||1)].range[0],s[s.length-1].range[1]]),void 0!==(_=this.performAction.apply(w,[a,o,l,u.yy,m[1],n,s].concat(c))))return _;b&&(e=e.slice(0,-1*b*2),n=n.slice(0,-1*b),s=s.slice(0,-1*b)),e.push(this.productions_[m[1]][0]),n.push(w.$),s.push(w._$),k=r[e[e.length-2]][e[e.length-1]],e.push(k);break;case 3:return!0}}return!0}},m={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.length-1);var s=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:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((i=this._input.match(this.rules[s[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,n){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 20;case 5:return this.begin("title"),12;case 6:return this.popState(),"title_value";case 7:return this.begin("acc_title"),14;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),16;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:case 15:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:this.begin("string");break;case 16:return"txt";case 17:return 5;case 18:return 7;case 19:return"value";case 20:return 22}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[6],inclusive:!1},string:{rules:[15,16],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,7,9,11,14,17,18,19,20],inclusive:!0}}};function _(){this.yy={}}return d.lexer=m,_.prototype=d,d.Parser=_,new _}();v.parser=v;const S=v,w=t.pie,$={},A=!1;let E=$,T=A;const I=structuredClone(w),O=t=>{const e=Object.entries(t).map((t=>({label:t[0],value:t[1]}))).sort(((t,e)=>e.value-t.value)),i=function(){var t=k,e=b,i=null,n=x(0),s=x(g),r=x(0);function a(a){var l,o,c,h,u,y=(a=_(a)).length,p=0,f=new Array(y),d=new Array(y),m=+n.apply(this,arguments),x=Math.min(g,Math.max(-g,s.apply(this,arguments)-m)),b=Math.min(Math.abs(x)/y,r.apply(this,arguments)),k=b*(x<0?-1:1);for(l=0;l<y;++l)(u=d[f[l]=l]=+t(a[l],l,a))>0&&(p+=u);for(null!=e?f.sort((function(t,i){return e(d[t],d[i])})):null!=i&&f.sort((function(t,e){return i(a[t],a[e])})),l=0,c=p?(x-y*k)/p:0;l<y;++l,m=h)o=f[l],h=m+((u=d[o])>0?u*c:0)+k,d[o]={data:a[o],index:l,value:u,startAngle:m,endAngle:h,padAngle:b};return d}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:x(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,i=null,a):e},a.sort=function(t){return arguments.length?(i=t,e=null,a):i},a.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:x(+t),a):n},a.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:x(+t),a):s},a.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:x(+t),a):r},a}().value((t=>t.value));return i(e)},D={parser:S,db:{getConfig:()=>structuredClone(I),clear:()=>{E=structuredClone($),T=A,e()},setDiagramTitle:i,getDiagramTitle:n,setAccTitle:s,getAccTitle:r,setAccDescription:a,getAccDescription:l,addSection:(t,e)=>{t=o(t,c()),void 0===E[t]&&(E[t]=e,h.debug(`added new section: ${t}, with value: ${e}`))},getSections:()=>E,cleanupValue:t=>(":"===t.substring(0,1)&&(t=t.substring(1).trim()),Number(t.trim())),setShowData:t=>{T=t},getShowData:()=>T},renderer:{draw:(t,e,i,n)=>{h.debug("rendering pie chart\n"+t);const s=n.db,r=c(),a=u(s.getConfig(),r.pie),l=y(e),o=l.append("g"),g=s.getSections();o.attr("transform","translate(225,225)");const{themeVariables:_}=r;let[x]=p(_.pieOuterStrokeWidth);x??(x=2);const b=a.textPosition,k=Math.min(450,450)/2-40,v=d().innerRadius(0).outerRadius(k),S=d().innerRadius(k*b).outerRadius(k*b);o.append("circle").attr("cx",0).attr("cy",0).attr("r",k+x/2).attr("class","pieOuterCircle");const w=O(g),$=[_.pie1,_.pie2,_.pie3,_.pie4,_.pie5,_.pie6,_.pie7,_.pie8,_.pie9,_.pie10,_.pie11,_.pie12],A=m($);o.selectAll("mySlices").data(w).enter().append("path").attr("d",v).attr("fill",(t=>A(t.data.label))).attr("class","pieCircle");let E=0;Object.keys(g).forEach((t=>{E+=g[t]})),o.selectAll("mySlices").data(w).enter().append("text").text((t=>(t.data.value/E*100).toFixed(0)+"%")).attr("transform",(t=>"translate("+S.centroid(t)+")")).style("text-anchor","middle").attr("class","slice"),o.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const T=o.selectAll(".legend").data(A.domain()).enter().append("g").attr("class","legend").attr("transform",((t,e)=>"translate(216,"+(22*e-22*A.domain().length/2)+")"));T.append("rect").attr("width",18).attr("height",18).style("fill",A).style("stroke",A),T.data(w).append("text").attr("x",22).attr("y",14).text((t=>{const{label:e,value:i}=t.data;return s.getShowData()?`${e} [${i}]`:e}));const I=512+Math.max(...T.selectAll("text").nodes().map((t=>(null==t?void 0:t.getBoundingClientRect().width)??0)));l.attr("viewBox",`0 0 ${I} 450`),f(l,450,I,a.useMaxWidth)}},styles:t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`};export{D as diagram};
@@ -0,0 +1 @@
1
+ import{a1 as t,a as i,P as e,b as a,o as n,Q as r,X as s,$ as l,t as o,e as h,J as c,z as d,V as u,R as x}from"./index-167f08a0.js";import{J as g}from"./linear-5dc481fe-05c0f51e.js";import"react";import"react-dom";import"stream";import"./init-426b8023-e9aac3aa.js";var f=function(){var t=function(t,i,e,a){for(e=e||{},a=t.length;a--;e[t[a]]=i);return e},i=[1,3],e=[1,4],a=[1,5],n=[1,6],r=[1,7],s=[1,5,13,15,17,19,20,25,27,28,29,30,31,32,33,34,37,38,40,41,42,43,44,45,46,47,48,49,50],l=[1,5,6,13,15,17,19,20,25,27,28,29,30,31,32,33,34,37,38,40,41,42,43,44,45,46,47,48,49,50],o=[32,33,34],h=[2,7],c=[1,13],d=[1,17],u=[1,18],x=[1,19],g=[1,20],f=[1,21],y=[1,22],p=[1,23],q=[1,24],T=[1,25],m=[1,26],A=[1,27],_=[1,30],b=[1,31],S=[1,32],F=[1,33],k=[1,34],P=[1,35],v=[1,36],L=[1,37],C=[1,38],z=[1,39],E=[1,40],D=[1,41],I=[1,42],B=[1,57],R=[1,58],w=[5,22,26,32,33,34,40,41,42,43,44,45,46,47,48,49,50,51],W={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,SPACE:5,QUADRANT:6,document:7,line:8,statement:9,axisDetails:10,quadrantDetails:11,points:12,title:13,title_value:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,text:21,point_start:22,point_x:23,point_y:24,"X-AXIS":25,"AXIS-TEXT-DELIMITER":26,"Y-AXIS":27,QUADRANT_1:28,QUADRANT_2:29,QUADRANT_3:30,QUADRANT_4:31,NEWLINE:32,SEMI:33,EOF:34,alphaNumToken:35,textNoTagsToken:36,STR:37,MD_STR:38,alphaNum:39,PUNCTUATION:40,AMP:41,NUM:42,ALPHA:43,COMMA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,UNDERSCORE:50,MINUS:51,$accept:0,$end:1},terminals_:{2:"error",5:"SPACE",6:"QUADRANT",13:"title",14:"title_value",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",22:"point_start",23:"point_x",24:"point_y",25:"X-AXIS",26:"AXIS-TEXT-DELIMITER",27:"Y-AXIS",28:"QUADRANT_1",29:"QUADRANT_2",30:"QUADRANT_3",31:"QUADRANT_4",32:"NEWLINE",33:"SEMI",34:"EOF",37:"STR",38:"MD_STR",40:"PUNCTUATION",41:"AMP",42:"NUM",43:"ALPHA",44:"COMMA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"UNDERSCORE",51:"MINUS"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[9,0],[9,2],[9,1],[9,1],[9,1],[9,2],[9,2],[9,2],[9,1],[9,1],[12,4],[10,4],[10,3],[10,2],[10,4],[10,3],[10,2],[11,2],[11,2],[11,2],[11,2],[4,1],[4,1],[4,1],[21,1],[21,2],[21,1],[21,1],[39,1],[39,2],[35,1],[35,1],[35,1],[35,1],[35,1],[35,1],[35,1],[35,1],[35,1],[35,1],[35,1],[36,1],[36,1],[36,1]],performAction:function(t,i,e,a,n,r,s){var l=r.length-1;switch(n){case 12:this.$=r[l].trim(),a.setDiagramTitle(this.$);break;case 13:this.$=r[l].trim(),a.setAccTitle(this.$);break;case 14:case 15:this.$=r[l].trim(),a.setAccDescription(this.$);break;case 16:a.addSection(r[l].substr(8)),this.$=r[l].substr(8);break;case 17:a.addPoint(r[l-3],r[l-1],r[l]);break;case 18:a.setXAxisLeftText(r[l-2]),a.setXAxisRightText(r[l]);break;case 19:r[l-1].text+=" ⟶ ",a.setXAxisLeftText(r[l-1]);break;case 20:a.setXAxisLeftText(r[l]);break;case 21:a.setYAxisBottomText(r[l-2]),a.setYAxisTopText(r[l]);break;case 22:r[l-1].text+=" ⟶ ",a.setYAxisBottomText(r[l-1]);break;case 23:a.setYAxisBottomText(r[l]);break;case 24:a.setQuadrant1Text(r[l]);break;case 25:a.setQuadrant2Text(r[l]);break;case 26:a.setQuadrant3Text(r[l]);break;case 27:a.setQuadrant4Text(r[l]);break;case 31:case 33:this.$={text:r[l],type:"text"};break;case 32:this.$={text:r[l-1].text+""+r[l],type:r[l-1].type};break;case 34:this.$={text:r[l],type:"markdown"};break;case 35:this.$=r[l];break;case 36:this.$=r[l-1]+""+r[l]}},table:[{3:1,4:2,5:i,6:e,32:a,33:n,34:r},{1:[3]},{3:8,4:2,5:i,6:e,32:a,33:n,34:r},{3:9,4:2,5:i,6:e,32:a,33:n,34:r},t(s,[2,4],{7:10}),t(l,[2,28]),t(l,[2,29]),t(l,[2,30]),{1:[2,1]},{1:[2,2]},t(o,h,{8:11,9:12,10:14,11:15,12:16,21:28,35:29,1:[2,3],5:c,13:d,15:u,17:x,19:g,20:f,25:y,27:p,28:q,29:T,30:m,31:A,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I}),t(s,[2,5]),{4:43,32:a,33:n,34:r},t(o,h,{10:14,11:15,12:16,21:28,35:29,9:44,5:c,13:d,15:u,17:x,19:g,20:f,25:y,27:p,28:q,29:T,30:m,31:A,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I}),t(o,[2,9]),t(o,[2,10]),t(o,[2,11]),{14:[1,45]},{16:[1,46]},{18:[1,47]},t(o,[2,15]),t(o,[2,16]),{21:48,35:29,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I},{21:49,35:29,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I},{21:50,35:29,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I},{21:51,35:29,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I},{21:52,35:29,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I},{21:53,35:29,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I},{5:B,22:[1,54],35:56,36:55,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R},t(w,[2,31]),t(w,[2,33]),t(w,[2,34]),t(w,[2,37]),t(w,[2,38]),t(w,[2,39]),t(w,[2,40]),t(w,[2,41]),t(w,[2,42]),t(w,[2,43]),t(w,[2,44]),t(w,[2,45]),t(w,[2,46]),t(w,[2,47]),t(s,[2,6]),t(o,[2,8]),t(o,[2,12]),t(o,[2,13]),t(o,[2,14]),t(o,[2,20],{36:55,35:56,5:B,26:[1,59],40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),t(o,[2,23],{36:55,35:56,5:B,26:[1,60],40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),t(o,[2,24],{36:55,35:56,5:B,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),t(o,[2,25],{36:55,35:56,5:B,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),t(o,[2,26],{36:55,35:56,5:B,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),t(o,[2,27],{36:55,35:56,5:B,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),{23:[1,61]},t(w,[2,32]),t(w,[2,48]),t(w,[2,49]),t(w,[2,50]),t(o,[2,19],{35:29,21:62,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I}),t(o,[2,22],{35:29,21:63,37:_,38:b,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I}),{24:[1,64]},t(o,[2,18],{36:55,35:56,5:B,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),t(o,[2,21],{36:55,35:56,5:B,40:S,41:F,42:k,43:P,44:v,45:L,46:C,47:z,48:E,49:D,50:I,51:R}),t(o,[2,17])],defaultActions:{8:[2,1],9:[2,2]},parseError:function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)},parse:function(t){var i=[0],e=[],a=[null],n=[],r=this.table,s="",l=0,o=0,h=n.slice.call(arguments,1),c=Object.create(this.lexer),d={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(d.yy[u]=this.yy[u]);c.setInput(t,d.yy),d.yy.lexer=c,d.yy.parser=this,void 0===c.yylloc&&(c.yylloc={});var x=c.yylloc;n.push(x);var g=c.options&&c.options.ranges;"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,y,p,q,T,m,A,_,b,S={};;){if(y=i[i.length-1],this.defaultActions[y]?p=this.defaultActions[y]:(null==f&&(b=void 0,"number"!=typeof(b=e.pop()||c.lex()||1)&&(b instanceof Array&&(b=(e=b).pop()),b=this.symbols_[b]||b),f=b),p=r[y]&&r[y][f]),void 0===p||!p.length||!p[0]){var F;for(T in _=[],r[y])this.terminals_[T]&&T>2&&_.push("'"+this.terminals_[T]+"'");F=c.showPosition?"Parse error on line "+(l+1)+":\n"+c.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(F,{text:c.match,token:this.terminals_[f]||f,line:c.yylineno,loc:x,expected:_})}if(p[0]instanceof Array&&p.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+f);switch(p[0]){case 1:i.push(f),a.push(c.yytext),n.push(c.yylloc),i.push(p[1]),f=null,o=c.yyleng,s=c.yytext,l=c.yylineno,x=c.yylloc;break;case 2:if(m=this.productions_[p[1]][1],S.$=a[a.length-m],S._$={first_line:n[n.length-(m||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(m||1)].first_column,last_column:n[n.length-1].last_column},g&&(S._$.range=[n[n.length-(m||1)].range[0],n[n.length-1].range[1]]),void 0!==(q=this.performAction.apply(S,[s,o,l,d.yy,p[1],a,n].concat(h))))return q;m&&(i=i.slice(0,-1*m*2),a=a.slice(0,-1*m),n=n.slice(0,-1*m)),i.push(this.productions_[p[1]][0]),a.push(S.$),n.push(S._$),A=r[i[i.length-2]][i[i.length-1]],i.push(A);break;case 3:return!0}}return!0}},N={EOF:1,parseError:function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},setInput:function(t,i){return this.yy=i||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var a=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),e.length-1&&(this.yylineno-=e.length-1);var n=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:e?(e.length===a.length?this.yylloc.first_column:0)+a[a.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},test_match:function(t,i){var e,a,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,i,e,a;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((e=this._input.match(this.rules[n[r]]))&&(!i||e[0].length>i[0].length)){if(i=e,a=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,n[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,n[a]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,i,e,a){switch(e){case 0:case 1:case 3:break;case 2:return 32;case 4:return this.begin("title"),13;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),15;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),17;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 22:case 24:case 28:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 25;case 14:return 27;case 15:return 26;case 16:return 28;case 17:return 29;case 18:return 30;case 19:return 31;case 20:this.begin("md_string");break;case 21:return"MD_STR";case 23:this.begin("string");break;case 25:return"STR";case 26:return this.begin("point_start"),22;case 27:return this.begin("point_x"),23;case 29:this.popState(),this.begin("point_y");break;case 30:return this.popState(),24;case 31:return 6;case 32:return 43;case 33:return"COLON";case 34:return 45;case 35:return 44;case 36:case 37:return 46;case 38:return 47;case 39:return 49;case 40:return 50;case 41:return 48;case 42:return 41;case 43:return 51;case 44:return 42;case 45:return 5;case 46:return 33;case 47:return 40;case 48:return 34}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{point_y:{rules:[30],inclusive:!1},point_x:{rules:[29],inclusive:!1},point_start:{rules:[27,28],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[21,22],inclusive:!1},string:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,23,26,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],inclusive:!0}}};function U(){this.yy={}}return W.lexer=N,U.prototype=W,W.Parser=U,new U}();f.parser=f;const y=f,p=t(),q=i();function T(t){return x(t.trim(),q)}const m=new class{constructor(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var t,i,a,n,r,s,l,o,h,c,d,u,x,g,f,y,p,q;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:(null==(t=e.quadrantChart)?void 0:t.chartWidth)||500,chartWidth:(null==(i=e.quadrantChart)?void 0:i.chartHeight)||500,titlePadding:(null==(a=e.quadrantChart)?void 0:a.titlePadding)||10,titleFontSize:(null==(n=e.quadrantChart)?void 0:n.titleFontSize)||20,quadrantPadding:(null==(r=e.quadrantChart)?void 0:r.quadrantPadding)||5,xAxisLabelPadding:(null==(s=e.quadrantChart)?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:(null==(l=e.quadrantChart)?void 0:l.yAxisLabelPadding)||5,xAxisLabelFontSize:(null==(o=e.quadrantChart)?void 0:o.xAxisLabelFontSize)||16,yAxisLabelFontSize:(null==(h=e.quadrantChart)?void 0:h.yAxisLabelFontSize)||16,quadrantLabelFontSize:(null==(c=e.quadrantChart)?void 0:c.quadrantLabelFontSize)||16,quadrantTextTopPadding:(null==(d=e.quadrantChart)?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:(null==(u=e.quadrantChart)?void 0:u.pointTextPadding)||5,pointLabelFontSize:(null==(x=e.quadrantChart)?void 0:x.pointLabelFontSize)||12,pointRadius:(null==(g=e.quadrantChart)?void 0:g.pointRadius)||5,xAxisPosition:(null==(f=e.quadrantChart)?void 0:f.xAxisPosition)||"top",yAxisPosition:(null==(y=e.quadrantChart)?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:(null==(p=e.quadrantChart)?void 0:p.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:(null==(q=e.quadrantChart)?void 0:q.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:p.quadrant1Fill,quadrant2Fill:p.quadrant2Fill,quadrant3Fill:p.quadrant3Fill,quadrant4Fill:p.quadrant4Fill,quadrant1TextFill:p.quadrant1TextFill,quadrant2TextFill:p.quadrant2TextFill,quadrant3TextFill:p.quadrant3TextFill,quadrant4TextFill:p.quadrant4TextFill,quadrantPointFill:p.quadrantPointFill,quadrantPointTextFill:p.quadrantPointTextFill,quadrantXAxisTextFill:p.quadrantXAxisTextFill,quadrantYAxisTextFill:p.quadrantYAxisTextFill,quadrantTitleFill:p.quadrantTitleFill,quadrantInternalBorderStrokeFill:p.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:p.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),a.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}setConfig(t){a.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){a.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,i,e,a){const n=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,r={top:"top"===t&&i?n:0,bottom:"bottom"===t&&i?n:0},s=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,l={left:"left"===this.config.yAxisPosition&&e?s:0,right:"right"===this.config.yAxisPosition&&e?s:0},o=this.config.titleFontSize+2*this.config.titlePadding,h={top:a?o:0},c=this.config.quadrantPadding+l.left,d=this.config.quadrantPadding+r.top+h.top,u=this.config.chartWidth-2*this.config.quadrantPadding-l.left-l.right,x=this.config.chartHeight-2*this.config.quadrantPadding-r.top-r.bottom-h.top;return{xAxisSpace:r,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:c,quadrantTop:d,quadrantWidth:u,quadrantHalfWidth:u/2,quadrantHeight:x,quadrantHalfHeight:x/2}}}getAxisLabels(t,i,e,a){const{quadrantSpace:n,titleSpace:r}=a,{quadrantHalfHeight:s,quadrantHeight:l,quadrantLeft:o,quadrantHalfWidth:h,quadrantTop:c,quadrantWidth:d}=n,u=Boolean(this.data.xAxisRightText),x=Boolean(this.data.yAxisTopText),g=[];return this.data.xAxisLeftText&&i&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:o+(u?h/2:0),y:"top"===t?this.config.xAxisLabelPadding+r.top:this.config.xAxisLabelPadding+c+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:u?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&i&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:o+h+(u?h/2:0),y:"top"===t?this.config.xAxisLabelPadding+r.top:this.config.xAxisLabelPadding+c+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:u?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&e&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+o+d+this.config.quadrantPadding,y:c+l-(x?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&e&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+o+d+this.config.quadrantPadding,y:c+s-(x?s/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(t){const{quadrantSpace:i}=t,{quadrantHalfHeight:e,quadrantLeft:a,quadrantHalfWidth:n,quadrantTop:r}=i,s=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:a+n,y:r,width:n,height:e,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:a,y:r,width:n,height:e,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:a,y:r+e,width:n,height:e,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:a+n,y:r+e,width:n,height:e,fill:this.themeConfig.quadrant4Fill}];for(const t of s)t.text.x=t.x+t.width/2,0===this.data.points.length?(t.text.y=t.y+t.height/2,t.text.horizontalPos="middle"):(t.text.y=t.y+this.config.quadrantTextTopPadding,t.text.horizontalPos="top");return s}getQuadrantPoints(t){const{quadrantSpace:i}=t,{quadrantHeight:e,quadrantLeft:a,quadrantTop:n,quadrantWidth:r}=i,s=g().domain([0,1]).range([a,r+a]),l=g().domain([0,1]).range([e+n,n]);return this.data.points.map((t=>({x:s(t.x),y:l(t.y),fill:this.themeConfig.quadrantPointFill,radius:this.config.pointRadius,text:{text:t.text,fill:this.themeConfig.quadrantPointTextFill,x:s(t.x),y:l(t.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0}})))}getBorders(t){const i=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:e}=t,{quadrantHalfHeight:a,quadrantHeight:n,quadrantLeft:r,quadrantHalfWidth:s,quadrantTop:l,quadrantWidth:o}=e;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:r-i,y1:l,x2:r+o+i,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:r+o,y1:l+i,x2:r+o,y2:l+n-i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:r-i,y1:l+n,x2:r+o+i,y2:l+n},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:r,y1:l+i,x2:r,y2:l+n-i},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:r+s,y1:l+i,x2:r+s,y2:l+n-i},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:r+i,y1:l+a,x2:r+o-i,y2:l+a}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!(!this.data.xAxisLeftText&&!this.data.xAxisRightText),i=this.config.showYAxis&&!(!this.data.yAxisTopText&&!this.data.yAxisBottomText),e=this.config.showTitle&&!!this.data.titleText,a=this.data.points.length>0?"bottom":this.config.xAxisPosition,n=this.calculateSpace(a,t,i,e);return{points:this.getQuadrantPoints(n),quadrants:this.getQuadrants(n),axisLabels:this.getAxisLabels(a,t,i,n),borderLines:this.getBorders(n),title:this.getTitle(e)}}},A={parser:y,db:{setWidth:function(t){m.setConfig({chartWidth:t})},setHeight:function(t){m.setConfig({chartHeight:t})},setQuadrant1Text:function(t){m.setData({quadrant1Text:T(t.text)})},setQuadrant2Text:function(t){m.setData({quadrant2Text:T(t.text)})},setQuadrant3Text:function(t){m.setData({quadrant3Text:T(t.text)})},setQuadrant4Text:function(t){m.setData({quadrant4Text:T(t.text)})},setXAxisLeftText:function(t){m.setData({xAxisLeftText:T(t.text)})},setXAxisRightText:function(t){m.setData({xAxisRightText:T(t.text)})},setYAxisTopText:function(t){m.setData({yAxisTopText:T(t.text)})},setYAxisBottomText:function(t){m.setData({yAxisBottomText:T(t.text)})},addPoint:function(t,i,e){m.addPoints([{x:i,y:e,text:T(t.text)}])},getQuadrantData:function(){const t=i(),{themeVariables:e,quadrantChart:a}=t;return a&&m.setConfig(a),m.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),m.setData({titleText:n()}),m.build()},clear:function(){m.clear(),r()},setAccTitle:s,getAccTitle:l,setDiagramTitle:o,getDiagramTitle:n,getAccDescription:h,setAccDescription:c},renderer:{draw:(t,e,n,r)=>{var s,l,o;function h(t){return"top"===t?"hanging":"middle"}function c(t){return"left"===t?"start":"middle"}function x(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}const g=i();a.debug("Rendering quadrant chart\n"+t);const f=g.securityLevel;let y;"sandbox"===f&&(y=d("#i"+e));const p=d("sandbox"===f?y.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),q=p.append("g").attr("class","main"),T=(null==(s=g.quadrantChart)?void 0:s.chartWidth)||500,m=(null==(l=g.quadrantChart)?void 0:l.chartHeight)||500;u(p,m,T,(null==(o=g.quadrantChart)?void 0:o.useMaxWidth)||!0),p.attr("viewBox","0 0 "+T+" "+m),r.db.setHeight(m),r.db.setWidth(T);const A=r.db.getQuadrantData(),_=q.append("g").attr("class","quadrants"),b=q.append("g").attr("class","border"),S=q.append("g").attr("class","data-points"),F=q.append("g").attr("class","labels"),k=q.append("g").attr("class","title");A.title&&k.append("text").attr("x",0).attr("y",0).attr("fill",A.title.fill).attr("font-size",A.title.fontSize).attr("dominant-baseline",h(A.title.horizontalPos)).attr("text-anchor",c(A.title.verticalPos)).attr("transform",x(A.title)).text(A.title.text),A.borderLines&&b.selectAll("line").data(A.borderLines).enter().append("line").attr("x1",(t=>t.x1)).attr("y1",(t=>t.y1)).attr("x2",(t=>t.x2)).attr("y2",(t=>t.y2)).style("stroke",(t=>t.strokeFill)).style("stroke-width",(t=>t.strokeWidth));const P=_.selectAll("g.quadrant").data(A.quadrants).enter().append("g").attr("class","quadrant");P.append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)),P.append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>h(t.text.horizontalPos))).attr("text-anchor",(t=>c(t.text.verticalPos))).attr("transform",(t=>x(t.text))).text((t=>t.text.text)),F.selectAll("g.label").data(A.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text((t=>t.text)).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>h(t.horizontalPos))).attr("text-anchor",(t=>c(t.verticalPos))).attr("transform",(t=>x(t)));const v=S.selectAll("g.data-point").data(A.points).enter().append("g").attr("class","data-point");v.append("circle").attr("cx",(t=>t.x)).attr("cy",(t=>t.y)).attr("r",(t=>t.radius)).attr("fill",(t=>t.fill)),v.append("text").attr("x",0).attr("y",0).text((t=>t.text.text)).attr("fill",(t=>t.text.fill)).attr("font-size",(t=>t.text.fontSize)).attr("dominant-baseline",(t=>h(t.text.horizontalPos))).attr("text-anchor",(t=>c(t.text.verticalPos))).attr("transform",(t=>x(t.text)))}},styles:()=>""};export{A as diagram};
@@ -1 +1 @@
1
- import{F as t,A as e,M as i,N as n,R as r,i as s,r as a,v as o,E as l,a as c}from"./index-0c25c9f2.js";import{N as h}from"./graph-a2efb7be-713af9a6.js";import{V as u}from"./layout-f41a9481-b65a914c.js";import{f as y}from"./line-8bf27c33-c9dee662.js";import"react";import"react-dom";import"stream";import"./array-75b204b6-7055adac.js";import"./path-5bb65086-3ae6d6fa.js";var d=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,3],i=[1,4],n=[1,5],r=[1,6],s=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],a=[1,18],o=[2,7],l=[1,22],c=[1,23],h=[1,24],u=[1,25],y=[1,26],d=[1,27],p=[1,20],_=[1,28],E=[1,29],g=[62,63],m=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],R=[1,47],f=[1,48],I=[1,49],b=[1,50],S=[1,51],T=[1,52],k=[1,53],N=[53,54],x=[1,64],A=[1,60],v=[1,61],q=[1,62],$=[1,63],O=[1,65],w=[1,69],C=[1,70],L=[1,67],F=[1,68],M=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],D={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:function(t,e,i,n,r,s,a){var o=s.length-1;switch(r){case 4:this.$=s[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=s[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:n.addRequirement(s[o-3],s[o-4]);break;case 14:n.setNewReqId(s[o-2]);break;case 15:n.setNewReqText(s[o-2]);break;case 16:n.setNewReqRisk(s[o-2]);break;case 17:n.setNewReqVerifyMethod(s[o-2]);break;case 20:this.$=n.RequirementType.REQUIREMENT;break;case 21:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=n.RiskLevel.LOW_RISK;break;case 27:this.$=n.RiskLevel.MED_RISK;break;case 28:this.$=n.RiskLevel.HIGH_RISK;break;case 29:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=n.VerifyType.VERIFY_TEST;break;case 33:n.addElement(s[o-3]);break;case 34:n.setNewElementType(s[o-2]);break;case 35:n.setNewElementDocRef(s[o-2]);break;case 38:n.addRelationship(s[o-2],s[o],s[o-4]);break;case 39:n.addRelationship(s[o-2],s[o-4],s[o]);break;case 40:this.$=n.Relationships.CONTAINS;break;case 41:this.$=n.Relationships.COPIES;break;case 42:this.$=n.Relationships.DERIVES;break;case 43:this.$=n.Relationships.SATISFIES;break;case 44:this.$=n.Relationships.VERIFIES;break;case 45:this.$=n.Relationships.REFINES;break;case 46:this.$=n.Relationships.TRACES}},table:[{3:1,4:2,6:e,9:i,11:n,13:r},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:i,11:n,13:r},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(s,[2,6]),{3:12,4:2,6:e,9:i,11:n,13:r},{1:[2,2]},{4:17,5:a,7:13,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},t(s,[2,4]),t(s,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:a,7:31,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:32,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:33,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:34,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:35,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},t(g,[2,20]),t(g,[2,21]),t(g,[2,22]),t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),t(m,[2,49]),t(m,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:R,56:f,57:I,58:b,59:S,60:T,61:k},{52:54,55:R,56:f,57:I,58:b,59:S,60:T,61:k},{5:[1,55]},{5:[1,56]},{53:[1,57]},t(N,[2,40]),t(N,[2,41]),t(N,[2,42]),t(N,[2,43]),t(N,[2,44]),t(N,[2,45]),t(N,[2,46]),{54:[1,58]},{5:x,20:59,21:A,24:v,26:q,28:$,30:O},{5:w,30:C,46:66,47:L,49:F},{23:71,62:_,63:E},{23:72,62:_,63:E},t(M,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:x,20:77,21:A,24:v,26:q,28:$,30:O},t(M,[2,19]),t(M,[2,33]),{22:[1,78]},{22:[1,79]},{5:w,30:C,46:80,47:L,49:F},t(M,[2,37]),t(M,[2,38]),t(M,[2,39]),{23:81,62:_,63:E},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},t(M,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},t(M,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:x,20:106,21:A,24:v,26:q,28:$,30:O},{5:x,20:107,21:A,24:v,26:q,28:$,30:O},{5:x,20:108,21:A,24:v,26:q,28:$,30:O},{5:x,20:109,21:A,24:v,26:q,28:$,30:O},{5:w,30:C,46:110,47:L,49:F},{5:w,30:C,46:111,47:L,49:F},t(M,[2,14]),t(M,[2,15]),t(M,[2,16]),t(M,[2,17]),t(M,[2,34]),t(M,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=[0],i=[],n=[null],r=[],s=this.table,a="",o=0,l=0,c=r.slice.call(arguments,1),h=Object.create(this.lexer),u={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(u.yy[y]=this.yy[y]);h.setInput(t,u.yy),u.yy.lexer=h,u.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var d=h.yylloc;r.push(d);var p=h.options&&h.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,E,g,m,R,f,I,b,S,T={};;){if(E=e[e.length-1],this.defaultActions[E]?g=this.defaultActions[E]:(null==_&&(S=void 0,"number"!=typeof(S=i.pop()||h.lex()||1)&&(S instanceof Array&&(S=(i=S).pop()),S=this.symbols_[S]||S),_=S),g=s[E]&&s[E][_]),void 0===g||!g.length||!g[0]){var k;for(R in b=[],s[E])this.terminals_[R]&&R>2&&b.push("'"+this.terminals_[R]+"'");k=h.showPosition?"Parse error on line "+(o+1)+":\n"+h.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(k,{text:h.match,token:this.terminals_[_]||_,line:h.yylineno,loc:d,expected:b})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+_);switch(g[0]){case 1:e.push(_),n.push(h.yytext),r.push(h.yylloc),e.push(g[1]),_=null,l=h.yyleng,a=h.yytext,o=h.yylineno,d=h.yylloc;break;case 2:if(f=this.productions_[g[1]][1],T.$=n[n.length-f],T._$={first_line:r[r.length-(f||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(f||1)].first_column,last_column:r[r.length-1].last_column},p&&(T._$.range=[r[r.length-(f||1)].range[0],r[r.length-1].range[1]]),void 0!==(m=this.performAction.apply(T,[a,l,o,u.yy,g[1],n,r].concat(c))))return m;f&&(e=e.slice(0,-1*f*2),n=n.slice(0,-1*f),r=r.slice(0,-1*f)),e.push(this.productions_[g[1]][0]),n.push(T.$),r.push(T._$),I=s[e[e.length-2]][e[e.length-1]],e.push(I);break;case 3:return!0}}return!0}},P={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.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:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((i=this._input.match(this.rules[r[s]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,n){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}},rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,50],inclusive:!0}}};function V(){this.yy={}}return D.lexer=P,V.prototype=D,D.Parser=V,new V}();d.parser=d;let p=[],_={},E={},g={},m={};const R={CONTAINS:"contains",ARROW:"arrow"},f=R,I=(t,e)=>{let i=t.append("defs").append("marker").attr("id",R.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",R.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)};let b={},S=0;const T=(t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",b.rect_min_width+"px").attr("height",b.rect_min_height+"px"),k=(t,e,i)=>{let n=b.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",b.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach(t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",b.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",b.rect_min_width/2).attr("dy",.75*b.line_height).text(t),s++});let a=1.5*b.rect_padding+s*b.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",b.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}},N=(t,e,i,n)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",b.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0,a=[];return i.forEach(t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0}),a.forEach(t=>{r.append("tspan").attr("x",b.rect_padding).attr("dy",b.line_height).text(t)}),r},x=function(t,e,i,n,r){const s=i.edge(A(e.src),A(e.dst)),a=y().x(function(t){return t.x}).y(function(t){return t.y}),o=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+c.getUrl(b.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+c.getUrl(b.arrowMarkerAbsolute)+"#"+f.ARROW+"_line_ending)")),((t,e,i,n)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+S;S++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")})(t,o,0,`<<${e.type}>>`)},A=t=>t.replace(/\s/g,"").replace(/\./g,"_"),v={parser:d,db:{RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:()=>t().req,addRequirement:(t,e)=>(void 0===E[t]&&(E[t]={name:t,type:e,id:_.id,text:_.text,risk:_.risk,verifyMethod:_.verifyMethod}),_={},E[t]),getRequirements:()=>E,setNewReqId:t=>{void 0!==_&&(_.id=t)},setNewReqText:t=>{void 0!==_&&(_.text=t)},setNewReqRisk:t=>{void 0!==_&&(_.risk=t)},setNewReqVerifyMethod:t=>{void 0!==_&&(_.verifyMethod=t)},setAccTitle:e,getAccTitle:i,setAccDescription:n,getAccDescription:r,addElement:t=>(void 0===m[t]&&(m[t]={name:t,type:g.type,docRef:g.docRef},s.info("Added new requirement: ",t)),g={},m[t]),getElements:()=>m,setNewElementType:t=>{void 0!==g&&(g.type=t)},setNewElementDocRef:t=>{void 0!==g&&(g.docRef=t)},addRelationship:(t,e,i)=>{p.push({type:t,src:e,dst:i})},getRelationships:()=>p,clear:()=>{p=[],_={},E={},g={},m={},a()}},renderer:{draw:(e,i,n,r)=>{b=t().requirement;const a=b.securityLevel;let c;"sandbox"===a&&(c=o("#i"+i));const y=o("sandbox"===a?c.nodes()[0].contentDocument.body:"body").select(`[id='${i}']`);I(y,b);const d=new h({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:b.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});let p=r.db.getRequirements(),_=r.db.getElements(),E=r.db.getRelationships();var g,m,R;g=p,m=d,R=y,Object.keys(g).forEach(t=>{let e=g[t];t=A(t),s.info("Added new requirement: ",t);const i=R.append("g").attr("id",t),n=T(i,"req-"+t);let r=k(i,t+"_title",[`<<${e.type}>>`,`${e.name}`]);N(i,t+"_body",[`Id: ${e.id}`,`Text: ${e.text}`,`Risk: ${e.risk}`,`Verification: ${e.verifyMethod}`],r.y);const a=n.node().getBBox();m.setNode(t,{width:a.width,height:a.height,shape:"rect",id:t})}),((t,e,i)=>{Object.keys(t).forEach(n=>{let r=t[n];const s=A(n),a=i.append("g").attr("id",s),o="element-"+s,l=T(a,o);let c=k(a,o+"_title",["<<Element>>",`${n}`]);N(a,o+"_body",[`Type: ${r.type||"Not Specified"}`,`Doc Ref: ${r.docRef||"None"}`],c.y);const h=l.node().getBBox();e.setNode(s,{width:h.width,height:h.height,shape:"rect",id:s})})})(_,d,y),((t,e)=>{t.forEach(function(t){let i=A(t.src),n=A(t.dst);e.setEdge(i,n,{relationship:t})})})(E,d),u(d),function(t,e){e.nodes().forEach(function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))})}(y,d),E.forEach(function(t){x(y,t,d,i,r)});const f=b.rect_padding,S=y.node().getBBox(),v=S.width+2*f,q=S.height+2*f;l(y,q,v,b.useMaxWidth),y.attr("viewBox",`${S.x-f} ${S.y-f} ${v} ${q}`)}},styles:t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`};export{v as diagram};
1
+ import{a as t,X as e,$ as i,J as n,e as r,b as s,Q as a,z as o,V as l,j as c}from"./index-167f08a0.js";import{N as h}from"./graph-afe27007-8e18cc75.js";import{V as u}from"./layout-ae3a065f-6e640144.js";import{f as y}from"./line-7161536c-1eab81ab.js";import"react";import"react-dom";import"stream";import"./array-5c028890-e9486e2e.js";import"./path-a3e377ce-ded30e71.js";var d=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,3],i=[1,4],n=[1,5],r=[1,6],s=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],a=[1,18],o=[2,7],l=[1,22],c=[1,23],h=[1,24],u=[1,25],y=[1,26],d=[1,27],p=[1,20],_=[1,28],E=[1,29],g=[62,63],m=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],R=[1,47],f=[1,48],I=[1,49],b=[1,50],S=[1,51],T=[1,52],k=[1,53],N=[53,54],x=[1,64],A=[1,60],v=[1,61],$=[1,62],q=[1,63],O=[1,65],w=[1,69],C=[1,70],L=[1,67],F=[1,68],M=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],D={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:function(t,e,i,n,r,s,a){var o=s.length-1;switch(r){case 4:this.$=s[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=s[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:n.addRequirement(s[o-3],s[o-4]);break;case 14:n.setNewReqId(s[o-2]);break;case 15:n.setNewReqText(s[o-2]);break;case 16:n.setNewReqRisk(s[o-2]);break;case 17:n.setNewReqVerifyMethod(s[o-2]);break;case 20:this.$=n.RequirementType.REQUIREMENT;break;case 21:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=n.RiskLevel.LOW_RISK;break;case 27:this.$=n.RiskLevel.MED_RISK;break;case 28:this.$=n.RiskLevel.HIGH_RISK;break;case 29:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=n.VerifyType.VERIFY_TEST;break;case 33:n.addElement(s[o-3]);break;case 34:n.setNewElementType(s[o-2]);break;case 35:n.setNewElementDocRef(s[o-2]);break;case 38:n.addRelationship(s[o-2],s[o],s[o-4]);break;case 39:n.addRelationship(s[o-2],s[o-4],s[o]);break;case 40:this.$=n.Relationships.CONTAINS;break;case 41:this.$=n.Relationships.COPIES;break;case 42:this.$=n.Relationships.DERIVES;break;case 43:this.$=n.Relationships.SATISFIES;break;case 44:this.$=n.Relationships.VERIFIES;break;case 45:this.$=n.Relationships.REFINES;break;case 46:this.$=n.Relationships.TRACES}},table:[{3:1,4:2,6:e,9:i,11:n,13:r},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:i,11:n,13:r},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(s,[2,6]),{3:12,4:2,6:e,9:i,11:n,13:r},{1:[2,2]},{4:17,5:a,7:13,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},t(s,[2,4]),t(s,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:a,7:31,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:32,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:33,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:34,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{4:17,5:a,7:35,8:o,9:i,11:n,13:r,14:14,15:15,16:16,17:19,23:21,31:l,32:c,33:h,34:u,35:y,36:d,44:p,62:_,63:E},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},t(g,[2,20]),t(g,[2,21]),t(g,[2,22]),t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),t(m,[2,49]),t(m,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:R,56:f,57:I,58:b,59:S,60:T,61:k},{52:54,55:R,56:f,57:I,58:b,59:S,60:T,61:k},{5:[1,55]},{5:[1,56]},{53:[1,57]},t(N,[2,40]),t(N,[2,41]),t(N,[2,42]),t(N,[2,43]),t(N,[2,44]),t(N,[2,45]),t(N,[2,46]),{54:[1,58]},{5:x,20:59,21:A,24:v,26:$,28:q,30:O},{5:w,30:C,46:66,47:L,49:F},{23:71,62:_,63:E},{23:72,62:_,63:E},t(M,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:x,20:77,21:A,24:v,26:$,28:q,30:O},t(M,[2,19]),t(M,[2,33]),{22:[1,78]},{22:[1,79]},{5:w,30:C,46:80,47:L,49:F},t(M,[2,37]),t(M,[2,38]),t(M,[2,39]),{23:81,62:_,63:E},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},t(M,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},t(M,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:x,20:106,21:A,24:v,26:$,28:q,30:O},{5:x,20:107,21:A,24:v,26:$,28:q,30:O},{5:x,20:108,21:A,24:v,26:$,28:q,30:O},{5:x,20:109,21:A,24:v,26:$,28:q,30:O},{5:w,30:C,46:110,47:L,49:F},{5:w,30:C,46:111,47:L,49:F},t(M,[2,14]),t(M,[2,15]),t(M,[2,16]),t(M,[2,17]),t(M,[2,34]),t(M,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=[0],i=[],n=[null],r=[],s=this.table,a="",o=0,l=0,c=r.slice.call(arguments,1),h=Object.create(this.lexer),u={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(u.yy[y]=this.yy[y]);h.setInput(t,u.yy),u.yy.lexer=h,u.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var d=h.yylloc;r.push(d);var p=h.options&&h.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,E,g,m,R,f,I,b,S,T={};;){if(E=e[e.length-1],this.defaultActions[E]?g=this.defaultActions[E]:(null==_&&(S=void 0,"number"!=typeof(S=i.pop()||h.lex()||1)&&(S instanceof Array&&(S=(i=S).pop()),S=this.symbols_[S]||S),_=S),g=s[E]&&s[E][_]),void 0===g||!g.length||!g[0]){var k;for(R in b=[],s[E])this.terminals_[R]&&R>2&&b.push("'"+this.terminals_[R]+"'");k=h.showPosition?"Parse error on line "+(o+1)+":\n"+h.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(k,{text:h.match,token:this.terminals_[_]||_,line:h.yylineno,loc:d,expected:b})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+_);switch(g[0]){case 1:e.push(_),n.push(h.yytext),r.push(h.yylloc),e.push(g[1]),_=null,l=h.yyleng,a=h.yytext,o=h.yylineno,d=h.yylloc;break;case 2:if(f=this.productions_[g[1]][1],T.$=n[n.length-f],T._$={first_line:r[r.length-(f||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(f||1)].first_column,last_column:r[r.length-1].last_column},p&&(T._$.range=[r[r.length-(f||1)].range[0],r[r.length-1].range[1]]),void 0!==(m=this.performAction.apply(T,[a,l,o,u.yy,g[1],n,r].concat(c))))return m;f&&(e=e.slice(0,-1*f*2),n=n.slice(0,-1*f),r=r.slice(0,-1*f)),e.push(this.productions_[g[1]][0]),n.push(T.$),r.push(T._$),I=s[e[e.length-2]][e[e.length-1]],e.push(I);break;case 3:return!0}}return!0}},P={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.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:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((i=this._input.match(this.rules[r[s]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,i,n){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}},rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,50],inclusive:!0}}};function V(){this.yy={}}return D.lexer=P,V.prototype=D,D.Parser=V,new V}();d.parser=d;let p=[],_={},E={},g={},m={};const R={CONTAINS:"contains",ARROW:"arrow"},f=R,I=(t,e)=>{let i=t.append("defs").append("marker").attr("id",R.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",R.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)};let b={},S=0;const T=(t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",b.rect_min_width+"px").attr("height",b.rect_min_height+"px"),k=(t,e,i)=>{let n=b.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",b.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach((t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",b.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",b.rect_min_width/2).attr("dy",.75*b.line_height).text(t),s++}));let a=1.5*b.rect_padding+s*b.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",b.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}},N=(t,e,i,n)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",b.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0,a=[];return i.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{r.append("tspan").attr("x",b.rect_padding).attr("dy",b.line_height).text(t)})),r},x=function(t,e,i,n,r){const s=i.edge(A(e.src),A(e.dst)),a=y().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+c.getUrl(b.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+c.getUrl(b.arrowMarkerAbsolute)+"#"+f.ARROW+"_line_ending)")),((t,e,i,n)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+S;S++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")})(t,o,0,`<<${e.type}>>`)},A=t=>t.replace(/\s/g,"").replace(/\./g,"_"),v={parser:d,db:{RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:()=>t().req,addRequirement:(t,e)=>(void 0===E[t]&&(E[t]={name:t,type:e,id:_.id,text:_.text,risk:_.risk,verifyMethod:_.verifyMethod}),_={},E[t]),getRequirements:()=>E,setNewReqId:t=>{void 0!==_&&(_.id=t)},setNewReqText:t=>{void 0!==_&&(_.text=t)},setNewReqRisk:t=>{void 0!==_&&(_.risk=t)},setNewReqVerifyMethod:t=>{void 0!==_&&(_.verifyMethod=t)},setAccTitle:e,getAccTitle:i,setAccDescription:n,getAccDescription:r,addElement:t=>(void 0===m[t]&&(m[t]={name:t,type:g.type,docRef:g.docRef},s.info("Added new requirement: ",t)),g={},m[t]),getElements:()=>m,setNewElementType:t=>{void 0!==g&&(g.type=t)},setNewElementDocRef:t=>{void 0!==g&&(g.docRef=t)},addRelationship:(t,e,i)=>{p.push({type:t,src:e,dst:i})},getRelationships:()=>p,clear:()=>{p=[],_={},E={},g={},m={},a()}},renderer:{draw:(e,i,n,r)=>{b=t().requirement;const a=b.securityLevel;let c;"sandbox"===a&&(c=o("#i"+i));const y=o("sandbox"===a?c.nodes()[0].contentDocument.body:"body").select(`[id='${i}']`);I(y,b);const d=new h({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:b.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let p=r.db.getRequirements(),_=r.db.getElements(),E=r.db.getRelationships();var g,m,R;g=p,m=d,R=y,Object.keys(g).forEach((t=>{let e=g[t];t=A(t),s.info("Added new requirement: ",t);const i=R.append("g").attr("id",t),n=T(i,"req-"+t);let r=k(i,t+"_title",[`<<${e.type}>>`,`${e.name}`]);N(i,t+"_body",[`Id: ${e.id}`,`Text: ${e.text}`,`Risk: ${e.risk}`,`Verification: ${e.verifyMethod}`],r.y);const a=n.node().getBBox();m.setNode(t,{width:a.width,height:a.height,shape:"rect",id:t})})),((t,e,i)=>{Object.keys(t).forEach((n=>{let r=t[n];const s=A(n),a=i.append("g").attr("id",s),o="element-"+s,l=T(a,o);let c=k(a,o+"_title",["<<Element>>",`${n}`]);N(a,o+"_body",[`Type: ${r.type||"Not Specified"}`,`Doc Ref: ${r.docRef||"None"}`],c.y);const h=l.node().getBBox();e.setNode(s,{width:h.width,height:h.height,shape:"rect",id:s})}))})(_,d,y),((t,e)=>{t.forEach((function(t){let i=A(t.src),n=A(t.dst);e.setEdge(i,n,{relationship:t})}))})(E,d),u(d),function(t,e){e.nodes().forEach((function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))}))}(y,d),E.forEach((function(t){x(y,t,d,i,r)}));const f=b.rect_padding,S=y.node().getBBox(),v=S.width+2*f,$=S.height+2*f;l(y,$,v,b.useMaxWidth),y.attr("viewBox",`${S.x-f} ${S.y-f} ${v} ${$}`)}},styles:t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`};export{v as diagram};
@@ -0,0 +1 @@
1
+ import{a as t,j as n,$ as e,X as i,e as s,J as r,o,t as l,Q as c,aJ as a,z as h,W as u}from"./index-167f08a0.js";import{a as f}from"./Tableau10-e8b1eccc-4cef513c.js";import{u as y}from"./ordinal-03018387-faf5bec3.js";import"react";import"react-dom";import"stream";import"./init-426b8023-e9aac3aa.js";function d(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e<s||void 0===e&&s>=s)&&(e=s)}return e}function p(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e>s||void 0===e&&s>=s)&&(e=s)}return e}function g(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let s of t)(s=+n(s,++i,t))&&(e+=s)}return e}function _(t){return t.target.depth}function m(t,n){return t.sourceLinks.length?t.depth:n-1}function x(t){return function(){return t}}function k(t,n){return b(t.source,n.source)||t.index-n.index}function v(t,n){return b(t.target,n.target)||t.index-n.index}function b(t,n){return t.y0-n.y0}function w(t){return t.value}function E(t){return t.index}function L(t){return t.nodes}function A(t){return t.links}function S(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function M({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function I(){let t,n,e,i=0,s=0,r=1,o=1,l=24,c=8,a=E,h=m,u=L,f=A,y=6;function _(){const _={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map(((n,e)=>[a(n,e,t),n])));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:s}=e;"object"!=typeof n&&(n=e.source=S(i,n)),"object"!=typeof s&&(s=e.target=S(i,s)),n.sourceLinks.push(e),s.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(_),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(g(n.sourceLinks,w),g(n.targetLinks,w)):n.fixedValue}(_),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.depth=s;for(const{target:n}of t.sourceLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(_),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.height=s;for(const{source:n}of t.targetLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(_),function(e){const a=function({nodes:t}){const e=d(t,(t=>t.depth))+1,s=(r-i-l)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*s,n.x1=n.x0+l,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(c,(o-s)/(d(a,(t=>t.length))-1)),function(n){const e=p(n,(n=>(o-s-(n.length-1)*t)/g(n,w)));for(const i of n){let n=s;for(const s of i){s.y0=n,s.y1=n+s.value*e,n=s.y1+t;for(const t of s.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}j(i)}}(a);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);T(a,n,e),I(a,n,e)}}(_),M(_),_}function I(t,e,i){for(let s=1,r=t.length;s<r;++s){const r=t[s];for(const t of r){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=N(e,t)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,$(t)}void 0===n&&r.sort(b),O(r,i)}}function T(t,e,i){for(let s=t.length-2;s>=0;--s){const r=t[s];for(const t of r){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=C(t,e)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,$(t)}void 0===n&&r.sort(b),O(r,i)}}function O(n,e){const i=n.length>>1,r=n[i];P(n,r.y0-t,i-1,e),D(n,r.y1+t,i+1,e),P(n,o,n.length-1,e),D(n,s,0,e)}function D(n,e,i,s){for(;i<n.length;++i){const r=n[i],o=(e-r.y0)*s;o>1e-6&&(r.y0+=o,r.y1+=o),e=r.y1+t}}function P(n,e,i,s){for(;i>=0;--i){const r=n[i],o=(r.y1-e)*s;o>1e-6&&(r.y0-=o,r.y1-=o),e=r.y0-t}}function $({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(v);for(const{target:{targetLinks:n}}of t)n.sort(k)}}function j(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(v),e.sort(k)}function N(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:s,width:r}of n.sourceLinks){if(s===e)break;i+=r+t}for(const{source:t,width:s}of e.targetLinks){if(t===n)break;i-=s}return i}function C(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:s,width:r}of e.targetLinks){if(s===n)break;i+=r+t}for(const{target:t,width:s}of n.sourceLinks){if(t===e)break;i-=s}return i}return _.update=function(t){return M(t),t},_.nodeId=function(t){return arguments.length?(a="function"==typeof t?t:x(t),_):a},_.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:x(t),_):h},_.nodeSort=function(t){return arguments.length?(n=t,_):n},_.nodeWidth=function(t){return arguments.length?(l=+t,_):l},_.nodePadding=function(n){return arguments.length?(c=t=+n,_):c},_.nodes=function(t){return arguments.length?(u="function"==typeof t?t:x(t),_):u},_.links=function(t){return arguments.length?(f="function"==typeof t?t:x(t),_):f},_.linkSort=function(t){return arguments.length?(e=t,_):e},_.size=function(t){return arguments.length?(i=s=0,r=+t[0],o=+t[1],_):[r-i,o-s]},_.extent=function(t){return arguments.length?(i=+t[0][0],r=+t[1][0],s=+t[0][1],o=+t[1][1],_):[[i,s],[r,o]]},_.iterations=function(t){return arguments.length?(y=+t,_):y},_}var T=Math.PI,O=2*T,D=1e-6,P=O-D;function $(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function j(){return new $}function N(t){return function(){return t}}function C(t){return t[0]}function z(t){return t[1]}$.prototype=j.prototype={constructor:$,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,s,r){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+s)+","+(this._y1=+r)},arcTo:function(t,n,e,i,s){t=+t,n=+n,e=+e,i=+i,s=+s;var r=this._x1,o=this._y1,l=e-t,c=i-n,a=r-t,h=o-n,u=a*a+h*h;if(s<0)throw new Error("negative radius: "+s);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>D)if(Math.abs(h*l-c*a)>D&&s){var f=e-r,y=i-o,d=l*l+c*c,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=s*Math.tan((T-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>D&&(this._+="L"+(t+x*a)+","+(n+x*h)),this._+="A"+s+","+s+",0,0,"+ +(h*f>a*y)+","+(this._x1=t+k*l)+","+(this._y1=n+k*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,i,s,r){t=+t,n=+n,r=!!r;var o=(e=+e)*Math.cos(i),l=e*Math.sin(i),c=t+o,a=n+l,h=1^r,u=r?i-s:s-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+a:(Math.abs(this._x1-c)>D||Math.abs(this._y1-a)>D)&&(this._+="L"+c+","+a),e&&(u<0&&(u=u%O+O),u>P?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-l)+"A"+e+","+e+",0,1,"+h+","+(this._x1=c)+","+(this._y1=a):u>D&&(this._+="A"+e+","+e+",0,"+ +(u>=T)+","+h+","+(this._x1=t+e*Math.cos(s))+","+(this._y1=n+e*Math.sin(s))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var W=Array.prototype.slice;function F(t){return t.source}function U(t){return t.target}function X(t,n,e,i,s){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,s,i,s)}function G(t){return[t.source.x1,t.y0]}function Q(t){return[t.target.x0,t.y1]}var V=function(){var t=function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},n=[1,9],e=[1,10],i=[1,5,10,12],s={trace:function(){},yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:function(t,n,e,i,s,r,o){var l=r.length-1;switch(s){case 7:const t=i.findOrCreateNode(r[l-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(r[l-2].trim().replaceAll('""','"')),e=parseFloat(r[l].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=r[l];break;case 10:this.$=r[l-1]}},table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},parse:function(t){var n=[0],e=[],i=[null],s=[],r=this.table,o="",l=0,c=0,a=s.slice.call(arguments,1),h=Object.create(this.lexer),u={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(u.yy[f]=this.yy[f]);h.setInput(t,u.yy),u.yy.lexer=h,u.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var y=h.yylloc;s.push(y);var d=h.options&&h.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var p,g,_,m,x,k,v,b,w,E={};;){if(g=n[n.length-1],this.defaultActions[g]?_=this.defaultActions[g]:(null==p&&(w=void 0,"number"!=typeof(w=e.pop()||h.lex()||1)&&(w instanceof Array&&(w=(e=w).pop()),w=this.symbols_[w]||w),p=w),_=r[g]&&r[g][p]),void 0===_||!_.length||!_[0]){var L;for(x in b=[],r[g])this.terminals_[x]&&x>2&&b.push("'"+this.terminals_[x]+"'");L=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[p]||p)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(L,{text:h.match,token:this.terminals_[p]||p,line:h.yylineno,loc:y,expected:b})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+p);switch(_[0]){case 1:n.push(p),i.push(h.yytext),s.push(h.yylloc),n.push(_[1]),p=null,c=h.yyleng,o=h.yytext,l=h.yylineno,y=h.yylloc;break;case 2:if(k=this.productions_[_[1]][1],E.$=i[i.length-k],E._$={first_line:s[s.length-(k||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(k||1)].first_column,last_column:s[s.length-1].last_column},d&&(E._$.range=[s[s.length-(k||1)].range[0],s[s.length-1].range[1]]),void 0!==(m=this.performAction.apply(E,[o,c,l,u.yy,_[1],i,s].concat(a))))return m;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),s=s.slice(0,-1*k)),n.push(this.productions_[_[1]][0]),i.push(E.$),s.push(E._$),v=r[n[n.length-2]][n[n.length-1]],n.push(v);break;case 3:return!0}}return!0}},r={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=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),e.length-1&&(this.yylineno-=e.length-1);var s=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:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},test_match:function(t,n){var e,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((e=this._input.match(this.rules[s[r]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,s[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,n,e,i){switch(e){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}},rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};function o(){this.yy={}}return s.lexer=r,o.prototype=s,s.Parser=o,new o}();V.parser=V;const q=V;let J=[],Y=[],B={};class K{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}}class R{constructor(t){this.ID=t}}const Z={nodesMap:B,getConfig:()=>t().sankey,getNodes:()=>Y,getLinks:()=>J,getGraph:()=>({nodes:Y.map((t=>({id:t.ID}))),links:J.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))}),addLink:(t,n,e)=>{J.push(new K(t,n,e))},findOrCreateNode:e=>(e=n.sanitizeText(e,t()),B[e]||(B[e]=new R(e),Y.push(B[e])),B[e]),getAccTitle:e,setAccTitle:i,getAccDescription:s,setAccDescription:r,getDiagramTitle:o,setDiagramTitle:l,clear:()=>{J=[],Y=[],B={},c()}},H=class t{static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}};H.count=0;let tt=H;const nt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?p(t.sourceLinks,_)-1:0},justify:m},et={draw:function(n,e,i,s){const{securityLevel:r,sankey:o}=t(),l=a.sankey;let c;"sandbox"===r&&(c=h("#i"+e));const d=h("sandbox"===r?c.nodes()[0].contentDocument.body:"body"),p="sandbox"===r?d.select(`[id="${e}"]`):h(`[id="${e}"]`),g=(null==o?void 0:o.width)??l.width,_=(null==o?void 0:o.height)??l.width,m=(null==o?void 0:o.useMaxWidth)??l.useMaxWidth,x=(null==o?void 0:o.nodeAlignment)??l.nodeAlignment,k=(null==o?void 0:o.prefix)??l.prefix,v=(null==o?void 0:o.suffix)??l.suffix,b=(null==o?void 0:o.showValues)??l.showValues,w=s.db.getGraph(),E=nt[x];I().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(b?15:0)).nodeAlign(E).extent([[0,0],[g,_]])(w);const L=y(f);p.append("g").attr("class","nodes").selectAll(".node").data(w.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=tt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>L(t.id))),p.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(w.nodes).join("text").attr("x",(t=>t.x0<g/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(b?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<g/2?"start":"end")).text((({id:t,value:n})=>b?`${t}\n${k}${Math.round(100*n)/100}${v}`:t));const A=p.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(w.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),S=(null==o?void 0:o.linkColor)||"gradient";if("gradient"===S){const t=A.append("linearGradient").attr("id",(t=>(t.uid=tt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>L(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>L(t.target.id)))}let M;switch(S){case"gradient":M=t=>t.uid;break;case"source":M=t=>L(t.source.id);break;case"target":M=t=>L(t.target.id);break;default:M=S}A.append("path").attr("d",function(t){var n=F,e=U,i=C,s=z,r=null;function o(){var o,l=W.call(arguments),c=n.apply(this,l),a=e.apply(this,l);if(r||(r=o=j()),t(r,+i.apply(this,(l[0]=c,l)),+s.apply(this,l),+i.apply(this,(l[0]=a,l)),+s.apply(this,l)),o)return r=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:N(+t),o):i},o.y=function(t){return arguments.length?(s="function"==typeof t?t:N(+t),o):s},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o}(X).source(G).target(Q)).attr("stroke",M).attr("stroke-width",(t=>Math.max(1,t.width))),u(void 0,p,0,m)}},it=q.parse.bind(q);q.parse=t=>it((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim())(t));const st={parser:q,db:Z,renderer:et};export{st as diagram};
@@ -0,0 +1 @@
1
+ import{a8 as t,d as e,a,z as s,b as r,f as i,a9 as n,j as o,V as c,$ as l,o as d,t as h,Q as p,R as g,X as u,J as x,e as y,G as m,a2 as b,Z as f,y as T,aa as E}from"./index-167f08a0.js";import{i as w,n as P,r as _,s as v,o as L,x as k}from"./svgDrawCommon-08f97a94-6a32c869-fc129345.js";import"react";import"react-dom";import"stream";var I=function(){var t=function(t,e,a,s){for(a=a||{},s=t.length;s--;a[t[s]]=e);return a},e=[1,2],a=[1,3],s=[1,4],r=[2,4],i=[1,9],n=[1,11],o=[1,13],c=[1,14],l=[1,16],d=[1,17],h=[1,18],p=[1,24],g=[1,25],u=[1,26],x=[1,27],y=[1,28],m=[1,29],b=[1,30],f=[1,31],T=[1,32],E=[1,33],w=[1,34],P=[1,35],_=[1,36],v=[1,37],L=[1,38],k=[1,39],I=[1,41],M=[1,42],N=[1,43],A=[1,44],O=[1,45],S=[1,46],D=[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],R=[4,5,16,50,52,53],C=[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],$=[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],Y=[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],B=[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],V=[68,69,70],F=[1,120],W={trace:function(){},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,DOTTED_ARROW:74,SOLID_CROSS:75,DOTTED_CROSS:76,SOLID_POINT:77,DOTTED_POINT:78,TXT:79,$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:"DOTTED_ARROW",75:"SOLID_CROSS",76:"DOTTED_CROSS",77:"SOLID_POINT",78:"DOTTED_POINT",79:"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],[56,1]],performAction:function(t,e,a,s,r,i,n){var o=i.length-1;switch(r){case 3:return s.apply(i[o]),i[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 11:case 12:case 62:this.$=i[o];break;case 15:i[o].type="createParticipant",this.$=i[o];break;case 16:i[o-1].unshift({type:"boxStart",boxData:s.parseBoxData(i[o-2])}),i[o-1].push({type:"boxEnd",boxText:i[o-2]}),this.$=i[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:s.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:s.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:s.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:s.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:s.LINETYPE.ACTIVE_START,actor:i[o-1]};break;case 23:this.$={type:"activeEnd",signalType:s.LINETYPE.ACTIVE_END,actor:i[o-1]};break;case 29:s.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 30:s.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 31:this.$=i[o].trim(),s.setAccTitle(this.$);break;case 32:case 33:this.$=i[o].trim(),s.setAccDescription(this.$);break;case 34:i[o-1].unshift({type:"loopStart",loopText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.LOOP_START}),i[o-1].push({type:"loopEnd",loopText:i[o-2],signalType:s.LINETYPE.LOOP_END}),this.$=i[o-1];break;case 35:i[o-1].unshift({type:"rectStart",color:s.parseMessage(i[o-2]),signalType:s.LINETYPE.RECT_START}),i[o-1].push({type:"rectEnd",color:s.parseMessage(i[o-2]),signalType:s.LINETYPE.RECT_END}),this.$=i[o-1];break;case 36:i[o-1].unshift({type:"optStart",optText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.OPT_START}),i[o-1].push({type:"optEnd",optText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.OPT_END}),this.$=i[o-1];break;case 37:i[o-1].unshift({type:"altStart",altText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.ALT_START}),i[o-1].push({type:"altEnd",signalType:s.LINETYPE.ALT_END}),this.$=i[o-1];break;case 38:i[o-1].unshift({type:"parStart",parText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.PAR_START}),i[o-1].push({type:"parEnd",signalType:s.LINETYPE.PAR_END}),this.$=i[o-1];break;case 39:i[o-1].unshift({type:"parStart",parText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.PAR_OVER_START}),i[o-1].push({type:"parEnd",signalType:s.LINETYPE.PAR_END}),this.$=i[o-1];break;case 40:i[o-1].unshift({type:"criticalStart",criticalText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.CRITICAL_START}),i[o-1].push({type:"criticalEnd",signalType:s.LINETYPE.CRITICAL_END}),this.$=i[o-1];break;case 41:i[o-1].unshift({type:"breakStart",breakText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.BREAK_START}),i[o-1].push({type:"breakEnd",optText:s.parseMessage(i[o-2]),signalType:s.LINETYPE.BREAK_END}),this.$=i[o-1];break;case 43:this.$=i[o-3].concat([{type:"option",optionText:s.parseMessage(i[o-1]),signalType:s.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 45:this.$=i[o-3].concat([{type:"and",parText:s.parseMessage(i[o-1]),signalType:s.LINETYPE.PAR_AND},i[o]]);break;case 47:this.$=i[o-3].concat([{type:"else",altText:s.parseMessage(i[o-1]),signalType:s.LINETYPE.ALT_ELSE},i[o]]);break;case 48:i[o-3].draw="participant",i[o-3].type="addParticipant",i[o-3].description=s.parseMessage(i[o-1]),this.$=i[o-3];break;case 49:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 50:i[o-3].draw="actor",i[o-3].type="addParticipant",i[o-3].description=s.parseMessage(i[o-1]),this.$=i[o-3];break;case 51:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 52:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 53:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 54:i[o-2]=[].concat(i[o-1],i[o-1]).slice(0,2),i[o-2][0]=i[o-2][0].actor,i[o-2][1]=i[o-2][1].actor,this.$=[i[o-1],{type:"addNote",placement:s.PLACEMENT.OVER,actor:i[o-2].slice(0,2),text:i[o]}];break;case 55:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 56:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 57:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 58:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 61:this.$=[i[o-2],i[o]];break;case 63:this.$=s.PLACEMENT.LEFTOF;break;case 64:this.$=s.PLACEMENT.RIGHTOF;break;case 65:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0},{type:"activeStart",signalType:s.LINETYPE.ACTIVE_START,actor:i[o-1]}];break;case 66:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o]},{type:"activeEnd",signalType:s.LINETYPE.ACTIVE_END,actor:i[o-4]}];break;case 67:this.$=[i[o-3],i[o-1],{type:"addMessage",from:i[o-3].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o]}];break;case 68:this.$={type:"addParticipant",actor:i[o]};break;case 69:this.$=s.LINETYPE.SOLID_OPEN;break;case 70:this.$=s.LINETYPE.DOTTED_OPEN;break;case 71:this.$=s.LINETYPE.SOLID;break;case 72:this.$=s.LINETYPE.DOTTED;break;case 73:this.$=s.LINETYPE.SOLID_CROSS;break;case 74:this.$=s.LINETYPE.DOTTED_CROSS;break;case 75:this.$=s.LINETYPE.SOLID_POINT;break;case 76:this.$=s.LINETYPE.DOTTED_POINT;break;case 77:this.$=s.parseMessage(i[o].trim().substring(1))}},table:[{3:1,4:e,5:a,6:s},{1:[3]},{3:5,4:e,5:a,6:s},{3:6,4:e,5:a,6:s},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,12:12,13:o,14:c,17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},t(D,[2,5]),{9:47,12:12,13:o,14:c,17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},t(D,[2,7]),t(D,[2,8]),t(D,[2,14]),{12:48,50:v,52:L,53:k},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:S},{22:55,70:S},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(D,[2,29]),t(D,[2,30]),{32:[1,61]},{34:[1,62]},t(D,[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:S},{22:72,70:S},{22:73,70:S},{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]},{55:83,57:[1,84],65:[1,85],66:[1,86]},{22:87,70:S},{22:88,70:S},{22:89,70:S},{22:90,70:S},t([5,51,64,71,72,73,74,75,76,77,78,79],[2,68]),t(D,[2,6]),t(D,[2,15]),t(R,[2,9],{10:91}),t(D,[2,17]),{5:[1,93],19:[1,92]},{5:[1,94]},t(D,[2,21]),{5:[1,95]},{5:[1,96]},t(D,[2,24]),t(D,[2,25]),t(D,[2,26]),t(D,[2,27]),t(D,[2,28]),t(D,[2,31]),t(D,[2,32]),t(C,r,{7:97}),t(C,r,{7:98}),t(C,r,{7:99}),t($,r,{40:100,7:101}),t(Y,r,{42:102,7:103}),t(Y,r,{7:103,42:104}),t(B,r,{45:105,7:106}),t(C,r,{7:107}),{5:[1,109],51:[1,108]},{5:[1,111],51:[1,110]},{5:[1,112]},{22:115,68:[1,113],69:[1,114],70:S},t(V,[2,69]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),{22:116,70:S},{22:118,58:117,70:S},{70:[2,63]},{70:[2,64]},{56:119,79:F},{56:121,79:F},{56:122,79:F},{56:123,79:F},{4:[1,126],5:[1,128],11:125,12:127,16:[1,124],50:v,52:L,53:k},{5:[1,129]},t(D,[2,19]),t(D,[2,20]),t(D,[2,22]),t(D,[2,23]),{4:i,5:n,8:8,9:10,12:12,13:o,14:c,16:[1,130],17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},{4:i,5:n,8:8,9:10,12:12,13:o,14:c,16:[1,131],17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},{4:i,5:n,8:8,9:10,12:12,13:o,14:c,16:[1,132],17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},{16:[1,133]},{4:i,5:n,8:8,9:10,12:12,13:o,14:c,16:[2,46],17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,49:[1,134],50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},{16:[1,135]},{4:i,5:n,8:8,9:10,12:12,13:o,14:c,16:[2,44],17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,48:[1,136],50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},{16:[1,137]},{16:[1,138]},{4:i,5:n,8:8,9:10,12:12,13:o,14:c,16:[2,42],17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,47:[1,139],50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},{4:i,5:n,8:8,9:10,12:12,13:o,14:c,16:[1,140],17:15,18:l,21:d,22:40,23:h,24:19,25:20,26:21,27:22,28:23,29:p,30:g,31:u,33:x,35:y,36:m,37:b,38:f,39:T,41:E,43:w,44:P,46:_,50:v,52:L,53:k,54:I,59:M,60:N,61:A,62:O,70:S},{15:[1,141]},t(D,[2,49]),{15:[1,142]},t(D,[2,51]),t(D,[2,52]),{22:143,70:S},{22:144,70:S},{56:145,79:F},{56:146,79:F},{56:147,79:F},{64:[1,148],79:[2,62]},{5:[2,55]},{5:[2,77]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(D,[2,16]),t(R,[2,10]),{12:149,50:v,52:L,53:k},t(R,[2,12]),t(R,[2,13]),t(D,[2,18]),t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),t(D,[2,37]),{15:[1,150]},t(D,[2,38]),{15:[1,151]},t(D,[2,39]),t(D,[2,40]),{15:[1,152]},t(D,[2,41]),{5:[1,153]},{5:[1,154]},{56:155,79:F},{56:156,79:F},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:157,70:S},t(R,[2,11]),t($,r,{7:101,40:158}),t(Y,r,{7:103,42:159}),t(B,r,{7:106,45:160}),t(D,[2,48]),t(D,[2,50]),{5:[2,65]},{5:[2,66]},{79:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],85:[2,63],86:[2,64],119:[2,55],120:[2,77],121:[2,56],122:[2,57],123:[2,58],145:[2,67],146:[2,53],147:[2,54],155:[2,65],156:[2,66],157:[2,61],158:[2,47],159:[2,45],160:[2,43]},parseError:function(t,e){if(!e.recoverable){var a=new Error(t);throw a.hash=e,a}this.trace(t)},parse:function(t){var e=[0],a=[],s=[null],r=[],i=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),d=Object.create(this.lexer),h={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(h.yy[p]=this.yy[p]);d.setInput(t,h.yy),h.yy.lexer=d,h.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;r.push(g);var u=d.options&&d.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var x,y,m,b,f,T,E,w,P,_={};;){if(y=e[e.length-1],this.defaultActions[y]?m=this.defaultActions[y]:(null==x&&(P=void 0,"number"!=typeof(P=a.pop()||d.lex()||1)&&(P instanceof Array&&(P=(a=P).pop()),P=this.symbols_[P]||P),x=P),m=i[y]&&i[y][x]),void 0===m||!m.length||!m[0]){var v;for(f in w=[],i[y])this.terminals_[f]&&f>2&&w.push("'"+this.terminals_[f]+"'");v=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[x]||x,line:d.yylineno,loc:g,expected:w})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+x);switch(m[0]){case 1:e.push(x),s.push(d.yytext),r.push(d.yylloc),e.push(m[1]),x=null,c=d.yyleng,n=d.yytext,o=d.yylineno,g=d.yylloc;break;case 2:if(T=this.productions_[m[1]][1],_.$=s[s.length-T],_._$={first_line:r[r.length-(T||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(T||1)].first_column,last_column:r[r.length-1].last_column},u&&(_._$.range=[r[r.length-(T||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(_,[n,c,o,h.yy,m[1],s,r].concat(l))))return b;T&&(e=e.slice(0,-1*T*2),s=s.slice(0,-1*T),r=r.slice(0,-1*T)),e.push(this.productions_[m[1]][0]),s.push(_.$),r.push(_._$),E=i[e[e.length-2]][e[e.length-1]],e.push(E);break;case 3:return!0}}return!0}},q={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===s.length?this.yylloc.first_column:0)+s[s.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var a,s,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],a=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var i in r)this[i]=r[i];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,a,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),i=0;i<r.length;i++)if((a=this._input.match(this.rules[r[i]]))&&(!e||a[0].length>e[0].length)){if(e=a,s=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(a,r[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,a,s){switch(a){case 0:case 51:case 64:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return e.yytext=e.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 71;case 56:return 72;case 57:return 75;case 58:return 76;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 68;case 63:return 69;case 65:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65],inclusive:!0}}};function z(){this.yy={}}return W.lexer=q,z.prototype=W,W.Parser=z,new z}();I.parser=I;const M=I,N=new class{constructor(t){this.init=t,this.records=this.init()}reset(){this.records=this.init()}}((()=>({prevActor:void 0,actors:{},createdActors:{},destroyedActors:{},boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0}))),A=function(t,e,a,s){let r=N.records.currentBox;const i=N.records.actors[t];if(i){if(N.records.currentBox&&i.box&&N.records.currentBox!==i.box)throw new Error("A same participant should only be defined in one Box: "+i.name+" can't be in '"+i.box.name+"' and in '"+N.records.currentBox.name+"' at the same time.");if(r=i.box?i.box:N.records.currentBox,i.box=r,i&&e===i.name&&null==a)return}null!=a&&null!=a.text||(a={text:e,wrap:null,type:s}),null!=s&&null!=a.text||(a={text:e,wrap:null,type:s}),N.records.actors[t]={box:r,name:e,description:a.text,wrap:void 0===a.wrap&&D()||!!a.wrap,prevActor:N.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:s||"participant"},N.records.prevActor&&N.records.actors[N.records.prevActor]&&(N.records.actors[N.records.prevActor].nextActor=t),N.records.currentBox&&N.records.currentBox.actorKeys.push(t),N.records.prevActor=t},O=function(t,e,a={text:void 0,wrap:void 0},s,r=!1){if(s===R.ACTIVE_END&&(t=>{let e,a=0;for(e=0;e<N.records.messages.length;e++)N.records.messages[e].type===R.ACTIVE_START&&N.records.messages[e].from.actor===t&&a++,N.records.messages[e].type===R.ACTIVE_END&&N.records.messages[e].from.actor===t&&a--;return a})(t.actor)<1){let e=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}return N.records.messages.push({from:t,to:e,message:a.text,wrap:void 0===a.wrap&&D()||!!a.wrap,type:s,activate:r}),!0},S=function(t){return N.records.actors[t]},D=()=>void 0!==N.records.wrapEnabled?N.records.wrapEnabled:a().sequence.wrap,R={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32},C=function(t,e,a){const s={actor:t,placement:e,message:a.text,wrap:void 0===a.wrap&&D()||!!a.wrap},r=[].concat(t,t);N.records.notes.push(s),N.records.messages.push({from:r[0],to:r[1],message:a.text,wrap:void 0===a.wrap&&D()||!!a.wrap,type:R.NOTE,placement:e})},$=function(t,e){const s=S(t);try{let t=g(e.text,a());t=t.replace(/&amp;/g,"&"),t=t.replace(/&equals;/g,"="),Y(s,JSON.parse(t))}catch(t){r.error("error while parsing actor link text",t)}};function Y(t,e){if(null==t.links)t.links=e;else for(let a in e)t.links[a]=e[a]}const B=function(t,e){const s=S(t);try{let t=g(e.text,a());V(s,JSON.parse(t))}catch(t){r.error("error while parsing actor properties text",t)}};function V(t,e){if(null==t.properties)t.properties=e;else for(let a in e)t.properties[a]=e[a]}const F=function(t,e){const a=S(t),s=document.getElementById(e.text);try{const t=s.innerHTML,e=JSON.parse(t);e.properties&&V(a,e.properties),e.links&&Y(a,e.links)}catch(t){r.error("error while parsing actor details text",t)}},W=function(t){if(Array.isArray(t))t.forEach((function(t){W(t)}));else switch(t.type){case"sequenceIndex":N.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":A(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(N.records.actors[t.actor])throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");N.records.lastCreated=t.actor,A(t.actor,t.actor,t.description,t.draw),N.records.createdActors[t.actor]=N.records.messages.length;break;case"destroyParticipant":N.records.lastDestroyed=t.actor,N.records.destroyedActors[t.actor]=N.records.messages.length;break;case"activeStart":case"activeEnd":O(t.actor,void 0,void 0,t.signalType);break;case"addNote":C(t.actor,t.placement,t.text);break;case"addLinks":$(t.actor,t.text);break;case"addALink":!function(t,e){const s=S(t);try{const t={};let r=g(e.text,a());var i=r.indexOf("@");r=r.replace(/&amp;/g,"&"),r=r.replace(/&equals;/g,"=");var n=r.slice(0,i-1).trim(),o=r.slice(i+1).trim();t[n]=o,Y(s,t)}catch(t){r.error("error while parsing actor link text",t)}}(t.actor,t.text);break;case"addProperties":B(t.actor,t.text);break;case"addDetails":F(t.actor,t.text);break;case"addMessage":if(N.records.lastCreated){if(t.to!==N.records.lastCreated)throw new Error("The created participant "+N.records.lastCreated+" does not have an associated creating message after its declaration. Please check the sequence diagram.");N.records.lastCreated=void 0}else if(N.records.lastDestroyed){if(t.to!==N.records.lastDestroyed&&t.from!==N.records.lastDestroyed)throw new Error("The destroyed participant "+N.records.lastDestroyed+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");N.records.lastDestroyed=void 0}O(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":e=t.boxData,N.records.boxes.push({name:e.text,wrap:void 0===e.wrap&&D()||!!e.wrap,fill:e.color,actorKeys:[]}),N.records.currentBox=N.records.boxes.slice(-1)[0];break;case"boxEnd":N.records.currentBox=void 0;break;case"loopStart":O(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":O(void 0,void 0,void 0,t.signalType);break;case"rectStart":O(void 0,void 0,t.color,t.signalType);break;case"optStart":O(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":O(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":u(t.text);break;case"parStart":case"and":O(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":O(void 0,void 0,t.criticalText,t.signalType);break;case"option":O(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":O(void 0,void 0,t.breakText,t.signalType)}var e},q={addActor:A,addMessage:function(t,e,a,s){N.records.messages.push({from:t,to:e,message:a.text,wrap:void 0===a.wrap&&D()||!!a.wrap,answer:s})},addSignal:O,addLinks:$,addDetails:F,addProperties:B,autoWrap:D,setWrap:function(t){N.records.wrapEnabled=t},enableSequenceNumbers:function(){N.records.sequenceNumbersEnabled=!0},disableSequenceNumbers:function(){N.records.sequenceNumbersEnabled=!1},showSequenceNumbers:()=>N.records.sequenceNumbersEnabled,getMessages:function(){return N.records.messages},getActors:function(){return N.records.actors},getCreatedActors:function(){return N.records.createdActors},getDestroyedActors:function(){return N.records.destroyedActors},getActor:S,getActorKeys:function(){return Object.keys(N.records.actors)},getActorProperty:function(t,e){if(void 0!==t&&void 0!==t.properties)return t.properties[e]},getAccTitle:l,getBoxes:function(){return N.records.boxes},getDiagramTitle:d,setDiagramTitle:h,getConfig:()=>a().sequence,clear:function(){N.reset(),p()},parseMessage:function(t){const e=t.trim(),a={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:null!==e.match(/^:?wrap:/)||null===e.match(/^:?nowrap:/)&&void 0};return r.debug("parseMessage:",a),a},parseBoxData:function(t){const e=t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);let s=null!=e&&e[1]?e[1].trim():"transparent",r=null!=e&&e[2]?e[2].trim():void 0;if(window&&window.CSS)window.CSS.supports("color",s)||(s="transparent",r=t.trim());else{const e=(new Option).style;e.color=s,e.color!==s&&(s="transparent",r=t.trim())}return{color:s,text:void 0!==r?g(r.replace(/^:?(?:no)?wrap:/,""),a()):void 0,wrap:void 0!==r?null!==r.match(/^:?wrap:/)||null===r.match(/^:?nowrap:/)&&void 0:void 0}},LINETYPE:R,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:C,setAccTitle:u,apply:W,setAccDescription:x,getAccDescription:y,hasAtLeastOneBox:function(){return N.records.boxes.length>0},hasAtLeastOneBoxWithTitle:function(){return N.records.boxes.some((t=>t.name))}},z="actor-top",U="actor-bottom",H=function(t,e){return _(t,e)},j=async function(t,e,a=null){let s=t.append("foreignObject");const r=await m(e.text,b()),i=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();if(s.attr("height",Math.round(i.height)).attr("width",Math.round(i.width)),"noteText"===e.class){const a=t.node().firstChild;a.setAttribute("height",i.height+2*e.textMargin);const r=a.getBBox();s.attr("x",Math.round(r.x+r.width/2-i.width/2)).attr("y",Math.round(r.y+r.height/2-i.height/2))}else if(a){let{startx:t,stopx:r,starty:n}=a;if(t>r){const e=t;t=r,r=e}s.attr("x",Math.round(t+Math.abs(t-r)/2-i.width/2)),"loopText"===e.class?s.attr("y",Math.round(n)):s.attr("y",Math.round(n-i.height))}return[s]},K=function(t,e){let a=0,s=0;const r=e.text.split(o.lineBreakRegex),[i,n]=f(e.fontSize);let c=[],l=0,d=()=>e.y;if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":d=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":d=()=>Math.round(e.y+(a+s+e.textMargin)/2);break;case"bottom":case"end":d=()=>Math.round(e.y+(a+s+2*e.textMargin)-e.textMargin)}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[o,h]of r.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==i&&(l=o*i);const r=t.append("text");r.attr("x",e.x),r.attr("y",d()),void 0!==e.anchor&&r.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&r.style("font-family",e.fontFamily),void 0!==n&&r.style("font-size",n),void 0!==e.fontWeight&&r.style("font-weight",e.fontWeight),void 0!==e.fill&&r.attr("fill",e.fill),void 0!==e.class&&r.attr("class",e.class),void 0!==e.dy?r.attr("dy",e.dy):0!==l&&r.attr("dy",l);const p=h||E;if(e.tspan){const t=r.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(p)}else r.text(p);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(s+=(r._groups||r)[0][0].getBBox().height,a=s),c.push(r)}return c},X=function(t,e){const a=t.append("polygon");var s,r,i,n;return a.attr("points",(s=e.x)+","+(r=e.y)+" "+(s+(i=e.width))+","+r+" "+(s+i)+","+(r+(n=e.height)-7)+" "+(s+i-8.4)+","+(r+n)+" "+s+","+(r+n)),a.attr("class","labelBox"),e.y=e.y+e.height/2,K(t,e),a};let G=-1;const J=(t,e,a,s)=>{t.select&&a.forEach((a=>{const r=e[a],i=t.select("#actor"+r.actorCnt);!s.mirrorActors&&r.stopy?i.attr("y2",r.stopy+r.height/2):s.mirrorActors&&i.attr("y2",r.stopy)}))},Z=function(t,e){v(t,e)},Q=function(){function t(t,e,a,s,i,n,o){r(e.append("text").attr("x",a+i/2).attr("y",s+n/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,a,s,i,n,c,l){const{actorFontSize:d,actorFontFamily:h,actorFontWeight:p}=l,[g,u]=f(d),x=t.split(o.lineBreakRegex);for(let t=0;t<x.length;t++){const o=t*g-g*(x.length-1)/2,l=e.append("text").attr("x",a+i/2).attr("y",s).style("text-anchor","middle").style("font-size",u).style("font-weight",p).style("font-family",h);l.append("tspan").attr("x",a+i/2).attr("dy",o).text(x[t]),l.attr("y",s+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(l,c)}}function a(t,a,s,i,n,o,c,l){const d=a.append("switch"),h=d.append("foreignObject").attr("x",s).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");h.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,d,s,i,n,o,c,l),r(h,c)}async function s(t,a,s,i,o,c,l,d){const h=await n(t,b()),p=a.append("switch"),g=p.append("foreignObject").attr("x",s+o/2-h.width/2).attr("y",i+c/2-h.height/2).attr("width",h.width).attr("height",h.height).append("xhtml:div").style("height","100%").style("width","100%");g.append("div").style("text-align","center").style("vertical-align","middle").html(await m(t,b())),e(t,p,s,i,o,c,l,d),r(g,l)}function r(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return function(r,i=!1){return i?s:"fo"===r.textPlacement?a:"old"===r.textPlacement?t:e}}(),tt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").text(t),o)}function e(t,e,a,r,i,n,c,l){const{actorFontSize:d,actorFontFamily:h,actorFontWeight:p}=l,g=t.split(o.lineBreakRegex);for(let t=0;t<g.length;t++){const i=t*d-d*(g.length-1)/2,o=e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").style("font-size",d).style("font-weight",p).style("font-family",h);o.append("tspan").attr("x",a).attr("dy",i).text(g[t]),o.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(o,c)}}function a(t,a,r,i,n,o,c,l){const d=a.append("switch"),h=d.append("foreignObject").attr("x",r).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");h.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,d,r,i,0,o,c,l),s(h,c)}function s(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return function(s){return"fo"===s.textPlacement?a:"old"===s.textPlacement?t:e}}(),et=H,at=async function(e,a,s,r){switch(a.type){case"actor":return await async function(e,a,s,r){const i=r?a.stopy:a.starty,n=a.x+a.width/2,o=i+80;e.lower(),r||(G++,e.append("line").attr("id","actor"+G).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),a.actorCnt=G);const c=e.append("g");let l="actor-man";l+=r?` ${U}`:` ${z}`,c.attr("class",l),c.attr("name",a.name);const d=L();d.x=a.x,d.y=i,d.fill="#eaeaea",d.width=a.width,d.height=a.height,d.class="actor",d.rx=3,d.ry=3,c.append("line").attr("id","actor-man-torso"+G).attr("x1",n).attr("y1",i+25).attr("x2",n).attr("y2",i+45),c.append("line").attr("id","actor-man-arms"+G).attr("x1",n-18).attr("y1",i+33).attr("x2",n+18).attr("y2",i+33),c.append("line").attr("x1",n-18).attr("y1",i+60).attr("x2",n).attr("y2",i+45),c.append("line").attr("x1",n).attr("y1",i+45).attr("x2",n+18-2).attr("y2",i+60);const h=c.append("circle");h.attr("cx",a.x+a.width/2),h.attr("cy",i+10),h.attr("r",15),h.attr("width",a.width),h.attr("height",a.height);const p=c.node().getBBox();return a.height=p.height,await Q(s,t(a.description))(a.description,c,d.x,d.y+35,d.width,d.height,{class:"actor"},s),a.height}(e,a,s,r);case"participant":return await async function(e,a,s,r){const i=r?a.stopy:a.starty,n=a.x+a.width/2,o=i+5,c=e.append("g").lower();var l,d=c;r||(G++,Object.keys(a.links||{}).length&&!s.forceMenus&&d.attr("onclick",(l=`actor${G}_popup`,"var pu = document.getElementById('"+l+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }")).attr("cursor","pointer"),d.append("line").attr("id","actor"+G).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),d=c.append("g"),a.actorCnt=G,null!=a.links&&d.attr("id","root-"+G));const h=L();var p="actor";null!=a.properties&&a.properties.class?p=a.properties.class:h.fill="#eaeaea",p+=r?` ${U}`:` ${z}`,h.x=a.x,h.y=i,h.width=a.width,h.height=a.height,h.class=p,h.rx=3,h.ry=3,h.name=a.name;const g=H(d,h);if(a.rectData=h,null!=a.properties&&a.properties.icon){const t=a.properties.icon.trim();"@"===t.charAt(0)?w(d,h.x+h.width-20,h.y+10,t.substr(1)):P(d,h.x+h.width-20,h.y+10,t)}await Q(s,t(a.description))(a.description,d,h.x,h.y,h.width,h.height,{class:"actor"},s);let u=a.height;if(g.node){const t=g.node().getBBox();a.height=t.height,u=t.height}return u}(e,a,s,r)}},st=async function(t,e,a){const s=t.append("g");Z(s,e),e.name&&await Q(a)(e.name,s,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),s.lower()},rt=function(t,a,s,r,i){if(void 0===a.links||null===a.links||0===Object.keys(a.links).length)return{height:0,width:0};const n=a.links,o=a.actorCnt,c=a.rectData;var l="none";i&&(l="block !important");const d=t.append("g");d.attr("id","actor"+o+"_popup"),d.attr("class","actorPopupMenu"),d.attr("display",l);var h="";void 0!==c.class&&(h=" "+c.class);let p=c.width>s?c.width:s;const g=d.append("rect");if(g.attr("class","actorPopupMenuPanel"+h),g.attr("x",c.x),g.attr("y",c.height),g.attr("fill",c.fill),g.attr("stroke",c.stroke),g.attr("width",p),g.attr("height",c.height),g.attr("rx",c.rx),g.attr("ry",c.ry),null!=n){var u=20;for(let t in n){var x=d.append("a"),y=e.sanitizeUrl(n[t]);x.attr("xlink:href",y),x.attr("target","_blank"),tt(r)(t,x,c.x+10,c.height+u,p,20,{class:"actor"},r),u+=30}}return g.attr("height",u),{height:c.height+u,width:p}},it=function(t){return t.append("g")},nt=function(t,e,a,s,r){const i=L(),n=e.anchored;i.x=e.startx,i.y=e.starty,i.class="activation"+r%3,i.width=e.stopx-e.startx,i.height=a-e.starty,H(n,i)},ot=async function(e,a,s,r){const{boxMargin:i,boxTextMargin:n,labelBoxHeight:o,labelBoxWidth:c,messageFontFamily:l,messageFontSize:d,messageFontWeight:h}=r,p=e.append("g"),g=function(t,e,a,s){return p.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",s).attr("class","loopLine")};g(a.startx,a.starty,a.stopx,a.starty),g(a.stopx,a.starty,a.stopx,a.stopy),g(a.startx,a.stopy,a.stopx,a.stopy),g(a.startx,a.starty,a.startx,a.stopy),void 0!==a.sections&&a.sections.forEach((function(t){g(a.startx,t.y,a.stopx,t.y).style("stroke-dasharray","3, 3")}));let u=k();u.text=s,u.x=a.startx,u.y=a.starty,u.fontFamily=l,u.fontSize=d,u.fontWeight=h,u.anchor="middle",u.valign="middle",u.tspan=!1,u.width=c||50,u.height=o||20,u.textMargin=n,u.class="labelText",X(p,u),u={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},u.text=a.title,u.x=a.startx+c/2+(a.stopx-a.startx)/2,u.y=a.starty+i+n,u.anchor="middle",u.valign="middle",u.textMargin=n,u.class="loopText",u.fontFamily=l,u.fontSize=d,u.fontWeight=h,u.wrap=!0;let x=t(u.text)?await j(p,u,a):K(p,u);if(void 0!==a.sectionTitles)for(const[e,s]of Object.entries(a.sectionTitles))if(s.message){u.text=s.message,u.x=a.startx+(a.stopx-a.startx)/2,u.y=a.sections[e].y+i+n,u.class="loopText",u.anchor="middle",u.valign="middle",u.tspan=!1,u.fontFamily=l,u.fontSize=d,u.fontWeight=h,u.wrap=a.wrap,t(u.text)?(a.starty=a.sections[e].y,await j(p,u,a)):K(p,u);let r=Math.round(x.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));a.sections[e].height+=r-(i+n)}return a.height=Math.round(a.stopy-a.starty),p},ct=Z,lt=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").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},dt=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")},ht=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)},pt=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")},gt=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")},ut=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")},xt=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")};e.sanitizeUrl;let yt={};const mt={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))},clear:function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},addBox:function(t){this.boxes.push(t)},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],boxes:[],loops:[],messages:[],notes:[]},init: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,Lt(a())},updateVal:function(t,e,a,s){void 0===t[e]?t[e]=a:t[e]=s(a,t[e])},updateBounds:function(t,e,a,s){const r=this;let i=0;function n(n){return function(o){i++;const c=r.sequenceItems.length-i+1;r.updateVal(o,"starty",e-c*yt.boxMargin,Math.min),r.updateVal(o,"stopy",s+c*yt.boxMargin,Math.max),r.updateVal(mt.data,"startx",t-c*yt.boxMargin,Math.min),r.updateVal(mt.data,"stopx",a+c*yt.boxMargin,Math.max),"activation"!==n&&(r.updateVal(o,"startx",t-c*yt.boxMargin,Math.min),r.updateVal(o,"stopx",a+c*yt.boxMargin,Math.max),r.updateVal(mt.data,"starty",e-c*yt.boxMargin,Math.min),r.updateVal(mt.data,"stopy",s+c*yt.boxMargin,Math.max))}}this.sequenceItems.forEach(n()),this.activations.forEach(n("activation"))},insert:function(t,e,a,s){const r=o.getMin(t,a),i=o.getMax(t,a),n=o.getMin(e,s),c=o.getMax(e,s);this.updateVal(mt.data,"startx",r,Math.min),this.updateVal(mt.data,"starty",n,Math.min),this.updateVal(mt.data,"stopx",i,Math.max),this.updateVal(mt.data,"stopy",c,Math.max),this.updateBounds(r,n,i,c)},newActivation:function(t,e,a){const s=a[t.from.actor],r=kt(t.from.actor).length||0,i=s.x+s.width/2+(r-1)*yt.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+yt.activationWidth,stopy:void 0,actor:t.from.actor,anchored:it(e)})},endActivation:function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop: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}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},isLoopOverlap:function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:mt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},saveVerticalPos:function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},resetVerticalPos:function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=o.getMax(this.data.stopy,this.verticalPos)},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},bt=async function(e,a){mt.bumpVerticalPos(yt.boxMargin),a.height=yt.boxMargin,a.starty=mt.getVerticalPos();const s=L();s.x=a.startx,s.y=a.starty,s.width=a.width||yt.width,s.class="note";const r=e.append("g"),i=et(r,s),n=k();n.x=a.startx,n.y=a.starty,n.width=s.width,n.dy="1em",n.text=a.message,n.class="noteText",n.fontFamily=yt.noteFontFamily,n.fontSize=yt.noteFontSize,n.fontWeight=yt.noteFontWeight,n.anchor=yt.noteAlign,n.textMargin=yt.noteMargin,n.valign="center";const o=t(n.text)?await j(r,n):K(r,n),c=Math.round(o.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));i.attr("height",c+2*yt.noteMargin),a.height+=c+2*yt.noteMargin,mt.bumpVerticalPos(c+2*yt.noteMargin),a.stopy=a.starty+c+2*yt.noteMargin,a.stopx=a.startx+s.width,mt.insert(a.startx,a.starty,a.stopx,a.stopy),mt.models.addNote(a)},ft=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),Tt=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),Et=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});async function wt(e,s){mt.bumpVerticalPos(10);const{startx:r,stopx:c,message:l}=s,d=o.splitBreaks(l).length,h=t(l),p=h?await n(l,a()):i.calculateTextDimensions(l,ft(yt));if(!h){const t=p.height/d;s.height+=t,mt.bumpVerticalPos(t)}let g,u=p.height-10;const x=p.width;if(r===c){g=mt.getVerticalPos()+u,yt.rightAngles||(u+=yt.boxMargin,g=mt.getVerticalPos()+u),u+=30;const t=o.getMax(x/2,yt.width/2);mt.insert(r-t,mt.getVerticalPos()-10+u,c+t,mt.getVerticalPos()+30+u)}else u+=yt.boxMargin,g=mt.getVerticalPos()+u,mt.insert(r,g-10,c,g);return mt.bumpVerticalPos(u),s.height+=u,s.stopy=s.starty+s.height,mt.insert(s.fromBounds,s.starty,s.toBounds,s.stopy),g}const Pt=async function(e,a,s,r){const{startx:n,stopx:c,starty:l,message:d,type:h,sequenceIndex:p,sequenceVisible:g}=a,u=i.calculateTextDimensions(d,ft(yt)),x=k();x.x=n,x.y=l+10,x.width=c-n,x.class="messageText",x.dy="1em",x.text=d,x.fontFamily=yt.messageFontFamily,x.fontSize=yt.messageFontSize,x.fontWeight=yt.messageFontWeight,x.anchor=yt.messageAlign,x.valign="center",x.textMargin=yt.wrapPadding,x.tspan=!1,t(x.text)?await j(e,x,{startx:n,stopx:c,starty:s}):K(e,x);const y=u.width;let m;n===c?m=yt.rightAngles?e.append("path").attr("d",`M ${n},${s} H ${n+o.getMax(yt.width/2,y/2)} V ${s+25} H ${n}`):e.append("path").attr("d","M "+n+","+s+" C "+(n+60)+","+(s-10)+" "+(n+60)+","+(s+30)+" "+n+","+(s+20)):(m=e.append("line"),m.attr("x1",n),m.attr("y1",s),m.attr("x2",c),m.attr("y2",s)),h===r.db.LINETYPE.DOTTED||h===r.db.LINETYPE.DOTTED_CROSS||h===r.db.LINETYPE.DOTTED_POINT||h===r.db.LINETYPE.DOTTED_OPEN?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let b="";yt.arrowMarkerAbsolute&&(b=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,b=b.replace(/\(/g,"\\("),b=b.replace(/\)/g,"\\)")),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),h!==r.db.LINETYPE.SOLID&&h!==r.db.LINETYPE.DOTTED||m.attr("marker-end","url("+b+"#arrowhead)"),h!==r.db.LINETYPE.SOLID_POINT&&h!==r.db.LINETYPE.DOTTED_POINT||m.attr("marker-end","url("+b+"#filled-head)"),h!==r.db.LINETYPE.SOLID_CROSS&&h!==r.db.LINETYPE.DOTTED_CROSS||m.attr("marker-end","url("+b+"#crosshead)"),(g||yt.showSequenceNumbers)&&(m.attr("marker-start","url("+b+"#sequencenumber)"),e.append("text").attr("x",n).attr("y",s+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(p))},_t=async function(t,e,a,s){if(s){let s=0;mt.bumpVerticalPos(2*yt.boxMargin);for(const r of a){const a=e[r];a.stopy||(a.stopy=mt.getVerticalPos());const i=await at(t,a,yt,!0);s=o.getMax(s,i)}mt.bumpVerticalPos(s+yt.boxMargin)}else for(const s of a){const a=e[s];await at(t,a,yt,!1)}},vt=function(t,e,a,s){let r=0,i=0;for(const n of a){const a=e[n],o=At(a),c=rt(t,a,o,yt,yt.forceMenus,s);c.height>r&&(r=c.height),c.width+a.x>i&&(i=c.width+a.x)}return{maxHeight:r,maxWidth:i}},Lt=function(t){T(yt,t),t.fontFamily&&(yt.actorFontFamily=yt.noteFontFamily=yt.messageFontFamily=t.fontFamily),t.fontSize&&(yt.actorFontSize=yt.noteFontSize=yt.messageFontSize=t.fontSize),t.fontWeight&&(yt.actorFontWeight=yt.noteFontWeight=yt.messageFontWeight=t.fontWeight)},kt=function(t){return mt.activations.filter((function(e){return e.actor===t}))},It=function(t,e){const a=e[t],s=kt(t);return[s.reduce((function(t,e){return o.getMin(t,e.startx)}),a.x+a.width/2-1),s.reduce((function(t,e){return o.getMax(t,e.stopx)}),a.x+a.width/2+1)]};function Mt(t,e,a,s,n){mt.bumpVerticalPos(a);let c=s;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,n=ft(yt);e.message=i.wrapLabel(`[${e.message}]`,a-2*yt.wrapPadding,n),e.width=a,e.wrap=!0;const l=i.calculateTextDimensions(e.message,n),d=o.getMax(l.height,yt.labelBoxHeight);c=s+d,r.debug(`${d} - ${e.message}`)}n(e),mt.bumpVerticalPos(c)}function Nt(t,e,a,s,r,i,n){function o(a,s){a.x<r[t.from].x?(mt.insert(e.stopx-s,e.starty,e.startx,e.stopy+a.height/2+yt.noteMargin),e.stopx=e.stopx+s):(mt.insert(e.startx,e.starty,e.stopx+s,e.stopy+a.height/2+yt.noteMargin),e.stopx=e.stopx-s)}if(i[t.to]==s){const e=r[t.to];o(e,"actor"==e.type?21:e.width/2+3),e.starty=a-e.height/2,mt.bumpVerticalPos(e.height/2)}else if(n[t.from]==s){const s=r[t.from];yt.mirrorActors&&function(a,s){a.x<r[t.to].x?(mt.insert(e.startx-s,e.starty,e.stopx,e.stopy+a.height/2+yt.noteMargin),e.startx=e.startx+s):(mt.insert(e.stopx,e.starty,e.startx+s,e.stopy+a.height/2+yt.noteMargin),e.startx=e.startx-s)}(s,"actor"==s.type?18:s.width/2),s.stopy=a-s.height/2,mt.bumpVerticalPos(s.height/2)}else if(n[t.to]==s){const e=r[t.to];yt.mirrorActors&&o(e,"actor"==e.type?21:e.width/2+3),e.stopy=a-e.height/2,mt.bumpVerticalPos(e.height/2)}}const At=function(t){let e=0;const a=Et(yt);for(const s in t.links){const t=i.calculateTextDimensions(s,a).width+2*yt.wrapPadding+2*yt.boxMargin;e<t&&(e=t)}return e},Ot=async function(e,s,c){const l=s[e.from].x,d=s[e.to].x,h=e.wrap&&e.message;let p=t(e.message)?await n(e.message,a()):i.calculateTextDimensions(h?i.wrapLabel(e.message,yt.width,Tt(yt)):e.message,Tt(yt));const g={width:h?yt.width:o.getMax(yt.width,p.width+2*yt.noteMargin),height:0,startx:s[e.from].x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===c.db.PLACEMENT.RIGHTOF?(g.width=h?o.getMax(yt.width,p.width):o.getMax(s[e.from].width/2+s[e.to].width/2,p.width+2*yt.noteMargin),g.startx=l+(s[e.from].width+yt.actorMargin)/2):e.placement===c.db.PLACEMENT.LEFTOF?(g.width=h?o.getMax(yt.width,p.width+2*yt.noteMargin):o.getMax(s[e.from].width/2+s[e.to].width/2,p.width+2*yt.noteMargin),g.startx=l-g.width+(s[e.from].width-yt.actorMargin)/2):e.to===e.from?(p=i.calculateTextDimensions(h?i.wrapLabel(e.message,o.getMax(yt.width,s[e.from].width),Tt(yt)):e.message,Tt(yt)),g.width=h?o.getMax(yt.width,s[e.from].width):o.getMax(s[e.from].width,yt.width,p.width+2*yt.noteMargin),g.startx=l+(s[e.from].width-g.width)/2):(g.width=Math.abs(l+s[e.from].width/2-(d+s[e.to].width/2))+yt.actorMargin,g.startx=l<d?l+s[e.from].width/2-yt.actorMargin/2:d+s[e.to].width/2-yt.actorMargin/2),h&&(g.message=i.wrapLabel(e.message,g.width-2*yt.wrapPadding,Tt(yt))),r.debug(`NM:[${g.startx},${g.stopx},${g.starty},${g.stopy}:${g.width},${g.height}=${e.message}]`),g},St=function(t,e,a){if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT].includes(t.type))return{};const[s,r]=It(t.from,e),[n,c]=It(t.to,e),l=s<=n,d=l?r:s;let h=l?n:c;const p=Math.abs(n-c)>2,g=t=>l?-t:t;t.from===t.to?h=d:(t.activate&&!p&&(h+=g(yt.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=g(3)));const u=[s,r,n,c],x=Math.abs(d-h);t.wrap&&t.message&&(t.message=i.wrapLabel(t.message,o.getMax(x+2*yt.wrapPadding,yt.width),ft(yt)));const y=i.calculateTextDimensions(t.message,ft(yt));return{width:o.getMax(t.wrap?0:y.width+2*yt.wrapPadding,x+2*yt.wrapPadding,yt.width),height:0,startx:d,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},Dt={parser:M,db:q,renderer:{bounds:mt,drawActors:_t,drawActorsPopup:vt,setConf:Lt,draw:async function(e,l,d,h){const{securityLevel:p,sequence:g}=a();let u;yt=g,"sandbox"===p&&(u=s("#i"+l));const x=s("sandbox"===p?u.nodes()[0].contentDocument.body:"body"),y="sandbox"===p?u.nodes()[0].contentDocument:document;mt.init(),r.debug(h.db);const m="sandbox"===p?x.select(`[id="${l}"]`):s(`[id="${l}"]`),b=h.db.getActors(),f=h.db.getCreatedActors(),T=h.db.getDestroyedActors(),E=h.db.getBoxes();let w=h.db.getActorKeys();const P=h.db.getMessages(),_=h.db.getDiagramTitle(),v=h.db.hasAtLeastOneBox(),L=h.db.hasAtLeastOneBoxWithTitle(),k=await async function(e,s,c){const l={};for(const r of s)if(e[r.to]&&e[r.from]){const s=e[r.to];if(r.placement===c.db.PLACEMENT.LEFTOF&&!s.prevActor)continue;if(r.placement===c.db.PLACEMENT.RIGHTOF&&!s.nextActor)continue;const d=void 0!==r.placement,h=!d,p=d?Tt(yt):ft(yt),g=r.wrap?i.wrapLabel(r.message,yt.width-2*yt.wrapPadding,p):r.message,u=(t(g)?await n(r.message,a()):i.calculateTextDimensions(g,p)).width+2*yt.wrapPadding;h&&r.from===s.nextActor?l[r.to]=o.getMax(l[r.to]||0,u):h&&r.from===s.prevActor?l[r.from]=o.getMax(l[r.from]||0,u):h&&r.from===r.to?(l[r.from]=o.getMax(l[r.from]||0,u/2),l[r.to]=o.getMax(l[r.to]||0,u/2)):r.placement===c.db.PLACEMENT.RIGHTOF?l[r.from]=o.getMax(l[r.from]||0,u):r.placement===c.db.PLACEMENT.LEFTOF?l[s.prevActor]=o.getMax(l[s.prevActor]||0,u):r.placement===c.db.PLACEMENT.OVER&&(s.prevActor&&(l[s.prevActor]=o.getMax(l[s.prevActor]||0,u/2)),s.nextActor&&(l[r.from]=o.getMax(l[r.from]||0,u/2)))}return r.debug("maxMessageWidthPerActor:",l),l}(b,P,h);if(yt.height=await async function(e,s,r){let c=0;for(const s of Object.keys(e)){const r=e[s];r.wrap&&(r.description=i.wrapLabel(r.description,yt.width-2*yt.wrapPadding,Et(yt)));const l=t(r.description)?await n(r.description,a()):i.calculateTextDimensions(r.description,Et(yt));r.width=r.wrap?yt.width:o.getMax(yt.width,l.width+2*yt.wrapPadding),r.height=r.wrap?o.getMax(l.height,yt.height):yt.height,c=o.getMax(c,r.height)}for(const t in s){const a=e[t];if(!a)continue;const r=e[a.nextActor];if(!r){const e=s[t]+yt.actorMargin-a.width/2;a.margin=o.getMax(e,yt.actorMargin);continue}const i=s[t]+yt.actorMargin-a.width/2-r.width/2;a.margin=o.getMax(i,yt.actorMargin)}let l=0;return r.forEach((t=>{const a=ft(yt);let s=t.actorKeys.reduce(((t,a)=>t+(e[a].width+(e[a].margin||0))),0);s-=2*yt.boxTextMargin,t.wrap&&(t.name=i.wrapLabel(t.name,s-2*yt.wrapPadding,a));const r=i.calculateTextDimensions(t.name,a);l=o.getMax(r.height,l);const n=o.getMax(s,r.width+2*yt.wrapPadding);if(t.margin=yt.boxTextMargin,s<n){const e=(n-s)/2;t.margin+=e}})),r.forEach((t=>t.textMaxHeight=l)),o.getMax(c,yt.height)}(b,k,E),ut(m),gt(m),xt(m),v&&(mt.bumpVerticalPos(yt.boxMargin),L&&mt.bumpVerticalPos(E[0].textMaxHeight)),!0===yt.hideUnusedParticipants){const t=new Set;P.forEach((e=>{t.add(e.from),t.add(e.to)})),w=w.filter((e=>t.has(e)))}await async function(t,e,a,s,r,i,n){let c,l=0,d=0,h=0;for(const t of s){const s=e[t],r=s.box;c&&c!=r&&(mt.models.addBox(c),d+=yt.boxMargin+c.margin),r&&r!=c&&(r.x=l+d,r.y=0,d+=r.margin),s.width=s.width||yt.width,s.height=o.getMax(s.height||yt.height,yt.height),s.margin=s.margin||yt.actorMargin,h=o.getMax(h,s.height),a[s.name]&&(d+=s.width/2),s.x=l+d,s.starty=mt.getVerticalPos(),mt.insert(s.x,0,s.x+s.width,s.height),l+=s.width+d,s.box&&(s.box.width=l+r.margin-s.box.x),d=s.margin,c=s.box,mt.models.addActor(s)}c&&mt.models.addBox(c),mt.bumpVerticalPos(h)}(0,b,f,w);const I=await async function(t,e,a,s){const n={},c=[];let l,d,h;for(const a of t){switch(a.id=i.random({length:10}),a.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:c.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:a.message&&(l=c.pop(),n[l.id]=l,n[a.id]=l,c.push(l));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:l=c.pop(),n[l.id]=l;break;case s.db.LINETYPE.ACTIVE_START:{const t=e[a.from?a.from.actor:a.to.actor],s=kt(a.from?a.from.actor:a.to.actor).length,r=t.x+t.width/2+(s-1)*yt.activationWidth/2,i={startx:r,stopx:r+yt.activationWidth,actor:a.from.actor,enabled:!0};mt.activations.push(i)}break;case s.db.LINETYPE.ACTIVE_END:{const t=mt.activations.map((t=>t.actor)).lastIndexOf(a.from.actor);delete mt.activations.splice(t,1)[0]}}void 0!==a.placement?(d=await Ot(a,e,s),a.noteModel=d,c.forEach((t=>{l=t,l.from=o.getMin(l.from,d.startx),l.to=o.getMax(l.to,d.startx+d.width),l.width=o.getMax(l.width,Math.abs(l.from-l.to))-yt.labelBoxWidth}))):(h=St(a,e,s),a.msgModel=h,h.startx&&h.stopx&&c.length>0&&c.forEach((t=>{if(l=t,h.startx===h.stopx){const t=e[a.from],s=e[a.to];l.from=o.getMin(t.x-h.width/2,t.x-t.width/2,l.from),l.to=o.getMax(s.x+h.width/2,s.x+t.width/2,l.to),l.width=o.getMax(l.width,Math.abs(l.to-l.from))-yt.labelBoxWidth}else l.from=o.getMin(h.startx,l.from),l.to=o.getMax(h.stopx,l.to),l.width=o.getMax(l.width,h.width)-yt.labelBoxWidth})))}return mt.activations=[],r.debug("Loop type widths:",n),n}(P,b,0,h);function M(t,e){const a=mt.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),nt(m,a,e,yt,kt(t.from.actor).length),mt.insert(a.startx,e-10,a.stopx,e)}lt(m),pt(m),dt(m),ht(m);let N=1,A=1;const O=[],S=[];let D=0;for(const t of P){let a,s,i;switch(t.type){case h.db.LINETYPE.NOTE:mt.resetVerticalPos(),s=t.noteModel,await bt(m,s);break;case h.db.LINETYPE.ACTIVE_START:mt.newActivation(t,m,b);break;case h.db.LINETYPE.ACTIVE_END:M(t,mt.getVerticalPos());break;case h.db.LINETYPE.LOOP_START:Mt(I,t,yt.boxMargin,yt.boxMargin+yt.boxTextMargin,(t=>mt.newLoop(t)));break;case h.db.LINETYPE.LOOP_END:a=mt.endLoop(),await ot(m,a,"loop",yt),mt.bumpVerticalPos(a.stopy-mt.getVerticalPos()),mt.models.addLoop(a);break;case h.db.LINETYPE.RECT_START:Mt(I,t,yt.boxMargin,yt.boxMargin,(t=>mt.newLoop(void 0,t.message)));break;case h.db.LINETYPE.RECT_END:a=mt.endLoop(),S.push(a),mt.models.addLoop(a),mt.bumpVerticalPos(a.stopy-mt.getVerticalPos());break;case h.db.LINETYPE.OPT_START:Mt(I,t,yt.boxMargin,yt.boxMargin+yt.boxTextMargin,(t=>mt.newLoop(t)));break;case h.db.LINETYPE.OPT_END:a=mt.endLoop(),await ot(m,a,"opt",yt),mt.bumpVerticalPos(a.stopy-mt.getVerticalPos()),mt.models.addLoop(a);break;case h.db.LINETYPE.ALT_START:Mt(I,t,yt.boxMargin,yt.boxMargin+yt.boxTextMargin,(t=>mt.newLoop(t)));break;case h.db.LINETYPE.ALT_ELSE:Mt(I,t,yt.boxMargin+yt.boxTextMargin,yt.boxMargin,(t=>mt.addSectionToLoop(t)));break;case h.db.LINETYPE.ALT_END:a=mt.endLoop(),await ot(m,a,"alt",yt),mt.bumpVerticalPos(a.stopy-mt.getVerticalPos()),mt.models.addLoop(a);break;case h.db.LINETYPE.PAR_START:case h.db.LINETYPE.PAR_OVER_START:Mt(I,t,yt.boxMargin,yt.boxMargin+yt.boxTextMargin,(t=>mt.newLoop(t))),mt.saveVerticalPos();break;case h.db.LINETYPE.PAR_AND:Mt(I,t,yt.boxMargin+yt.boxTextMargin,yt.boxMargin,(t=>mt.addSectionToLoop(t)));break;case h.db.LINETYPE.PAR_END:a=mt.endLoop(),await ot(m,a,"par",yt),mt.bumpVerticalPos(a.stopy-mt.getVerticalPos()),mt.models.addLoop(a);break;case h.db.LINETYPE.AUTONUMBER:N=t.message.start||N,A=t.message.step||A,t.message.visible?h.db.enableSequenceNumbers():h.db.disableSequenceNumbers();break;case h.db.LINETYPE.CRITICAL_START:Mt(I,t,yt.boxMargin,yt.boxMargin+yt.boxTextMargin,(t=>mt.newLoop(t)));break;case h.db.LINETYPE.CRITICAL_OPTION:Mt(I,t,yt.boxMargin+yt.boxTextMargin,yt.boxMargin,(t=>mt.addSectionToLoop(t)));break;case h.db.LINETYPE.CRITICAL_END:a=mt.endLoop(),await ot(m,a,"critical",yt),mt.bumpVerticalPos(a.stopy-mt.getVerticalPos()),mt.models.addLoop(a);break;case h.db.LINETYPE.BREAK_START:Mt(I,t,yt.boxMargin,yt.boxMargin+yt.boxTextMargin,(t=>mt.newLoop(t)));break;case h.db.LINETYPE.BREAK_END:a=mt.endLoop(),await ot(m,a,"break",yt),mt.bumpVerticalPos(a.stopy-mt.getVerticalPos()),mt.models.addLoop(a);break;default:try{i=t.msgModel,i.starty=mt.getVerticalPos(),i.sequenceIndex=N,i.sequenceVisible=h.db.showSequenceNumbers();const e=await wt(0,i);Nt(t,i,e,D,b,f,T),O.push({messageModel:i,lineStartY:e}),mt.models.addMessage(i)}catch(e){r.error("error while drawing message",e)}}[h.db.LINETYPE.SOLID_OPEN,h.db.LINETYPE.DOTTED_OPEN,h.db.LINETYPE.SOLID,h.db.LINETYPE.DOTTED,h.db.LINETYPE.SOLID_CROSS,h.db.LINETYPE.DOTTED_CROSS,h.db.LINETYPE.SOLID_POINT,h.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(N+=A),D++}r.debug("createdActors",f),r.debug("destroyedActors",T),await _t(m,b,w,!1);for(const t of O)await Pt(m,t.messageModel,t.lineStartY,h);yt.mirrorActors&&await _t(m,b,w,!0),S.forEach((t=>ct(m,t))),J(m,b,w,yt);for(const t of mt.models.boxes)t.height=mt.getVerticalPos()-t.y,mt.insert(t.x,t.y,t.x+t.width,t.height),t.startx=t.x,t.starty=t.y,t.stopx=t.startx+t.width,t.stopy=t.starty+t.height,t.stroke="rgb(0,0,0, 0.5)",await st(m,t,yt);v&&mt.bumpVerticalPos(yt.boxMargin);const R=vt(m,b,w,y),{bounds:C}=mt.getBounds();let $=C.stopy-C.starty;$<R.maxHeight&&($=R.maxHeight);let Y=$+2*yt.diagramMarginY;yt.mirrorActors&&(Y=Y-yt.boxMargin+yt.bottomMarginAdj);let B=C.stopx-C.startx;B<R.maxWidth&&(B=R.maxWidth);const V=B+2*yt.diagramMarginX;_&&m.append("text").text(_).attr("x",(C.stopx-C.startx)/2-2*yt.diagramMarginX).attr("y",-25),c(m,Y,V,yt.useMaxWidth);const F=_?40:0;m.attr("viewBox",C.startx-yt.diagramMarginX+" -"+(yt.diagramMarginY+F)+" "+V+" "+(Y+F)),r.debug("models:",mt.models)}},styles:t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`,init:({wrap:t})=>{q.setWrap(t)}};export{Dt as diagram};