@logan-jun/cd1-rag-chat 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/arc-scm8MMJs.js +1 -0
- package/dist/assets/architectureDiagram-3BPJPVTR-B4HnSePg.js +36 -0
- package/dist/assets/blockDiagram-GPEHLZMM-Br570MCp.js +132 -0
- package/dist/assets/c4Diagram-AAUBKEIU-DkTSnj0d.js +10 -0
- package/dist/assets/channel-DiZdOJ9B.js +1 -0
- package/dist/assets/chunk-2J33WTMH-CrTr9xzl.js +1 -0
- package/dist/assets/chunk-4BX2VUAB-D0wgG8xH.js +1 -0
- package/dist/assets/chunk-55IACEB6-Duov_Htw.js +1 -0
- package/dist/assets/chunk-727SXJPM-DDvX-nhe.js +206 -0
- package/dist/assets/chunk-AQP2D5EJ-09XyW5jk.js +231 -0
- package/dist/assets/chunk-FMBD7UC4-C8_DpYrt.js +15 -0
- package/dist/assets/chunk-ND2GUHAM-BeN_xln2.js +1 -0
- package/dist/assets/chunk-QZHKN3VN-vOMf7cyc.js +1 -0
- package/dist/assets/classDiagram-4FO5ZUOK-DDDJcc4H.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-DDDJcc4H.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-pK2cAyHP.js +1 -0
- package/dist/assets/cytoscape.esm-C6a136cz.js +331 -0
- package/dist/assets/dagre-BM42HDAG-kL6GF6jg.js +4 -0
- package/dist/assets/defaultLocale-CrowFXzY.js +1 -0
- package/dist/assets/diagram-2AECGRRQ-dykDFI_K.js +43 -0
- package/dist/assets/diagram-5GNKFQAL-WJvXRiuM.js +10 -0
- package/dist/assets/diagram-KO2AKTUF-D2favLYT.js +3 -0
- package/dist/assets/diagram-LMA3HP47-CXVuETL_.js +24 -0
- package/dist/assets/diagram-OG6HWLK6-BcJzKfoj.js +24 -0
- package/dist/assets/erDiagram-TEJ5UH35-thR4lGNd.js +85 -0
- package/dist/assets/flowDiagram-I6XJVG4X-BxfwGe_r.js +162 -0
- package/dist/assets/ganttDiagram-6RSMTGT7-fwLip5Nh.js +292 -0
- package/dist/assets/gitGraphDiagram-PVQCEYII-D-oFePm0.js +106 -0
- package/dist/assets/graph-BB0J4w4c.js +1 -0
- package/dist/assets/index-CbSmh0fl.js +86 -0
- package/dist/assets/index-DDQloFPo.css +1 -0
- package/dist/assets/infoDiagram-5YYISTIA-D4MiRb75.js +2 -0
- package/dist/assets/init-Gi6I4Gst.js +1 -0
- package/dist/assets/ishikawaDiagram-YF4QCWOH-BXo0XBC7.js +70 -0
- package/dist/assets/journeyDiagram-JHISSGLW-CqScJnKj.js +139 -0
- package/dist/assets/kanban-definition-UN3LZRKU-MV47OAPx.js +89 -0
- package/dist/assets/katex-DOa3rsiF.js +257 -0
- package/dist/assets/layout-X4aHIIHH.js +1 -0
- package/dist/assets/linear-DLYnUT7M.js +1 -0
- package/dist/assets/mermaid.core-DuagT3S2.js +307 -0
- package/dist/assets/mindmap-definition-RKZ34NQL-HJXV2iNz.js +96 -0
- package/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/assets/pieDiagram-4H26LBE5-BVHq2F8U.js +30 -0
- package/dist/assets/quadrantDiagram-W4KKPZXB-BUPck4BP.js +7 -0
- package/dist/assets/requirementDiagram-4Y6WPE33-DQl89ON9.js +84 -0
- package/dist/assets/sankeyDiagram-5OEKKPKP-DD5N52ZQ.js +40 -0
- package/dist/assets/sequenceDiagram-3UESZ5HK-zctcDLCC.js +162 -0
- package/dist/assets/stateDiagram-AJRCARHV-Vyn0aDZv.js +1 -0
- package/dist/assets/stateDiagram-v2-BHNVJYJU-BY6pmmBt.js +1 -0
- package/dist/assets/timeline-definition-PNZ67QCA-1XNXDgjy.js +120 -0
- package/dist/assets/vennDiagram-CIIHVFJN-DZ1fF_Rg.js +34 -0
- package/dist/assets/wardley-L42UT6IY-DsEWk1n9.js +173 -0
- package/dist/assets/wardleyDiagram-YWT4CUSO-CpQIM9KB.js +78 -0
- package/dist/assets/xychartDiagram-2RQKCTM6-CIryoW2U.js +7 -0
- package/dist/index.html +2 -2
- package/package.json +18 -4
- package/dist/assets/index-Bp_ymGdi.js +0 -89
- package/dist/assets/index-D4hGefa4.css +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{b as l,a3 as yt,av as Vt,aA as Ft,M as Gt,a4 as mt,aE as w,b0 as zt,aN as Ot,b7 as xt,a$ as J,_ as Dt,y as Kt,t as Ut}from"./mermaid.core-DuagT3S2.js";import{d as ht}from"./arc-scm8MMJs.js";import"./index-CbSmh0fl.js";var nt=function(){var n=l(function(g,s,d,h){for(d=d||{},h=g.length;h--;d[g[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],e=[1,14],a=[1,15],o=[1,16],c=[1,19],f=[1,20],m={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:l(function(s,d,h,p,k,u,_){var v=u.length-1;switch(k){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},n(t,[2,5],{5:6}),n(t,[2,2]),n(t,[2,3]),n(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:e,19:a,20:o,21:17,22:18,23:c,24:f},n(t,[2,10],{1:[2,1]}),n(t,[2,6]),{12:21,14:r,15:i,17:e,19:a,20:o,21:17,22:18,23:c,24:f},n(t,[2,8]),n(t,[2,9]),n(t,[2,11]),{16:[1,22]},{18:[1,23]},n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,17]),n(t,[2,18]),n(t,[2,19]),n(t,[2,7]),n(t,[2,12]),n(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],p=[],k=[null],u=[],_=this.table,v="",R=0,F=0,W=2,z=1,H=u.slice.call(arguments,1),b=Object.create(this.lexer),$={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&($.yy[P]=this.yy[P]);b.setInput(s,$.yy),$.yy.lexer=b,$.yy.parser=this,typeof b.yylloc=="undefined"&&(b.yylloc={});var G=b.yylloc;u.push(G);var q=b.options&&b.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function U(T){h.length=h.length-2*T,k.length=k.length-T,u.length=u.length-T}l(U,"popStack");function K(){var T;return T=p.pop()||b.lex()||z,typeof T!="number"&&(T instanceof Array&&(p=T,T=p.pop()),T=d.symbols_[T]||T),T}l(K,"lex");for(var I,B,M,O,L={},E,S,N,A;;){if(B=h[h.length-1],this.defaultActions[B]?M=this.defaultActions[B]:((I===null||typeof I=="undefined")&&(I=K()),M=_[B]&&_[B][I]),typeof M=="undefined"||!M.length||!M[0]){var V="";A=[];for(E in _[B])this.terminals_[E]&&E>W&&A.push("'"+this.terminals_[E]+"'");b.showPosition?V="Parse error on line "+(R+1)+`:
|
|
2
|
+
`+b.showPosition()+`
|
|
3
|
+
Expecting `+A.join(", ")+", got '"+(this.terminals_[I]||I)+"'":V="Parse error on line "+(R+1)+": Unexpected "+(I==z?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(V,{text:b.match,token:this.terminals_[I]||I,line:b.yylineno,loc:G,expected:A})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+I);switch(M[0]){case 1:h.push(I),k.push(b.yytext),u.push(b.yylloc),h.push(M[1]),I=null,F=b.yyleng,v=b.yytext,R=b.yylineno,G=b.yylloc;break;case 2:if(S=this.productions_[M[1]][1],L.$=k[k.length-S],L._$={first_line:u[u.length-(S||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(S||1)].first_column,last_column:u[u.length-1].last_column},q&&(L._$.range=[u[u.length-(S||1)].range[0],u[u.length-1].range[1]]),O=this.performAction.apply(L,[v,F,R,$.yy,M[1],k,u].concat(H)),typeof O!="undefined")return O;S&&(h=h.slice(0,-1*S*2),k=k.slice(0,-1*S),u=u.slice(0,-1*S)),h.push(this.productions_[M[1]][0]),k.push(L.$),u.push(L._$),N=_[h[h.length-2]][h[h.length-1]],h.push(N);break;case 3:return!0}}return!0},"parse")},x=function(){var g={EOF:1,parseError:l(function(d,h){if(this.yy.parser)this.yy.parser.parseError(d,h);else throw new Error(d)},"parseError"),setInput:l(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var d=s.length,h=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=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),h.length-1&&(this.yylineno-=h.length-1);var k=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:h?(h.length===p.length?this.yylloc.first_column:0)+p[p.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+d+"^"},"showPosition"),test_match:l(function(s,d){var h,p,k;if(this.options.backtrack_lexer&&(k={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&&(k.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],h=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var u in k)this[u]=k[u];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,h,p;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),u=0;u<k.length;u++)if(h=this._input.match(this.rules[k[u]]),h&&(!d||h[0].length>d[0].length)){if(d=h,p=u,this.options.backtrack_lexer){if(s=this.test_match(h,k[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,k[p]),s!==!1?s:!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})},"next"),lex:l(function(){var d=this.next();return d||this.lex()},"lex"),begin:l(function(d){this.conditionStack.push(d)},"begin"),popState:l(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:l(function(d){this.begin(d)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(d,h,p,k){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/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]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return g}();m.lexer=x;function y(){this.yy={}}return l(y,"Parser"),y.prototype=m,m.Parser=y,new y}();nt.parser=nt;var Xt=nt,kt={};Dt(kt,{addEvent:()=>It,addSection:()=>Et,addTask:()=>Nt,addTaskOrg:()=>Ht,clear:()=>_t,default:()=>Zt,getCommonDb:()=>bt,getDirection:()=>St,getSections:()=>Tt,getTasks:()=>$t,setDirection:()=>wt});var X="",vt=0,st="LR",it=[],Q=[],Z=[],bt=l(()=>Kt,"getCommonDb"),_t=l(function(){it.length=0,Q.length=0,X="",Z.length=0,st="LR",Ut()},"clear"),wt=l(function(n){st=n},"setDirection"),St=l(function(){return st},"getDirection"),Et=l(function(n){X=n,it.push(n)},"addSection"),Tt=l(function(){return it},"getSections"),$t=l(function(){let n=dt();const t=100;let r=0;for(;!n&&r<t;)n=dt(),r++;return Q.push(...Z),Q},"getTasks"),Nt=l(function(n,t,r){const i={id:vt++,section:X,type:X,task:n,score:t||0,events:r?[r]:[]};Z.push(i)},"addTask"),It=l(function(n){Z.find(r=>r.id===vt-1).events.push(n)},"addEvent"),Ht=l(function(n){const t={section:X,type:X,description:n,task:n,classes:[]};Q.push(t)},"addTaskOrg"),dt=l(function(){const n=l(function(r){return Z[r].processed},"compileTask");let t=!0;for(const[r,i]of Z.entries())n(r),t=t&&i.processed;return t},"compileTasks"),Zt={clear:_t,getCommonDb:bt,getDirection:St,setDirection:wt,addSection:Et,getSections:Tt,getTasks:$t,addTask:Nt,addTaskOrg:Ht,addEvent:It},Lt=0,j=l(function(n,t){const r=n.append("rect");return r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),r.attr("rx",t.rx),r.attr("ry",t.ry),t.class!==void 0&&r.attr("class",t.class),r},"drawRect"),qt=l(function(n,t){const i=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),e=n.append("g");e.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"),e.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 a(f){const m=ht().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}l(a,"smile");function o(f){const m=ht().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}l(o,"sad");function c(f){f.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 l(c,"ambivalent"),t.score>3?a(e):t.score<3?o(e):c(e),i},"drawFace"),Jt=l(function(n,t){const r=n.append("circle");return r.attr("cx",t.cx),r.attr("cy",t.cy),r.attr("class","actor-"+t.pos),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("r",t.r),r.class!==void 0&&r.attr("class",r.class),t.title!==void 0&&r.append("title").text(t.title),r},"drawCircle"),Mt=l(function(n,t){const r=t.text.replace(/<br\s*\/?>/gi," "),i=n.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const e=i.append("tspan");return e.attr("x",t.x+t.textMargin*2),e.text(r),i},"drawText"),Qt=l(function(n,t){function r(e,a,o,c,f){return e+","+a+" "+(e+o)+","+a+" "+(e+o)+","+(a+c-f)+" "+(e+o-f*1.2)+","+(a+c)+" "+e+","+(a+c)}l(r,"genPoints");const i=n.append("polygon");i.attr("points",r(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,Mt(n,t)},"drawLabel"),jt=l(function(n,t,r){const i=n.append("g"),e=at();e.x=t.x,e.y=t.y,e.fill=t.fill,e.width=r.width,e.height=r.height,e.class="journey-section section-type-"+t.num,e.rx=3,e.ry=3,j(i,e),At(r)(t.text,i,e.x,e.y,e.width,e.height,{class:"journey-section section-type-"+t.num},r,t.colour)},"drawSection"),rt=-1,Yt=l(function(n,t,r,i){const e=t.x+r.width/2,a=n.append("g");rt++;const o=300+5*30;a.append("line").attr("id",i+"-task"+rt).attr("x1",e).attr("y1",t.y).attr("x2",e).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),qt(a,{cx:e,cy:300+(5-t.score)*30,score:t.score});const c=at();c.x=t.x,c.y=t.y,c.fill=t.fill,c.width=r.width,c.height=r.height,c.class="task task-type-"+t.num,c.rx=3,c.ry=3,j(a,c),At(r)(t.task,a,c.x,c.y,c.width,c.height,{class:"task"},r,t.colour)},"drawTask"),te=l(function(n,t){j(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),ee=l(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),at=l(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),At=function(){function n(e,a,o,c,f,m,x,y){const g=a.append("text").attr("x",o+f/2).attr("y",c+m/2+5).style("font-color",y).style("text-anchor","middle").text(e);i(g,x)}l(n,"byText");function t(e,a,o,c,f,m,x,y,g){const{taskFontSize:s,taskFontFamily:d}=y,h=e.split(/<br\s*\/?>/gi);for(let p=0;p<h.length;p++){const k=p*s-s*(h.length-1)/2,u=a.append("text").attr("x",o+f/2).attr("y",c).attr("fill",g).style("text-anchor","middle").style("font-size",s).style("font-family",d);u.append("tspan").attr("x",o+f/2).attr("dy",k).text(h[p]),u.attr("y",c+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(u,x)}}l(t,"byTspan");function r(e,a,o,c,f,m,x,y){const g=a.append("switch"),d=g.append("foreignObject").attr("x",o).attr("y",c).attr("width",f).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(e),t(e,g,o,c,f,m,x,y),i(d,x)}l(r,"byFo");function i(e,a){for(const o in a)o in a&&e.attr(o,a[o])}return l(i,"_setTextAttrs"),function(e){return e.textPlacement==="fo"?r:e.textPlacement==="old"?n:t}}(),ne=l(function(n,t){Lt=0,rt=-1,n.append("defs").append("marker").attr("id",t+"-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")},"initGraphics");function ot(n,t){n.each(function(){var r=J(this),i=r.text().split(/(\s+|<br>)/).reverse(),e,a=[],o=1.1,c=r.attr("y"),f=parseFloat(r.attr("dy")),m=r.text(null).append("tspan").attr("x",0).attr("y",c).attr("dy",f+"em");for(let x=0;x<i.length;x++)e=i[i.length-1-x],a.push(e),m.text(a.join(" ").trim()),(m.node().getComputedTextLength()>t||e==="<br>")&&(a.pop(),m.text(a.join(" ").trim()),e==="<br>"?a=[""]:a=[e],m=r.append("tspan").attr("x",0).attr("y",c).attr("dy",o+"em").text(e))})}l(ot,"wrap");var re=l(function(n,t,r,i,e,a=!1){var k,u,_,v,R,F;const{theme:o,look:c}=i,f=o==null?void 0:o.includes("redux"),m=(u=(k=i==null?void 0:i.themeVariables)==null?void 0:k.THEME_COLOR_LIMIT)!=null?u:12,x=r%m-1,y=n.append("g");t.section=x,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+x));const g=y.append("g"),s=y.append("g"),h=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ot,t.width).node().getBBox(),p=(_=i.fontSize)!=null&&_.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=h.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${a?t.padding/2+3:t.padding})`),ie(g,t,x,e,i),c==="neo"&&(y.attr("data-look","neo"),f)){const W=o.includes("dark"),z=(R=(v=n.node())==null?void 0:v.ownerSVGElement)!=null?R:n.node(),H=J(z),b=(F=H.attr("id"))!=null?F:"",$=b?`${b}-drop-shadow`:"drop-shadow";if(H.select(`#${$}`).empty()){const P=H.select("defs");(P.empty()?H.append("defs"):P).append("filter").attr("id",$).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",W?"0.2":"0.06").attr("flood-color",W?"#FFFFFF":"#000000")}}return t},"drawNode"),se=l(function(n,t,r){var c;const i=n.append("g"),a=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(ot,t.width).node().getBBox(),o=(c=r.fontSize)!=null&&c.replace?r.fontSize.replace("px",""):r.fontSize;return i.remove(),a.height+o*1.1*.5+t.padding},"getVirtualNodeHeight"),ie=l(function(n,t,r,i,e){const{theme:a}=e,o=a!=null&&a.includes("redux")?0:5,c=5,f=o>0?`M0 ${t.height-c} v${-t.height+2*c} q0,-${o},${o},-${o} h${t.width-2*c} q${o},0,${o},${o} v${t.height-c} H0 Z`:`M0 ${t.height-c} v${-(t.height-c)} h${t.width} v${t.height} H0 Z`;n.append("path").attr("id",i+"-node-"+Lt++).attr("class","node-bkg node-"+t.type).attr("d",f),a!=null&&a.includes("redux")||n.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),C={drawRect:j,drawCircle:Jt,drawSection:jt,drawText:Mt,drawLabel:Qt,drawTask:Yt,drawBackgroundRect:te,getTextObj:ee,getNoteRect:at,initGraphics:ne,drawNode:re,getVirtualNodeHeight:se},ae=l(function(n,t,r,i){var U,K,I,B,M,O;const e=mt(),{look:a,theme:o,themeVariables:c}=e,{useGradient:f,gradientStart:m,gradientStop:x}=c,y=(K=(U=e.timeline)==null?void 0:U.leftMargin)!=null?K:50;w.debug("timeline",i.db);const g=e.securityLevel;let s;g==="sandbox"&&(s=J("#i"+t));const h=(g==="sandbox"?J(s.nodes()[0].contentDocument.body):J("body")).select("#"+t);h.append("g");const p=i.db.getTasks(),k=i.db.getCommonDb().getDiagramTitle();w.debug("task",p),C.initGraphics(h,t);const u=i.db.getSections();w.debug("sections",u);let _=0,v=0,R=0,F=0,W=50+y,z=50;F=50;let H=0,b=!0;u.forEach(function(L){const E={number:H,descr:L,section:H,width:150,padding:20,maxHeight:_},S=C.getVirtualNodeHeight(h,E,e);w.debug("sectionHeight before draw",S),_=Math.max(_,S+20)});let $=0,P=0;w.debug("tasks.length",p.length);for(const[L,E]of p.entries()){const S={number:L,descr:E,section:E.section,width:150,padding:20,maxHeight:v},N=C.getVirtualNodeHeight(h,S,e);w.debug("taskHeight before draw",N),v=Math.max(v,N+20),$=Math.max($,E.events.length);let A=0;for(const V of E.events){const T={descr:V,section:E.section,number:E.section,width:150,padding:20,maxHeight:50};A+=C.getVirtualNodeHeight(h,T,e)}E.events.length>0&&(A+=(E.events.length-1)*10),P=Math.max(P,A)}w.debug("maxSectionHeight before draw",_),w.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(L=>{const E=p.filter(V=>V.section===L),S={number:H,descr:L,section:H,width:200*Math.max(E.length,1)-50,padding:20,maxHeight:_};w.debug("sectionNode",S);const N=h.append("g"),A=C.drawNode(N,S,H,e,t);w.debug("sectionNode output",A),N.attr("transform",`translate(${W}, ${F})`),z+=_+50,E.length>0&&ut(h,E,H,W,z,v,e,$,P,_,!1,t),W+=200*Math.max(E.length,1),z=F,H++}):(b=!1,ut(h,p,H,W,z,v,e,$,P,_,!0,t));const G=h.node().getBBox();if(w.debug("bounds",G),k&&h.append("text").text(k).attr("x",a==="neo"?G.x*2+y:G.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),R=b?_+v+150:v+100,h.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",R).attr("x2",G.width+3*y).attr("y2",R).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),a==="neo"&&f&&o!=="neutral"){const L=h.select("defs"),S=(L.empty()?h.append("defs"):L).append("linearGradient").attr("id",h.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");S.append("stop").attr("offset","0%").attr("stop-color",m).attr("stop-opacity",1),S.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}xt(void 0,h,(B=(I=e.timeline)==null?void 0:I.padding)!=null?B:50,(O=(M=e.timeline)==null?void 0:M.useMaxWidth)!=null?O:!1)},"draw"),ut=l(function(n,t,r,i,e,a,o,c,f,m,x,y){var g;for(const s of t){const d={descr:s.task,section:r,number:r,width:150,padding:20,maxHeight:a};w.debug("taskNode",d);const h=n.append("g").attr("class","taskWrapper"),k=C.drawNode(h,d,r,o,y).height;if(w.debug("taskHeight after draw",k),h.attr("transform",`translate(${i}, ${e})`),a=Math.max(a,k),s.events){const u=n.append("g").attr("class","lineWrapper");let _=a;e+=100,_=_+oe(n,s.events,r,i,e,o,y),e-=100,u.append("line").attr("x1",i+190/2).attr("y1",e+a).attr("x2",i+190/2).attr("y2",e+a+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,x&&!((g=o.timeline)!=null&&g.disableMulticolor)&&r++}e=e-10},"drawTasks"),oe=l(function(n,t,r,i,e,a,o){let c=0;const f=e;e=e+100;for(const m of t){const x={descr:m,section:r,number:r,width:150,padding:20,maxHeight:50};w.debug("eventNode",x);const y=n.append("g").attr("class","eventWrapper"),s=C.drawNode(y,x,r,a,o,!0).height;c=c+s,y.attr("transform",`translate(${i}, ${e})`),e=e+10+s}return e=f,c},"drawEvents"),ce={setConf:l(()=>{},"setConf"),draw:ae},Y=200,D=5,le=Y+D*2,ct=Y+100,he=ct+D*2,Rt=10,de=0,pt=20,Ct=20,gt=30,Wt=50,ue=l(function(n,t,r,i){var U,K,I,B,M,O,L,E;const e=mt(),a=(K=(U=e.timeline)==null?void 0:U.leftMargin)!=null?K:50;w.debug("timeline",i.db);const o=zt(t);o.append("g");const c=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();w.debug("task",c),C.initGraphics(o);const m=i.db.getSections();w.debug("sections",m);let x=0,y=0;const g=50+a;let s=50;const d=s,h=g,p=le+Ct,k=he+Wt,u=h+p;let _=0;const v=m&&m.length>0,R=v?u:g+p,F=Math.max(50,p+k-D*2);m.forEach(function(S){const N={number:_,descr:S,section:_,width:F,padding:D,maxHeight:x},A=C.getVirtualNodeHeight(o,N,e);w.debug("sectionHeight before draw",A),x=Math.max(x,A)});let W=0;w.debug("tasks.length",c.length);for(const[S,N]of c.entries()){const A={number:S,descr:N,section:N.section,width:Y,padding:D,maxHeight:y},V=C.getVirtualNodeHeight(o,A,e);w.debug("taskHeight before draw",V),y=Math.max(y,V);let T=0;for(const tt of N.events){const et={descr:tt,section:N.section,number:N.section,width:ct,padding:D,maxHeight:50};T+=C.getVirtualNodeHeight(o,et,e)}N.events.length>0&&(T+=(N.events.length-1)*Rt),W=Math.max(W,T)+de}w.debug("maxSectionHeight before draw",x),w.debug("maxTaskHeight before draw",y);const H=Math.max(y,W)+gt;v?m.forEach(S=>{const N=c.filter(Bt=>Bt.section===S),A={number:_,descr:S,section:_,width:F,padding:D,maxHeight:x};w.debug("sectionNode",A);const V=o.append("g"),T=C.drawNode(V,A,_,e);w.debug("sectionNode output",T);const tt=R-p;V.attr("transform",`translate(${tt}, ${s})`);const et=s+T.height+pt;N.length>0&&ft(o,N,_,R,et,y,e,H,!1);const lt=N.length,Pt=T.height+pt+H*Math.max(lt,1)-(lt>0?gt*2:0);s+=Pt,_++}):ft(o,c,_,R,s,y,e,H,!0);let b=(I=o.node())==null?void 0:I.getBBox();if(!b)throw new Error("bbox not found");if(w.debug("bounds",b),f){if(o.append("text").text(f).attr("x",b.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),b=(B=o.node())==null?void 0:B.getBBox(),!b)throw new Error("bbox not found");w.debug("bounds after title",b)}const[$]=Ot(e.fontSize),P=($!=null?$:16)*2,G=($!=null?$:16)*.5+20,q=o.append("g").attr("class","lineWrapper");q.append("line").attr("x1",R).attr("y1",d-P).attr("x2",R).attr("y2",b.y+b.height+G).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),q.lower(),xt(void 0,o,(O=(M=e.timeline)==null?void 0:M.padding)!=null?O:50,(E=(L=e.timeline)==null?void 0:L.useMaxWidth)!=null?E:!1)},"draw"),ft=l(function(n,t,r,i,e,a,o,c,f){var m;for(const x of t){const y={descr:x.task,section:r,number:r,width:Y,padding:D,maxHeight:a};w.debug("taskNode",y);const g=n.append("g").attr("class","taskWrapper"),s=C.drawNode(g,y,r,o),d=s.height;w.debug("taskHeight after draw",d);const h=i-Ct-s.width;if(g.attr("transform",`translate(${h}, ${e})`),a=Math.max(a,d),x.events&&x.events.length>0){const p=e,k=i+Wt;pe(n,x.events,r,i,k,p,o)}e=e+c,f&&!((m=o.timeline)!=null&&m.disableMulticolor)&&r++}},"drawTasks"),pe=l(function(n,t,r,i,e,a,o){let c=a;for(const f of t){const m={descr:f,section:r,number:r,width:ct,padding:D,maxHeight:0};w.debug("eventNode",m);const x=n.append("g").attr("class","eventWrapper"),g=C.drawNode(x,m,r,o).height;x.attr("transform",`translate(${e}, ${c})`);const s=n.append("g").attr("class","lineWrapper"),d=c+g/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",e).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),c=c+g+Rt}return c-a},"drawEvents"),ge={setConf:l(()=>{},"setConf"),draw:ue},fe=l(n=>{var c,f,m,x,y;const{theme:t}=yt(),r=t==null?void 0:t.includes("dark"),i=t==null?void 0:t.includes("color"),e=(f=(c=n.svgId)==null?void 0:c.replace(/^#/,""))!=null?f:"",a=e?`url(#${e}-drop-shadow)`:(m=n.dropShadow)!=null?m:"none";let o="";for(let g=0;g<n.THEME_COLOR_LIMIT;g++){const s=`${17-3*g}`,d=i?n.borderColorArray[g]:n.mainBkg,h=i?n.borderColorArray[g]:n.nodeBorder;o+=`
|
|
7
|
+
.section-${g-1} rect,
|
|
8
|
+
.section-${g-1} path,
|
|
9
|
+
.section-${g-1} circle {
|
|
10
|
+
fill: ${r&&i?n.mainBkg:d};
|
|
11
|
+
stroke: ${h};
|
|
12
|
+
stroke-width: ${n.strokeWidth};
|
|
13
|
+
filter: ${a};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.section-${g-1} text {
|
|
17
|
+
fill: ${n.nodeBorder};
|
|
18
|
+
font-weight: ${n.fontWeight}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.node-icon-${g-1} {
|
|
22
|
+
font-size: 40px;
|
|
23
|
+
color: ${n["cScaleLabel"+g]};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.section-edge-${g-1} {
|
|
27
|
+
stroke: ${n["cScale"+g]};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.edge-depth-${g-1} {
|
|
31
|
+
stroke-width: ${s};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.section-${g-1} line {
|
|
35
|
+
stroke: ${n["cScaleInv"+g]};
|
|
36
|
+
stroke-width: 3;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.lineWrapper line {
|
|
40
|
+
stroke: ${n.nodeBorder};
|
|
41
|
+
stroke-width:${n.strokeWidth}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.disabled,
|
|
45
|
+
.disabled circle,
|
|
46
|
+
.disabled text {
|
|
47
|
+
fill: ${(x=n.tertiaryColor)!=null?x:"lightgray"};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.disabled text {
|
|
51
|
+
fill: ${(y=n.clusterBorder)!=null?y:"#efefef"};
|
|
52
|
+
}
|
|
53
|
+
`}return o},"genReduxSections"),ye=l(n=>{var r,i;let t="";for(let e=0;e<n.THEME_COLOR_LIMIT;e++)n["lineColor"+e]=n["lineColor"+e]||n["cScaleInv"+e],Vt(n["lineColor"+e])?n["lineColor"+e]=Ft(n["lineColor"+e],20):n["lineColor"+e]=Gt(n["lineColor"+e],20);for(let e=0;e<n.THEME_COLOR_LIMIT;e++){const a=""+(17-3*e);t+=`
|
|
54
|
+
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} path {
|
|
55
|
+
fill: ${n["cScale"+e]};
|
|
56
|
+
}
|
|
57
|
+
.section-${e-1} text {
|
|
58
|
+
fill: ${n["cScaleLabel"+e]};
|
|
59
|
+
}
|
|
60
|
+
.node-icon-${e-1} {
|
|
61
|
+
font-size: 40px;
|
|
62
|
+
color: ${n["cScaleLabel"+e]};
|
|
63
|
+
}
|
|
64
|
+
.section-edge-${e-1}{
|
|
65
|
+
stroke: ${n["cScale"+e]};
|
|
66
|
+
}
|
|
67
|
+
.edge-depth-${e-1}{
|
|
68
|
+
stroke-width: ${a};
|
|
69
|
+
}
|
|
70
|
+
.section-${e-1} line {
|
|
71
|
+
stroke: ${n["cScaleInv"+e]} ;
|
|
72
|
+
stroke-width: 3;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.lineWrapper line{
|
|
76
|
+
stroke: ${n["cScaleLabel"+e]} ;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.disabled, .disabled circle, .disabled text {
|
|
80
|
+
fill: ${(r=n.tertiaryColor)!=null?r:"lightgray"};
|
|
81
|
+
}
|
|
82
|
+
.disabled text {
|
|
83
|
+
fill: ${(i=n.clusterBorder)!=null?i:"#efefef"};
|
|
84
|
+
}
|
|
85
|
+
`}return t},"genSections"),me=l(n=>{var o,c;const{theme:t}=yt(),r=t==null?void 0:t.includes("redux"),i=t==="neutral",e=(c=(o=n.svgId)==null?void 0:o.replace(/^#/,""))!=null?c:"";let a="";if(n.useGradient&&e&&n.THEME_COLOR_LIMIT&&!i)for(let f=0;f<n.THEME_COLOR_LIMIT;f++)a+=`
|
|
86
|
+
.section-${f-1}[data-look="neo"] rect,
|
|
87
|
+
.section-${f-1}[data-look="neo"] path,
|
|
88
|
+
.section-${f-1}[data-look="neo"] circle {
|
|
89
|
+
fill: ${n.mainBkg};
|
|
90
|
+
stroke: url(#${e}-gradient);
|
|
91
|
+
stroke-width: 2;
|
|
92
|
+
}
|
|
93
|
+
.section-${f-1}[data-look="neo"] line {
|
|
94
|
+
stroke: url(#${e}-gradient);
|
|
95
|
+
stroke-width: 2;
|
|
96
|
+
}`;return`
|
|
97
|
+
.edge {
|
|
98
|
+
stroke-width: 3;
|
|
99
|
+
}
|
|
100
|
+
${r?fe(n):ye(n)}
|
|
101
|
+
${a}
|
|
102
|
+
.section-root rect, .section-root path, .section-root circle {
|
|
103
|
+
fill: ${n.git0};
|
|
104
|
+
}
|
|
105
|
+
.section-root text {
|
|
106
|
+
fill: ${n.gitBranchLabel0};
|
|
107
|
+
}
|
|
108
|
+
.icon-container {
|
|
109
|
+
height:100%;
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
}
|
|
114
|
+
.edge {
|
|
115
|
+
fill: none;
|
|
116
|
+
}
|
|
117
|
+
.eventWrapper {
|
|
118
|
+
filter: brightness(120%);
|
|
119
|
+
}
|
|
120
|
+
`},"getStyles"),xe=me,ke={setConf:l(()=>{},"setConf"),draw:l((n,t,r,i)=>{var a,o,c;return((c=(o=(a=i==null?void 0:i.db)==null?void 0:a.getDirection)==null?void 0:o.call(a))!=null?c:"LR")==="TD"?ge.draw(n,t,r,i):ce.draw(n,t,r,i)},"draw")},we={db:kt,renderer:ke,parser:Xt,styles:xe};export{we as diagram};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{e as Yt,b1 as Xt,a1 as Zt,a6 as Jt,b4 as Qt,a2 as $t,b2 as te,b as S,a3 as Et,b0 as ee,a$ as lt,l as ne,av as se,aA as ie,M as re,F as oe,t as ae,s as le,T as ce}from"./mermaid.core-DuagT3S2.js";import"./index-CbSmh0fl.js";const St=(t,n)=>Yt(t,"a",-n),At=1e-10;function it(t,n){const s=he(t),e=s.filter(c=>ue(c,t));let i=0,r=0;const o=[];if(e.length>1){const c=Rt(e);for(let u=0;u<e.length;++u){const l=e[u];l.angle=Math.atan2(l.x-c.x,l.y-c.y)}e.sort((u,l)=>l.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const l=e[u];r+=(f.x+l.x)*(l.y-f.y);const m={x:(l.x+f.x)/2,y:(l.y+f.y)/2};let g=null;for(let b=0;b<l.parentIndex.length;++b)if(f.parentIndex.includes(l.parentIndex[b])){const d=t[l.parentIndex[b]],k=Math.atan2(l.x-d.x,l.y-d.y),E=Math.atan2(f.x-d.x,f.y-d.y);let T=E-k;T<0&&(T+=2*Math.PI);const w=E-T/2;let x=G(m,{x:d.x+d.radius*Math.sin(w),y:d.y+d.radius*Math.cos(w)});x>d.radius*2&&(x=d.radius*2),(g==null||g.width>x)&&(g={circle:d,width:x,p1:l,p2:f,large:x>d.radius,sweep:!0})}g!=null&&(o.push(g),i+=ht(g.circle.radius,g.width),f=l)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(G(t[u],c)>Math.abs(c.radius-t[u].radius)){f=!0;break}f?i=r=0:(i=c.radius*c.radius*Math.PI,o.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-At,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ue(t,n){return n.every(s=>G(t,s)<s.radius+At)}function he(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=zt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function ht(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function G(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function mt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return ht(t,e)+ht(n,i)}function zt(t,n){const s=G(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),c=t.x+r*(n.x-t.x)/s,f=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),l=-(n.x-t.x)*(o/s);return[{x:c+u,y:f-l},{x:c-u,y:f+l}]}function Rt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function fe(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),c=t(s);let f=s-n;if(o*c>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(c===0)return s;for(let u=0;u<i;++u){f/=2;const l=n+f,m=t(l);if(m*o>=0&&(n=l),Math.abs(f)<r||m===0)return l}return n+f}function ft(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function _t(t,n){return ft(t).map(()=>ft(n))}function et(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function dt(t){return Math.sqrt(et(t,t))}function gt(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function Ct(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,l=s.psi!==void 0?s.psi:-.5,m=s.sigma!==void 0?s.sigma:.5;let g;const b=n.length,d=new Array(b+1);d[0]=n,d[0].fx=t(n),d[0].id=0;for(let v=0;v<b;++v){const a=n.slice();a[v]=a[v]?a[v]*i:r,d[v+1]=a,d[v+1].fx=t(a),d[v+1].id=v+1}function k(v){for(let a=0;a<v.length;a++)d[b][a]=v[a];d[b].fx=v.fx}const E=(v,a)=>v.fx-a.fx,T=n.slice(),w=n.slice(),x=n.slice(),p=n.slice();for(let v=0;v<e;++v){if(d.sort(E),s.history){const y=d.map(h=>{const j=h.slice();return j.fx=h.fx,j.id=h.id,j});y.sort((h,j)=>h.id-j.id),s.history.push({x:d[0].slice(),fx:d[0].fx,simplex:y})}g=0;for(let y=0;y<b;++y)g=Math.max(g,Math.abs(d[0][y]-d[1][y]));if(Math.abs(d[0].fx-d[b].fx)<o&&g<c)break;for(let y=0;y<b;++y){T[y]=0;for(let h=0;h<b;++h)T[y]+=d[h][y];T[y]/=b}const a=d[b];if(Q(w,1+f,T,-f,a),w.fx=t(w),w.fx<d[0].fx)Q(p,1+u,T,-u,a),p.fx=t(p),p.fx<w.fx?k(p):k(w);else if(w.fx>=d[b-1].fx){let y=!1;if(w.fx>a.fx?(Q(x,1+l,T,-l,a),x.fx=t(x),x.fx<a.fx?k(x):y=!0):(Q(x,1-l*f,T,l*f,a),x.fx=t(x),x.fx<w.fx?k(x):y=!0),y){if(m>=1)break;for(let h=1;h<d.length;++h)Q(d[h],1-m,d[0],m,d[h]),d[h].fx=t(d[h])}}else k(w)}return d.sort(E),{fx:d[0].fx,x:d[0]}}function de(t,n,s,e,i,r,o){const c=s.fx,f=et(s.fxprime,n);let u=c,l=c,m=f,g=0;i=i||1,r=r||1e-6,o=o||.1;function b(d,k,E){for(let T=0;T<16;++T)if(i=(d+k)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),m=et(e.fxprime,n),u>c+r*i*f||u>=E)k=i;else{if(Math.abs(m)<=-o*f)return i;m*(k-d)>=0&&(k=d),d=i,E=u}return 0}for(let d=0;d<10;++d){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),m=et(e.fxprime,n),u>c+r*i*f||d&&u>=l)return b(g,i,l);if(Math.abs(m)<=-o*f)return i;if(m>=0)return b(i,g,u);l=u,g=i,i*=2}return i}function ge(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,c,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),gt(o,e.fxprime,-1);for(let l=0;l<u;++l){if(f=de(t,o,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)gt(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const m=et(e.fxprime,e.fxprime),g=Math.max(0,et(r,i.fxprime)/m);Q(o,g,o,-1,i.fxprime),c=e,e=i,i=c}if(dt(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function Dt(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||me,e=n.lossFunction||nt,i=xe(t,n),r=s(i,n),o=Object.keys(r),c=[];for(const l of o)c.push(r[l].x),c.push(r[l].y);const u=Ct(l=>{const m={};for(let g=0;g<o.length;++g){const b=o[g];m[b]={x:l[2*g],y:l[2*g+1],radius:r[b].radius}}return e(m,i)},c,n).x;for(let l=0;l<o.length;++l){const m=o[l];r[m].x=u[2*l],r[m].y=u[2*l+1]}return r}const Nt=1e-10;function xt(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Nt?Math.abs(t-n):fe(e=>mt(t,n,e)-s,0,t+n)}function xe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const l=String(f.sets[u]);c.set(l,f.size+(c.get(l)||0));for(let m=u+1;m<f.sets.length;m++){const g=String(f.sets[m]),b=`${l};${g}`,d=`${g};${l}`;c.set(b,f.size+(c.get(b)||0)),c.set(d,f.size+(c.get(d)||0))}}for(const f of e)f.sets.length<3&&(f.size=c.get(i(f.sets)))}const r=[],o=new Set;for(const c of e)if(c.sets.length===1)r.push(c.sets[0]);else if(c.sets.length===2){const f=c.sets[0],u=c.sets[1];o.add(i(c.sets)),o.add(i([u,f]))}r.sort((c,f)=>c===f?0:c<f?-1:1);for(let c=0;c<r.length;++c){const f=r[c];for(let u=c+1;u<r.length;++u){const l=r[u];o.has(i([f,l]))||e.push({sets:[f,l],size:0})}}return e}function ye(t,n,s){const e=_t(n.length,n.length),i=_t(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],c=s[r.sets[1]],f=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),l=xt(f,u,r.size);e[o][c]=e[c][o]=l;let m=0;r.size+1e-10>=Math.min(n[o].size,n[c].size)?m=1:r.size<=1e-10&&(m=-1),i[o][c]=i[c][o]=m}),{distances:e,constraints:i}}function pe(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],c=t[2*r+1];for(let f=r+1;f<s.length;++f){const u=t[2*f],l=t[2*f+1],m=s[r][f],g=e[r][f],b=(u-o)*(u-o)+(l-c)*(l-c),d=Math.sqrt(b),k=b-m*m;g>0&&d<=m||g<0&&d>=m||(i+=2*k*k,n[2*r]+=4*k*(o-u),n[2*r+1]+=4*k*(c-l),n[2*f]+=4*k*(u-o),n[2*f+1]+=4*k*(l-c))}}return i}function me(t,n={}){let s=ve(t,n);const e=n.lossFunction||nt;if(t.length>=8){const i=be(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function be(t,n={}){const s=n.restarts||10,e=[],i={};for(const g of t)g.sets.length===1&&(i[g.sets[0]]=e.length,e.push(g));let{distances:r,constraints:o}=ye(t,e,i);const c=dt(r.map(dt))/r.length;r=r.map(g=>g.map(b=>b/c));const f=(g,b)=>pe(g,b,r,o);let u=null;for(let g=0;g<s;++g){const b=ft(r.length*2).map(Math.random),d=ge(f,b,n);(!u||d.fx<u.fx)&&(u=d)}const l=u.x,m={};for(let g=0;g<e.length;++g){const b=e[g];m[b.sets[0]]={x:l[2*g]*c,y:l[2*g+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const g of n.history)gt(g.x,c);return m}function ve(t,n){const s=n&&n.lossFunction?n.lossFunction:nt,e={},i={};for(const m of t)if(m.sets.length===1){const g=m.sets[0];e[g]={x:1e10,y:1e10,rowid:e.length,size:m.size,radius:Math.sqrt(m.size/Math.PI)},i[g]=[]}t=t.filter(m=>m.sets.length===2);for(const m of t){let g=m.weight!=null?m.weight:1;const b=m.sets[0],d=m.sets[1];m.size+Nt>=Math.min(e[b].size,e[d].size)&&(g=0),i[b].push({set:d,size:m.size,weight:g}),i[d].push({set:b,size:m.size,weight:g})}const r=[];Object.keys(i).forEach(m=>{let g=0;for(let b=0;b<i[m].length;++b)g+=i[m][b].size*i[m][b].weight;r.push({set:m,size:g})});function o(m,g){return g.size-m.size}r.sort(o);const c={};function f(m){return m.set in c}function u(m,g){e[g].x=m.x,e[g].y=m.y,c[g]=!0}u({x:0,y:0},r[0].set);for(let m=1;m<r.length;++m){const g=r[m].set,b=i[g].filter(f),d=e[g];if(b.sort(o),b.length===0)throw"ERROR: missing pairwise overlap information";const k=[];for(var l=0;l<b.length;++l){const w=e[b[l].set],x=xt(d.radius,w.radius,b[l].size);k.push({x:w.x+x,y:w.y}),k.push({x:w.x-x,y:w.y}),k.push({y:w.y+x,x:w.x}),k.push({y:w.y-x,x:w.x});for(let p=l+1;p<b.length;++p){const v=e[b[p].set],a=xt(d.radius,v.radius,b[p].size),y=zt({x:w.x,y:w.y,radius:x},{x:v.x,y:v.y,radius:a});k.push(...y)}}let E=1e50,T=k[0];for(const w of k){e[g].x=w.x,e[g].y=w.y;const x=s(e,t);x<E&&(E=x,T=w)}u(T,g)}return e}function nt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],c=t[e.sets[1]];i=mt(o.radius,c.radius,G(o,c))}else i=it(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ot(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],f=t[e.sets[1]];i=mt(c.radius,f.radius,G(c,f))}else i=it(e.sets.map(c=>t[c]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function Ie(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&G(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const c of t){const f=c.x,u=c.y;c.x=r*f-o*u,c.y=o*f+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function ke(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),c=n(r);o.parent=c}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;G(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function yt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ft(t,n,s){n==null&&(n=Math.PI/2);let e=Pt(t).map(u=>Object.assign({},u));const i=ke(e);for(const u of i){Ie(u,n,s);const l=yt(u);u.size=(l.xRange.max-l.xRange.min)*(l.yRange.max-l.yRange.min),u.bounds=l}i.sort((u,l)=>l.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function c(u,l,m){if(!u)return;const g=u.bounds;let b,d;if(l)b=r.xRange.max-g.xRange.min+o;else{b=r.xRange.max-g.xRange.max;const k=(g.xRange.max-g.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;k<0&&(b+=k)}if(m)d=r.yRange.max-g.yRange.min+o;else{d=r.yRange.max-g.yRange.max;const k=(g.yRange.max-g.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;k<0&&(d+=k)}for(const k of u)k.x+=b,k.y+=d,e.push(k)}let f=1;for(;f<i.length;)c(i[f],!0,!1),c(i[f+1],!1,!0),c(i[f+2],!0,!0),f+=3,r=yt(e);return jt(e)}function Lt(t,n,s,e,i){const r=Pt(t);n-=2*e,s-=2*e;const{xRange:o,yRange:c}=yt(r);if(o.max===o.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(o.max-o.min),u=s/(c.max-c.min);const l=Math.min(u,f),m=(n-(o.max-o.min)*l)/2,g=(s-(c.max-c.min)*l)/2;return jt(r.map(b=>({radius:l*b.radius,x:e+m+(b.x-o.min)*l,y:e+g+(b.y-c.min)*l,setid:b.setid})))}function jt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Pt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function Me(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,c=!0,f=null,u=!0,l=!0,m=null,g=null,b=!1,d=null,k=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,x=function(y){if(y in E)return E[y];var h=E[y]=T[w];return w+=1,w>=T.length&&(w=0),h},p=Dt,v=nt;function a(y){let h=y.datum();const j=new Set;h.forEach(I=>{I.size==0&&I.sets.length==1&&j.add(I.sets[0])}),h=h.filter(I=>!I.sets.some(C=>j.has(C)));let M={},F={};if(h.length>0){let I=p(h,{lossFunction:v,distinct:b});c&&(I=Ft(I,o,g)),M=Lt(I,s,e,i,f),F=Bt(M,h,k)}const Y={};h.forEach(I=>{I.label&&(Y[I.sets]=I.label)});function V(I){if(I.sets in Y)return Y[I.sets];if(I.sets.length==1)return""+I.sets[0]}y.selectAll("svg").data([M]).enter().append("svg");const K=y.select("svg");n?K.attr("viewBox",`0 0 ${s} ${e}`):K.attr("width",s).attr("height",e);const H={};let A=!1;K.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!b&&(A=!0,H[I.sets[0]]=_e(C))});function N(I){return C=>{const B=I.sets.map(X=>{let P=H[X],U=M[X];return P||(P={x:s/2,y:e/2,radius:1}),U||(U={x:s/2,y:e/2,radius:1}),{x:P.x*(1-C)+U.x*C,y:P.y*(1-C)+U.y*C,radius:P.radius*(1-C)+U.radius*C}});return Tt(B,d)}}const q=K.selectAll(".venn-area").data(h,I=>I.sets),W=q.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),Z=W.append("path"),J=W.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);l&&(Z.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:x(I.sets)).style("fill-opacity",".25"),J.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?x(I.sets):"#444"));function O(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=y;A&&typeof _.transition=="function"?(_=O(y),_.selectAll("path").attrTween("d",N)):_.selectAll("path").attr("d",I=>Tt(I.sets.map(C=>M[C])),d);const z=_.selectAll("text").filter(I=>I.sets in F).text(I=>V(I)).attr("x",I=>Math.floor(F[I.sets].x)).attr("y",I=>Math.floor(F[I.sets].y));u&&(A?"on"in z?z.on("end",ct(M,V)):z.each("end",ct(M,V)):z.each(ct(M,V)));const R=O(q.exit()).remove();typeof q.transition=="function"&&R.selectAll("path").attrTween("d",N);const D=R.selectAll("text").attr("x",s/2).attr("y",e/2);return m!==null&&(J.style("font-size","0px"),z.style("font-size",m),D.style("font-size","0px")),{circles:M,textCentres:F,nodes:q,enter:W,update:_,exit:R}}return a.wrap=function(y){return arguments.length?(u=y,a):u},a.useViewBox=function(){return n=!0,a},a.width=function(y){return arguments.length?(s=y,a):s},a.height=function(y){return arguments.length?(e=y,a):e},a.padding=function(y){return arguments.length?(i=y,a):i},a.distinct=function(y){return arguments.length?(b=y,a):b},a.colours=function(y){return arguments.length?(x=y,a):x},a.colors=function(y){return arguments.length?(x=y,a):x},a.fontSize=function(y){return arguments.length?(m=y,a):m},a.round=function(y){return arguments.length?(d=y,a):d},a.duration=function(y){return arguments.length?(r=y,a):r},a.layoutFunction=function(y){return arguments.length?(p=y,a):p},a.normalize=function(y){return arguments.length?(c=y,a):c},a.scaleToFit=function(y){return arguments.length?(f=y,a):f},a.styled=function(y){return arguments.length?(l=y,a):l},a.orientation=function(y){return arguments.length?(o=y,a):o},a.orientationOrder=function(y){return arguments.length?(g=y,a):g},a.lossFunction=function(y){return arguments.length?(v=y==="default"?nt:y==="logRatio"?Ot:y,a):v},a}function ct(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),f=(r.length+o.length)/3;let u=o.pop(),l=[u],m=0;const g=1.1;e.textContent=null;const b=[];function d(x){const p=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return p.textContent=x,b.push(p),e.append(p),p}let k=d(u);for(;u=o.pop(),!!u;){l.push(u);const x=l.join(" ");k.textContent=x,x.length>f&&k.getComputedTextLength()>i&&(l.pop(),k.textContent=l.join(" "),l=[u],k=d(u),m++)}const E=.35-m*g/2,T=e.getAttribute("x"),w=e.getAttribute("y");b.forEach((x,p)=>{x.setAttribute("x",T),x.setAttribute("y",w),x.setAttribute("dy",`${E+p*g}em`)})}}function ut(t,n,s){let e=n[0].radius-G(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-G(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=G(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function Vt(t,n,s){const e=[];for(const l of t)e.push({x:l.x,y:l.y}),e.push({x:l.x+l.radius/2,y:l.y}),e.push({x:l.x-l.radius/2,y:l.y}),e.push({x:l.x,y:l.y+l.radius/2}),e.push({x:l.x,y:l.y-l.radius/2});let i=e[0],r=ut(e[0],t,n);for(let l=1;l<e.length;++l){const m=ut(e[l],t,n);m>=r&&(i=e[l],r=m)}const o=Ct(l=>-1*ut({x:l[0],y:l[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:o[0],y:o[1]};let f=!0;for(const l of t)if(G(c,l)>l.radius){f=!1;break}for(const l of n)if(G(c,l)<l.radius){f=!1;break}if(f)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return it(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Vt(t,[]):Rt(u.arcs.map(l=>l.p1))}function we(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const c=s[o],f=t[c],u=G(r,f);u+f.radius<=r.radius+1e-10?n[c].push(i):u+r.radius<=f.radius+1e-10&&n[i].push(c)}}return n}function Bt(t,n,s){const e={},i=we(t);for(let r=0;r<n.length;++r){const o=n[r].sets,c={},f={};for(let g=0;g<o.length;++g){c[o[g]]=!0;const b=i[o[g]];for(let d=0;d<b.length;++d)f[b[d]]=!0}const u=[],l=[];for(let g in t)g in c?u.push(t[g]):g in f||l.push(t[g]);const m=Vt(u,l,s);e[o]=m,m.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Se(t,n,s){const e=[];return e.push(`
|
|
2
|
+
M`,t,n),e.push(`
|
|
3
|
+
m`,-s,0),e.push(`
|
|
4
|
+
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
5
|
+
a`,s,s,0,1,0,-s*2,0),e.join(" ")}function _e(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function qt(t){if(t.length===0)return[];const n={};return it(t,n),n.arcs}function Ut(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?r=>Math.round(r*s)/s:r=>r;if(t.length==1){const r=t[0].circle;return Se(e(r.x),e(r.y),e(r.radius))}const i=[`
|
|
6
|
+
M`,e(t[0].p2.x),e(t[0].p2.y)];for(const r of t){const o=e(r.circle.radius);i.push(`
|
|
7
|
+
A`,o,o,0,r.large?1:0,r.sweep?1:0,e(r.p1.x),e(r.p1.y))}return i.join(" ")}function Tt(t,n){return Ut(qt(t),n)}function Te(t,n={}){const{lossFunction:s,layoutFunction:e=Dt,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:c=600,height:f=350,padding:u=15,scaleToFit:l=!1,symmetricalTextCentre:m=!1,distinct:g,round:b=2}=n;let d=e(t,{lossFunction:s==="default"||!s?nt:s==="logRatio"?Ot:s,distinct:g});i&&(d=Ft(d,r,o));const k=Lt(d,c,f,u,l),E=Bt(k,t,m),T=new Map(Object.keys(k).map(p=>[p,{set:p,x:k[p].x,y:k[p].y,radius:k[p].radius}])),w=t.map(p=>{const v=p.sets.map(h=>T.get(h)),a=qt(v),y=Ut(a,b);return{circles:v,arcs:a,path:y,area:p,has:new Set(p.sets)}});function x(p){let v="";for(const a of w)a.has.size>p.length&&p.every(y=>a.has.has(y))&&(v+=" "+a.path);return v}return w.map(({circles:p,arcs:v,path:a,area:y})=>({data:y,text:E[y.sets],circles:p,arcs:v,path:a,distinctPath:a+x(y.sets)}))}var pt=function(){var t=S(function(w,x,p,v){for(p=p||{},v=w.length;v--;p[w[v]]=x);return p},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],o=[1,31],c=[1,39],f=[7,8,11,12,17,19,22,24,27],u=[1,57],l=[1,56],m=[1,58],g=[1,59],b=[1,60],d=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],k={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:S(function(x,p,v,a,y,h,j){var M=h.length-1;switch(y){case 1:return h[M-1];case 2:case 3:case 4:this.$=[];break;case 5:h[M-1].push(h[M]),this.$=h[M-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=h[M];break;case 8:a.setDiagramTitle(h[M].substr(6)),this.$=h[M].substr(6);break;case 9:a.addSubsetData([h[M]],void 0,void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 10:a.addSubsetData([h[M-1]],h[M],void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 11:a.addSubsetData([h[M-2]],void 0,parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 12:a.addSubsetData([h[M-3]],h[M-2],parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 13:if(h[M].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M]),a.addSubsetData(h[M],void 0,void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 14:if(h[M-1].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M-1]),a.addSubsetData(h[M-1],h[M],void 0),a.setIndentMode&&a.setIndentMode(!0);break;case 15:if(h[M-2].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M-2]),a.addSubsetData(h[M-2],void 0,parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 16:if(h[M-3].length<2)throw new Error("union requires multiple identifiers");a.validateUnionIdentifiers&&a.validateUnionIdentifiers(h[M-3]),a.addSubsetData(h[M-3],h[M-2],parseFloat(h[M])),a.setIndentMode&&a.setIndentMode(!0);break;case 17:case 18:case 19:a.addTextData(h[M-1],h[M],void 0);break;case 20:case 21:a.addTextData(h[M-2],h[M-1],h[M]);break;case 23:a.addStyleData(h[M-1],h[M]);break;case 24:case 25:case 26:var F=a.getCurrentSets();if(!F)throw new Error("text requires set");a.addTextData(F,h[M],void 0);break;case 27:case 28:var F=a.getCurrentSets();if(!F)throw new Error("text requires set");a.addTextData(F,h[M-1],h[M]);break;case 29:case 41:this.$=[h[M]];break;case 30:case 42:this.$=[...h[M-2],h[M]];break;case 31:this.$=[h[M-2],h[M]];break;case 33:this.$=h[M].join(" ");break;case 34:this.$=[h[M]];break;case 35:h[M-1].push(h[M]),this.$=h[M-1];break;case 43:case 44:this.$=h[M];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:o}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:c,25:37,26:38,27:o},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(f,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(r,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:c,26:51},{16:u,20:l,21:[1,53],28:52,29:54,30:55,31:m,32:g,33:b},t(s,[2,12]),t(s,[2,16]),t(f,[2,30]),t(f,[2,31]),t(f,[2,32]),t(f,[2,33],{30:61,16:u,20:l,31:m,32:g,33:b}),t(d,[2,34]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),t(d,[2,39]),t(d,[2,40]),t(d,[2,35])],defaultActions:{6:[2,1]},parseError:S(function(x,p){if(p.recoverable)this.trace(x);else{var v=new Error(x);throw v.hash=p,v}},"parseError"),parse:S(function(x){var p=this,v=[0],a=[],y=[null],h=[],j=this.table,M="",F=0,Y=0,V=2,K=1,H=h.slice.call(arguments,1),A=Object.create(this.lexer),N={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(N.yy[q]=this.yy[q]);A.setInput(x,N.yy),N.yy.lexer=A,N.yy.parser=this,typeof A.yylloc=="undefined"&&(A.yylloc={});var W=A.yylloc;h.push(W);var Z=A.options&&A.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function J(L){v.length=v.length-2*L,y.length=y.length-L,h.length=h.length-L}S(J,"popStack");function O(){var L;return L=a.pop()||A.lex()||K,typeof L!="number"&&(L instanceof Array&&(a=L,L=a.pop()),L=p.symbols_[L]||L),L}S(O,"lex");for(var _,z,R,D,I={},C,B,X,P;;){if(z=v[v.length-1],this.defaultActions[z]?R=this.defaultActions[z]:((_===null||typeof _=="undefined")&&(_=O()),R=j[z]&&j[z][_]),typeof R=="undefined"||!R.length||!R[0]){var U="";P=[];for(C in j[z])this.terminals_[C]&&C>V&&P.push("'"+this.terminals_[C]+"'");A.showPosition?U="Parse error on line "+(F+1)+`:
|
|
8
|
+
`+A.showPosition()+`
|
|
9
|
+
Expecting `+P.join(", ")+", got '"+(this.terminals_[_]||_)+"'":U="Parse error on line "+(F+1)+": Unexpected "+(_==K?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(U,{text:A.match,token:this.terminals_[_]||_,line:A.yylineno,loc:W,expected:P})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+_);switch(R[0]){case 1:v.push(_),y.push(A.yytext),h.push(A.yylloc),v.push(R[1]),_=null,Y=A.yyleng,M=A.yytext,F=A.yylineno,W=A.yylloc;break;case 2:if(B=this.productions_[R[1]][1],I.$=y[y.length-B],I._$={first_line:h[h.length-(B||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(B||1)].first_column,last_column:h[h.length-1].last_column},Z&&(I._$.range=[h[h.length-(B||1)].range[0],h[h.length-1].range[1]]),D=this.performAction.apply(I,[M,Y,F,N.yy,R[1],y,h].concat(H)),typeof D!="undefined")return D;B&&(v=v.slice(0,-1*B*2),y=y.slice(0,-1*B),h=h.slice(0,-1*B)),v.push(this.productions_[R[1]][0]),y.push(I.$),h.push(I._$),X=j[v[v.length-2]][v[v.length-1]],v.push(X);break;case 3:return!0}}return!0},"parse")},E=function(){var w={EOF:1,parseError:S(function(p,v){if(this.yy.parser)this.yy.parser.parseError(p,v);else throw new Error(p)},"parseError"),setInput:S(function(x,p){return this.yy=p||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:S(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var p=x.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:S(function(x){var p=x.length,v=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.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:v?(v.length===a.length?this.yylloc.first_column:0)+a[a.length-v.length].length-v[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(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).
|
|
10
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(x){this.unput(this.match.slice(x))},"less"),pastInput:S(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var x=this.pastInput(),p=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
|
|
11
|
+
`+p+"^"},"showPosition"),test_match:S(function(x,p){var v,a,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))),a=x[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,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(x[0].length),this.matched+=x[0],v=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var h in y)this[h]=y[h];return!1}return!1},"test_match"),next:S(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,p,v,a;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),h=0;h<y.length;h++)if(v=this._input.match(this.rules[y[h]]),v&&(!p||v[0].length>p[0].length)){if(p=v,a=h,this.options.backtrack_lexer){if(x=this.test_match(v,y[h]),x!==!1)return x;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(x=this.test_match(p,y[a]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
12
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:S(function(){var p=this.next();return p||this.lex()},"lex"),begin:S(function(p){this.conditionStack.push(p)},"begin"),popState:S(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:S(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:S(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:S(function(p){this.begin(p)},"pushState"),stateStackSize:S(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:S(function(p,v,a,y){switch(a){case 0:break;case 1:break;case 2:break;case 3:if(p.getIndentMode&&p.getIndentMode())return p.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:p.setIndentMode&&p.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(p.consumeIndentText)p.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return w}();k.lexer=E;function T(){this.yy={}}return S(T,"Parser"),T.prototype=k,k.Parser=T,new T}();pt.parser=pt;var Ee=pt,bt=[],vt=[],It=[],kt=new Set,Mt,wt=!1,Ae=S((t,n,s)=>{const e=rt(t).sort(),i=s!=null?s:10/Math.pow(t.length,2);Mt=e,e.length===1&&kt.add(e[0]),bt.push({sets:e,size:i,label:n?st(n):void 0})},"addSubsetData"),ze=S(()=>bt,"getSubsetData"),st=S(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Re=S(t=>t&&st(t),"normalizeStyleValue"),Ce=S((t,n,s)=>{const e=st(n);vt.push({sets:rt(t).sort(),id:e,label:s?st(s):void 0})},"addTextData"),De=S((t,n)=>{var i;const s=rt(t).sort(),e={};for(const[r,o]of n)e[r]=(i=Re(o))!=null?i:o;It.push({targets:s,styles:e})},"addStyleData"),Ne=S(()=>It,"getStyleData"),rt=S(t=>t.map(n=>st(n)),"normalizeIdentifierList"),Oe=S(t=>{const s=rt(t).filter(e=>!kt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),Fe=S(()=>vt,"getTextData"),Le=S(()=>Mt,"getCurrentSets"),je=S(()=>wt,"getIndentMode"),Pe=S(t=>{wt=t},"setIndentMode"),Ve=ce.venn;function Gt(){return le(Ve,Et().venn)}S(Gt,"getConfig");var Be=S(()=>{ae(),bt.length=0,vt.length=0,It.length=0,kt.clear(),Mt=void 0,wt=!1},"customClear"),qe={getConfig:Gt,clear:Be,setAccTitle:te,getAccTitle:$t,setDiagramTitle:Qt,getDiagramTitle:Jt,getAccDescription:Zt,setAccDescription:Xt,addSubsetData:Ae,getSubsetData:ze,addTextData:Ce,addStyleData:De,validateUnionIdentifiers:Oe,getTextData:Fe,getStyleData:Ne,getCurrentSets:Le,getIndentMode:je,setIndentMode:Pe},Ue=S(t=>`
|
|
13
|
+
.venn-title {
|
|
14
|
+
font-size: 32px;
|
|
15
|
+
fill: ${t.vennTitleTextColor};
|
|
16
|
+
font-family: ${t.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.venn-circle text {
|
|
20
|
+
font-size: 48px;
|
|
21
|
+
font-family: ${t.fontFamily};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.venn-intersection text {
|
|
25
|
+
font-size: 48px;
|
|
26
|
+
fill: ${t.vennSetTextColor};
|
|
27
|
+
font-family: ${t.fontFamily};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.venn-text-node {
|
|
31
|
+
font-family: ${t.fontFamily};
|
|
32
|
+
color: ${t.vennSetTextColor};
|
|
33
|
+
}
|
|
34
|
+
`,"getStyles"),Ge=Ue;function Wt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}S(Wt,"buildStyleByKey");var We=S((t,n,s,e)=>{var K,H,A,N,q,W,Z,J;const i=e.db,r=(K=i.getConfig)==null?void 0:K.call(i),{themeVariables:o,look:c,handDrawnSeed:f}=Et(),u=c==="handDrawn",l=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),m=(H=i.getDiagramTitle)==null?void 0:H.call(i),g=i.getSubsetData(),b=i.getTextData(),d=Wt(i.getStyleData()),k=(A=r==null?void 0:r.width)!=null?A:800,E=(N=r==null?void 0:r.height)!=null?N:450,w=k/1600,x=m?48*w:0,p=(q=o.primaryTextColor)!=null?q:o.textColor,v=ee(n);v.attr("viewBox",`0 0 ${k} ${E}`),m&&v.append("text").text(m).attr("class","venn-title").attr("font-size",`${32*w}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*w).style("fill",o.vennTitleTextColor||o.titleColor);const a=lt(document.createElement("div")),y=Me().width(k).height(E-x);a.datum(g).call(y);const h=u?ne.svg(a.select("svg").node()):void 0,j=Te(g,{width:k,height:E-x,padding:(W=r==null?void 0:r.padding)!=null?W:15}),M=new Map;for(const O of j){const _=$([...O.data.sets].sort());M.set(_,O)}b.length>0&&Kt(r,M,a,b,w,d);const F=se(o.background||"#f4f4f4");a.selectAll(".venn-circle").each(function(O,_){var L,tt;const z=lt(this),D=$([...O.sets].sort()),I=d.get(D),C=(I==null?void 0:I.fill)||l[_%l.length]||o.primaryColor;z.classed(`venn-set-${_%8}`,!0);const B=(L=I==null?void 0:I["fill-opacity"])!=null?L:.1,X=(I==null?void 0:I.stroke)||C,P=(I==null?void 0:I["stroke-width"])||`${5*w}`;if(u&&h){const ot=M.get(D);if(ot&&ot.circles.length>0){const at=ot.circles[0],Ht=h.circle(at.x,at.y,at.radius*2,{roughness:.7,seed:f,fill:St(C,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+_*60,stroke:X,strokeWidth:parseFloat(String(P))});z.select("path").remove(),(tt=z.node())==null||tt.insertBefore(Ht,z.select("text").node())}}else z.select("path").style("fill",C).style("fill-opacity",B).style("stroke",X).style("stroke-width",P).style("stroke-opacity",.95);const U=(I==null?void 0:I.color)||(F?ie(C,30):re(C,30));z.select("text").style("font-size",`${48*w}px`).style("fill",U)}),u&&h?a.selectAll(".venn-intersection").each(function(O){var C,B,X;const _=lt(this),R=$([...O.sets].sort()),D=d.get(R),I=D==null?void 0:D.fill;if(I){const P=_.select("path"),U=P.attr("d");if(U){const L=h.path(U,{roughness:.7,seed:f,fill:St(I,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),tt=P.node();(C=tt==null?void 0:tt.parentNode)==null||C.insertBefore(L,tt),P.remove()}}else _.select("path").style("fill-opacity",0);_.select("text").style("font-size",`${48*w}px`).style("fill",(X=(B=D==null?void 0:D.color)!=null?B:o.vennSetTextColor)!=null?X:p)}):(a.selectAll(".venn-intersection text").style("font-size",`${48*w}px`).style("fill",O=>{var R,D,I;const z=$([...O.sets].sort());return(I=(D=(R=d.get(z))==null?void 0:R.color)!=null?D:o.vennSetTextColor)!=null?I:p}),a.selectAll(".venn-intersection path").style("fill-opacity",O=>{var R;const z=$([...O.sets].sort());return(R=d.get(z))!=null&&R.fill?1:0}).style("fill",O=>{var R,D;const z=$([...O.sets].sort());return(D=(R=d.get(z))==null?void 0:R.fill)!=null?D:"transparent"}));const Y=v.append("g").attr("transform",`translate(0, ${x})`),V=a.select("svg").node();if(V&&"childNodes"in V)for(const O of[...V.childNodes])(Z=Y.node())==null||Z.appendChild(O);oe(v,E,k,(J=r==null?void 0:r.useMaxWidth)!=null?J:!0)},"draw");function $(t){return t.join("|")}S($,"stableSetsKey");function Kt(t,n,s,e,i,r){var l,m,g;const o=(l=t==null?void 0:t.useDebugLayout)!=null?l:!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const b of e){const d=$(b.sets),k=u.get(d);k?k.push(b):u.set(d,[b])}for(const[b,d]of u.entries()){const k=n.get(b);if(!(k!=null&&k.text))continue;const E=k.text.x,T=k.text.y,w=Math.min(...k.circles.map(N=>N.radius)),x=Math.min(...k.circles.map(N=>N.radius-Math.hypot(E-N.x,T-N.y)));let p=Number.isFinite(x)?Math.max(0,x):0;p===0&&Number.isFinite(w)&&(p=w*.6);const v=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&v.append("circle").attr("class","venn-text-debug-circle").attr("cx",E).attr("cy",T).attr("r",p).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const a=Math.max(80*i,p*2*.95),y=Math.max(60*i,p*2*.95),M=(k.data.label&&k.data.label.length>0?Math.min(32*i,p*.25):0)+(d.length<=2?30*i:0),F=E-a/2,Y=T-y/2+M,V=Math.max(1,Math.ceil(Math.sqrt(d.length))),K=Math.max(1,Math.ceil(d.length/V)),H=a/V,A=y/K;for(const[N,q]of d.entries()){const W=N%V,Z=Math.floor(N/V),J=F+H*(W+.5),O=Y+A*(Z+.5);o&&v.append("rect").attr("class","venn-text-debug-cell").attr("x",F+H*W).attr("y",Y+A*Z).attr("width",H).attr("height",A).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const _=H*.9,z=A*.9,R=v.append("foreignObject").attr("class","venn-text-node-fo").attr("width",_).attr("height",z).attr("x",J-_/2).attr("y",O-z/2).attr("overflow","visible"),D=(m=r.get(q.id))==null?void 0:m.color,I=R.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text((g=q.label)!=null?g:q.id);D&&I.style("color",D)}}}S(Kt,"renderTextNodes");var Ke={draw:We},Xe={parser:Ee,db:qe,renderer:Ke,styles:Ge};export{Xe as diagram};
|