import{d as Vt}from"./chunk-OJ4XBKBL.mjs";import"./chunk-MISPJMMF.mjs";import{a as Qt,e as Dt,f as zt,g as Et,h as Bt,i as It,j as wt,k as qt}from"./chunk-3HPIZZTI.mjs";import"./chunk-5V2RFD56.mjs";import{a as u,c as tt,e as Lt,h as L,p as nt,s as Ct}from"./chunk-BW7V6N3L.mjs";var kt=function(){var e=u(function(G,a,r,l){for(r=r||{},l=G.length;l--;r[G[l]]=a);return r},"o"),n=[1,3],h=[1,5],p=[1,6],g=[1,7],f=[1,8],d=[1,10],T=[1,5,14,16,18,20,21,26,28,29,30,31,32,38,39,40,41,47,48,50,51,52,53,54,55,56,57,58,59,60],o=[1,5,7,14,16,18,20,21,26,28,29,30,31,32,38,39,40,41,47,48,50,51,52,53,54,55,56,57,58,59,60],c=[38,39,40],C=[2,8],W=[1,19],H=[1,23],D=[1,24],w=[1,25],B=[1,26],J=[1,27],et=[1,29],rt=[1,30],st=[1,31],ot=[1,32],it=[1,33],ht=[1,34],N=[1,37],t=[1,38],m=[1,39],b=[1,40],q=[1,41],k=[1,42],A=[1,43],_=[1,44],S=[1,45],P=[1,46],F=[1,47],v=[1,48],Q=[1,49],_t=[1,52],X=[1,67],M=[1,68],z=[5,23,27,38,39,40,50,51,52,53,54,55,56,57,58,59,60,61],xt=[5,7,38,39,40,41],ft={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,SPACE:5,directive:6,QUADRANT:7,document:8,line:9,statement:10,axisDetails:11,quadrantDetails:12,points:13,title:14,title_value:15,acc_title:16,acc_title_value:17,acc_descr:18,acc_descr_value:19,acc_descr_multiline_value:20,section:21,text:22,point_start:23,point_x:24,point_y:25,"X-AXIS":26,"AXIS-TEXT-DELIMITER":27,"Y-AXIS":28,QUADRANT_1:29,QUADRANT_2:30,QUADRANT_3:31,QUADRANT_4:32,openDirective:33,typeDirective:34,closeDirective:35,":":36,argDirective:37,NEWLINE:38,SEMI:39,EOF:40,open_directive:41,type_directive:42,arg_directive:43,close_directive:44,alphaNumToken:45,textNoTagsToken:46,STR:47,MD_STR:48,alphaNum:49,PUNCTUATION:50,AMP:51,NUM:52,ALPHA:53,COMMA:54,PLUS:55,EQUALS:56,MULT:57,DOT:58,BRKT:59,UNDERSCORE:60,MINUS:61,$accept:0,$end:1},terminals_:{2:"error",5:"SPACE",7:"QUADRANT",14:"title",15:"title_value",16:"acc_title",17:"acc_title_value",18:"acc_descr",19:"acc_descr_value",20:"acc_descr_multiline_value",21:"section",23:"point_start",24:"point_x",25:"point_y",26:"X-AXIS",27:"AXIS-TEXT-DELIMITER",28:"Y-AXIS",29:"QUADRANT_1",30:"QUADRANT_2",31:"QUADRANT_3",32:"QUADRANT_4",36:":",38:"NEWLINE",39:"SEMI",40:"EOF",41:"open_directive",42:"type_directive",43:"arg_directive",44:"close_directive",47:"STR",48:"MD_STR",50:"PUNCTUATION",51:"AMP",52:"NUM",53:"ALPHA",54:"COMMA",55:"PLUS",56:"EQUALS",57:"MULT",58:"DOT",59:"BRKT",60:"UNDERSCORE",61:"MINUS"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[10,0],[10,2],[10,1],[10,1],[10,1],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[13,4],[11,4],[11,3],[11,2],[11,4],[11,3],[11,2],[12,2],[12,2],[12,2],[12,2],[6,3],[6,5],[4,1],[4,1],[4,1],[33,1],[34,1],[37,1],[35,1],[22,1],[22,2],[22,1],[22,1],[49,1],[49,2],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,1],[46,1],[46,1]],performAction:u(function(a,r,l,s,y,i,at){var x=i.length-1;switch(y){case 13:this.$=i[x].trim(),s.setDiagramTitle(this.$);break;case 14:this.$=i[x].trim(),s.setAccTitle(this.$);break;case 15:case 16:this.$=i[x].trim(),s.setAccDescription(this.$);break;case 17:s.addSection(i[x].substr(8)),this.$=i[x].substr(8);break;case 19:s.addPoint(i[x-3],i[x-1],i[x]);break;case 20:s.setXAxisLeftText(i[x-2]),s.setXAxisRightText(i[x]);break;case 21:i[x-1].text+=" \u27F6 ",s.setXAxisLeftText(i[x-1]);break;case 22:s.setXAxisLeftText(i[x]);break;case 23:s.setYAxisBottomText(i[x-2]),s.setYAxisTopText(i[x]);break;case 24:i[x-1].text+=" \u27F6 ",s.setYAxisBottomText(i[x-1]);break;case 25:s.setYAxisBottomText(i[x]);break;case 26:s.setQuadrant1Text(i[x]);break;case 27:s.setQuadrant2Text(i[x]);break;case 28:s.setQuadrant3Text(i[x]);break;case 29:s.setQuadrant4Text(i[x]);break;case 35:s.parseDirective("%%{","open_directive");break;case 36:s.parseDirective(i[x],"type_directive");break;case 37:i[x]=i[x].trim().replace(/'/g,'"'),s.parseDirective(i[x],"arg_directive");break;case 38:s.parseDirective("}%%","close_directive","quadrantChart");break;case 39:this.$={text:i[x],type:"text"};break;case 40:this.$={text:i[x-1].text+""+i[x],type:i[x-1].type};break;case 41:this.$={text:i[x],type:"text"};break;case 42:this.$={text:i[x],type:"markdown"};break;case 43:this.$=i[x];break;case 44:this.$=i[x-1]+""+i[x];break}},"anonymous"),table:[{3:1,4:2,5:n,6:4,7:h,33:9,38:p,39:g,40:f,41:d},{1:[3]},{3:11,4:2,5:n,6:4,7:h,33:9,38:p,39:g,40:f,41:d},{3:12,4:2,5:n,6:4,7:h,33:9,38:p,39:g,40:f,41:d},{3:13,4:2,5:n,6:4,7:h,33:9,38:p,39:g,40:f,41:d},e(T,[2,5],{8:14}),e(o,[2,32]),e(o,[2,33]),e(o,[2,34]),{34:15,42:[1,16]},{42:[2,35]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(c,C,{33:9,9:17,10:18,11:20,12:21,13:22,6:28,22:35,45:36,1:[2,4],5:W,14:H,16:D,18:w,20:B,21:J,26:et,28:rt,29:st,30:ot,31:it,32:ht,41:d,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q}),{35:50,36:[1,51],44:_t},e([36,44],[2,36]),e(T,[2,6]),{4:53,38:p,39:g,40:f},e(c,C,{33:9,11:20,12:21,13:22,6:28,22:35,45:36,10:54,5:W,14:H,16:D,18:w,20:B,21:J,26:et,28:rt,29:st,30:ot,31:it,32:ht,41:d,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q}),e(c,[2,10]),e(c,[2,11]),e(c,[2,12]),{15:[1,55]},{17:[1,56]},{19:[1,57]},e(c,[2,16]),e(c,[2,17]),e(c,[2,18]),{22:58,45:36,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q},{22:59,45:36,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q},{22:60,45:36,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q},{22:61,45:36,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q},{22:62,45:36,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q},{22:63,45:36,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q},{5:X,23:[1,64],45:66,46:65,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M},e(z,[2,39]),e(z,[2,41]),e(z,[2,42]),e(z,[2,45]),e(z,[2,46]),e(z,[2,47]),e(z,[2,48]),e(z,[2,49]),e(z,[2,50]),e(z,[2,51]),e(z,[2,52]),e(z,[2,53]),e(z,[2,54]),e(z,[2,55]),e(xt,[2,30]),{37:69,43:[1,70]},e(xt,[2,38]),e(T,[2,7]),e(c,[2,9]),e(c,[2,13]),e(c,[2,14]),e(c,[2,15]),e(c,[2,22],{46:65,45:66,5:X,27:[1,71],50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),e(c,[2,25],{46:65,45:66,5:X,27:[1,72],50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),e(c,[2,26],{46:65,45:66,5:X,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),e(c,[2,27],{46:65,45:66,5:X,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),e(c,[2,28],{46:65,45:66,5:X,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),e(c,[2,29],{46:65,45:66,5:X,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),{24:[1,73]},e(z,[2,40]),e(z,[2,56]),e(z,[2,57]),e(z,[2,58]),{35:74,44:_t},{44:[2,37]},e(c,[2,21],{45:36,22:75,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q}),e(c,[2,24],{45:36,22:76,47:N,48:t,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q}),{25:[1,77]},e(xt,[2,31]),e(c,[2,20],{46:65,45:66,5:X,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),e(c,[2,23],{46:65,45:66,5:X,50:m,51:b,52:q,53:k,54:A,55:_,56:S,57:P,58:F,59:v,60:Q,61:M}),e(c,[2,19])],defaultActions:{10:[2,35],11:[2,1],12:[2,2],13:[2,3],70:[2,37]},parseError:u(function(a,r){if(r.recoverable)this.trace(a);else{var l=new Error(a);throw l.hash=r,l}},"parseError"),parse:u(function(a){var r=this,l=[0],s=[],y=[null],i=[],at=this.table,x="",lt=0,St=0,Pt=0,Ut=2,Ft=1,Xt=i.slice.call(arguments,1),E=Object.create(this.lexer),K={yy:{}};for(var gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gt)&&(K.yy[gt]=this.yy[gt]);E.setInput(a,K.yy),K.yy.lexer=E,K.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var yt=E.yylloc;i.push(yt);var Mt=E.options&&E.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(O){l.length=l.length-2*O,y.length=y.length-O,i.length=i.length-O}u(de,"popStack");function Yt(){var O;return O=s.pop()||E.lex()||Ft,typeof O!="number"&&(O instanceof Array&&(s=O,O=s.pop()),O=r.symbols_[O]||O),O}u(Yt,"lex");for(var V,Tt,Z,U,he,mt,$={},ut,Y,vt,ct;;){if(Z=l[l.length-1],this.defaultActions[Z]?U=this.defaultActions[Z]:((V===null||typeof V>"u")&&(V=Yt()),U=at[Z]&&at[Z][V]),typeof U>"u"||!U.length||!U[0]){var bt="";ct=[];for(ut in at[Z])this.terminals_[ut]&&ut>Ut&&ct.push("'"+this.terminals_[ut]+"'");E.showPosition?bt="Parse error on line "+(lt+1)+`: `+E.showPosition()+` Expecting `+ct.join(", ")+", got '"+(this.terminals_[V]||V)+"'":bt="Parse error on line "+(lt+1)+": Unexpected "+(V==Ft?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(bt,{text:E.match,token:this.terminals_[V]||V,line:E.yylineno,loc:yt,expected:ct})}if(U[0]instanceof Array&&U.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+V);switch(U[0]){case 1:l.push(V),y.push(E.yytext),i.push(E.yylloc),l.push(U[1]),V=null,Tt?(V=Tt,Tt=null):(St=E.yyleng,x=E.yytext,lt=E.yylineno,yt=E.yylloc,Pt>0&&Pt--);break;case 2:if(Y=this.productions_[U[1]][1],$.$=y[y.length-Y],$._$={first_line:i[i.length-(Y||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(Y||1)].first_column,last_column:i[i.length-1].last_column},Mt&&($._$.range=[i[i.length-(Y||1)].range[0],i[i.length-1].range[1]]),mt=this.performAction.apply($,[x,St,lt,K.yy,U[1],y,i].concat(Xt)),typeof mt<"u")return mt;Y&&(l=l.slice(0,-1*Y*2),y=y.slice(0,-1*Y),i=i.slice(0,-1*Y)),l.push(this.productions_[U[1]][0]),y.push($.$),i.push($._$),vt=at[l[l.length-2]][l[l.length-1]],l.push(vt);break;case 3:return!0}}return!0},"parse")},Ot=function(){var G={EOF:1,parseError:u(function(r,l){if(this.yy.parser)this.yy.parser.parseError(r,l);else throw new Error(r)},"parseError"),setInput:function(a,r){return this.yy=r||this.yy||{},this._input=a,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 a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var r=a.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),a},unput:function(a){var r=a.length,l=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var y=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===s.length?this.yylloc.first_column:0)+s[s.length-l.length].length-l[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[y[0],y[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). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),r=new Array(a.length+1).join("-");return a+this.upcomingInput()+` `+r+"^"},test_match:function(a,r){var l,s,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),s=a[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[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 i in y)this[i]=y[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,r,l,s;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),i=0;ir[0].length)){if(r=l,s=i,this.options.backtrack_lexer){if(a=this.test_match(l,y[i]),a!==!1)return a;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(a=this.test_match(r,y[s]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:u(function(){var r=this.next();return r||this.lex()},"lex"),begin:u(function(r){this.conditionStack.push(r)},"begin"),popState:u(function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:u(function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},"topState"),pushState:u(function(r){this.begin(r)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(r,l,s,y){var i=y;switch(s){case 0:return this.begin("open_directive"),41;break;case 1:return this.begin("type_directive"),42;break;case 2:return this.popState(),this.begin("arg_directive"),36;break;case 3:return this.popState(),this.popState(),44;break;case 4:return 43;case 5:break;case 6:break;case 7:return 38;case 8:break;case 9:return this.begin("title"),14;break;case 10:return this.popState(),"title_value";break;case 11:return this.begin("acc_title"),16;break;case 12:return this.popState(),"acc_title_value";break;case 13:return this.begin("acc_descr"),18;break;case 14:return this.popState(),"acc_descr_value";break;case 15:this.begin("acc_descr_multiline");break;case 16:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:return 26;case 19:return 28;case 20:return 27;case 21:return 29;case 22:return 30;case 23:return 31;case 24:return 32;case 25:this.begin("md_string");break;case 26:return"MD_STR";case 27:this.popState();break;case 28:this.begin("string");break;case 29:this.popState();break;case 30:return"STR";case 31:return this.begin("point_start"),23;break;case 32:return this.begin("point_x"),24;break;case 33:this.popState();break;case 34:this.popState(),this.begin("point_y");break;case 35:return this.popState(),25;break;case 36:return 7;case 37:return 53;case 38:return"COLON";case 39:return 55;case 40:return 54;case 41:return 56;case 42:return 56;case 43:return 57;case 44:return 59;case 45:return 60;case 46:return 58;case 47:return 51;case 48:return 61;case 49:return 52;case 50:return 5;case 51:return 39;case 52:return 50;case 53:return 40}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{point_y:{rules:[35],inclusive:!1},point_x:{rules:[34],inclusive:!1},point_start:{rules:[32,33],inclusive:!1},acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},title:{rules:[10],inclusive:!1},md_string:{rules:[26,27],inclusive:!1},string:{rules:[29,30],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,11,13,15,18,19,20,21,22,23,24,25,28,31,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53],inclusive:!0}}};return G}();ft.lexer=Ot;function pt(){this.yy={}}return u(pt,"Parser"),pt.prototype=ft,ft.Parser=pt,new pt}();kt.parser=kt;var Rt=kt;import{scaleLinear as Wt}from"d3";var R=Lt(),dt=class{static{u(this,"QuadrantBuilder")}constructor(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:L.quadrantChart?.chartWidth||500,chartWidth:L.quadrantChart?.chartHeight||500,titlePadding:L.quadrantChart?.titlePadding||10,titleFontSize:L.quadrantChart?.titleFontSize||20,quadrantPadding:L.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:L.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:L.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:L.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:L.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:L.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:L.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:L.quadrantChart?.pointTextPadding||5,pointLabelFontSize:L.quadrantChart?.pointLabelFontSize||12,pointRadius:L.quadrantChart?.pointRadius||5,xAxisPosition:L.quadrantChart?.xAxisPosition||"top",yAxisPosition:L.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:L.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:L.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:R.quadrant1Fill,quadrant2Fill:R.quadrant2Fill,quadrant3Fill:R.quadrant3Fill,quadrant4Fill:R.quadrant4Fill,quadrant1TextFill:R.quadrant1TextFill,quadrant2TextFill:R.quadrant2TextFill,quadrant3TextFill:R.quadrant3TextFill,quadrant4TextFill:R.quadrant4TextFill,quadrantPointFill:R.quadrantPointFill,quadrantPointTextFill:R.quadrantPointTextFill,quadrantXAxisTextFill:R.quadrantXAxisTextFill,quadrantYAxisTextFill:R.quadrantYAxisTextFill,quadrantTitleFill:R.quadrantTitleFill,quadrantInternalBorderStrokeFill:R.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:R.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),tt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}setConfig(n){tt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){tt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,h,p,g){let f=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,d={top:n==="top"&&h?f:0,bottom:n==="bottom"&&h?f:0},T=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,o={left:this.config.yAxisPosition==="left"&&p?T:0,right:this.config.yAxisPosition==="right"&&p?T:0},c=this.config.titleFontSize+this.config.titlePadding*2,C={top:g?c:0},W=this.config.quadrantPadding+o.left,H=this.config.quadrantPadding+d.top+C.top,D=this.config.chartWidth-this.config.quadrantPadding*2-o.left-o.right,w=this.config.chartHeight-this.config.quadrantPadding*2-d.top-d.bottom-C.top,B=D/2,J=w/2;return{xAxisSpace:d,yAxisSpace:o,titleSpace:C,quadrantSpace:{quadrantLeft:W,quadrantTop:H,quadrantWidth:D,quadrantHalfWidth:B,quadrantHeight:w,quadrantHalfHeight:J}}}getAxisLabels(n,h,p,g){let{quadrantSpace:f,titleSpace:d}=g,{quadrantHalfHeight:T,quadrantHeight:o,quadrantLeft:c,quadrantHalfWidth:C,quadrantTop:W,quadrantWidth:H}=f,D=this.data.points.length===0,w=[];return this.data.xAxisLeftText&&h&&w.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+(D?C/2:0),y:n==="top"?this.config.xAxisLabelPadding+d.top:this.config.xAxisLabelPadding+W+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:D?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&h&&w.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+C+(D?C/2:0),y:n==="top"?this.config.xAxisLabelPadding+d.top:this.config.xAxisLabelPadding+W+o+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:D?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&p&&w.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+H+this.config.quadrantPadding,y:W+o-(D?T/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:D?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&p&&w.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+H+this.config.quadrantPadding,y:W+T-(D?T/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:D?"center":"left",horizontalPos:"top",rotation:-90}),w}getQuadrants(n){let{quadrantSpace:h}=n,{quadrantHalfHeight:p,quadrantLeft:g,quadrantHalfWidth:f,quadrantTop:d}=h,T=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:g+f,y:d,width:f,height:p,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:g,y:d,width:f,height:p,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:g,y:d+p,width:f,height:p,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:g+f,y:d+p,width:f,height:p,fill:this.themeConfig.quadrant4Fill}];for(let o of T)o.text.x=o.x+o.width/2,this.data.points.length===0?(o.text.y=o.y+o.height/2,o.text.horizontalPos="middle"):(o.text.y=o.y+this.config.quadrantTextTopPadding,o.text.horizontalPos="top");return T}getQuadrantPoints(n){let{quadrantSpace:h}=n,{quadrantHeight:p,quadrantLeft:g,quadrantTop:f,quadrantWidth:d}=h,T=Wt().domain([0,1]).range([g,d+g]),o=Wt().domain([0,1]).range([p+f,f]);return this.data.points.map(C=>({x:T(C.x),y:o(C.y),fill:this.themeConfig.quadrantPointFill,radius:this.config.pointRadius,text:{text:C.text,fill:this.themeConfig.quadrantPointTextFill,x:T(C.x),y:o(C.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0}}))}getBorders(n){let h=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:p}=n,{quadrantHalfHeight:g,quadrantHeight:f,quadrantLeft:d,quadrantHalfWidth:T,quadrantTop:o,quadrantWidth:c}=p;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:d-h,y1:o,x2:d+c+h,y2:o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:d+c,y1:o+h,x2:d+c,y2:o+f-h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:d-h,y1:o+f,x2:d+c+h,y2:o+f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:d,y1:o+h,x2:d,y2:o+f-h},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:d+T,y1:o+h,x2:d+T,y2:o+f-h},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:d+h,y1:o+g,x2:d+c-h,y2:o+g}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){let n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),h=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),p=this.config.showTitle&&!!this.data.titleText,g=this.data.points.length>0?"bottom":this.config.xAxisPosition,f=this.calculateSpace(g,n,h,p);return{points:this.getQuadrantPoints(f),quadrants:this.getQuadrants(f),axisLabels:this.getAxisLabels(g,n,h,f),borderLines:this.getBorders(f),title:this.getTitle(p)}}};var Gt=nt();function j(e){return Qt(e.trim(),Gt)}u(j,"textSanitizer");var I=new dt;function Kt(e){I.setData({quadrant1Text:j(e.text)})}u(Kt,"setQuadrant1Text");function Zt(e){I.setData({quadrant2Text:j(e.text)})}u(Zt,"setQuadrant2Text");function Jt(e){I.setData({quadrant3Text:j(e.text)})}u(Jt,"setQuadrant3Text");function $t(e){I.setData({quadrant4Text:j(e.text)})}u($t,"setQuadrant4Text");function te(e){I.setData({xAxisLeftText:j(e.text)})}u(te,"setXAxisLeftText");function ee(e){I.setData({xAxisRightText:j(e.text)})}u(ee,"setXAxisRightText");function ie(e){I.setData({yAxisTopText:j(e.text)})}u(ie,"setYAxisTopText");function ae(e){I.setData({yAxisBottomText:j(e.text)})}u(ae,"setYAxisBottomText");function ne(e,n,h){I.addPoints([{x:n,y:h,text:j(e.text)}])}u(ne,"addPoint");function re(e){I.setConfig({chartWidth:e})}u(re,"setWidth");function se(e){I.setConfig({chartHeight:e})}u(se,"setHeight");function oe(){let e=nt(),{themeVariables:n,quadrantChart:h}=e;return h&&I.setConfig(h),I.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),I.setData({titleText:qt()}),I.build()}u(oe,"getQuadrantData");var le=u(function(e,n,h){Vt.parseDirective(this,e,n,h)},"parseDirective"),ue=u(function(){I.clear(),Dt()},"clear"),Ht={setWidth:re,setHeight:se,setQuadrant1Text:Kt,setQuadrant2Text:Zt,setQuadrant3Text:Jt,setQuadrant4Text:$t,setXAxisLeftText:te,setXAxisRightText:ee,setYAxisTopText:ie,setYAxisBottomText:ae,addPoint:ne,getQuadrantData:oe,parseDirective:le,clear:ue,setAccTitle:zt,getAccTitle:Et,setDiagramTitle:wt,getDiagramTitle:qt,getAccDescription:It,setAccDescription:Bt};import{select as At}from"d3";var ce=u((e,n,h,p)=>{function g(t){return t==="top"?"hanging":"middle"}u(g,"getDominantBaseLine");function f(t){return t==="left"?"start":"middle"}u(f,"getTextAnchor");function d(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}u(d,"getTransformation");let T=nt();tt.debug(`Rendering quadrant chart `+e);let o=T.securityLevel,c;o==="sandbox"&&(c=At("#i"+n));let W=(o==="sandbox"?At(c.nodes()[0].contentDocument.body):At("body")).select(`[id="${n}"]`),H=W.append("g").attr("class","main"),D=T.quadrantChart?.chartWidth||500,w=T.quadrantChart?.chartHeight||500;Ct(W,w,D,T.quadrantChart?.useMaxWidth||!0),W.attr("viewBox","0 0 "+D+" "+w),p.db.setHeight(w),p.db.setWidth(D);let B=p.db.getQuadrantData(),J=H.append("g").attr("class","quadrants"),et=H.append("g").attr("class","border"),rt=H.append("g").attr("class","data-points"),st=H.append("g").attr("class","labels"),ot=H.append("g").attr("class","title");B.title&&ot.append("text").attr("x",0).attr("y",0).attr("fill",B.title.fill).attr("font-size",B.title.fontSize).attr("dominant-baseline",g(B.title.horizontalPos)).attr("text-anchor",f(B.title.verticalPos)).attr("transform",d(B.title)).text(B.title.text),B.borderLines&&et.selectAll("line").data(B.borderLines).enter().append("line").attr("x1",t=>t.x1).attr("y1",t=>t.y1).attr("x2",t=>t.x2).attr("y2",t=>t.y2).style("stroke",t=>t.strokeFill).style("stroke-width",t=>t.strokeWidth);let it=J.selectAll("g.quadrant").data(B.quadrants).enter().append("g").attr("class","quadrant");it.append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill),it.append("text").attr("x",0).attr("y",0).attr("fill",t=>t.text.fill).attr("font-size",t=>t.text.fontSize).attr("dominant-baseline",t=>g(t.text.horizontalPos)).attr("text-anchor",t=>f(t.text.verticalPos)).attr("transform",t=>d(t.text)).text(t=>t.text.text),st.selectAll("g.label").data(B.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(t=>t.text).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>g(t.horizontalPos)).attr("text-anchor",t=>f(t.verticalPos)).attr("transform",t=>d(t));let N=rt.selectAll("g.data-point").data(B.points).enter().append("g").attr("class","data-point");N.append("circle").attr("cx",t=>t.x).attr("cy",t=>t.y).attr("r",t=>t.radius).attr("fill",t=>t.fill),N.append("text").attr("x",0).attr("y",0).text(t=>t.text.text).attr("fill",t=>t.text.fill).attr("font-size",t=>t.text.fontSize).attr("dominant-baseline",t=>g(t.text.horizontalPos)).attr("text-anchor",t=>f(t.text.verticalPos)).attr("transform",t=>d(t.text))},"draw"),Nt={draw:ce};var Be={parser:Rt,db:Ht,renderer:Nt,styles:()=>""};export{Be as diagram};