orbitchat 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/orbitchat.js +8 -2
- package/dist/assets/api-DA987w_8.js +2 -0
- package/dist/assets/api-DX_p3qKZ.js +2 -0
- package/dist/assets/arc-CvECY7sY-mF3uILBQ.js +1 -0
- package/dist/assets/{blockDiagram-c4efeb88-BF2cqC5E-BkXQGexK.js → blockDiagram-c4efeb88-NvaZhZFT-DyzUC8xw.js} +8 -8
- package/dist/assets/{c4Diagram-c83219d4-D9AJbzWz-CNYGOFES.js → c4Diagram-c83219d4-gPr1eF38-xGRY6ZJG.js} +3 -3
- package/dist/assets/channel-6PI3wNcc-DbDIx5lv.js +1 -0
- package/dist/assets/classDiagram-beda092f-B8axaKGu-BwcqEuwT.js +2 -0
- package/dist/assets/classDiagram-v2-2358418a-DPdf2DxR-5hysvjgp.js +2 -0
- package/dist/assets/clone-D01vUIhD-DWCt7jEw.js +1 -0
- package/dist/assets/{createText-1719965b-D5GExXUl-Ckz8tHz2.js → createText-1719965b-D9Y3vUMn-BXWUwuWn.js} +1 -1
- package/dist/assets/edges-96097737-Zc6U9nQz-B4W6EbQT.js +4 -0
- package/dist/assets/{erDiagram-0228fc6a-DNX6_tUA-DhPLx33M.js → erDiagram-0228fc6a-BLw8FsIp-Co3IqBB-.js} +4 -4
- package/dist/assets/{flowDb-c6c81e3f-DFROkPpA-B3HlgleO.js → flowDb-c6c81e3f-DXVkMlSE-Bsj2HEVx.js} +3 -3
- package/dist/assets/{flowDiagram-50d868cf-Cmwizbui-BeKU27fc.js → flowDiagram-50d868cf-mkkB0hFd-Pl7pk3Xq.js} +3 -3
- package/dist/assets/flowDiagram-v2-4f6560a1-BRIhxQ3y-D9kQJ4UM.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-CNwLXR6A-DOFVWWCc.js → flowchart-elk-definition-6af322e1-D9IbjnSJ-D-DoGrrB.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-7uphPAFV-BP-Pmtkl.js → ganttDiagram-a2739b55-Cqs5_Zht-BUj_k1-4.js} +3 -3
- package/dist/assets/{gitGraphDiagram-82fe8481-DRDypp_x-D9EVaeSh.js → gitGraphDiagram-82fe8481-txBzFn40-DkScLHCv.js} +12 -12
- package/dist/assets/{graph-CvRY9YIM-BSWPV9Nr.js → graph-BZahQKIN-BnTQ3Y35.js} +1 -1
- package/dist/assets/index-4fWplple.css +1 -0
- package/dist/assets/{index-5325376f-D7k5u-pg-BkjFLQrR.js → index-5325376f-DsNDppci-C-Sv8Db0.js} +1 -1
- package/dist/assets/index-uJgdYNFJ.js +1006 -0
- package/dist/assets/{infoDiagram-8eee0895-BcQBWTwp-B_L_58_Z.js → infoDiagram-8eee0895-SbmhgTjv-CHX7_bdf.js} +3 -3
- package/dist/assets/{journeyDiagram-c64418c1-CN5eh0M6-Cblzjpty.js → journeyDiagram-c64418c1-C7AiwbKr-DOkt6igN.js} +4 -4
- package/dist/assets/layout-j-hMNqAM-kApliJ5_.js +1 -0
- package/dist/assets/{mindmap-definition-8da855dc-BIK1yn9--Jo-NTSHi.js → mindmap-definition-8da855dc-B1WjnfxE-atU1SoQA.js} +13 -13
- package/dist/assets/{pieDiagram-a8764435-ikNRxsHY-DMvtPLAT.js → pieDiagram-a8764435-zrkaw4r--BF-2aWXc.js} +5 -5
- package/dist/assets/{quadrantDiagram-1e28029f-jvSP5gnQ-6wFt9EAe.js → quadrantDiagram-1e28029f-C2Wa5n16-CLeiHK9N.js} +5 -5
- package/dist/assets/{requirementDiagram-08caed73-FO_Z83qK-B12P_I-Z.js → requirementDiagram-08caed73-BtHxx079-BbOwqupS.js} +4 -4
- package/dist/assets/{sankeyDiagram-a04cb91d-DN0iWjES-D5WnyMp5.js → sankeyDiagram-a04cb91d-DXlmqTKB-Dbgyfluo.js} +5 -5
- package/dist/assets/{sequenceDiagram-c5b8d532-CGsjpH84-dYgkkktm.js → sequenceDiagram-c5b8d532-BVQF3vcA-C6q0Hvwz.js} +1 -1
- package/dist/assets/{stateDiagram-1ecb1508-zuhKSs9y-jJmEXeoz.js → stateDiagram-1ecb1508-Dybc3i2m-CELUBkCg.js} +1 -1
- package/dist/assets/stateDiagram-v2-c2b004d7-Bp8rRkv2-B560Z2oj.js +1 -0
- package/dist/assets/{styles-b4e223ce-BOk_k5Y1-BRehazjg.js → styles-b4e223ce-BSiU4oYL-BgSFRCxx.js} +3 -3
- package/dist/assets/{styles-ca3715f6-g0iC1zjD-137Q5E3Y.js → styles-ca3715f6-DU7x0doE-BGs7K4Ws.js} +4 -4
- package/dist/assets/{styles-d45a18b0-VfGWd52Q-CGigGBMU.js → styles-d45a18b0-B_CU21kM-nwxkzuib.js} +3 -3
- package/dist/assets/{svgDrawCommon-b86b1483-BnVJ45aa-DzmeVj2M.js → svgDrawCommon-b86b1483-sbEe2n2v-BuguNFlb.js} +1 -1
- package/dist/assets/threadService-B9Db3n0J.js +1 -0
- package/dist/assets/{timeline-definition-faaaa080-BpDBXry4-BFWV_D1Z.js → timeline-definition-faaaa080-b82QCnJ9-CCJ0MYkA.js} +5 -5
- package/dist/assets/{xychartDiagram-f5964ef8-CvN7DIQW-DQ0y-Ye4.js → xychartDiagram-f5964ef8-BtRcO0uy-Co4cQ3MA.js} +4 -4
- package/dist/index.html +3 -6
- package/package.json +3 -3
- package/dist/assets/api-BHF9IxKN.js +0 -1
- package/dist/assets/api-BK67K_W_.js +0 -2
- package/dist/assets/arc-CVHSP1cu-BRo_NEw5.js +0 -1
- package/dist/assets/channel-BYhLgIow-BRybLlZc.js +0 -1
- package/dist/assets/classDiagram-beda092f-B88VjdUG-BbwMvv2v.js +0 -2
- package/dist/assets/classDiagram-v2-2358418a-BPyGCNOs-Cbd2QXtY.js +0 -2
- package/dist/assets/clone-C0MdfhAf-BMHvCdCo.js +0 -1
- package/dist/assets/edges-96097737-BnGLzlID-DglIvYsr.js +0 -4
- package/dist/assets/flowDiagram-v2-4f6560a1-LfQOA08G-CEF5LezR.js +0 -1
- package/dist/assets/index-BocEneU2.js +0 -983
- package/dist/assets/index-CfrvHiM_.css +0 -1
- package/dist/assets/layout-DSZZaifl-Dg6wRbVD.js +0 -1
- package/dist/assets/stateDiagram-v2-c2b004d7-CNnNRi3z-D_BHzNsc.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{aL as yt,aM as gt,aN as ft,
|
|
1
|
+
import{aL as yt,aM as gt,aN as ft,S as mt,O as w,F as R,k as xt,aO as _t,j as kt}from"./index-uJgdYNFJ.js";import{h as Z}from"./arc-CvECY7sY-mF3uILBQ.js";var Q=function(){var n=function(m,i,o,l){for(o=o||{},l=m.length;l--;o[m[l]]=i);return o},t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],s=[1,10],r=[1,11],a=[1,12],h=[1,13],u=[1,16],y=[1,17],g={trace:function(){},yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:function(m,i,o,l,d,c,x){var _=c.length-1;switch(d){case 1:return c[_-1];case 2:this.$=[];break;case 3:c[_-1].push(c[_]),this.$=c[_-1];break;case 4:case 5:this.$=c[_];break;case 6:case 7:this.$=[];break;case 8:l.getCommonDb().setDiagramTitle(c[_].substr(6)),this.$=c[_].substr(6);break;case 9:this.$=c[_].trim(),l.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=c[_].trim(),l.getCommonDb().setAccDescription(this.$);break;case 12:l.addSection(c[_].substr(8)),this.$=c[_].substr(8);break;case 15:l.addTask(c[_],0,""),this.$=c[_];break;case 16:l.addEvent(c[_].substr(2)),this.$=c[_];break}},table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:s,14:r,16:a,17:h,18:14,19:15,20:u,21:y},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:s,14:r,16:a,17:h,18:14,19:15,20:u,21:y},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:function(m,i){if(i.recoverable)this.trace(m);else{var o=new Error(m);throw o.hash=i,o}},parse:function(m){var i=this,o=[0],l=[],d=[null],c=[],x=this.table,_="",$=0,D=0,O=2,A=1,F=c.slice.call(arguments,1),f=Object.create(this.lexer),k={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(k.yy[E]=this.yy[E]);f.setInput(m,k.yy),k.yy.lexer=f,k.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var I=f.yylloc;c.push(I);var z=f.options&&f.options.ranges;typeof k.yy.parseError=="function"?this.parseError=k.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(){var T;return T=l.pop()||f.lex()||A,typeof T!="number"&&(T instanceof Array&&(l=T,T=l.pop()),T=i.symbols_[T]||T),T}for(var v,C,S,U,L={},W,M,Y,B;;){if(C=o[o.length-1],this.defaultActions[C]?S=this.defaultActions[C]:((v===null||typeof v>"u")&&(v=H()),S=x[C]&&x[C][v]),typeof S>"u"||!S.length||!S[0]){var G="";B=[];for(W in x[C])this.terminals_[W]&&W>O&&B.push("'"+this.terminals_[W]+"'");f.showPosition?G="Parse error on line "+($+1)+`:
|
|
2
2
|
`+f.showPosition()+`
|
|
3
|
-
Expecting `+
|
|
3
|
+
Expecting `+B.join(", ")+", got '"+(this.terminals_[v]||v)+"'":G="Parse error on line "+($+1)+": Unexpected "+(v==A?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(G,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:I,expected:B})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+v);switch(S[0]){case 1:o.push(v),d.push(f.yytext),c.push(f.yylloc),o.push(S[1]),v=null,D=f.yyleng,_=f.yytext,$=f.yylineno,I=f.yylloc;break;case 2:if(M=this.productions_[S[1]][1],L.$=d[d.length-M],L._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},z&&(L._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),U=this.performAction.apply(L,[_,D,$,k.yy,S[1],d,c].concat(F)),typeof U<"u")return U;M&&(o=o.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),o.push(this.productions_[S[1]][0]),d.push(L.$),c.push(L._$),Y=x[o[o.length-2]][o[o.length-1]],o.push(Y);break;case 3:return!0}}return!0}},p=function(){var m={EOF:1,parseError:function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},setInput:function(i,o){return this.yy=o||this.yy||{},this._input=i,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 i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var o=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var d=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),l.length-1&&(this.yylineno-=l.length-1);var c=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:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
5
|
`+o+"^"},test_match:function(i,o){var l,d,c;if(this.options.backtrack_lexer&&(c={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&&(c.yylloc.range=this.yylloc.range.slice(0))),d=i[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],l=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var x in c)this[x]=c[x];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,l,d;this._more||(this.yytext="",this.match="");for(var c=this._currentRules(),x=0;x<c.length;x++)if(l=this._input.match(this.rules[c[x]]),l&&(!o||l[0].length>o[0].length)){if(o=l,d=x,this.options.backtrack_lexer){if(i=this.test_match(l,c[x]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,c[d]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var i=this.next();return i||this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){var i=this.conditionStack.length-1;return i>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(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},pushState:function(i){this.begin(i)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(i,o,l,d){switch(l){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/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,/^(?:section\s[^#:\n;]+)/i,/^(?::\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return m}();g.lexer=p;function b(){this.yy={}}return b.prototype=g,g.Parser=b,new b}();X.parser=X;const bt=X;let N="",nt=0;const J=[],V=[],j=[],it=()=>_t,rt=function(){J.length=0,V.length=0,N="",j.length=0,kt()},st=function(n){N=n,J.push(n)},at=function(){return J},ot=function(){let n=K();const t=100;let e=0;for(;!n&&e<t;)n=K(),e++;return V.push(...j),V},ct=function(n,t,e){const s={id:nt++,section:N,type:N,task:n,score:t||0,events:e?[e]:[]};j.push(s)},lt=function(n){j.find(t=>t.id===nt-1).events.push(n)},ht=function(n){const t={section:N,type:N,description:n,task:n,classes:[]};V.push(t)},K=function(){const n=function(e){return j[e].processed};let t=!0;for(const[e,s]of j.entries())n(e),t=t&&s.processed;return t},vt={clear:rt,getCommonDb:it,addSection:st,getSections:at,getTasks:ot,addTask:ct,addTaskOrg:ht,addEvent:lt},wt=Object.freeze(Object.defineProperty({__proto__:null,addEvent:lt,addSection:st,addTask:ct,addTaskOrg:ht,clear:rt,default:vt,getCommonDb:it,getSections:at,getTasks:ot},Symbol.toStringTag,{value:"Module"})),$t=12,q=function(n,t){const e=n.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},St=function(n,t){const e=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),s=n.append("g");s.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function r(u){const y=Z().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}function a(u){const y=Z().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}function h(u){u.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return t.score>3?r(s):t.score<3?a(s):h(s),e},Et=function(n,t){const e=n.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},dt=function(n,t){const e=t.text.replace(/<br\s*\/?>/gi," "),s=n.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class!==void 0&&s.attr("class",t.class);const r=s.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(e),s},It=function(n,t){function e(r,a,h,u,y){return r+","+a+" "+(r+h)+","+a+" "+(r+h)+","+(a+u-y)+" "+(r+h-y*1.2)+","+(a+u)+" "+r+","+(a+u)}const s=n.append("polygon");s.attr("points",e(t.x,t.y,50,20,7)),s.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,dt(n,t)},Mt=function(n,t,e){const s=n.append("g"),r=Q();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=e.width,r.height=e.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,q(s,r),ut(e)(t.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},e,t.colour)};let tt=-1;const Tt=function(n,t,e){const s=t.x+e.width/2,r=n.append("g");tt++,r.append("line").attr("id","task"+tt).attr("x1",s).attr("y1",t.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),St(r,{cx:s,cy:300+(5-t.score)*30,score:t.score});const a=Q();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=e.width,a.height=e.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,q(r,a),t.x+14,ut(e)(t.task,r,a.x,a.y,a.width,a.height,{class:"task"},e,t.colour)},At=function(n,t){q(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},Ht=function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},Q=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},ut=function(){function n(r,a,h,u,y,g,p,b){const m=a.append("text").attr("x",h+y/2).attr("y",u+g/2+5).style("font-color",b).style("text-anchor","middle").text(r);s(m,p)}function t(r,a,h,u,y,g,p,b,m){const{taskFontSize:i,taskFontFamily:o}=b,l=r.split(/<br\s*\/?>/gi);for(let d=0;d<l.length;d++){const c=d*i-i*(l.length-1)/2,x=a.append("text").attr("x",h+y/2).attr("y",u).attr("fill",m).style("text-anchor","middle").style("font-size",i).style("font-family",o);x.append("tspan").attr("x",h+y/2).attr("dy",c).text(l[d]),x.attr("y",u+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(x,p)}}function e(r,a,h,u,y,g,p,b){const m=a.append("switch"),i=m.append("foreignObject").attr("x",h).attr("y",u).attr("width",y).attr("height",g).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");i.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,m,h,u,y,g,p,b),s(i,p)}function s(r,a){for(const h in a)h in a&&r.attr(h,a[h])}return function(r){return r.textPlacement==="fo"?e:r.textPlacement==="old"?n:t}}(),Pt=function(n){n.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")};function pt(n,t){n.each(function(){var e=R(this),s=e.text().split(/(\s+|<br>)/).reverse(),r,a=[],h=1.1,u=e.attr("y"),y=parseFloat(e.attr("dy")),g=e.text(null).append("tspan").attr("x",0).attr("y",u).attr("dy",y+"em");for(let p=0;p<s.length;p++)r=s[s.length-1-p],a.push(r),g.text(a.join(" ").trim()),(g.node().getComputedTextLength()>t||r==="<br>")&&(a.pop(),g.text(a.join(" ").trim()),r==="<br>"?a=[""]:a=[r],g=e.append("tspan").attr("x",0).attr("y",u).attr("dy",h+"em").text(r))})}const Ct=function(n,t,e,s){const r=e%$t-1,a=n.append("g");t.section=r,a.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+r));const h=a.append("g"),u=a.append("g"),y=u.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,t.width).node().getBBox(),g=s.fontSize&&s.fontSize.replace?s.fontSize.replace("px",""):s.fontSize;return t.height=y.height+g*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,u.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),zt(h,t,r),t},Ot=function(n,t,e){const s=n.append("g"),r=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,t.width).node().getBBox(),a=e.fontSize&&e.fontSize.replace?e.fontSize.replace("px",""):e.fontSize;return s.remove(),r.height+a*1.1*.5+t.padding},zt=function(n,t,e){n.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),n.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},C={drawRect:q,drawCircle:Et,drawSection:Mt,drawText:dt,drawLabel:It,drawTask:Tt,drawBackgroundRect:At,getTextObj:Ht,getNoteRect:Q,initGraphics:Pt,drawNode:Ct,getVirtualNodeHeight:Ot},Lt=function(n,t,e,s){var r,a;const h=mt(),u=h.leftMargin??50;w.debug("timeline",s.db);const y=h.securityLevel;let g;y==="sandbox"&&(g=R("#i"+t));const p=(y==="sandbox"?R(g.nodes()[0].contentDocument.body):R("body")).select("#"+t);p.append("g");const b=s.db.getTasks(),m=s.db.getCommonDb().getDiagramTitle();w.debug("task",b),C.initGraphics(p);const i=s.db.getSections();w.debug("sections",i);let o=0,l=0,d=0,c=0,x=50+u,_=50;c=50;let $=0,D=!0;i.forEach(function(f){const k={number:$,descr:f,section:$,width:150,padding:20,maxHeight:o},E=C.getVirtualNodeHeight(p,k,h);w.debug("sectionHeight before draw",E),o=Math.max(o,E+20)});let O=0,A=0;w.debug("tasks.length",b.length);for(const[f,k]of b.entries()){const E={number:f,descr:k,section:k.section,width:150,padding:20,maxHeight:l},I=C.getVirtualNodeHeight(p,E,h);w.debug("taskHeight before draw",I),l=Math.max(l,I+20),O=Math.max(O,k.events.length);let z=0;for(let H=0;H<k.events.length;H++){const v={descr:k.events[H],section:k.section,number:k.section,width:150,padding:20,maxHeight:50};z+=C.getVirtualNodeHeight(p,v,h)}A=Math.max(A,z)}w.debug("maxSectionHeight before draw",o),w.debug("maxTaskHeight before draw",l),i&&i.length>0?i.forEach(f=>{const k=b.filter(H=>H.section===f),E={number:$,descr:f,section:$,width:200*Math.max(k.length,1)-50,padding:20,maxHeight:o};w.debug("sectionNode",E);const I=p.append("g"),z=C.drawNode(I,E,$,h);w.debug("sectionNode output",z),I.attr("transform",`translate(${x}, ${c})`),_+=o+50,k.length>0&&et(p,k,$,x,_,l,h,O,A,o,!1),x+=200*Math.max(k.length,1),_=c,$++}):(D=!1,et(p,b,$,x,_,l,h,O,A,o,!0));const W=p.node().getBBox();w.debug("bounds",W),m&&p.append("text").text(m).attr("x",W.width/2-u).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),d=D?o+l+150:l+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",u).attr("y1",d).attr("x2",W.width+3*u).attr("y2",d).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),xt(void 0,p,((r=h.timeline)==null?void 0:r.padding)??50,((a=h.timeline)==null?void 0:a.useMaxWidth)??!1)},et=function(n,t,e,s,r,a,h,u,y,g,p){var b;for(const m of t){const i={descr:m.task,section:e,number:e,width:150,padding:20,maxHeight:a};w.debug("taskNode",i);const o=n.append("g").attr("class","taskWrapper"),l=C.drawNode(o,i,e,h).height;if(w.debug("taskHeight after draw",l),o.attr("transform",`translate(${s}, ${r})`),a=Math.max(a,l),m.events){const d=n.append("g").attr("class","lineWrapper");let c=a;r+=100,c=c+Nt(n,m.events,e,s,r,h),r-=100,d.append("line").attr("x1",s+190/2).attr("y1",r+a).attr("x2",s+190/2).attr("y2",r+a+(p?a:g)+y+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}s=s+200,p&&!((b=h.timeline)!=null&&b.disableMulticolor)&&e++}r=r-10},Nt=function(n,t,e,s,r,a){let h=0;const u=r;r=r+100;for(const y of t){const g={descr:y,section:e,number:e,width:150,padding:20,maxHeight:50};w.debug("eventNode",g);const p=n.append("g").attr("class","eventWrapper"),b=C.drawNode(p,g,e,a).height;h=h+b,p.attr("transform",`translate(${s}, ${r})`),r=r+10+b}return r=u,h},jt={setConf:()=>{},draw:Lt},Dt=n=>{let t="";for(let e=0;e<n.THEME_COLOR_LIMIT;e++)n["lineColor"+e]=n["lineColor"+e]||n["cScaleInv"+e],yt(n["lineColor"+e])?n["lineColor"+e]=gt(n["lineColor"+e],20):n["lineColor"+e]=ft(n["lineColor"+e],20);for(let e=0;e<n.THEME_COLOR_LIMIT;e++){const s=""+(17-3*e);t+=`
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var i=this.next();return i||this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){var i=this.conditionStack.length-1;return i>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(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},pushState:function(i){this.begin(i)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(i,o,l,d){switch(l){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/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,/^(?:section\s[^#:\n;]+)/i,/^(?::\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return m}();g.lexer=p;function b(){this.yy={}}return b.prototype=g,g.Parser=b,new b}();Q.parser=Q;const bt=Q;let N="",nt=0;const X=[],V=[],j=[],it=()=>_t,rt=function(){X.length=0,V.length=0,N="",j.length=0,kt()},st=function(n){N=n,X.push(n)},at=function(){return X},ot=function(){let n=K();const t=100;let e=0;for(;!n&&e<t;)n=K(),e++;return V.push(...j),V},ct=function(n,t,e){const s={id:nt++,section:N,type:N,task:n,score:t||0,events:e?[e]:[]};j.push(s)},lt=function(n){j.find(t=>t.id===nt-1).events.push(n)},ht=function(n){const t={section:N,type:N,description:n,task:n,classes:[]};V.push(t)},K=function(){const n=function(e){return j[e].processed};let t=!0;for(const[e,s]of j.entries())n(e),t=t&&s.processed;return t},vt={clear:rt,getCommonDb:it,addSection:st,getSections:at,getTasks:ot,addTask:ct,addTaskOrg:ht,addEvent:lt},wt=Object.freeze(Object.defineProperty({__proto__:null,addEvent:lt,addSection:st,addTask:ct,addTaskOrg:ht,clear:rt,default:vt,getCommonDb:it,getSections:at,getTasks:ot},Symbol.toStringTag,{value:"Module"})),$t=12,q=function(n,t){const e=n.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},St=function(n,t){const e=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),s=n.append("g");s.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function r(u){const y=Z().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}function a(u){const y=Z().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}function h(u){u.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return t.score>3?r(s):t.score<3?a(s):h(s),e},Et=function(n,t){const e=n.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},dt=function(n,t){const e=t.text.replace(/<br\s*\/?>/gi," "),s=n.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class!==void 0&&s.attr("class",t.class);const r=s.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(e),s},It=function(n,t){function e(r,a,h,u,y){return r+","+a+" "+(r+h)+","+a+" "+(r+h)+","+(a+u-y)+" "+(r+h-y*1.2)+","+(a+u)+" "+r+","+(a+u)}const s=n.append("polygon");s.attr("points",e(t.x,t.y,50,20,7)),s.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,dt(n,t)},Mt=function(n,t,e){const s=n.append("g"),r=J();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=e.width,r.height=e.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,q(s,r),ut(e)(t.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},e,t.colour)};let tt=-1;const Tt=function(n,t,e){const s=t.x+e.width/2,r=n.append("g");tt++,r.append("line").attr("id","task"+tt).attr("x1",s).attr("y1",t.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),St(r,{cx:s,cy:300+(5-t.score)*30,score:t.score});const a=J();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=e.width,a.height=e.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,q(r,a),t.x+14,ut(e)(t.task,r,a.x,a.y,a.width,a.height,{class:"task"},e,t.colour)},At=function(n,t){q(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},Ht=function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},J=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},ut=function(){function n(r,a,h,u,y,g,p,b){const m=a.append("text").attr("x",h+y/2).attr("y",u+g/2+5).style("font-color",b).style("text-anchor","middle").text(r);s(m,p)}function t(r,a,h,u,y,g,p,b,m){const{taskFontSize:i,taskFontFamily:o}=b,l=r.split(/<br\s*\/?>/gi);for(let d=0;d<l.length;d++){const c=d*i-i*(l.length-1)/2,x=a.append("text").attr("x",h+y/2).attr("y",u).attr("fill",m).style("text-anchor","middle").style("font-size",i).style("font-family",o);x.append("tspan").attr("x",h+y/2).attr("dy",c).text(l[d]),x.attr("y",u+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(x,p)}}function e(r,a,h,u,y,g,p,b){const m=a.append("switch"),i=m.append("foreignObject").attr("x",h).attr("y",u).attr("width",y).attr("height",g).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");i.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,m,h,u,y,g,p,b),s(i,p)}function s(r,a){for(const h in a)h in a&&r.attr(h,a[h])}return function(r){return r.textPlacement==="fo"?e:r.textPlacement==="old"?n:t}}(),Ct=function(n){n.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")};function pt(n,t){n.each(function(){var e=R(this),s=e.text().split(/(\s+|<br>)/).reverse(),r,a=[],h=1.1,u=e.attr("y"),y=parseFloat(e.attr("dy")),g=e.text(null).append("tspan").attr("x",0).attr("y",u).attr("dy",y+"em");for(let p=0;p<s.length;p++)r=s[s.length-1-p],a.push(r),g.text(a.join(" ").trim()),(g.node().getComputedTextLength()>t||r==="<br>")&&(a.pop(),g.text(a.join(" ").trim()),r==="<br>"?a=[""]:a=[r],g=e.append("tspan").attr("x",0).attr("y",u).attr("dy",h+"em").text(r))})}const Pt=function(n,t,e,s){const r=e%$t-1,a=n.append("g");t.section=r,a.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+r));const h=a.append("g"),u=a.append("g"),y=u.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,t.width).node().getBBox(),g=s.fontSize&&s.fontSize.replace?s.fontSize.replace("px",""):s.fontSize;return t.height=y.height+g*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,u.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),zt(h,t,r),t},Ot=function(n,t,e){const s=n.append("g"),r=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,t.width).node().getBBox(),a=e.fontSize&&e.fontSize.replace?e.fontSize.replace("px",""):e.fontSize;return s.remove(),r.height+a*1.1*.5+t.padding},zt=function(n,t,e){n.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),n.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},P={drawRect:q,drawCircle:Et,drawSection:Mt,drawText:dt,drawLabel:It,drawTask:Tt,drawBackgroundRect:At,getTextObj:Ht,getNoteRect:J,initGraphics:Ct,drawNode:Pt,getVirtualNodeHeight:Ot},Lt=function(n,t,e,s){var r,a;const h=mt(),u=h.leftMargin??50;w.debug("timeline",s.db);const y=h.securityLevel;let g;y==="sandbox"&&(g=R("#i"+t));const p=(y==="sandbox"?R(g.nodes()[0].contentDocument.body):R("body")).select("#"+t);p.append("g");const b=s.db.getTasks(),m=s.db.getCommonDb().getDiagramTitle();w.debug("task",b),P.initGraphics(p);const i=s.db.getSections();w.debug("sections",i);let o=0,l=0,d=0,c=0,x=50+u,_=50;c=50;let $=0,D=!0;i.forEach(function(f){const k={number:$,descr:f,section:$,width:150,padding:20,maxHeight:o},E=P.getVirtualNodeHeight(p,k,h);w.debug("sectionHeight before draw",E),o=Math.max(o,E+20)});let O=0,A=0;w.debug("tasks.length",b.length);for(const[f,k]of b.entries()){const E={number:f,descr:k,section:k.section,width:150,padding:20,maxHeight:l},I=P.getVirtualNodeHeight(p,E,h);w.debug("taskHeight before draw",I),l=Math.max(l,I+20),O=Math.max(O,k.events.length);let z=0;for(let H=0;H<k.events.length;H++){const v={descr:k.events[H],section:k.section,number:k.section,width:150,padding:20,maxHeight:50};z+=P.getVirtualNodeHeight(p,v,h)}A=Math.max(A,z)}w.debug("maxSectionHeight before draw",o),w.debug("maxTaskHeight before draw",l),i&&i.length>0?i.forEach(f=>{const k=b.filter(H=>H.section===f),E={number:$,descr:f,section:$,width:200*Math.max(k.length,1)-50,padding:20,maxHeight:o};w.debug("sectionNode",E);const I=p.append("g"),z=P.drawNode(I,E,$,h);w.debug("sectionNode output",z),I.attr("transform",`translate(${x}, ${c})`),_+=o+50,k.length>0&&et(p,k,$,x,_,l,h,O,A,o,!1),x+=200*Math.max(k.length,1),_=c,$++}):(D=!1,et(p,b,$,x,_,l,h,O,A,o,!0));const F=p.node().getBBox();w.debug("bounds",F),m&&p.append("text").text(m).attr("x",F.width/2-u).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),d=D?o+l+150:l+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",u).attr("y1",d).attr("x2",F.width+3*u).attr("y2",d).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),xt(void 0,p,((r=h.timeline)==null?void 0:r.padding)??50,((a=h.timeline)==null?void 0:a.useMaxWidth)??!1)},et=function(n,t,e,s,r,a,h,u,y,g,p){var b;for(const m of t){const i={descr:m.task,section:e,number:e,width:150,padding:20,maxHeight:a};w.debug("taskNode",i);const o=n.append("g").attr("class","taskWrapper"),l=P.drawNode(o,i,e,h).height;if(w.debug("taskHeight after draw",l),o.attr("transform",`translate(${s}, ${r})`),a=Math.max(a,l),m.events){const d=n.append("g").attr("class","lineWrapper");let c=a;r+=100,c=c+Nt(n,m.events,e,s,r,h),r-=100,d.append("line").attr("x1",s+190/2).attr("y1",r+a).attr("x2",s+190/2).attr("y2",r+a+(p?a:g)+y+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}s=s+200,p&&!((b=h.timeline)!=null&&b.disableMulticolor)&&e++}r=r-10},Nt=function(n,t,e,s,r,a){let h=0;const u=r;r=r+100;for(const y of t){const g={descr:y,section:e,number:e,width:150,padding:20,maxHeight:50};w.debug("eventNode",g);const p=n.append("g").attr("class","eventWrapper"),b=P.drawNode(p,g,e,a).height;h=h+b,p.attr("transform",`translate(${s}, ${r})`),r=r+10+b}return r=u,h},jt={setConf:()=>{},draw:Lt},Dt=n=>{let t="";for(let e=0;e<n.THEME_COLOR_LIMIT;e++)n["lineColor"+e]=n["lineColor"+e]||n["cScaleInv"+e],yt(n["lineColor"+e])?n["lineColor"+e]=gt(n["lineColor"+e],20):n["lineColor"+e]=ft(n["lineColor"+e],20);for(let e=0;e<n.THEME_COLOR_LIMIT;e++){const s=""+(17-3*e);t+=`
|
|
7
7
|
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} path {
|
|
8
8
|
fill: ${n["cScale"+e]};
|
|
9
9
|
}
|
|
@@ -35,7 +35,7 @@ Expecting `+F.join(", ")+", got '"+(this.terminals_[v]||v)+"'":G="Parse error on
|
|
|
35
35
|
.disabled text {
|
|
36
36
|
fill: #efefef;
|
|
37
37
|
}
|
|
38
|
-
`}return t},
|
|
38
|
+
`}return t},Ft=n=>`
|
|
39
39
|
.edge {
|
|
40
40
|
stroke-width: 3;
|
|
41
41
|
}
|
|
@@ -58,4 +58,4 @@ Expecting `+F.join(", ")+", got '"+(this.terminals_[v]||v)+"'":G="Parse error on
|
|
|
58
58
|
.eventWrapper {
|
|
59
59
|
filter: brightness(120%);
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,Wt=Ft,Vt={db:wt,renderer:jt,parser:bt,styles:Wt};export{Vt as diagram};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{R as Ft,D as Nt,M as At,L as Ot,N as Bt,I as Xt,O as wt,ab as Vt,J as Ut,j as Yt,ak as nt,ac as kt,af as Ht,aj as Gt,G as jt,al as xt,q as dt,e as pt}from"./index-uJgdYNFJ.js";import{U as Qt}from"./createText-1719965b-D9Y3vUMn-BXWUwuWn.js";var et=function(){var e=function(I,h,r,l){for(r=r||{},l=I.length;l--;r[I[l]]=h);return r},t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],c=[1,6],g=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],y=[1,25],D=[1,26],S=[1,28],_=[1,29],P=[1,30],v=[1,31],C=[1,32],E=[1,33],d=[1,34],A=[1,35],o=[1,36],T=[1,37],N=[1,43],ot=[1,42],rt=[1,47],U=[1,50],m=[1,10,12,14,16,18,19,21,23,34,35,36],Q=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],R=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],lt=[1,64],K={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:function(I,h,r,l,f,a,w){var u=a.length-1;switch(f){case 5:l.setOrientation(a[u]);break;case 9:l.setDiagramTitle(a[u].text.trim());break;case 12:l.setLineData({text:"",type:"text"},a[u]);break;case 13:l.setLineData(a[u-1],a[u]);break;case 14:l.setBarData({text:"",type:"text"},a[u]);break;case 15:l.setBarData(a[u-1],a[u]);break;case 16:this.$=a[u].trim(),l.setAccTitle(this.$);break;case 17:case 18:this.$=a[u].trim(),l.setAccDescription(this.$);break;case 19:this.$=a[u-1];break;case 20:this.$=[Number(a[u-2]),...a[u]];break;case 21:this.$=[Number(a[u])];break;case 22:l.setXAxisTitle(a[u]);break;case 23:l.setXAxisTitle(a[u-1]);break;case 24:l.setXAxisTitle({type:"text",text:""});break;case 25:l.setXAxisBand(a[u]);break;case 26:l.setXAxisRangeData(Number(a[u-2]),Number(a[u]));break;case 27:this.$=a[u-1];break;case 28:this.$=[a[u-2],...a[u]];break;case 29:this.$=[a[u]];break;case 30:l.setYAxisTitle(a[u]);break;case 31:l.setYAxisTitle(a[u-1]);break;case 32:l.setYAxisTitle({type:"text",text:""});break;case 33:l.setYAxisRangeData(Number(a[u-2]),Number(a[u]));break;case 37:this.$={text:a[u],type:"text"};break;case 38:this.$={text:a[u],type:"text"};break;case 39:this.$={text:a[u],type:"markdown"};break;case 40:this.$=a[u];break;case 41:this.$=a[u-1]+""+a[u];break}},table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:c,36:g}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:c,36:g}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:c,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:c,36:g}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:c,36:g}),{11:23,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T},{11:39,13:38,24:N,27:ot,29:40,30:41,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T},{11:45,15:44,27:rt,33:46,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T},{11:49,17:48,24:U,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T},{11:52,17:51,24:U,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T},{20:[1,53]},{22:[1,54]},e(m,[2,18]),{1:[2,2]},e(m,[2,8]),e(m,[2,9]),e(Q,[2,37],{40:55,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T}),e(Q,[2,38]),e(Q,[2,39]),e(R,[2,40]),e(R,[2,42]),e(R,[2,43]),e(R,[2,44]),e(R,[2,45]),e(R,[2,46]),e(R,[2,47]),e(R,[2,48]),e(R,[2,49]),e(R,[2,50]),e(R,[2,51]),e(m,[2,10]),e(m,[2,22],{30:41,29:56,24:N,27:ot}),e(m,[2,24]),e(m,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T},e(m,[2,11]),e(m,[2,30],{33:60,27:rt}),e(m,[2,32]),{31:[1,61]},e(m,[2,12]),{17:62,24:U},{25:63,27:lt},e(m,[2,14]),{17:65,24:U},e(m,[2,16]),e(m,[2,17]),e(R,[2,41]),e(m,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(m,[2,31]),{27:[1,69]},e(m,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(m,[2,15]),e(m,[2,26]),e(m,[2,27]),{11:59,32:72,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:v,45:C,46:E,47:d,48:A,49:o,50:T},e(m,[2,33]),e(m,[2,19]),{25:73,27:lt},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:function(I,h){if(h.recoverable)this.trace(I);else{var r=new Error(I);throw r.hash=h,r}},parse:function(I){var h=this,r=[0],l=[],f=[null],a=[],w=this.table,u="",Y=0,ct=0,Mt=2,gt=1,$t=a.slice.call(arguments,1),b=Object.create(this.lexer),z={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(z.yy[J]=this.yy[J]);b.setInput(I,z.yy),z.yy.lexer=b,z.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;a.push(q);var zt=b.options&&b.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Wt(){var $;return $=l.pop()||b.lex()||gt,typeof $!="number"&&($ instanceof Array&&(l=$,$=l.pop()),$=h.symbols_[$]||$),$}for(var k,W,L,tt,F={},H,M,ut,G;;){if(W=r[r.length-1],this.defaultActions[W]?L=this.defaultActions[W]:((k===null||typeof k>"u")&&(k=Wt()),L=w[W]&&w[W][k]),typeof L>"u"||!L.length||!L[0]){var it="";G=[];for(H in w[W])this.terminals_[H]&&H>Mt&&G.push("'"+this.terminals_[H]+"'");b.showPosition?it="Parse error on line "+(Y+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
|
-
Expecting `+G.join(", ")+", got '"+(this.terminals_[k]||k)+"'":it="Parse error on line "+(Y+1)+": Unexpected "+(k==gt?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(it,{text:b.match,token:this.terminals_[k]||k,line:b.yylineno,loc:
|
|
3
|
+
Expecting `+G.join(", ")+", got '"+(this.terminals_[k]||k)+"'":it="Parse error on line "+(Y+1)+": Unexpected "+(k==gt?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(it,{text:b.match,token:this.terminals_[k]||k,line:b.yylineno,loc:q,expected:G})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+k);switch(L[0]){case 1:r.push(k),f.push(b.yytext),a.push(b.yylloc),r.push(L[1]),k=null,ct=b.yyleng,u=b.yytext,Y=b.yylineno,q=b.yylloc;break;case 2:if(M=this.productions_[L[1]][1],F.$=f[f.length-M],F._$={first_line:a[a.length-(M||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(M||1)].first_column,last_column:a[a.length-1].last_column},zt&&(F._$.range=[a[a.length-(M||1)].range[0],a[a.length-1].range[1]]),tt=this.performAction.apply(F,[u,ct,Y,z.yy,L[1],f,a].concat($t)),typeof tt<"u")return tt;M&&(r=r.slice(0,-1*M*2),f=f.slice(0,-1*M),a=a.slice(0,-1*M)),r.push(this.productions_[L[1]][0]),f.push(F.$),a.push(F._$),ut=w[r[r.length-2]][r[r.length-1]],r.push(ut);break;case 3:return!0}}return!0}},It=function(){var I={EOF:1,parseError:function(h,r){if(this.yy.parser)this.yy.parser.parseError(h,r);else throw new Error(h)},setInput:function(h,r){return this.yy=r||this.yy||{},this._input=h,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 h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var r=h.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},unput:function(h){var r=h.length,l=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var f=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),l.length-1&&(this.yylineno-=l.length-1);var a=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:l?(l.length===f.length?this.yylloc.first_column:0)+f[f.length-l.length].length-l[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(h){this.unput(this.match.slice(h))},pastInput:function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var h=this.pastInput(),r=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
|
5
5
|
`+r+"^"},test_match:function(h,r){var l,f,a;if(this.options.backtrack_lexer&&(a={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&&(a.yylloc.range=this.yylloc.range.slice(0))),f=h[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],l=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var w in a)this[w]=a[w];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,r,l,f;this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),w=0;w<a.length;w++)if(l=this._input.match(this.rules[a[w]]),l&&(!r||l[0].length>r[0].length)){if(r=l,f=w,this.options.backtrack_lexer){if(h=this.test_match(l,a[w]),h!==!1)return h;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(h=this.test_match(r,a[f]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var h=this.next();return h||this.lex()},begin:function(h){this.conditionStack.push(h)},popState:function(){var h=this.conditionStack.length-1;return h>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(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},pushState:function(h){this.begin(h)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(h,r,l,f){switch(l){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 25:this.popState();break;case 26:this.pushState("string");break;case 27:this.popState();break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 43:break;case 44:return 35;case 45:return 36}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return $}();K.lexer=$t;function Z(){this.yy={}}return Z.prototype=K,K.Parser=Z,new Z}();et.parser=et;const Kt=et;function ft(e){return e.type==="bar"}function Ct(e){return e.type==="band"}function N(e){return e.type==="linear"}class St{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((c,g)=>Math.max(g.length,c),0)*i,height:i};const s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const c of t){const g=Qt(n,1,c),p=g?g.width:c.length*i,y=g?g.height:i;s.width=Math.max(s.width,p),s.height=Math.max(s.height,y)}return n.remove(),s}}const yt=.7,mt=.2;class _t{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){yt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(yt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=mt*t.width;this.outerPadding=Math.min(s.width/2,n);const c=s.height+this.axisConfig.labelPadding*2;this.labelTextHeight=s.height,c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=mt*t.height;this.outerPadding=Math.min(s.height/2,n);const c=s.width+this.axisConfig.labelPadding*2;c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}}class Zt extends _t{constructor(t,i,s,n,c){super(t,n,c,i),this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),wt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)||this.getRange()[0]}}class qt extends _t{constructor(t,i,s,n,c){super(t,n,c,i),this.domain=s,this.scale=dt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=dt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}}function bt(e,t,i,s){const n=new St(s);return Ct(e)?new Zt(t,i,e.categories,e.title,n):new qt(t,i,[e.min,e.max],e.title,n)}class Jt{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}}function ti(e,t,i,s){const n=new St(s);return new Jt(n,e,t,i)}class ii{constructor(t,i,s,n,c){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=c}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let i;return this.orientation==="horizontal"?i=pt().y(s=>s[0]).x(s=>s[1])(t):i=pt().x(s=>s[0]).y(s=>s[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}}class ei{constructor(t,i,s,n,c,g){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=c,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=i/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:i,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:i,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}}class si{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const n=new ii(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{const n=new ei(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}}function ni(e,t,i){return new si(e,t,i)}class ai{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:ti(t,i,s,n),plot:ni(t,i,s),xAxis:bt(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:bt(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,c=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:c,height:g});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=p.width,t-=p.width,t>0&&(c+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:c,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+g}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(y=>ft(y))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,c=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),y=this.componentStore.plot.calculateSpace({width:g,height:p});t-=y.width,i-=y.height,y=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=y.height,i-=y.height,this.componentStore.xAxis.setAxisPosition("left"),y=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=y.width,n=y.width,this.componentStore.yAxis.setAxisPosition("top"),y=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=y.height,c=s+y.height,t>0&&(g+=t,t=0),i>0&&(p+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:p}),this.componentStore.plot.setBoundingBoxXY({x:n,y:c}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([c,c+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:c}),this.chartData.plots.some(D=>ft(D))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}}class hi{static build(t,i,s,n){return new ai(t,i,s,n).getDrawableElement()}}let O=0,Tt,X=Lt(),V=Rt(),x=Dt(),st=V.plotColorPalette.split(",").map(e=>e.trim()),j=!1,at=!1;function Rt(){const e=Gt(),t=nt();return kt(e.xyChart,t.themeVariables.xyChart)}function Lt(){const e=nt();return kt(Ht.xyChart,e.xyChart)}function Dt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function ht(e){const t=nt();return jt(e.trim(),t)}function oi(e){Tt=e}function ri(e){e==="horizontal"?X.chartOrientation="horizontal":X.chartOrientation="vertical"}function li(e){x.xAxis.title=ht(e.text)}function Pt(e,t){x.xAxis={type:"linear",title:x.xAxis.title,min:e,max:t},j=!0}function ci(e){x.xAxis={type:"band",title:x.xAxis.title,categories:e.map(t=>ht(t.text))},j=!0}function gi(e){x.yAxis.title=ht(e.text)}function ui(e,t){x.yAxis={type:"linear",title:x.yAxis.title,min:e,max:t},at=!0}function xi(e){const t=Math.min(...e),i=Math.max(...e),s=N(x.yAxis)?x.yAxis.min:1/0,n=N(x.yAxis)?x.yAxis.max:-1/0;x.yAxis={type:"linear",title:x.yAxis.title,min:Math.min(s,t),max:Math.max(n,i)}}function vt(e){let t=[];if(e.length===0)return t;if(!j){const i=N(x.xAxis)?x.xAxis.min:1/0,s=N(x.xAxis)?x.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(s,e.length))}if(at||xi(e),Ct(x.xAxis)&&(t=x.xAxis.categories.map((i,s)=>[i,e[s]])),N(x.xAxis)){const i=x.xAxis.min,s=x.xAxis.max,n=(s-i+1)/e.length,c=[];for(let g=i;g<=s;g+=n)c.push(`${g}`);t=c.map((g,p)=>[g,e[p]])}return t}function Et(e){return st[e===0?0:e%st.length]}function di(e,t){const i=vt(t);x.plots.push({type:"line",strokeFill:Et(O),strokeWidth:2,data:i}),O++}function pi(e,t){const i=vt(t);x.plots.push({type:"bar",fill:Et(O),data:i}),O++}function fi(){if(x.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return x.title=At(),hi.build(X,x,V,Tt)}function yi(){return V}function mi(){return X}const bi=function(){Yt(),O=0,X=Lt(),x=Dt(),V=Rt(),st=V.plotColorPalette.split(",").map(e=>e.trim()),j=!1,at=!1},Ai={getDrawableElem:fi,clear:bi,setAccTitle:Xt,getAccTitle:Ot,setDiagramTitle:Nt,getDiagramTitle:At,getAccDescription:Bt,setAccDescription:Ft,setOrientation:ri,setXAxisTitle:li,setXAxisRangeData:Pt,setXAxisBand:ci,setYAxisTitle:gi,setYAxisRangeData:ui,setLineData:di,setBarData:pi,setTmpSVGG:oi,getChartThemeConfig:yi,getChartConfig:mi},wi=(e,t,i,s)=>{const n=s.db,c=n.getChartThemeConfig(),g=n.getChartConfig();function p(d){return d==="top"?"text-before-edge":"middle"}function y(d){return d==="left"?"start":d==="right"?"end":"middle"}function D(d){return`translate(${d.x}, ${d.y}) rotate(${d.rotation||0})`}wt.debug(`Rendering xychart chart
|
|
7
|
-
`+e);const
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var h=this.next();return h||this.lex()},begin:function(h){this.conditionStack.push(h)},popState:function(){var h=this.conditionStack.length-1;return h>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(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},pushState:function(h){this.begin(h)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(h,r,l,f){switch(l){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 25:this.popState();break;case 26:this.pushState("string");break;case 27:this.popState();break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 43:break;case 44:return 35;case 45:return 36}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return I}();K.lexer=It;function Z(){this.yy={}}return Z.prototype=K,K.Parser=Z,new Z}();et.parser=et;const Kt=et;function ft(e){return e.type==="bar"}function St(e){return e.type==="band"}function O(e){return e.type==="linear"}class Ct{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((c,g)=>Math.max(g.length,c),0)*i,height:i};const s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const c of t){const g=Qt(n,1,c),p=g?g.width:c.length*i,y=g?g.height:i;s.width=Math.max(s.width,p),s.height=Math.max(s.height,y)}return n.remove(),s}}const yt=.7,mt=.2;class _t{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){yt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(yt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=mt*t.width;this.outerPadding=Math.min(s.width/2,n);const c=s.height+this.axisConfig.labelPadding*2;this.labelTextHeight=s.height,c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=mt*t.height;this.outerPadding=Math.min(s.height/2,n);const c=s.width+this.axisConfig.labelPadding*2;c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}}class Zt extends _t{constructor(t,i,s,n,c){super(t,n,c,i),this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),wt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)||this.getRange()[0]}}class Jt extends _t{constructor(t,i,s,n,c){super(t,n,c,i),this.domain=s,this.scale=dt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=dt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}}function bt(e,t,i,s){const n=new Ct(s);return St(e)?new Zt(t,i,e.categories,e.title,n):new Jt(t,i,[e.min,e.max],e.title,n)}class qt{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}}function ti(e,t,i,s){const n=new Ct(s);return new qt(n,e,t,i)}class ii{constructor(t,i,s,n,c){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=c}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let i;return this.orientation==="horizontal"?i=pt().y(s=>s[0]).x(s=>s[1])(t):i=pt().x(s=>s[0]).y(s=>s[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}}class ei{constructor(t,i,s,n,c,g){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=c,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=i/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:i,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:i,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}}class si{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const n=new ii(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{const n=new ei(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}}function ni(e,t,i){return new si(e,t,i)}class ai{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:ti(t,i,s,n),plot:ni(t,i,s),xAxis:bt(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:bt(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,c=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:c,height:g});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=p.width,t-=p.width,t>0&&(c+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:c,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+g}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(y=>ft(y))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,c=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),y=this.componentStore.plot.calculateSpace({width:g,height:p});t-=y.width,i-=y.height,y=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=y.height,i-=y.height,this.componentStore.xAxis.setAxisPosition("left"),y=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=y.width,n=y.width,this.componentStore.yAxis.setAxisPosition("top"),y=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=y.height,c=s+y.height,t>0&&(g+=t,t=0),i>0&&(p+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:p}),this.componentStore.plot.setBoundingBoxXY({x:n,y:c}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([c,c+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:c}),this.chartData.plots.some(D=>ft(D))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}}class hi{static build(t,i,s,n){return new ai(t,i,s,n).getDrawableElement()}}let B=0,Tt,X=Lt(),V=Rt(),x=Dt(),st=V.plotColorPalette.split(",").map(e=>e.trim()),j=!1,at=!1;function Rt(){const e=Gt(),t=nt();return kt(e.xyChart,t.themeVariables.xyChart)}function Lt(){const e=nt();return kt(Ht.xyChart,e.xyChart)}function Dt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function ht(e){const t=nt();return jt(e.trim(),t)}function oi(e){Tt=e}function ri(e){e==="horizontal"?X.chartOrientation="horizontal":X.chartOrientation="vertical"}function li(e){x.xAxis.title=ht(e.text)}function Pt(e,t){x.xAxis={type:"linear",title:x.xAxis.title,min:e,max:t},j=!0}function ci(e){x.xAxis={type:"band",title:x.xAxis.title,categories:e.map(t=>ht(t.text))},j=!0}function gi(e){x.yAxis.title=ht(e.text)}function ui(e,t){x.yAxis={type:"linear",title:x.yAxis.title,min:e,max:t},at=!0}function xi(e){const t=Math.min(...e),i=Math.max(...e),s=O(x.yAxis)?x.yAxis.min:1/0,n=O(x.yAxis)?x.yAxis.max:-1/0;x.yAxis={type:"linear",title:x.yAxis.title,min:Math.min(s,t),max:Math.max(n,i)}}function vt(e){let t=[];if(e.length===0)return t;if(!j){const i=O(x.xAxis)?x.xAxis.min:1/0,s=O(x.xAxis)?x.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(s,e.length))}if(at||xi(e),St(x.xAxis)&&(t=x.xAxis.categories.map((i,s)=>[i,e[s]])),O(x.xAxis)){const i=x.xAxis.min,s=x.xAxis.max,n=(s-i+1)/e.length,c=[];for(let g=i;g<=s;g+=n)c.push(`${g}`);t=c.map((g,p)=>[g,e[p]])}return t}function Et(e){return st[e===0?0:e%st.length]}function di(e,t){const i=vt(t);x.plots.push({type:"line",strokeFill:Et(B),strokeWidth:2,data:i}),B++}function pi(e,t){const i=vt(t);x.plots.push({type:"bar",fill:Et(B),data:i}),B++}function fi(){if(x.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return x.title=At(),hi.build(X,x,V,Tt)}function yi(){return V}function mi(){return X}const bi=function(){Yt(),B=0,X=Lt(),x=Dt(),V=Rt(),st=V.plotColorPalette.split(",").map(e=>e.trim()),j=!1,at=!1},Ai={getDrawableElem:fi,clear:bi,setAccTitle:Xt,getAccTitle:Bt,setDiagramTitle:Ot,getDiagramTitle:At,getAccDescription:Nt,setAccDescription:Ft,setOrientation:ri,setXAxisTitle:li,setXAxisRangeData:Pt,setXAxisBand:ci,setYAxisTitle:gi,setYAxisRangeData:ui,setLineData:di,setBarData:pi,setTmpSVGG:oi,getChartThemeConfig:yi,getChartConfig:mi},wi=(e,t,i,s)=>{const n=s.db,c=n.getChartThemeConfig(),g=n.getChartConfig();function p(d){return d==="top"?"text-before-edge":"middle"}function y(d){return d==="left"?"start":d==="right"?"end":"middle"}function D(d){return`translate(${d.x}, ${d.y}) rotate(${d.rotation||0})`}wt.debug(`Rendering xychart chart
|
|
7
|
+
`+e);const S=Vt(t),_=S.append("g").attr("class","main"),P=_.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");Ut(S,g.height,g.width,!0),S.attr("viewBox",`0 0 ${g.width} ${g.height}`),P.attr("fill",c.backgroundColor),n.setTmpSVGG(S.append("g").attr("class","mermaid-tmp-group"));const v=n.getDrawableElem(),C={};function E(d){let A=_,o="";for(const[T]of d.entries()){let N=_;T>0&&C[o]&&(N=C[o]),o+=d[T],A=C[o],A||(A=C[o]=N.append("g").attr("class",d[T]))}return A}for(const d of v){if(d.data.length===0)continue;const A=E(d.groupTexts);switch(d.type){case"rect":A.selectAll("rect").data(d.data).enter().append("rect").attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height).attr("fill",o=>o.fill).attr("stroke",o=>o.strokeFill).attr("stroke-width",o=>o.strokeWidth);break;case"text":A.selectAll("text").data(d.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",o=>o.fill).attr("font-size",o=>o.fontSize).attr("dominant-baseline",o=>p(o.verticalPos)).attr("text-anchor",o=>y(o.horizontalPos)).attr("transform",o=>D(o)).text(o=>o.text);break;case"path":A.selectAll("path").data(d.data).enter().append("path").attr("d",o=>o.path).attr("fill",o=>o.fill?o.fill:"none").attr("stroke",o=>o.strokeFill).attr("stroke-width",o=>o.strokeWidth);break}}},ki={draw:wi},_i={parser:Kt,db:Ai,renderer:ki};export{_i as diagram};
|
package/dist/index.html
CHANGED
|
@@ -5,16 +5,13 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>ORBIT Chat</title>
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
11
8
|
<style>
|
|
12
9
|
* {
|
|
13
|
-
font-family:
|
|
10
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
14
11
|
}
|
|
15
12
|
</style>
|
|
16
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-uJgdYNFJ.js"></script>
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-4fWplple.css">
|
|
18
15
|
</head>
|
|
19
16
|
<body>
|
|
20
17
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orbitchat",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"orbitchat": "./bin/orbitchat.js"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"prepublishOnly": "npm run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@schmitech/chatbot-api": "^2.
|
|
29
|
-
"@schmitech/markdown-renderer": "^0.4.
|
|
28
|
+
"@schmitech/chatbot-api": "^2.1.1",
|
|
29
|
+
"@schmitech/markdown-renderer": "^0.4.2",
|
|
30
30
|
"@types/markdown-it": "^14.1.2",
|
|
31
31
|
"lucide-react": "^0.344.0",
|
|
32
32
|
"path": "^0.12.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const r=()=>{throw new Error("Local API stub loaded while VITE_USE_LOCAL_API=false.")},e=async function*(){throw new Error("Local API stub loaded while VITE_USE_LOCAL_API=false.")};class t{constructor(){throw new Error("Local API stub loaded while VITE_USE_LOCAL_API=false.")}}export{t as ApiClient,r as configureApi,e as streamChat};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as x}from"./index-BocEneU2.js";var U=Object.defineProperty,j=(l,t,e)=>t in l?U(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e,P=(l,t,e)=>j(l,typeof t!="symbol"?t+"":t,e);let I=null,F=null;typeof window>"u"&&Promise.all([x(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null),x(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null)]).then(([l,t])=>{var e,r;(e=l==null?void 0:l.default)!=null&&e.Agent?I=new l.default.Agent({keepAlive:!0}):l!=null&&l.Agent&&(I=new l.Agent({keepAlive:!0})),(r=t==null?void 0:t.default)!=null&&r.Agent?F=new t.default.Agent({keepAlive:!0}):t!=null&&t.Agent&&(F=new t.Agent({keepAlive:!0}))}).catch(l=>{console.warn("Failed to initialize HTTP agents:",l.message)});class q{constructor(t){if(P(this,"apiUrl"),P(this,"apiKey"),P(this,"sessionId"),!t.apiUrl||typeof t.apiUrl!="string")throw new Error("API URL must be a valid string");if(t.apiKey!==void 0&&t.apiKey!==null&&typeof t.apiKey!="string")throw new Error("API key must be a valid string or null");if(t.sessionId!==void 0&&t.sessionId!==null&&typeof t.sessionId!="string")throw new Error("Session ID must be a valid string or null");this.apiUrl=t.apiUrl,this.apiKey=t.apiKey??null,this.sessionId=t.sessionId??null}setSessionId(t){if(t!==null&&typeof t!="string")throw new Error("Session ID must be a valid string or null");this.sessionId=t}getSessionId(){return this.sessionId}async validateApiKey(){var t;if(!this.apiKey)throw new Error("API key is required for validation");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/${this.apiKey}/status`,{...this.getFetchOptions({method:"GET"})}).catch(i=>{throw i.name==="TypeError"&&i.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):i});if(!e.ok){let i="";try{i=await e.text()}catch{i=`HTTP ${e.status}`}let s,n;try{const o=JSON.parse(i);s=o.detail||o.message||i}catch{s=i||`HTTP ${e.status}`}switch(e.status){case 401:n="API key is invalid or expired";break;case 403:n="Access denied: API key does not have required permissions";break;case 404:n="API key not found";break;case 503:n="API key management is not available in inference-only mode";break;default:n=`Failed to validate API key: ${s}`;break}throw new Error(n)}const r=await e.json();if(!r.exists){const i="API key does not exist";throw new Error(i)}if(!r.active){const i="API key is inactive";throw new Error(i)}return r}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Access denied")||e.message.includes("invalid")||e.message.includes("expired")||e.message.includes("inactive")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`API key validation failed: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="API key validation failed. Please check your API key and try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}async getAdapterInfo(){var t;if(!this.apiKey)throw new Error("API key is required to get adapter information");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/info`,{...this.getFetchOptions({method:"GET"})}).catch(r=>{throw r.name==="TypeError"&&r.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):r});if(!e.ok){let r="";try{r=await e.text()}catch{r=`HTTP ${e.status}`}let i,s;try{const n=JSON.parse(r);i=n.detail||n.message||r}catch{i=r||`HTTP ${e.status}`}switch(e.status){case 401:s="API key is invalid, disabled, or has no associated adapter";break;case 404:s="Adapter configuration not found";break;case 503:s="Service is not available";break;default:s=`Failed to get adapter info: ${i}`;break}throw new Error(s)}return await e.json()}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Adapter")||e.message.includes("invalid")||e.message.includes("disabled")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`Failed to get adapter info: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="Failed to get adapter information. Please try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}getFetchOptions(t={}){const e={};if(typeof window>"u"){const i=this.apiUrl.startsWith("https:")?F:I;i&&(e.agent=i)}else e.headers={Connection:"keep-alive"};const r={"X-Request-ID":Date.now().toString(36)+Math.random().toString(36).substring(2)};if(e.headers&&Object.assign(r,e.headers),t.headers){const i=t.headers;for(const[s,n]of Object.entries(i))(s.toLowerCase()!=="x-api-key"||!this.apiKey)&&(r[s]=n)}return this.apiKey&&(r["X-API-Key"]=this.apiKey),this.sessionId&&(r["X-Session-ID"]=this.sessionId),{...t,...e,headers:r}}createChatRequest(t,e=!0,r,i,s,n,o,h,p,m){const c={messages:[{role:"user",content:t}],stream:e};return r&&r.length>0&&(c.file_ids=r),i&&(c.audio_input=i),s&&(c.audio_format=s),n&&(c.language=n),o!==void 0&&(c.return_audio=o),h&&(c.tts_voice=h),p&&(c.source_language=p),m&&(c.target_language=m),c}async*streamChat(t,e=!0,r,i,s,n,o,h,p,m){var c,T;try{const w=new AbortController,O=setTimeout(()=>w.abort(),6e4),y=await fetch(`${this.apiUrl}/v1/chat`,{...this.getFetchOptions({method:"POST",headers:{"Content-Type":"application/json",Accept:e?"text/event-stream":"application/json"},body:JSON.stringify(this.createChatRequest(t,e,r,i,s,n,o,h,p,m))}),signal:w.signal});if(clearTimeout(O),!y.ok){const f=await y.text();throw new Error(`Network response was not ok: ${y.status} ${f}`)}if(!e){const f=await y.json();f.response&&(yield{text:f.response,done:!0,audio:f.audio,audioFormat:f.audio_format});return}const E=(c=y.body)==null?void 0:c.getReader();if(!E)throw new Error("No reader available");const _=new TextDecoder;let u="",k=!1;try{for(;;){const{done:f,value:K}=await E.read();if(f)break;const S=_.decode(K,{stream:!0});u+=S;let v=0,A;for(;(A=u.indexOf(`
|
|
2
|
-
`,v))!==-1;){const g=u.slice(v,A).trim();if(v=A+1,g&&g.startsWith("data: ")){const d=g.slice(6).trim();if(!d||d==="[DONE]"){yield{text:"",done:!0};return}try{const a=JSON.parse(d);if(a.error){const C=`Server error: ${((T=a.error)==null?void 0:T.message)||a.error||"Unknown server error"}`;throw console.warn(`[ApiClient] ${C}`),new Error(C)}const b=a.response||"";if(a.audio_chunk!==void 0&&(yield{text:"",done:!1,audio_chunk:a.audio_chunk,audioFormat:a.audioFormat||a.audio_format||"opus",chunk_index:a.chunk_index??0}),(b||a.audio)&&(k=!0,yield{text:b,done:a.done||!1,audio:a.audio,audioFormat:a.audio_format||a.audioFormat}),a.done){yield{text:"",done:!0,audio:a.audio,audioFormat:a.audio_format||a.audioFormat};return}}catch(a){console.warn("[ApiClient] Unable to parse server response. This may be a temporary issue."),console.warn("[ApiClient] Parse error details:",a==null?void 0:a.message),console.warn("[ApiClient] JSON text length:",d==null?void 0:d.length),console.warn("[ApiClient] JSON text preview (first 200 chars):",d==null?void 0:d.substring(0,200)),console.warn("[ApiClient] JSON text preview (last 200 chars):",d==null?void 0:d.substring(d.length-200))}}else g&&(k=!0,yield{text:g,done:!1})}u=u.slice(v),u.length>1e6&&(console.warn("[ApiClient] Buffer too large, truncating..."),u=u.slice(-5e5))}k&&(yield{text:"",done:!0})}finally{E.releaseLock()}}catch(w){throw w.name==="AbortError"?new Error("Connection timed out. Please check if the server is running."):w.name==="TypeError"&&w.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):w}}async clearConversationHistory(t){const e=t||this.sessionId;if(!e)throw new Error("No session ID provided and no current session available");if(!this.apiKey)throw new Error("API key is required for clearing conversation history");const r={"Content-Type":"application/json","X-Session-ID":e,"X-API-Key":this.apiKey};try{const i=await fetch(`${this.apiUrl}/admin/chat-history/${e}`,{...this.getFetchOptions({method:"DELETE",headers:r})});if(!i.ok){const s=await i.text();throw new Error(`Failed to clear conversation history: ${i.status} ${s}`)}return await i.json()}catch(i){throw i.name==="TypeError"&&i.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):i}}async deleteConversationWithFiles(t,e){const r=t||this.sessionId;if(!r)throw new Error("No session ID provided and no current session available");if(!this.apiKey)throw new Error("API key is required for deleting conversation");const i={"Content-Type":"application/json","X-Session-ID":r,"X-API-Key":this.apiKey},s=e&&e.length>0?`?file_ids=${e.join(",")}`:"",n=`${this.apiUrl}/admin/conversations/${r}${s}`;try{const o=await fetch(n,{...this.getFetchOptions({method:"DELETE",headers:i})});if(!o.ok){const h=await o.text();throw new Error(`Failed to delete conversation: ${o.status} ${h}`)}return await o.json()}catch(o){throw o.name==="TypeError"&&o.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):o}}async uploadFile(t){if(!this.apiKey)throw new Error("API key is required for file upload");const e=new FormData;e.append("file",t);try{const r=await fetch(`${this.apiUrl}/api/files/upload`,{...this.getFetchOptions({method:"POST",body:e})});if(!r.ok){const i=await r.text();throw new Error(`Failed to upload file: ${r.status} ${i}`)}return await r.json()}catch(r){throw r.name==="TypeError"&&r.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):r}}async listFiles(){if(!this.apiKey)throw new Error("API key is required for listing files");try{const t=await fetch(`${this.apiUrl}/api/files`,{...this.getFetchOptions({method:"GET"})});if(!t.ok){const e=await t.text();throw new Error(`Failed to list files: ${t.status} ${e}`)}return await t.json()}catch(t){throw t.name==="TypeError"&&t.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):t}}async getFileInfo(t){if(!this.apiKey)throw new Error("API key is required for getting file info");try{const e=await fetch(`${this.apiUrl}/api/files/${t}`,{...this.getFetchOptions({method:"GET"})});if(!e.ok){const r=await e.text();throw new Error(`Failed to get file info: ${e.status} ${r}`)}return await e.json()}catch(e){throw e.name==="TypeError"&&e.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):e}}async queryFile(t,e,r=10){if(!this.apiKey)throw new Error("API key is required for querying files");try{const i=await fetch(`${this.apiUrl}/api/files/${t}/query`,{...this.getFetchOptions({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,max_results:r})})});if(!i.ok){const s=await i.text();throw new Error(`Failed to query file: ${i.status} ${s}`)}return await i.json()}catch(i){throw i.name==="TypeError"&&i.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):i}}async deleteFile(t){if(!this.apiKey)throw new Error("API key is required for deleting files");const e=`${this.apiUrl}/api/files/${t}`,r=this.getFetchOptions({method:"DELETE"});try{const i=await fetch(e,r);if(!i.ok){const s=await i.text();let n;try{const o=JSON.parse(s);n=o.detail||o.message||`Failed to delete file (HTTP ${i.status})`}catch{n=`Failed to delete file (HTTP ${i.status})`}throw console.warn(`[ApiClient] ${n}`),new Error(n)}return await i.json()}catch(i){let s;throw i.name==="TypeError"&&i.message.includes("Failed to fetch")?s="Could not connect to the server. Please check if the server is running.":i.message&&!i.message.includes("Failed to delete file")?s=i.message:s="Failed to delete file. Please try again.",console.warn(`[ApiClient] ${s}`),new Error(s)}}}let $=null;const N=(l,t=null,e=null)=>{$=new q({apiUrl:l,apiKey:t,sessionId:e})};async function*J(l,t=!0,e,r,i,s,n,o,h,p){if(!$)throw new Error("API not configured. Please call configureApi() with your server URL before using any API functions.");yield*$.streamChat(l,t,e,r,i,s,n,o,h,p)}export{q as ApiClient,N as configureApi,J as streamChat};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aP as sn,aQ as an,aR as Q,aS as X,ag as U,aT as un,aU as l,ai as on,aV as I,aW as q,aX as cn,aY as e,aZ as en,a_ as rn,a$ as yn}from"./index-BocEneU2.js";function fn(s){return s.innerRadius}function ln(s){return s.outerRadius}function gn(s){return s.startAngle}function mn(s){return s.endAngle}function pn(s){return s&&s.padAngle}function xn(s,v,B,O,d,T,V,a){var D=B-s,r=O-v,n=V-d,m=a-T,u=m*D-n*r;if(!(u*u<l))return u=(n*(v-T)-m*(s-d))/u,[s+u*D,v+u*r]}function G(s,v,B,O,d,T,V){var a=s-B,D=v-O,r=(V?T:-T)/I(a*a+D*D),n=r*D,m=-r*a,u=s+n,i=v+m,y=B+n,f=O+m,Z=(u+y)/2,o=(i+f)/2,p=y-u,g=f-i,N=p*p+g*g,R=d-T,A=u*f-y*i,K=(g<0?-1:1)*I(en(0,R*R*N-A*A)),P=(A*g-p*K)/N,S=(-A*p-g*K)/N,E=(A*g+p*K)/N,x=(-A*p+g*K)/N,h=P-Z,t=S-o,c=E-Z,_=x-o;return h*h+t*t>c*c+_*_&&(P=E,S=x),{cx:P,cy:S,x01:-n,y01:-m,x11:P*(d/R-1),y11:S*(d/R-1)}}function vn(){var s=fn,v=ln,B=U(0),O=null,d=gn,T=mn,V=pn,a=null,D=sn(r);function r(){var n,m,u=+s.apply(this,arguments),i=+v.apply(this,arguments),y=d.apply(this,arguments)-un,f=T.apply(this,arguments)-un,Z=cn(f-y),o=f>y;if(a||(a=n=D()),i<u&&(m=i,i=u,u=m),!(i>l))a.moveTo(0,0);else if(Z>on-l)a.moveTo(i*Q(y),i*X(y)),a.arc(0,0,i,y,f,!o),u>l&&(a.moveTo(u*Q(f),u*X(f)),a.arc(0,0,u,f,y,o));else{var p=y,g=f,N=y,R=f,A=Z,K=Z,P=V.apply(this,arguments)/2,S=P>l&&(O?+O.apply(this,arguments):I(u*u+i*i)),E=q(cn(i-u)/2,+B.apply(this,arguments)),x=E,h=E,t,c;if(S>l){var _=rn(S/u*X(P)),L=rn(S/i*X(P));(A-=_*2)>l?(_*=o?1:-1,N+=_,R-=_):(A=0,N=R=(y+f)/2),(K-=L*2)>l?(L*=o?1:-1,p+=L,g-=L):(K=0,p=g=(y+f)/2)}var Y=i*Q(p),$=i*X(p),M=u*Q(R),b=u*X(R);if(E>l){var k=i*Q(g),F=i*X(g),H=u*Q(N),C=u*X(N),W;if(Z<an)if(W=xn(Y,$,H,C,k,F,M,b)){var J=Y-W[0],j=$-W[1],w=k-W[0],z=F-W[1],nn=1/X(yn((J*w+j*z)/(I(J*J+j*j)*I(w*w+z*z)))/2),tn=I(W[0]*W[0]+W[1]*W[1]);x=q(E,(u-tn)/(nn-1)),h=q(E,(i-tn)/(nn+1))}else x=h=0}K>l?h>l?(t=G(H,C,Y,$,i,h,o),c=G(k,F,M,b,i,h,o),a.moveTo(t.cx+t.x01,t.cy+t.y01),h<E?a.arc(t.cx,t.cy,h,e(t.y01,t.x01),e(c.y01,c.x01),!o):(a.arc(t.cx,t.cy,h,e(t.y01,t.x01),e(t.y11,t.x11),!o),a.arc(0,0,i,e(t.cy+t.y11,t.cx+t.x11),e(c.cy+c.y11,c.cx+c.x11),!o),a.arc(c.cx,c.cy,h,e(c.y11,c.x11),e(c.y01,c.x01),!o))):(a.moveTo(Y,$),a.arc(0,0,i,p,g,!o)):a.moveTo(Y,$),!(u>l)||!(A>l)?a.lineTo(M,b):x>l?(t=G(M,b,k,F,u,-x,o),c=G(Y,$,H,C,u,-x,o),a.lineTo(t.cx+t.x01,t.cy+t.y01),x<E?a.arc(t.cx,t.cy,x,e(t.y01,t.x01),e(c.y01,c.x01),!o):(a.arc(t.cx,t.cy,x,e(t.y01,t.x01),e(t.y11,t.x11),!o),a.arc(0,0,u,e(t.cy+t.y11,t.cx+t.x11),e(c.cy+c.y11,c.cx+c.x11),o),a.arc(c.cx,c.cy,x,e(c.y11,c.x11),e(c.y01,c.x01),!o))):a.arc(0,0,u,R,N,o)}if(a.closePath(),n)return a=null,n+""||null}return r.centroid=function(){var n=(+s.apply(this,arguments)+ +v.apply(this,arguments))/2,m=(+d.apply(this,arguments)+ +T.apply(this,arguments))/2-an/2;return[Q(m)*n,X(m)*n]},r.innerRadius=function(n){return arguments.length?(s=typeof n=="function"?n:U(+n),r):s},r.outerRadius=function(n){return arguments.length?(v=typeof n=="function"?n:U(+n),r):v},r.cornerRadius=function(n){return arguments.length?(B=typeof n=="function"?n:U(+n),r):B},r.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:U(+n),r):O},r.startAngle=function(n){return arguments.length?(d=typeof n=="function"?n:U(+n),r):d},r.endAngle=function(n){return arguments.length?(T=typeof n=="function"?n:U(+n),r):T},r.padAngle=function(n){return arguments.length?(V=typeof n=="function"?n:U(+n),r):V},r.context=function(n){return arguments.length?(a=n??null,r):a},r}export{vn as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b0 as t,b1 as a}from"./index-BocEneU2.js";const n=(o,r)=>t.lang.round(a.parse(o)[r]);export{n as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Y,K as B,z as C}from"./styles-b4e223ce-BOk_k5Y1-BRehazjg.js";import{g as H,O as f,P as T,V as W,c as D,o as J,i as v,W as P}from"./index-BocEneU2.js";import{K as X}from"./graph-CvRY9YIM-BSWPV9Nr.js";import{A as Z}from"./layout-DSZZaifl-Dg6wRbVD.js";let O=0;const $=function(n,a,t,s,l){const c=function(i){switch(i){case l.db.relationType.AGGREGATION:return"aggregation";case l.db.relationType.EXTENSION:return"extension";case l.db.relationType.COMPOSITION:return"composition";case l.db.relationType.DEPENDENCY:return"dependency";case l.db.relationType.LOLLIPOP:return"lollipop"}};a.points=a.points.filter(i=>!Number.isNaN(i.y));const o=a.points,g=D().x(function(i){return i.x}).y(function(i){return i.y}).curve(J),d=n.append("path").attr("d",g(o)).attr("id","edge"+O).attr("class","relation");let r="";s.arrowMarkerAbsolute&&(r=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,r=r.replace(/\(/g,"\\("),r=r.replace(/\)/g,"\\)")),t.relation.lineType==1&&d.attr("class","relation dashed-line"),t.relation.lineType==10&&d.attr("class","relation dotted-line"),t.relation.type1!=="none"&&d.attr("marker-start","url("+r+"#"+c(t.relation.type1)+"Start)"),t.relation.type2!=="none"&&d.attr("marker-end","url("+r+"#"+c(t.relation.type2)+"End)");let y,p;const x=a.points.length;let m=v.calcLabelPosition(a.points);y=m.x,p=m.y;let b,w,e,h;if(x%2!==0&&x>1){let i=v.calcCardinalityPosition(t.relation.type1!=="none",a.points,a.points[0]),u=v.calcCardinalityPosition(t.relation.type2!=="none",a.points,a.points[x-1]);f.debug("cardinality_1_point "+JSON.stringify(i)),f.debug("cardinality_2_point "+JSON.stringify(u)),b=i.x,w=i.y,e=u.x,h=u.y}if(t.title!==void 0){const i=n.append("g").attr("class","classLabel"),u=i.append("text").attr("class","label").attr("x",y).attr("y",p).attr("fill","red").attr("text-anchor","middle").text(t.title);window.label=u;const E=u.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",E.x-s.padding/2).attr("y",E.y-s.padding/2).attr("width",E.width+s.padding).attr("height",E.height+s.padding)}f.info("Rendering relation "+JSON.stringify(t)),t.relationTitle1!==void 0&&t.relationTitle1!=="none"&&n.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",b).attr("y",w).attr("fill","black").attr("font-size","6").text(t.relationTitle1),t.relationTitle2!==void 0&&t.relationTitle2!=="none"&&n.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",e).attr("y",h).attr("fill","black").attr("font-size","6").text(t.relationTitle2),O++},G=function(n,a,t,s){f.debug("Rendering class ",a,t);const l=a.id,c={id:l,label:a.id,width:0,height:0},o=n.append("g").attr("id",s.db.lookUpDomId(l)).attr("class","classGroup");let g;a.link?g=o.append("svg:a").attr("xlink:href",a.link).attr("target",a.linkTarget).append("text").attr("y",t.textHeight+t.padding).attr("x",0):g=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);let d=!0;a.annotations.forEach(function(i){const u=g.append("tspan").text("«"+i+"»");d||u.attr("dy",t.textHeight),d=!1});let r=A(a);const y=g.append("tspan").text(r).attr("class","title");d||y.attr("dy",t.textHeight);const p=g.node().getBBox().height;let x,m,b;if(a.members.length>0){x=o.append("line").attr("x1",0).attr("y1",t.padding+p+t.dividerMargin/2).attr("y2",t.padding+p+t.dividerMargin/2);const i=o.append("text").attr("x",t.padding).attr("y",p+t.dividerMargin+t.textHeight).attr("fill","white").attr("class","classText");d=!0,a.members.forEach(function(u){S(i,u,d,t),d=!1}),m=i.node().getBBox()}if(a.methods.length>0){b=o.append("line").attr("x1",0).attr("y1",t.padding+p+t.dividerMargin+m.height).attr("y2",t.padding+p+t.dividerMargin+m.height);const i=o.append("text").attr("x",t.padding).attr("y",p+2*t.dividerMargin+m.height+t.textHeight).attr("fill","white").attr("class","classText");d=!0,a.methods.forEach(function(u){S(i,u,d,t),d=!1})}const w=o.node().getBBox();var e=" ";a.cssClasses.length>0&&(e=e+a.cssClasses.join(" "));const h=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",w.width+2*t.padding).attr("height",w.height+t.padding+.5*t.dividerMargin).attr("class",e).node().getBBox().width;return g.node().childNodes.forEach(function(i){i.setAttribute("x",(h-i.getBBox().width)/2)}),a.tooltip&&g.insert("title").text(a.tooltip),x&&x.attr("x2",h),b&&b.attr("x2",h),c.width=h,c.height=w.height+t.padding+.5*t.dividerMargin,c},A=function(n){let a=n.id;return n.type&&(a+="<"+P(n.type)+">"),a},I=function(n,a,t,s){f.debug("Rendering note ",a,t);const l=a.id,c={id:l,text:a.text,width:0,height:0},o=n.append("g").attr("id",l).attr("class","classGroup");let g=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);const d=JSON.parse(`"${a.text}"`).split(`
|
|
2
|
-
`);d.forEach(function(p){f.debug(`Adding line: ${p}`),g.append("tspan").text(p).attr("class","title").attr("dy",t.textHeight)});const r=o.node().getBBox(),y=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",r.width+2*t.padding).attr("height",r.height+d.length*t.textHeight+t.padding+.5*t.dividerMargin).node().getBBox().width;return g.node().childNodes.forEach(function(p){p.setAttribute("x",(y-p.getBBox().width)/2)}),c.width=y,c.height=r.height+d.length*t.textHeight+t.padding+.5*t.dividerMargin,c},S=function(n,a,t,s){const{displayText:l,cssStyle:c}=a.getDisplayDetails(),o=n.append("tspan").attr("x",s.padding).text(l);c!==""&&o.attr("style",a.cssStyle),t||o.attr("dy",s.textHeight)},M={getClassTitleString:A,drawClass:G,drawEdge:$,drawNote:I};let N={};const L=20,k=function(n){const a=Object.entries(N).find(t=>t[1].label===n);if(a)return a[0]},R=function(n){n.append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),n.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),n.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).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")},z=function(n,a,t,s){const l=H().class;N={},f.info("Rendering diagram "+n);const c=H().securityLevel;let o;c==="sandbox"&&(o=T("#i"+a));const g=c==="sandbox"?T(o.nodes()[0].contentDocument.body):T("body"),d=g.select(`[id='${a}']`);R(d);const r=new X({multigraph:!0});r.setGraph({isMultiGraph:!0}),r.setDefaultEdgeLabel(function(){return{}});const y=s.db.getClasses(),p=Object.keys(y);for(const e of p){const h=y[e],i=M.drawClass(d,h,l,s);N[i.id]=i,r.setNode(i.id,i),f.info("Org height: "+i.height)}s.db.getRelations().forEach(function(e){f.info("tjoho"+k(e.id1)+k(e.id2)+JSON.stringify(e)),r.setEdge(k(e.id1),k(e.id2),{relation:e},e.title||"DEFAULT")}),s.db.getNotes().forEach(function(e){f.debug(`Adding note: ${JSON.stringify(e)}`);const h=M.drawNote(d,e,l,s);N[h.id]=h,r.setNode(h.id,h),e.class&&e.class in y&&r.setEdge(e.id,k(e.class),{relation:{id1:e.id,id2:e.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")}),Z(r),r.nodes().forEach(function(e){e!==void 0&&r.node(e)!==void 0&&(f.debug("Node "+e+": "+JSON.stringify(r.node(e))),g.select("#"+(s.db.lookUpDomId(e)||e)).attr("transform","translate("+(r.node(e).x-r.node(e).width/2)+","+(r.node(e).y-r.node(e).height/2)+" )"))}),r.edges().forEach(function(e){e!==void 0&&r.edge(e)!==void 0&&(f.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(r.edge(e))),M.drawEdge(d,r.edge(e),r.edge(e).relation,l,s))});const x=d.node().getBBox(),m=x.width+L*2,b=x.height+L*2;W(d,b,m,l.useMaxWidth);const w=`${x.x-L} ${x.y-L} ${m} ${b}`;f.debug(`viewBox ${w}`),d.attr("viewBox",w)},F={draw:z},V={parser:C,db:B,renderer:F,styles:Y,init:n=>{n.class||(n.class={}),n.class.arrowMarkerAbsolute=n.arrowMarkerAbsolute,B.clear()}};export{V as diagram};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Y as P,K as L,z as R}from"./styles-b4e223ce-BOk_k5Y1-BRehazjg.js";import{O as c,g as d,P as w,i as _,h as B,l as E,a as D,k as A,Y as C}from"./index-BocEneU2.js";import{K}from"./graph-CvRY9YIM-BSWPV9Nr.js";import{b as O}from"./index-5325376f-D7k5u-pg-BkjFLQrR.js";import"./layout-DSZZaifl-Dg6wRbVD.js";import"./clone-C0MdfhAf-BMHvCdCo.js";import"./edges-96097737-BnGLzlID-DglIvYsr.js";import"./createText-1719965b-D5GExXUl-Ckz8tHz2.js";const k=o=>E.sanitizeText(o,d());let x={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const Y=function(o,t,b,i){const e=Object.keys(o);c.info("keys:",e),c.info(o),e.forEach(function(s){var l,r;const a=o[s],n={shape:"rect",id:a.id,domId:a.domId,labelText:k(a.id),labelStyle:"",style:"fill: none; stroke: black",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};t.setNode(a.id,n),I(a.classes,t,b,i,a.id),c.info("setNode",n)})},I=function(o,t,b,i,e){const s=Object.keys(o);c.info("keys:",s),c.info(o),s.filter(l=>o[l].parent==e).forEach(function(l){var r,a;const n=o[l],g=n.cssClasses.join(" "),y=D(n.styles),u=n.label??n.id,p=0,f={labelStyle:y.labelStyle,shape:"class_box",labelText:k(u),classData:n,rx:p,ry:p,class:g,style:y.style,id:n.id,domId:n.domId,tooltip:i.db.getTooltip(n.id,e)||"",haveCallback:n.haveCallback,link:n.link,width:n.type==="group"?500:void 0,type:n.type,padding:((r=d().flowchart)==null?void 0:r.padding)??((a=d().class)==null?void 0:a.padding)};t.setNode(n.id,f),e&&t.setParent(n.id,e),c.info("setNode",f)})},j=function(o,t,b,i){c.info(o),o.forEach(function(e,s){var l,r;const a=e,n="",g={labelStyle:"",style:""},y=a.text,u=0,p={labelStyle:g.labelStyle,shape:"note",labelText:k(y),noteData:a,rx:u,ry:u,class:n,style:g.style,id:a.id,domId:a.id,tooltip:"",type:"note",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};if(t.setNode(a.id,p),c.info("setNode",p),!a.class||!(a.class in i))return;const f=b+s,m={id:`edgeNote${f}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:A(x.curve,C)};t.setEdge(a.id,a.class,m,f)})},z=function(o,t){const b=d().flowchart;let i=0;o.forEach(function(e){var s;i++;const l={classes:"relation",pattern:e.relation.lineType==1?"dashed":"solid",id:`id_${e.id1}_${e.id2}_${i}`,arrowhead:e.type==="arrow_open"?"none":"normal",startLabelRight:e.relationTitle1==="none"?"":e.relationTitle1,endLabelLeft:e.relationTitle2==="none"?"":e.relationTitle2,arrowTypeStart:N(e.relation.type1),arrowTypeEnd:N(e.relation.type2),style:"fill:none",labelStyle:"",curve:A(b==null?void 0:b.curve,C)};if(c.info(l,e),e.style!==void 0){const r=D(e.style);l.style=r.style,l.labelStyle=r.labelStyle}e.text=e.title,e.text===void 0?e.style!==void 0&&(l.arrowheadStyle="fill: #333"):(l.arrowheadStyle="fill: #333",l.labelpos="c",((s=d().flowchart)==null?void 0:s.htmlLabels)??d().htmlLabels?(l.labelType="html",l.label='<span class="edgeLabel">'+e.text+"</span>"):(l.labelType="text",l.label=e.text.replace(E.lineBreakRegex,`
|
|
2
|
-
`),e.style===void 0&&(l.style=l.style||"stroke: #333; stroke-width: 1.5px;fill:none"),l.labelStyle=l.labelStyle.replace("color:","fill:"))),t.setEdge(e.id1,e.id2,l,i)})},H=function(o){x={...x,...o}},W=async function(o,t,b,i){c.info("Drawing class - ",t);const e=d().flowchart??d().class,s=d().securityLevel;c.info("config:",e);const l=(e==null?void 0:e.nodeSpacing)??50,r=(e==null?void 0:e.rankSpacing)??50,a=new K({multigraph:!0,compound:!0}).setGraph({rankdir:i.db.getDirection(),nodesep:l,ranksep:r,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=i.db.getNamespaces(),g=i.db.getClasses(),y=i.db.getRelations(),u=i.db.getNotes();c.info(y),Y(n,a,t,i),I(g,a,t,i),z(y,a),j(u,a,y.length+1,g);let p;s==="sandbox"&&(p=w("#i"+t));const f=s==="sandbox"?w(p.nodes()[0].contentDocument.body):w("body"),m=f.select(`[id="${t}"]`),$=f.select("#"+t+" g");if(await O($,a,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",t),_.insertTitle(m,"classTitleText",(e==null?void 0:e.titleTopMargin)??5,i.db.getDiagramTitle()),B(a,m,e==null?void 0:e.diagramPadding,e==null?void 0:e.useMaxWidth),!(e!=null&&e.htmlLabels)){const T=s==="sandbox"?p.nodes()[0].contentDocument:document,M=T.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const v of M){const S=v.getBBox(),h=T.createElementNS("http://www.w3.org/2000/svg","rect");h.setAttribute("rx",0),h.setAttribute("ry",0),h.setAttribute("width",S.width),h.setAttribute("height",S.height),v.insertBefore(h,v.firstChild)}}};function N(o){let t;switch(o){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}const q={setConf:H,draw:W},ee={parser:R,db:L,renderer:q,styles:P,init:o=>{o.class||(o.class={}),o.class.arrowMarkerAbsolute=o.arrowMarkerAbsolute,L.clear()}};export{ee as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as o}from"./graph-CvRY9YIM-BSWPV9Nr.js";var t=4;function n(r){return o(r,t)}export{n as a};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{O as f,c as lt,o as ot,g as w,p as O,P as _,i as N,q as z,br as G}from"./index-BocEneU2.js";import{$ as nt}from"./createText-1719965b-D5GExXUl-Ckz8tHz2.js";const dt=(a,t,e,s)=>{t.forEach(l=>{bt[l](a,e,s)})},ht=(a,t,e)=>{f.trace("Making markers for ",e),a.append("defs").append("marker").attr("id",e+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},ct=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},yt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},pt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).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")},gt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),a.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},xt=(a,t,e)=>{a.append("marker").attr("id",e+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).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").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),a.append("marker").attr("id",e+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},ft=(a,t,e)=>{a.append("marker").attr("id",e+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),a.append("marker").attr("id",e+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},ut=(a,t,e)=>{a.append("marker").attr("id",e+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),a.append("marker").attr("id",e+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},wt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},bt={extension:ht,composition:ct,aggregation:yt,dependency:pt,lollipop:gt,point:xt,circle:ft,cross:ut,barb:wt},or=dt;function mt(a,t){t&&a.attr("style",t)}function kt(a,t){const e=_(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),s=e.append("xhtml:div"),l=a.label,r=a.isNode?"nodeLabel":"edgeLabel";return s.html(z('<span class="'+r+'" '+(a.labelStyle?'style="'+a.labelStyle+'"':"")+">"+l+"</span>",t)),mt(s,a.labelStyle),s.style("display","inline-block"),s.style("white-space","nowrap"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}const Lt=(a,t,e,s)=>{let l=a||"";typeof l=="object"&&(l=l[0]);const r=w();if(O(r.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),f.debug("vertexText"+l);const n={isNode:s,label:G(l).replace(/fa[blrs]?:fa-[\w-]+/g,i=>`<i class='${i.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return kt(n,r)}else{const n=document.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("style",t.replace("color:","fill:"));let i=[];typeof l=="string"?i=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?i=l:i=[];for(const o of i){const h=document.createElementNS("http://www.w3.org/2000/svg","tspan");h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),h.setAttribute("dy","1em"),h.setAttribute("x","0"),e?h.setAttribute("class","title-row"):h.setAttribute("class","row"),h.textContent=o.trim(),n.appendChild(h)}return n}},P=Lt,M=async(a,t,e,s)=>{let l;const r=t.useHtmlLabels||O(w().flowchart.htmlLabels);e?l=e:l="node default";const n=a.insert("g").attr("class",l).attr("id",t.domId||t.id),i=n.insert("g").attr("class","label").attr("style",t.labelStyle);let o;t.labelText===void 0?o="":o=typeof t.labelText=="string"?t.labelText:t.labelText[0];const h=i.node();let d;t.labelType==="markdown"?d=nt(i,z(G(o),w()),{useHtmlLabels:r,width:t.width||w().flowchart.wrappingWidth,classes:"markdown-node-label"}):d=h.appendChild(P(z(G(o),w()),t.labelStyle,!1,s));let c=d.getBBox();const p=t.padding/2;if(O(w().flowchart.htmlLabels)){const y=d.children[0],x=_(d),k=y.getElementsByTagName("img");if(k){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(u=>new Promise(v=>{function B(){if(u.style.display="flex",u.style.flexDirection="column",g){const C=w().fontSize?w().fontSize:window.getComputedStyle(document.body).fontSize,X=parseInt(C,10)*5+"px";u.style.minWidth=X,u.style.maxWidth=X}else u.style.width="100%";v(u)}setTimeout(()=>{u.complete&&B()}),u.addEventListener("error",B),u.addEventListener("load",B)})))}c=y.getBoundingClientRect(),x.attr("width",c.width),x.attr("height",c.height)}return r?i.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):i.attr("transform","translate(0, "+-c.height/2+")"),t.centerLabel&&i.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:n,bbox:c,halfPadding:p,label:i}},m=(a,t)=>{const e=t.node().getBBox();a.width=e.width,a.height=e.height};function R(a,t,e,s){return a.insert("polygon",":first-child").attr("points",s.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+e/2+")")}function St(a,t){return a.intersect(t)}function st(a,t,e,s){var l=a.x,r=a.y,n=l-s.x,i=r-s.y,o=Math.sqrt(t*t*i*i+e*e*n*n),h=Math.abs(t*e*n/o);s.x<l&&(h=-h);var d=Math.abs(t*e*i/o);return s.y<r&&(d=-d),{x:l+h,y:r+d}}function vt(a,t,e){return st(a,t,t,e)}function Mt(a,t,e,s){var l,r,n,i,o,h,d,c,p,y,x,k,g,u,v;if(l=t.y-a.y,n=a.x-t.x,o=t.x*a.y-a.x*t.y,p=l*e.x+n*e.y+o,y=l*s.x+n*s.y+o,!(p!==0&&y!==0&&J(p,y))&&(r=s.y-e.y,i=e.x-s.x,h=s.x*e.y-e.x*s.y,d=r*a.x+i*a.y+h,c=r*t.x+i*t.y+h,!(d!==0&&c!==0&&J(d,c))&&(x=l*i-r*n,x!==0)))return k=Math.abs(x/2),g=n*h-i*o,u=g<0?(g-k)/x:(g+k)/x,g=r*o-l*h,v=g<0?(g-k)/x:(g+k)/x,{x:u,y:v}}function J(a,t){return a*t>0}function Tt(a,t,e){var s=a.x,l=a.y,r=[],n=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(x){n=Math.min(n,x.x),i=Math.min(i,x.y)}):(n=Math.min(n,t.x),i=Math.min(i,t.y));for(var o=s-a.width/2-n,h=l-a.height/2-i,d=0;d<t.length;d++){var c=t[d],p=t[d<t.length-1?d+1:0],y=Mt(a,e,{x:o+c.x,y:h+c.y},{x:o+p.x,y:h+p.y});y&&r.push(y)}return r.length?(r.length>1&&r.sort(function(x,k){var g=x.x-e.x,u=x.y-e.y,v=Math.sqrt(g*g+u*u),B=k.x-e.x,C=k.y-e.y,X=Math.sqrt(B*B+C*C);return v<X?-1:v===X?0:1}),r[0]):a}const Bt=(a,t)=>{var e=a.x,s=a.y,l=t.x-e,r=t.y-s,n=a.width/2,i=a.height/2,o,h;return Math.abs(r)*n>Math.abs(l)*i?(r<0&&(i=-i),o=r===0?0:i*l/r,h=i):(l<0&&(n=-n),o=n,h=l===0?0:n*r/l),{x:e+o,y:s+h}},_t=Bt,b={node:St,circle:vt,ellipse:st,polygon:Tt,rect:_t},Ct=async(a,t)=>{t.useHtmlLabels||w().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,"node "+t.classes,!0);f.info("Classes = ",t.classes);const r=e.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-s.width/2-l).attr("y",-s.height/2-l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),m(t,r),t.intersect=function(n){return b.rect(t,n)},e},$t=Ct,Et=a=>{const t=new Set;for(const e of a)switch(e){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(e);break}return t},Pt=(a,t,e)=>{const s=Et(a),l=2,r=t.height+2*e.padding,n=r/l,i=t.width+2*n+e.padding,o=e.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:n,y:0},{x:i/2,y:2*o},{x:i-n,y:0},{x:i,y:0},{x:i,y:-r/3},{x:i+2*o,y:-r/2},{x:i,y:-2*r/3},{x:i,y:-r},{x:i-n,y:-r},{x:i/2,y:-r-2*o},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*o,y:-r/2},{x:0,y:-r/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:n,y:0},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:n,y:-r},{x:i-n,y:-r},{x:i,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:i,y:-n},{x:i,y:-r+n},{x:0,y:-r}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:i,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:i,y:-r}]:s.has("right")&&s.has("left")?[{x:n,y:0},{x:n,y:-o},{x:i-n,y:-o},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:i-n,y:-r+o},{x:n,y:-r+o},{x:n,y:-r},{x:0,y:-r/2}]:s.has("up")&&s.has("down")?[{x:i/2,y:0},{x:0,y:-o},{x:n,y:-o},{x:n,y:-r+o},{x:0,y:-r+o},{x:i/2,y:-r},{x:i,y:-r+o},{x:i-n,y:-r+o},{x:i-n,y:-o},{x:i,y:-o}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:i,y:-n},{x:0,y:-r}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:i,y:0},{x:0,y:-r}]:s.has("left")&&s.has("up")?[{x:i,y:0},{x:0,y:-n},{x:i,y:-r}]:s.has("left")&&s.has("down")?[{x:i,y:0},{x:0,y:0},{x:i,y:-r}]:s.has("right")?[{x:n,y:-o},{x:n,y:-o},{x:i-n,y:-o},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:i-n,y:-r+o},{x:n,y:-r+o},{x:n,y:-r+o}]:s.has("left")?[{x:n,y:0},{x:n,y:-o},{x:i-n,y:-o},{x:i-n,y:-r+o},{x:n,y:-r+o},{x:n,y:-r},{x:0,y:-r/2}]:s.has("up")?[{x:n,y:-o},{x:n,y:-r+o},{x:0,y:-r+o},{x:i/2,y:-r},{x:i,y:-r+o},{x:i-n,y:-r+o},{x:i-n,y:-o}]:s.has("down")?[{x:i/2,y:0},{x:0,y:-o},{x:n,y:-o},{x:n,y:-r+o},{x:i-n,y:-r+o},{x:i-n,y:-o},{x:i,y:-o}]:[{x:0,y:0}]},Q=a=>a?" "+a:"",E=(a,t)=>`node default${Q(a.classes)} ${Q(a.class)}`,K=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=l+r,i=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];f.info("Question main (Circle)");const o=R(e,n,n,i);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return f.warn("Intersect called"),b.polygon(t,i,h)},e},Ot=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,l=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return e.insert("polygon",":first-child").attr("points",l.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return b.circle(t,14,r)},e},Rt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=4,r=s.height+t.padding,n=r/l,i=s.width+2*n+t.padding,o=[{x:n,y:0},{x:i-n,y:0},{x:i,y:-r/2},{x:i-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}],h=R(e,i,r,o);return h.attr("style",t.style),m(t,h),t.intersect=function(d){return b.polygon(t,o,d)},e},Wt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,void 0,!0),l=2,r=s.height+2*t.padding,n=r/l,i=s.width+2*n+t.padding,o=Pt(t.directions,s,t),h=R(e,i,r,o);return h.attr("style",t.style),m(t,h),t.intersect=function(d){return b.polygon(t,o,d)},e},Xt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:-r/2,y:0},{x:l,y:0},{x:l,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return R(e,l,r,n).attr("style",t.style),t.width=l+r,t.height=r,t.intersect=function(i){return b.polygon(t,n,i)},e},Yt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:-2*r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:r/6,y:-r}],i=R(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},It=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:2*r/6,y:0},{x:l+r/6,y:0},{x:l-2*r/6,y:-r},{x:-r/6,y:-r}],i=R(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Dt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:-2*r/6,y:0},{x:l+2*r/6,y:0},{x:l-r/6,y:-r},{x:r/6,y:-r}],i=R(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Ht=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:-2*r/6,y:-r}],i=R(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Nt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:0,y:0},{x:l+r/2,y:0},{x:l,y:-r/2},{x:l+r/2,y:-r},{x:0,y:-r}],i=R(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},jt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=l/2,n=r/(2.5+l/50),i=s.height+n+t.padding,o="M 0,"+n+" a "+r+","+n+" 0,0,0 "+l+" 0 a "+r+","+n+" 0,0,0 "+-l+" 0 l 0,"+i+" a "+r+","+n+" 0,0,0 "+l+" 0 l 0,"+-i,h=e.attr("label-offset-y",n).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-l/2+","+-(i/2+n)+")");return m(t,h),t.intersect=function(d){const c=b.rect(t,d),p=c.x-t.x;if(r!=0&&(Math.abs(p)<t.width/2||Math.abs(p)==t.width/2&&Math.abs(c.y-t.y)>t.height/2-n)){let y=n*n*(1-p*p/(r*r));y!=0&&(y=Math.sqrt(y)),y=n-y,d.y-t.y>0&&(y=-y),c.y+=y}return c},e},Ut=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,"node "+t.classes+" "+t.class,!0),r=e.insert("rect",":first-child"),n=t.positioned?t.width:s.width+t.padding,i=t.positioned?t.height:s.height+t.padding,o=t.positioned?-n/2:-s.width/2-l,h=t.positioned?-i/2:-s.height/2-l;if(r.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",h).attr("width",n).attr("height",i),t.props){const d=new Set(Object.keys(t.props));t.props.borders&&(F(r,t.props.borders,n,i),d.delete("borders")),d.forEach(c=>{f.warn(`Unknown node property ${c}`)})}return m(t,r),t.intersect=function(d){return b.rect(t,d)},e},At=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,"node "+t.classes,!0),r=e.insert("rect",":first-child"),n=t.positioned?t.width:s.width+t.padding,i=t.positioned?t.height:s.height+t.padding,o=t.positioned?-n/2:-s.width/2-l,h=t.positioned?-i/2:-s.height/2-l;if(r.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",h).attr("width",n).attr("height",i),t.props){const d=new Set(Object.keys(t.props));t.props.borders&&(F(r,t.props.borders,n,i),d.delete("borders")),d.forEach(c=>{f.warn(`Unknown node property ${c}`)})}return m(t,r),t.intersect=function(d){return b.rect(t,d)},e},Zt=async(a,t)=>{const{shapeSvg:e}=await M(a,t,"label",!0);f.trace("Classes = ",t.class);const s=e.insert("rect",":first-child"),l=0,r=0;if(s.attr("width",l).attr("height",r),e.attr("class","label edgeLabel"),t.props){const n=new Set(Object.keys(t.props));t.props.borders&&(F(s,t.props.borders,l,r),n.delete("borders")),n.forEach(i=>{f.warn(`Unknown node property ${i}`)})}return m(t,s),t.intersect=function(n){return b.rect(t,n)},e};function F(a,t,e,s){const l=[],r=i=>{l.push(i,0)},n=i=>{l.push(0,i)};t.includes("t")?(f.debug("add top border"),r(e)):n(e),t.includes("r")?(f.debug("add right border"),r(s)):n(s),t.includes("b")?(f.debug("add bottom border"),r(e)):n(e),t.includes("l")?(f.debug("add left border"),r(s)):n(s),a.attr("stroke-dasharray",l.join(" "))}const qt=(a,t)=>{let e;t.classes?e="node "+t.classes:e="node default";const s=a.insert("g").attr("class",e).attr("id",t.domId||t.id),l=s.insert("rect",":first-child"),r=s.insert("line"),n=s.insert("g").attr("class","label"),i=t.labelText.flat?t.labelText.flat():t.labelText;let o="";typeof i=="object"?o=i[0]:o=i,f.info("Label text abc79",o,i,typeof i=="object");const h=n.node().appendChild(P(o,t.labelStyle,!0,!0));let d={width:0,height:0};if(O(w().flowchart.htmlLabels)){const k=h.children[0],g=_(h);d=k.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}f.info("Text 2",i);const c=i.slice(1,i.length);let p=h.getBBox();const y=n.node().appendChild(P(c.join?c.join("<br/>"):c,t.labelStyle,!0,!0));if(O(w().flowchart.htmlLabels)){const k=y.children[0],g=_(y);d=k.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}const x=t.padding/2;return _(y).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+x+5)+")"),_(h).attr("transform","translate( "+(d.width<p.width?0:-(p.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")"),l.attr("class","outer title-state").attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+t.padding).attr("height",d.height+t.padding),r.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+p.height+x).attr("y2",-d.height/2-x+p.height+x),m(t,l),t.intersect=function(k){return b.rect(t,k)},s},zt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.height+t.padding,r=s.width+l/4+t.padding,n=e.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-r/2).attr("y",-l/2).attr("width",r).attr("height",l);return m(t,n),t.intersect=function(i){return b.rect(t,i)},e},Gt=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,E(t),!0),r=e.insert("circle",":first-child");return r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),f.info("Circle main"),m(t,r),t.intersect=function(n){return f.info("Circle intersect",t,s.width/2+l,n),b.circle(t,s.width/2+l,n)},e},Ft=async(a,t)=>{const{shapeSvg:e,bbox:s,halfPadding:l}=await M(a,t,E(t),!0),r=5,n=e.insert("g",":first-child"),i=n.insert("circle"),o=n.insert("circle");return n.attr("class",t.class),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l+r).attr("width",s.width+t.padding+r*2).attr("height",s.height+t.padding+r*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),f.info("DoubleCircle main"),m(t,i),t.intersect=function(h){return f.info("DoubleCircle intersect",t,s.width/2+l+r,h),b.circle(t,s.width/2+l+r,h)},e},Vt=async(a,t)=>{const{shapeSvg:e,bbox:s}=await M(a,t,E(t),!0),l=s.width+t.padding,r=s.height+t.padding,n=[{x:0,y:0},{x:l,y:0},{x:l,y:-r},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-r},{x:-8,y:-r},{x:-8,y:0}],i=R(e,l,r,n);return i.attr("style",t.style),m(t,i),t.intersect=function(o){return b.polygon(t,n,o)},e},Jt=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=e.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),m(t,s),t.intersect=function(l){return b.circle(t,7,l)},e},tt=(a,t,e)=>{const s=a.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,r=10;e==="LR"&&(l=10,r=70);const n=s.append("rect").attr("x",-1*l/2).attr("y",-1*r/2).attr("width",l).attr("height",r).attr("class","fork-join");return m(t,n),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(i){return b.rect(t,i)},s},Qt=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=e.insert("circle",":first-child"),l=e.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),m(t,l),t.intersect=function(r){return b.circle(t,7,r)},e},Kt=(a,t)=>{const e=t.padding/2,s=4,l=8;let r;t.classes?r="node "+t.classes:r="node default";const n=a.insert("g").attr("class",r).attr("id",t.domId||t.id),i=n.insert("rect",":first-child"),o=n.insert("line"),h=n.insert("line");let d=0,c=s;const p=n.insert("g").attr("class","label");let y=0;const x=t.classData.annotations&&t.classData.annotations[0],k=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",g=p.node().appendChild(P(k,t.labelStyle,!0,!0));let u=g.getBBox();if(O(w().flowchart.htmlLabels)){const L=g.children[0],S=_(g);u=L.getBoundingClientRect(),S.attr("width",u.width),S.attr("height",u.height)}t.classData.annotations[0]&&(c+=u.height+s,d+=u.width);let v=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(w().flowchart.htmlLabels?v+="<"+t.classData.type+">":v+="<"+t.classData.type+">");const B=p.node().appendChild(P(v,t.labelStyle,!0,!0));_(B).attr("class","classTitle");let C=B.getBBox();if(O(w().flowchart.htmlLabels)){const L=B.children[0],S=_(B);C=L.getBoundingClientRect(),S.attr("width",C.width),S.attr("height",C.height)}c+=C.height+s,C.width>d&&(d=C.width);const X=[];t.classData.members.forEach(L=>{const S=L.getDisplayDetails();let I=S.displayText;w().flowchart.htmlLabels&&(I=I.replace(/</g,"<").replace(/>/g,">"));const W=p.node().appendChild(P(I,S.cssStyle?S.cssStyle:t.labelStyle,!0,!0));let $=W.getBBox();if(O(w().flowchart.htmlLabels)){const q=W.children[0],H=_(W);$=q.getBoundingClientRect(),H.attr("width",$.width),H.attr("height",$.height)}$.width>d&&(d=$.width),c+=$.height+s,X.push(W)}),c+=l;const V=[];if(t.classData.methods.forEach(L=>{const S=L.getDisplayDetails();let I=S.displayText;w().flowchart.htmlLabels&&(I=I.replace(/</g,"<").replace(/>/g,">"));const W=p.node().appendChild(P(I,S.cssStyle?S.cssStyle:t.labelStyle,!0,!0));let $=W.getBBox();if(O(w().flowchart.htmlLabels)){const q=W.children[0],H=_(W);$=q.getBoundingClientRect(),H.attr("width",$.width),H.attr("height",$.height)}$.width>d&&(d=$.width),c+=$.height+s,V.push(W)}),c+=l,x){let L=(d-u.width)/2;_(g).attr("transform","translate( "+(-1*d/2+L)+", "+-1*c/2+")"),y=u.height+s}let it=(d-C.width)/2;return _(B).attr("transform","translate( "+(-1*d/2+it)+", "+(-1*c/2+y)+")"),y+=C.height+s,o.attr("class","divider").attr("x1",-d/2-e).attr("x2",d/2+e).attr("y1",-c/2-e+l+y).attr("y2",-c/2-e+l+y),y+=l,X.forEach(L=>{_(L).attr("transform","translate( "+-d/2+", "+(-1*c/2+y+l/2)+")");const S=L==null?void 0:L.getBBox();y+=((S==null?void 0:S.height)??0)+s}),y+=l,h.attr("class","divider").attr("x1",-d/2-e).attr("x2",d/2+e).attr("y1",-c/2-e+l+y).attr("y2",-c/2-e+l+y),y+=l,V.forEach(L=>{_(L).attr("transform","translate( "+-d/2+", "+(-1*c/2+y)+")");const S=L==null?void 0:L.getBBox();y+=((S==null?void 0:S.height)??0)+s}),i.attr("style",t.style).attr("class","outer title-state").attr("x",-d/2-e).attr("y",-(c/2)-e).attr("width",d+t.padding).attr("height",c+t.padding),m(t,i),t.intersect=function(L){return b.rect(t,L)},n},rt={rhombus:K,composite:At,question:K,rect:Ut,labelRect:Zt,rectWithTitle:qt,choice:Ot,circle:Gt,doublecircle:Ft,stadium:zt,hexagon:Rt,block_arrow:Wt,rect_left_inv_arrow:Xt,lean_right:Yt,lean_left:It,trapezoid:Dt,inv_trapezoid:Ht,rect_right_inv_arrow:Nt,cylinder:jt,start:Jt,end:Qt,note:$t,subroutine:Vt,fork:tt,join:tt,class_box:Kt};let D={};const dr=async(a,t,e)=>{let s,l;if(t.link){let r;w().securityLevel==="sandbox"?r="_top":t.linkTarget&&(r=t.linkTarget||"_blank"),s=a.insert("svg:a").attr("xlink:href",t.link).attr("target",r),l=await rt[t.shape](s,t,e)}else l=await rt[t.shape](a,t,e),s=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),s.attr("data-node","true"),s.attr("data-id",t.id),D[t.id]=s,t.haveCallback&&D[t.id].attr("class",D[t.id].attr("class")+" clickable"),s},hr=(a,t)=>{D[t.id]=a},cr=()=>{D={}},yr=a=>{const t=D[a.id];f.trace("Transforming node",a.diff,a,"translate("+(a.x-a.width/2-5)+", "+a.width/2+")");const e=8,s=a.diff||0;return a.clusterNode?t.attr("transform","translate("+(a.x+s-a.width/2)+", "+(a.y-a.height/2-e)+")"):t.attr("transform","translate("+a.x+", "+a.y+")"),s},tr=({flowchart:a})=>{var t,e;const s=((t=a==null?void 0:a.subGraphTitleMargin)==null?void 0:t.top)??0,l=((e=a==null?void 0:a.subGraphTitleMargin)==null?void 0:e.bottom)??0,r=s+l;return{subGraphTitleTopMargin:s,subGraphTitleBottomMargin:l,subGraphTitleTotalMargin:r}},Y={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:5.3};function j(a,t){if(a===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};a=A(a),t=A(t);const[e,s]=[a.x,a.y],[l,r]=[t.x,t.y],n=l-e,i=r-s;return{angle:Math.atan(i/n),deltaX:n,deltaY:i}}const A=a=>Array.isArray(a)?{x:a[0],y:a[1]}:a,rr=a=>({x:function(t,e,s){let l=0;if(e===0&&Object.hasOwn(Y,a.arrowTypeStart)){const{angle:r,deltaX:n}=j(s[0],s[1]);l=Y[a.arrowTypeStart]*Math.cos(r)*(n>=0?1:-1)}else if(e===s.length-1&&Object.hasOwn(Y,a.arrowTypeEnd)){const{angle:r,deltaX:n}=j(s[s.length-1],s[s.length-2]);l=Y[a.arrowTypeEnd]*Math.cos(r)*(n>=0?1:-1)}return A(t).x+l},y:function(t,e,s){let l=0;if(e===0&&Object.hasOwn(Y,a.arrowTypeStart)){const{angle:r,deltaY:n}=j(s[0],s[1]);l=Y[a.arrowTypeStart]*Math.abs(Math.sin(r))*(n>=0?1:-1)}else if(e===s.length-1&&Object.hasOwn(Y,a.arrowTypeEnd)){const{angle:r,deltaY:n}=j(s[s.length-1],s[s.length-2]);l=Y[a.arrowTypeEnd]*Math.abs(Math.sin(r))*(n>=0?1:-1)}return A(t).y+l}}),er=(a,t,e,s,l)=>{t.arrowTypeStart&&et(a,"start",t.arrowTypeStart,e,s,l),t.arrowTypeEnd&&et(a,"end",t.arrowTypeEnd,e,s,l)},ar={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},et=(a,t,e,s,l,r)=>{const n=ar[e];if(!n){f.warn(`Unknown arrow type: ${e}`);return}const i=t==="start"?"Start":"End";a.attr(`marker-${t}`,`url(${s}#${l}_${r}-${n}${i})`)};let Z={},T={};const pr=()=>{Z={},T={}},gr=(a,t)=>{const e=O(w().flowchart.htmlLabels),s=t.labelType==="markdown"?nt(a,t.label,{style:t.labelStyle,useHtmlLabels:e,addSvgBackground:!0}):P(t.label,t.labelStyle),l=a.insert("g").attr("class","edgeLabel"),r=l.insert("g").attr("class","label");r.node().appendChild(s);let n=s.getBBox();if(e){const o=s.children[0],h=_(s);n=o.getBoundingClientRect(),h.attr("width",n.width),h.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Z[t.id]=l,t.width=n.width,t.height=n.height;let i;if(t.startLabelLeft){const o=P(t.startLabelLeft,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startLeft=h,U(i,t.startLabelLeft)}if(t.startLabelRight){const o=P(t.startLabelRight,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=h.node().appendChild(o),d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startRight=h,U(i,t.startLabelRight)}if(t.endLabelLeft){const o=P(t.endLabelLeft,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),h.node().appendChild(o),T[t.id]||(T[t.id]={}),T[t.id].endLeft=h,U(i,t.endLabelLeft)}if(t.endLabelRight){const o=P(t.endLabelRight,t.labelStyle),h=a.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");i=d.node().appendChild(o);const c=o.getBBox();d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),h.node().appendChild(o),T[t.id]||(T[t.id]={}),T[t.id].endRight=h,U(i,t.endLabelRight)}return s};function U(a,t){w().flowchart.htmlLabels&&a&&(a.style.width=t.length*9+"px",a.style.height="12px")}const xr=(a,t)=>{f.debug("Moving label abc88 ",a.id,a.label,Z[a.id],t);let e=t.updatedPath?t.updatedPath:t.originalPath;const s=w(),{subGraphTitleTotalMargin:l}=tr(s);if(a.label){const r=Z[a.id];let n=a.x,i=a.y;if(e){const o=N.calcLabelPosition(e);f.debug("Moving label "+a.label+" from (",n,",",i,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(n=o.x,i=o.y)}r.attr("transform",`translate(${n}, ${i+l/2})`)}if(a.startLabelLeft){const r=T[a.id].startLeft;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeStart?10:0,"start_left",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}if(a.startLabelRight){const r=T[a.id].startRight;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeStart?10:0,"start_right",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}if(a.endLabelLeft){const r=T[a.id].endLeft;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeEnd?10:0,"end_left",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}if(a.endLabelRight){const r=T[a.id].endRight;let n=a.x,i=a.y;if(e){const o=N.calcTerminalLabelPosition(a.arrowTypeEnd?10:0,"end_right",e);n=o.x,i=o.y}r.attr("transform",`translate(${n}, ${i})`)}},nr=(a,t)=>{const e=a.x,s=a.y,l=Math.abs(t.x-e),r=Math.abs(t.y-s),n=a.width/2,i=a.height/2;return l>=n||r>=i},sr=(a,t,e)=>{f.debug(`intersection calc abc89:
|
|
2
|
-
outsidePoint: ${JSON.stringify(t)}
|
|
3
|
-
insidePoint : ${JSON.stringify(e)}
|
|
4
|
-
node : x:${a.x} y:${a.y} w:${a.width} h:${a.height}`);const s=a.x,l=a.y,r=Math.abs(s-e.x),n=a.width/2;let i=e.x<t.x?n-r:n+r;const o=a.height/2,h=Math.abs(t.y-e.y),d=Math.abs(t.x-e.x);if(Math.abs(l-t.y)*n>Math.abs(s-t.x)*o){let c=e.y<t.y?t.y-o-l:l-o-t.y;i=d*c/h;const p={x:e.x<t.x?e.x+i:e.x-d+i,y:e.y<t.y?e.y+h-c:e.y-h+c};return i===0&&(p.x=t.x,p.y=t.y),d===0&&(p.x=t.x),h===0&&(p.y=t.y),f.debug(`abc89 topp/bott calc, Q ${h}, q ${c}, R ${d}, r ${i}`,p),p}else{e.x<t.x?i=t.x-n-s:i=s-n-t.x;let c=h*i/d,p=e.x<t.x?e.x+d-i:e.x-d+i,y=e.y<t.y?e.y+c:e.y-c;return f.debug(`sides calc abc89, Q ${h}, q ${c}, R ${d}, r ${i}`,{_x:p,_y:y}),i===0&&(p=t.x,y=t.y),d===0&&(p=t.x),h===0&&(y=t.y),{x:p,y}}},at=(a,t)=>{f.debug("abc88 cutPathAtIntersect",a,t);let e=[],s=a[0],l=!1;return a.forEach(r=>{if(!nr(t,r)&&!l){const n=sr(t,s,r);let i=!1;e.forEach(o=>{i=i||o.x===n.x&&o.y===n.y}),e.some(o=>o.x===n.x&&o.y===n.y)||e.push(n),l=!0}else s=r,l||e.push(r)}),e},fr=function(a,t,e,s,l,r,n){let i=e.points;f.debug("abc88 InsertEdge: edge=",e,"e=",t);let o=!1;const h=r.node(t.v);var d=r.node(t.w);d!=null&&d.intersect&&h!=null&&h.intersect&&(i=i.slice(1,e.points.length-1),i.unshift(h.intersect(i[0])),i.push(d.intersect(i[i.length-1]))),e.toCluster&&(f.debug("to cluster abc88",s[e.toCluster]),i=at(e.points,s[e.toCluster].node),o=!0),e.fromCluster&&(f.debug("from cluster abc88",s[e.fromCluster]),i=at(i.reverse(),s[e.fromCluster].node).reverse(),o=!0);const c=i.filter(C=>!Number.isNaN(C.y));let p=ot;e.curve&&(l==="graph"||l==="flowchart")&&(p=e.curve);const{x:y,y:x}=rr(e),k=lt().x(y).y(x).curve(p);let g;switch(e.thickness){case"normal":g="edge-thickness-normal";break;case"thick":g="edge-thickness-thick";break;case"invisible":g="edge-thickness-thick";break;default:g=""}switch(e.pattern){case"solid":g+=" edge-pattern-solid";break;case"dotted":g+=" edge-pattern-dotted";break;case"dashed":g+=" edge-pattern-dashed";break}const u=a.append("path").attr("d",k(c)).attr("id",e.id).attr("class"," "+g+(e.classes?" "+e.classes:"")).attr("style",e.style);let v="";(w().flowchart.arrowMarkerAbsolute||w().state.arrowMarkerAbsolute)&&(v=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,v=v.replace(/\(/g,"\\("),v=v.replace(/\)/g,"\\)")),er(u,e,v,n,l);let B={};return o&&(B.updatedPath=i),B.originalPath=e.points,B};export{_t as E,M,P as R,er as a,or as c,xr as d,pr as f,fr as g,dr as h,m,hr as o,yr as p,rr as r,tr as t,gr as x,cr as y};
|