@softistx/pulsarix-widget 0.7.3 → 0.8.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/README.md +15 -8
- package/dist/chunks/abnfDiagram-XWFEHMT6.jcqkp43e.js +1 -0
- package/dist/chunks/architecture-WOLXFQ4H.6qa86taq.js +1 -0
- package/dist/chunks/architectureDiagram-CSQXQB3N.pk9dxdfb.js +36 -0
- package/dist/chunks/blockDiagram-BEDRHYPZ.ehefn7dt.js +140 -0
- package/dist/chunks/bpmnIcons-APHXDYXF.whh96nc8.js +1 -0
- package/dist/chunks/c4Diagram-M2UUVUY5.knj3as6x.js +38 -0
- package/dist/chunks/chat-markdown-DLDNLXM9.tvekh9sm.js +301 -0
- package/dist/chunks/classDiagram-v2-KXABOMEV.vtb7vjzn.js +217 -0
- package/dist/chunks/cose-bilkent-JH36ORCC.gb18dr42.js +1 -0
- package/dist/chunks/cynefin-EF2NZ3EQ.e86yfa9w.js +1 -0
- package/dist/chunks/cynefinDiagram-NJNITYFG.akmr90zk.js +62 -0
- package/dist/chunks/dagre-KIHZ2IZ3.7n7s7vq2.js +4 -0
- package/dist/chunks/diagram-7YQZDPLS.d3sdv0py.js +41 -0
- package/dist/chunks/diagram-QBROCOUO.2v08zs42.js +200 -0
- package/dist/chunks/diagram-RJJCUUZO.tpnwa621.js +30 -0
- package/dist/chunks/diagram-WERXNKYE.hz7tgbtr.js +24 -0
- package/dist/chunks/diagram-YHHI257C.9gge9ecb.js +3 -0
- package/dist/chunks/diagram-YR4HJLHV.bajpx75b.js +24 -0
- package/dist/chunks/ebnfDiagram-N527522P.hxbbq671.js +1 -0
- package/dist/chunks/editor-shortcuts-dialog-I77EAez1.0s00eh53.js +1 -0
- package/dist/chunks/editor.h5bxwyxn.js +4 -0
- package/dist/chunks/elk-O5DQBFGD.vy7cdqps.js +27 -0
- package/dist/chunks/emoji-picker-BofyuTmK.qf287fk6.js +4 -0
- package/dist/chunks/erDiagram-K3K3BIDK.kzs3v0ts.js +99 -0
- package/dist/chunks/eventmodeling-K75KTNOO.9yb5zf47.js +1 -0
- package/dist/chunks/flow-diagram-OPO1ep57.5006stqg.js +7 -0
- package/dist/chunks/flowDiagram-Z6JWZHQI.zf0kndsp.js +1 -0
- package/dist/chunks/ganttDiagram-3PRQTZWP.qkcp8pvg.js +292 -0
- package/dist/chunks/gitGraph-VSP46ZUC.txpj8e6d.js +1 -0
- package/dist/chunks/gitGraphDiagram-VXDFKS5L.ry9dejxm.js +106 -0
- package/dist/chunks/grid-E2QIVN74.q51enfx7.js +1 -0
- package/dist/chunks/illustration-BoOzuxNg.h0gnxa4s.js +1 -0
- package/dist/chunks/index.0hrfbrja.js +44 -0
- package/dist/chunks/index.153rcscj.js +2 -0
- package/dist/chunks/index.20dvswea.js +2 -0
- package/dist/chunks/index.23p1k2rx.js +2 -0
- package/dist/chunks/index.3k4gyba0.js +2 -0
- package/dist/chunks/index.51yk4ene.js +2 -0
- package/dist/chunks/index.9zhger75.js +142 -0
- package/dist/chunks/index.bfeafb22.js +1 -0
- package/dist/chunks/index.cf9nd6xy.js +2 -0
- package/dist/chunks/index.eec12m3n.js +16 -0
- package/dist/chunks/index.fab58nn0.js +2 -0
- package/dist/chunks/index.fgsp5qqn.js +303 -0
- package/dist/chunks/index.fv9af3wd.js +333 -0
- package/dist/chunks/index.fvh2m60c.js +2 -0
- package/dist/chunks/index.gqa9s37g.js +2 -0
- package/dist/chunks/index.h6120080.js +2 -0
- package/dist/chunks/index.q9dsw4bt.js +2 -0
- package/dist/chunks/index.vnhefjwh.js +2 -0
- package/dist/chunks/index.x163xe9c.js +89 -0
- package/dist/chunks/index.x1xqs5m5.js +214 -0
- package/dist/chunks/index.yf0h5qnv.js +2 -0
- package/dist/chunks/info-OHQRW6UA.xea9bh7d.js +1 -0
- package/dist/chunks/infoDiagram-EZ3ZOAHP.r2yygqw8.js +2 -0
- package/dist/chunks/ishikawaDiagram-S3EKX5GW.gwqtdvb2.js +70 -0
- package/dist/chunks/journeyDiagram-POQNLL5X.rp31qkq5.js +139 -0
- package/dist/chunks/kanban-definition-BH5XI6FM.ymsqx6en.js +89 -0
- package/dist/chunks/katex.n08hp8fc.js +257 -0
- package/dist/chunks/markup-color-chrome-ykGNUl8y.06cy435c.js +1 -0
- package/dist/chunks/markup-custom-color-C8Xc6JxB.an2wngns.js +1 -0
- package/dist/chunks/mention-list-Dhq70jL5.1k61f24q.js +1 -0
- package/dist/chunks/mermaid.core.x45crg0h.js +12 -0
- package/dist/chunks/mindmap-definition-WVAN44T4.5cbd4rg2.js +98 -0
- package/dist/chunks/packet-JDAUHWVQ.c7dmae11.js +1 -0
- package/dist/chunks/panel.rzp4q8s3.js +7 -0
- package/dist/chunks/pegDiagram-D4NLKWP3.fsryts4r.js +1 -0
- package/dist/chunks/pie-XZMESJXO.6rv4kzjx.js +1 -0
- package/dist/chunks/pieDiagram-36ENHN4W.k4k2gvg0.js +39 -0
- package/dist/chunks/plated-illustration-BzxADkoZ.wtc9psry.js +1 -0
- package/dist/chunks/quadrantDiagram-ZQUDMS73.j7nj12w0.js +7 -0
- package/dist/chunks/radar-ABXABTNO.58dfc8ba.js +1 -0
- package/dist/chunks/railroad-I3PHUGI6.00fqbahv.js +1 -0
- package/dist/chunks/railroad-abnf-LNEFI6M7.gt1x50q5.js +1 -0
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.qr5qfkga.js +1 -0
- package/dist/chunks/railroad-peg-JR7BVNR7.m61rq7hj.js +1 -0
- package/dist/chunks/railroadDiagram-JIZHGYPL.a681wt3b.js +1 -0
- package/dist/chunks/render-VIF2ZAQL.rn9hpsbx.js +1 -0
- package/dist/chunks/requirementDiagram-AXW2TVFA.shapgy39.js +84 -0
- package/dist/chunks/sankeyDiagram-FBCJTAIF.2syz1e2b.js +40 -0
- package/dist/chunks/sequenceDiagram-3LA2ROMG.jq1w12a6.js +169 -0
- package/dist/chunks/sizeCapture-2Q2CQKSF.jtv53a6j.js +1 -0
- package/dist/chunks/stateDiagram-v2-ATKHQDJO.x0g2rngz.js +291 -0
- package/dist/chunks/swimlanes-YQL5WMAO.j7j7c6ex.js +1 -0
- package/dist/chunks/swimlanesDiagram-UCCPES4V.tzqcsrmd.js +8 -0
- package/dist/chunks/timeline-definition-7Z437IG3.s5bvn8dr.js +120 -0
- package/dist/chunks/treeView-D4JQ5SDB.0x1grm2t.js +1 -0
- package/dist/chunks/treemap-SAJKECNS.1te19jsm.js +1 -0
- package/dist/chunks/usecaseDiagram-RDK6N6HP.9k4r423e.js +370 -0
- package/dist/chunks/vennDiagram-SHRQU5PJ.82q5dzm6.js +34 -0
- package/dist/chunks/wardley-7MLQ67FV.zp6gykk3.js +1 -0
- package/dist/chunks/wardleyDiagram-F3OXNVQS.fm4tw2nc.js +78 -0
- package/dist/chunks/xychartDiagram-GDYJKCDI.57vqn2zd.js +7 -0
- package/dist/index.js +23 -4695
- package/docs/integration.md +146 -33
- package/package.json +7 -6
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import{e,y,j,A,L,I,R,M,O,D,u,Y,Qe,g}from"./index.fgsp5qqn.js";var dt=function(){var t=e(function(z,i,n,s){for(n=n||{},s=z.length;s--;n[z[s]]=i);return n},"o"),f=[1,4],r=[1,14],l=[1,12],o=[1,13],p=[6,7,8],m=[1,20],d=[1,18],x=[1,19],c=[6,7,11],_=[1,6,13,14],b=[1,23],S=[1,24],E=[1,6,7,11,13,14],U={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(i,n,s,h,k,a,T){var v=a.length-1;switch(k){case 6:case 7:return h;case 15:h.addNode(a[v-1].length,a[v].trim());break;case 16:h.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:r,7:[1,10],9:9,12:11,13:l,14:o},t(p,[2,3]),{1:[2,2]},t(p,[2,4]),t(p,[2,5]),{1:[2,6],6:r,12:15,13:l,14:o},{6:r,9:16,12:11,13:l,14:o},{6:m,7:d,10:17,11:x},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:m,7:d,10:22,11:x},{1:[2,7],6:r,12:15,13:l,14:o},t(_,[2,14],{7:b,11:S}),t(E,[2,8]),t(E,[2,9]),t(E,[2,10]),t(c,[2,15]),t(_,[2,13],{7:b,11:S}),t(E,[2,11]),t(E,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:e(function(i){var n=this,s=[0],h=[],k=[null],a=[],T=this.table,v="",V=0,P=0,C=0,W=2,X=1,rt=a.slice.call(arguments,1),w=Object.create(this.lexer),B={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))B.yy[q]=this.yy[q];if(w.setInput(i,B.yy),B.yy.lexer=w,B.yy.parser=this,typeof w.yylloc>"u")w.yylloc={};var Q=w.yylloc;a.push(Q);var lt=w.options&&w.options.ranges;if(typeof B.yy.parseError==="function")this.parseError=B.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(G){s.length=s.length-2*G,k.length=k.length-G,a.length=a.length-G}e(xt,"popStack");function yt(){var G=h.pop()||w.lex()||X;if(typeof G!=="number"){if(G instanceof Array)h=G,G=h.pop();G=n.symbols_[G]||G}return G}e(yt,"lex");var F,ot,J,H,Vt,ht,tt={},st,K,ft,nt;while(!0){if(J=s[s.length-1],this.defaultActions[J])H=this.defaultActions[J];else{if(F===null||typeof F>"u")F=yt();H=T[J]&&T[J][F]}if(typeof H>"u"||!H.length||!H[0]){var ct="";nt=[];for(st in T[J])if(this.terminals_[st]&&st>W)nt.push("'"+this.terminals_[st]+"'");if(w.showPosition)ct="Parse error on line "+(V+1)+`:
|
|
2
|
+
`+w.showPosition()+`
|
|
3
|
+
Expecting `+nt.join(", ")+", got '"+(this.terminals_[F]||F)+"'";else ct="Parse error on line "+(V+1)+": Unexpected "+(F==X?"end of input":"'"+(this.terminals_[F]||F)+"'");this.parseError(ct,{text:w.match,token:this.terminals_[F]||F,line:w.yylineno,loc:Q,expected:nt})}if(H[0]instanceof Array&&H.length>1)throw Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(H[0]){case 1:if(s.push(F),k.push(w.yytext),a.push(w.yylloc),s.push(H[1]),F=null,!ot){if(P=w.yyleng,v=w.yytext,V=w.yylineno,Q=w.yylloc,C>0)C--}else F=ot,ot=null;break;case 2:if(K=this.productions_[H[1]][1],tt.$=k[k.length-K],tt._$={first_line:a[a.length-(K||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(K||1)].first_column,last_column:a[a.length-1].last_column},lt)tt._$.range=[a[a.length-(K||1)].range[0],a[a.length-1].range[1]];if(ht=this.performAction.apply(tt,[v,P,V,B.yy,H[1],k,a].concat(rt)),typeof ht<"u")return ht;if(K)s=s.slice(0,-1*K*2),k=k.slice(0,-1*K),a=a.slice(0,-1*K);s.push(this.productions_[H[1]][0]),k.push(tt.$),a.push(tt._$),ft=T[s[s.length-2]][s[s.length-1]],s.push(ft);break;case 3:return!0}}return!0},"parse")},Z=function(){var z={EOF:1,parseError:e(function(n,s){if(this.yy.parser)this.yy.parser.parseError(n,s);else throw Error(n)},"parseError"),setInput:e(function(i,n){if(this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);if(n)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:e(function(i){var n=i.length,s=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var h=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1)this.yylineno-=s.length-1;var k=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===h.length?this.yylloc.first_column:0)+h[h.length-s.length].length-s[0].length:this.yylloc.first_column-n},this.options.ranges)this.yylloc.range=[k[0],k[0]+this.yyleng-n];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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:e(function(i){this.unput(this.match.slice(i))},"less"),pastInput:e(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var i=this.pastInput(),n=Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
+
`+n+"^"},"showPosition"),test_match:e(function(i,n){var s,h,k;if(this.options.backtrack_lexer){if(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)}if(h=i[0].match(/(?:\r\n?|\n).*/g),h)this.yylineno+=h.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],s=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(s)return s;else if(this._backtrack){for(var a in k)this[a]=k[a];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,n,s,h;if(!this._more)this.yytext="",this.match="";var k=this._currentRules();for(var a=0;a<k.length;a++)if(s=this._input.match(this.rules[k[a]]),s&&(!n||s[0].length>n[0].length)){if(n=s,h=a,this.options.backtrack_lexer)if(i=this.test_match(s,k[a]),i!==!1)return i;else if(this._backtrack){n=!1;continue}else return!1;else if(!this.options.flex)break}if(n){if(i=this.test_match(n,k[h]),i!==!1)return i;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:e(function(n){this.conditionStack.push(n)},"begin"),popState:e(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:e(function(n){this.begin(n)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(n,s,h,k){var a=k;switch(h){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return z}();U.lexer=Z;function N(){this.yy={}}return e(N,"Parser"),N.prototype=U,U.Parser=N,new N}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,A()}getRoot(){return this.root}addNode(t,f){let r=y.sanitizeText(f,u());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],O(r);return}this.baseLevel??=t;let l=t-this.baseLevel+1;if(l<=0)l=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=l)this.stack.pop();let o=this.stack[this.stack.length-1].node,p={text:r,children:[]};o.children.push(p),this.stack.push({level:l,node:p})}getAccTitle(){return I()}setAccTitle(t){L(t)}getAccDescription(){return M()}setAccDescription(t){R(t)}getDiagramTitle(){return D()}setDiagramTitle(t){O(t)}},Et=14,et=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=e((t,f,r)=>{let l=t.node().getBBox(),o=l.width+f*2,p=l.height+f*2;j(t,p,o,r),t.attr("viewBox",`${l.x-f} ${l.y-f} ${o} ${p}`)},"applyPaddedViewBox"),Lt=e((t,f,r,l)=>{let p=l.db.getRoot();if(!p)return;let m=u(),{look:d,handDrawnSeed:x,themeVariables:c}=m,_=Qe(m.fontSize)[0]??Et,b=d==="handDrawn",S=p.children??[],E=m.ishikawa?.diagramPadding??20,U=m.ishikawa?.useMaxWidth??!1,Z=Y(f),N=Z.append("g").attr("class","ishikawa"),z=b?g.svg(Z.node()):void 0,i=z?{roughSvg:z,seed:x??0,lineColor:c?.lineColor??"#333",fillColor:c?.mainBkg??"#fff"}:void 0,n=`ishikawa-arrow-${f}`;if(!b)N.append("defs").append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let s=0,h=et,k=b?void 0:it(N,s,h,s,h,"ishikawa-spine");if(Tt(N,s,h,p.text,_,i),!S.length){if(b)it(N,s,h,s,h,"ishikawa-spine",i);kt(Z,E,U);return}s-=20;let a=S.filter((w,B)=>B%2===0),T=S.filter((w,B)=>B%2===1),v=mt(a),V=mt(T),P=v.total+V.total,C=et,W=et;if(P>0){let w=et*2,B=et*0.3;C=Math.max(B,w*(v.total/P)),W=Math.max(B,w*(V.total/P))}let X=_*2;if(C=Math.max(C,v.max*X),W=Math.max(W,V.max*X),h=Math.max(C,et),k)k.attr("y1",h).attr("y2",h);N.select(".ishikawa-head-group").attr("transform",`translate(0,${h})`);let rt=Math.ceil(S.length/2);for(let w=0;w<rt;w++){let B=N.append("g").attr("class","ishikawa-pair");for(let[q,Q,lt]of[[S[w*2],-1,C],[S[w*2+1],1,W]])if(q)Bt(B,q,s,h,Q,lt,_,i);s=B.selectAll("text").nodes().reduce((q,Q)=>Math.min(q,Q.getBBox().x),1/0)}if(b)it(N,s,h,0,h,"ishikawa-spine",i);else{k.attr("x1",s);let w=`url(#${n})`;N.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",w)}kt(Z,E,U)},"draw"),mt=e((t)=>{let f=e((r)=>r.children.reduce((l,o)=>l+1+f(o),0),"countDescendants");return t.reduce((r,l)=>{let o=f(l);return r.total+=o,r.max=Math.max(r.max,o),r},{total:0,max:0})},"sideStats"),Tt=e((t,f,r,l,o,p)=>{let m=Math.max(6,Math.floor(110/(o*0.6))),d=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${f},${r})`),x=at(d,_t(l,m),0,0,"ishikawa-head-label","start",o),c=x.node().getBBox(),_=Math.max(60,c.width+6),b=Math.max(40,c.height*2+40),S=`M 0 ${-b/2} L 0 ${b/2} Q ${_*2.4} 0 0 ${-b/2} Z`;if(p){let E=p.roughSvg.path(S,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});d.insert(()=>E,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",S);x.attr("transform",`translate(${(_-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Mt=e((t,f)=>{let r=[],l=[],o=e((p,m,d)=>{let x=f===-1?[...p].reverse():p;for(let c of x){let _=r.length,b=c.children??[];if(r.push({depth:d,text:_t(c.text,15),parentIndex:m,childCount:b.length}),d%2===0){if(l.push(_),b.length)o(b,_,d+1)}else{if(b.length)o(b,_,d+1);l.push(_)}}},"walk");return o(t,-1,2),{entries:r,yOrder:l}},"flattenTree"),Pt=e((t,f,r,l,o,p,m)=>{let d=t.append("g").attr("class","ishikawa-label-group"),c=at(d,f,r,l+11*o,"ishikawa-label cause","middle",p).node().getBBox();if(m){let _=m.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:m.seed,fill:m.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:m.lineColor,strokeWidth:2});d.insert(()=>_,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),ut=e((t,f,r,l,o,p)=>{let m=Math.sqrt(l*l+o*o);if(m===0)return;let d=l/m,x=o/m,c=6,_=-x*c,b=d*c,S=f,E=r,U=`M ${S} ${E} L ${S-d*c*2+_} ${E-x*c*2+b} L ${S-d*c*2-_} ${E-x*c*2-b} Z`,Z=p.roughSvg.path(U,{roughness:1,seed:p.seed,fill:p.lineColor,fillStyle:"solid",stroke:p.lineColor,strokeWidth:1});t.append(()=>Z)},"drawArrowMarker"),Bt=e((t,f,r,l,o,p,m,d)=>{let x=f.children??[],c=p*(x.length?1:0.2),_=-pt*c,b=gt*c*o,S=r+_,E=l+b;if(it(t,r,l,S,E,"ishikawa-branch",d),d)ut(t,r,l,r-S,l-E,d);if(Pt(t,f.text,S,E,o,m,d),!x.length)return;let{entries:U,yOrder:Z}=Mt(x,o),N=U.length,z=Array(N);for(let[k,a]of Z.entries())z[a]=l+b*((k+1)/(N+1));let i=new Map;i.set(-1,{x0:r,y0:l,x1:S,y1:E,childCount:x.length,childrenDrawn:0});let n=-pt,s=gt*o,h=o<0?"ishikawa-label up":"ishikawa-label down";for(let[k,a]of U.entries()){let T=z[k],v=i.get(a.parentIndex),V=t.append("g").attr("class","ishikawa-sub-group"),P=0,C=0,W=0;if(a.depth%2===0){let X=v.y1-v.y0;if(P=wt(v.x0,v.x1,X?(T-v.y0)/X:0.5),C=T,W=P-(a.childCount>0?At+a.childCount*It:$t),it(V,P,T,W,T,"ishikawa-sub-branch",d),d)ut(V,P,T,1,0,d);at(V,a.text,W,T,"ishikawa-label align","end",m)}else{let X=v.childrenDrawn++;if(P=wt(v.x0,v.x1,(v.childCount-X)/(v.childCount+1)),C=v.y0,W=P+n*((T-C)/s),it(V,P,C,W,T,"ishikawa-sub-branch",d),d)ut(V,P,C,P-W,C-T,d);at(V,a.text,W,T,h,"end",m)}if(a.childCount>0)i.set(k,{x0:P,y0:C,x1:W,y1:T,childCount:a.childCount,childrenDrawn:0})}},"drawBranch"),Nt=e((t)=>t.split(/<br\s*\/?>|\n/),"splitLines"),_t=e((t,f)=>{if(t.length<=f)return t;let r=[];for(let l of t.split(/\s+/)){let o=r.length-1;if(o>=0&&r[o].length+1+l.length<=f)r[o]+=" "+l;else r.push(l)}return r.join(`
|
|
7
|
+
`)},"wrapText"),at=e((t,f,r,l,o,p,m)=>{let d=Nt(f),x=m*1.05,c=t.append("text").attr("class",o).attr("text-anchor",p).attr("x",r).attr("y",l-(d.length-1)*x/2);for(let[_,b]of d.entries())c.append("tspan").attr("x",r).attr("dy",_===0?0:x).text(b);return c},"drawMultilineText"),wt=e((t,f,r)=>t+(f-t)*r,"lerp"),it=e((t,f,r,l,o,p,m)=>{if(m){let d=m.roughSvg.line(f,r,l,o,{roughness:1.5,seed:m.seed,stroke:m.lineColor,strokeWidth:2});t.append(()=>d).attr("class",p);return}return t.append("line").attr("class",p).attr("x1",f).attr("y1",r).attr("x2",l).attr("y2",o)},"drawLine"),Dt={draw:Lt},Ot=e((t)=>`
|
|
8
|
+
.ishikawa .ishikawa-spine,
|
|
9
|
+
.ishikawa .ishikawa-branch,
|
|
10
|
+
.ishikawa .ishikawa-sub-branch {
|
|
11
|
+
stroke: ${t.lineColor};
|
|
12
|
+
stroke-width: 2;
|
|
13
|
+
fill: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ishikawa .ishikawa-sub-branch {
|
|
17
|
+
stroke-width: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ishikawa .ishikawa-arrow {
|
|
21
|
+
fill: ${t.lineColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ishikawa .ishikawa-head {
|
|
25
|
+
fill: ${t.mainBkg};
|
|
26
|
+
stroke: ${t.lineColor};
|
|
27
|
+
stroke-width: 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ishikawa .ishikawa-label-box {
|
|
31
|
+
fill: ${t.mainBkg};
|
|
32
|
+
stroke: ${t.lineColor};
|
|
33
|
+
stroke-width: 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ishikawa text {
|
|
37
|
+
font-family: ${t.fontFamily};
|
|
38
|
+
font-size: ${t.fontSize};
|
|
39
|
+
fill: ${t.textColor};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ishikawa .ishikawa-head-label {
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
text-anchor: middle;
|
|
45
|
+
dominant-baseline: middle;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ishikawa .ishikawa-label {
|
|
50
|
+
text-anchor: end;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ishikawa .ishikawa-label.cause {
|
|
54
|
+
text-anchor: middle;
|
|
55
|
+
dominant-baseline: middle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ishikawa .ishikawa-label.align {
|
|
59
|
+
text-anchor: end;
|
|
60
|
+
dominant-baseline: middle;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ishikawa .ishikawa-label.up {
|
|
64
|
+
dominant-baseline: baseline;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ishikawa .ishikawa-label.down {
|
|
68
|
+
dominant-baseline: hanging;
|
|
69
|
+
}
|
|
70
|
+
`,"getStyles"),Ct=Ot,Gt={parser:vt,get db(){return new St},renderer:Dt,styles:Ct};export{Gt as diagram};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import{e,j,A,L,I,R,M,O,D,u,m,Qt}from"./index.fgsp5qqn.js";import{_r,Ca,ul,ct}from"./index.23p1k2rx.js";import{Xe}from"./index.eec12m3n.js";var nt=function(){var t=e(function(h,n,s,l){for(s=s||{},l=h.length;l--;s[h[l]]=n);return s},"o"),r=[6,8,10,11,12,14,16,17,18],a=[1,9],p=[1,10],i=[1,11],y=[1,12],g=[1,13],o=[1,14],x={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(n,s,l,d,f,c,w){var _=c.length-1;switch(f){case 1:return c[_-1];case 2:this.$=[];break;case 3:c[_-1].push(c[_]),this.$=c[_-1];break;case 4:case 5:this.$=c[_];break;case 6:case 7:this.$=[];break;case 8:d.setDiagramTitle(c[_].substr(6)),this.$=c[_].substr(6);break;case 9:this.$=c[_].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=c[_].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(c[_].substr(8)),this.$=c[_].substr(8);break;case 13:d.addTask(c[_-1],c[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:p,14:i,16:y,17:g,18:o},t(r,[2,7],{1:[2,1]}),t(r,[2,3]),{9:15,11:a,12:p,14:i,16:y,17:g,18:o},t(r,[2,5]),t(r,[2,6]),t(r,[2,8]),{13:[1,16]},{15:[1,17]},t(r,[2,11]),t(r,[2,12]),{19:[1,18]},t(r,[2,4]),t(r,[2,9]),t(r,[2,10]),t(r,[2,13])],defaultActions:{},parseError:e(function(n,s){if(s.recoverable)this.trace(n);else{var l=Error(n);throw l.hash=s,l}},"parseError"),parse:e(function(n){var s=this,l=[0],d=[],f=[null],c=[],w=this.table,_="",B=0,ot=0,ht=0,vt=2,ut=1,wt=c.slice.call(arguments,1),v=Object.create(this.lexer),z={yy:{}};for(var K in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,K))z.yy[K]=this.yy[K];if(v.setInput(n,z.yy),z.yy.lexer=v,z.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var Q=v.yylloc;c.push(Q);var Tt=v.options&&v.options.ranges;if(typeof z.yy.parseError==="function")this.parseError=z.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function St(E){l.length=l.length-2*E,f.length=f.length-E,c.length=c.length-E}e(St,"popStack");function yt(){var E=d.pop()||v.lex()||ut;if(typeof E!=="number"){if(E instanceof Array)d=E,E=d.pop();E=s.symbols_[E]||E}return E}e(yt,"lex");var T,tt,W,S,Gt,et,Y={},U,F,dt,Z;while(!0){if(W=l[l.length-1],this.defaultActions[W])S=this.defaultActions[W];else{if(T===null||typeof T>"u")T=yt();S=w[W]&&w[W][T]}if(typeof S>"u"||!S.length||!S[0]){var rt="";Z=[];for(U in w[W])if(this.terminals_[U]&&U>vt)Z.push("'"+this.terminals_[U]+"'");if(v.showPosition)rt="Parse error on line "+(B+1)+`:
|
|
2
|
+
`+v.showPosition()+`
|
|
3
|
+
Expecting `+Z.join(", ")+", got '"+(this.terminals_[T]||T)+"'";else rt="Parse error on line "+(B+1)+": Unexpected "+(T==ut?"end of input":"'"+(this.terminals_[T]||T)+"'");this.parseError(rt,{text:v.match,token:this.terminals_[T]||T,line:v.yylineno,loc:Q,expected:Z})}if(S[0]instanceof Array&&S.length>1)throw Error("Parse Error: multiple actions possible at state: "+W+", token: "+T);switch(S[0]){case 1:if(l.push(T),f.push(v.yytext),c.push(v.yylloc),l.push(S[1]),T=null,!tt){if(ot=v.yyleng,_=v.yytext,B=v.yylineno,Q=v.yylloc,ht>0)ht--}else T=tt,tt=null;break;case 2:if(F=this.productions_[S[1]][1],Y.$=f[f.length-F],Y._$={first_line:c[c.length-(F||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(F||1)].first_column,last_column:c[c.length-1].last_column},Tt)Y._$.range=[c[c.length-(F||1)].range[0],c[c.length-1].range[1]];if(et=this.performAction.apply(Y,[_,ot,B,z.yy,S[1],f,c].concat(wt)),typeof et<"u")return et;if(F)l=l.slice(0,-1*F*2),f=f.slice(0,-1*F),c=c.slice(0,-1*F);l.push(this.productions_[S[1]][0]),f.push(Y.$),c.push(Y._$),dt=w[l[l.length-2]][l[l.length-1]],l.push(dt);break;case 3:return!0}}return!0},"parse")},k=function(){var h={EOF:1,parseError:e(function(s,l){if(this.yy.parser)this.yy.parser.parseError(s,l);else throw Error(s)},"parseError"),setInput:e(function(n,s){if(this.yy=s||this.yy||{},this._input=n,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];return this.offset=0,this},"setInput"),input:e(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var s=n.match(/(?:\r\n?|\n).*/g);if(s)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),n},"input"),unput:e(function(n){var s=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var d=this.match.split(/(?:\r\n?|\n)/g);if(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 f=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-s},this.options.ranges)this.yylloc.range=[f[0],f[0]+this.yyleng-s];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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:e(function(n){this.unput(this.match.slice(n))},"less"),pastInput:e(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var n=this.match;if(n.length<20)n+=this._input.substr(0,20-n.length);return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var n=this.pastInput(),s=Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
+
`+s+"^"},"showPosition"),test_match:e(function(n,s){var l,d,f;if(this.options.backtrack_lexer){if(f={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)f.yylloc.range=this.yylloc.range.slice(0)}if(d=n[0].match(/(?:\r\n?|\n).*/g),d)this.yylineno+=d.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],l=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(l)return l;else if(this._backtrack){for(var c in f)this[c]=f[c];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var n,s,l,d;if(!this._more)this.yytext="",this.match="";var f=this._currentRules();for(var c=0;c<f.length;c++)if(l=this._input.match(this.rules[f[c]]),l&&(!s||l[0].length>s[0].length)){if(s=l,d=c,this.options.backtrack_lexer)if(n=this.test_match(l,f[c]),n!==!1)return n;else if(this._backtrack){s=!1;continue}else return!1;else if(!this.options.flex)break}if(s){if(n=this.test_match(s,f[d]),n!==!1)return n;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var s=this.next();if(s)return s;else return this.lex()},"lex"),begin:e(function(s){this.conditionStack.push(s)},"begin"),popState:e(function(){var s=this.conditionStack.length-1;if(s>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(s){if(s=this.conditionStack.length-1-Math.abs(s||0),s>=0)return this.conditionStack[s];else return"INITIAL"},"topState"),pushState:e(function(s){this.begin(s)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(s,l,d,f){var c=f;switch(d){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\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,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h}();x.lexer=k;function b(){this.yy={}}return e(b,"Parser"),b.prototype=x,x.Parser=b,new b}();nt.parser=nt;var $t=nt,q="",at=[],X=[],G=[],Mt=e(function(){at.length=0,X.length=0,q="",G.length=0,A()},"clear"),Et=e(function(t){q=t,at.push(t)},"addSection"),Ct=e(function(){return at},"getSections"),Pt=e(function(){let t=ft(),r=100,a=0;while(!t&&a<r)t=ft(),a++;return X.push(...G),X},"getTasks"),It=e(function(){let t=[];return X.forEach((a)=>{if(a.people)t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),At=e(function(t,r){let a=r.substr(1).split(":"),p=0,i=[];if(a.length===1)p=Number(a[0]),i=[];else p=Number(a[0]),i=a[1].split(",");let y=i.map((o)=>o.trim()),g={section:q,type:q,people:y,task:t,score:p};G.push(g)},"addTask"),Ft=e(function(t){let r={section:q,type:q,description:t,task:t,classes:[]};X.push(r)},"addTaskOrg"),ft=e(function(){let t=e(function(a){return G[a].processed},"compileTask"),r=!0;for(let[a,p]of G.entries())t(a),r=r&&p.processed;return r},"compileTasks"),Vt=e(function(){return It()},"getActors"),pt={getConfig:e(()=>u().journey,"getConfig"),clear:Mt,setDiagramTitle:O,getDiagramTitle:D,setAccTitle:L,getAccTitle:I,setAccDescription:R,getAccDescription:M,addSection:Et,getSections:Ct,getTasks:Pt,addTask:At,addTaskOrg:Ft,getActors:Vt},Rt=e((t)=>`.label {
|
|
7
|
+
font-family: ${t.fontFamily};
|
|
8
|
+
color: ${t.textColor};
|
|
9
|
+
}
|
|
10
|
+
.mouth {
|
|
11
|
+
stroke: #666;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
line {
|
|
15
|
+
stroke: ${t.textColor}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.legend {
|
|
19
|
+
fill: ${t.textColor};
|
|
20
|
+
font-family: ${t.fontFamily};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label text {
|
|
24
|
+
fill: #333;
|
|
25
|
+
}
|
|
26
|
+
.label {
|
|
27
|
+
color: ${t.textColor}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.face {
|
|
31
|
+
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
|
|
32
|
+
stroke: #999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.node rect,
|
|
36
|
+
.node circle,
|
|
37
|
+
.node ellipse,
|
|
38
|
+
.node polygon,
|
|
39
|
+
.node path {
|
|
40
|
+
fill: ${t.mainBkg};
|
|
41
|
+
stroke: ${t.nodeBorder};
|
|
42
|
+
stroke-width: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.node .label {
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
.node.clickable {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.arrowheadPath {
|
|
53
|
+
fill: ${t.arrowheadColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edgePaths .path {
|
|
57
|
+
stroke: ${t.lineColor};
|
|
58
|
+
stroke-width: 1.5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.flowchart-link {
|
|
62
|
+
stroke: ${t.lineColor};
|
|
63
|
+
fill: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.edgeLabel {
|
|
67
|
+
background-color: ${t.edgeLabelBackground};
|
|
68
|
+
rect {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cluster rect {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cluster text {
|
|
78
|
+
fill: ${t.titleColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.mermaidTooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
text-align: center;
|
|
84
|
+
max-width: 200px;
|
|
85
|
+
padding: 2px;
|
|
86
|
+
font-family: ${t.fontFamily};
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
background: ${t.tertiaryColor};
|
|
89
|
+
border: 1px solid ${t.border2};
|
|
90
|
+
border-radius: 2px;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
z-index: 100;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.task-type-0, .section-type-0 {
|
|
96
|
+
${t.fillType0?`fill: ${t.fillType0}`:""};
|
|
97
|
+
}
|
|
98
|
+
.task-type-1, .section-type-1 {
|
|
99
|
+
${t.fillType0?`fill: ${t.fillType1}`:""};
|
|
100
|
+
}
|
|
101
|
+
.task-type-2, .section-type-2 {
|
|
102
|
+
${t.fillType0?`fill: ${t.fillType2}`:""};
|
|
103
|
+
}
|
|
104
|
+
.task-type-3, .section-type-3 {
|
|
105
|
+
${t.fillType0?`fill: ${t.fillType3}`:""};
|
|
106
|
+
}
|
|
107
|
+
.task-type-4, .section-type-4 {
|
|
108
|
+
${t.fillType0?`fill: ${t.fillType4}`:""};
|
|
109
|
+
}
|
|
110
|
+
.task-type-5, .section-type-5 {
|
|
111
|
+
${t.fillType0?`fill: ${t.fillType5}`:""};
|
|
112
|
+
}
|
|
113
|
+
.task-type-6, .section-type-6 {
|
|
114
|
+
${t.fillType0?`fill: ${t.fillType6}`:""};
|
|
115
|
+
}
|
|
116
|
+
.task-type-7, .section-type-7 {
|
|
117
|
+
${t.fillType0?`fill: ${t.fillType7}`:""};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.actor-0 {
|
|
121
|
+
${t.actor0?`fill: ${t.actor0}`:""};
|
|
122
|
+
}
|
|
123
|
+
.actor-1 {
|
|
124
|
+
${t.actor1?`fill: ${t.actor1}`:""};
|
|
125
|
+
}
|
|
126
|
+
.actor-2 {
|
|
127
|
+
${t.actor2?`fill: ${t.actor2}`:""};
|
|
128
|
+
}
|
|
129
|
+
.actor-3 {
|
|
130
|
+
${t.actor3?`fill: ${t.actor3}`:""};
|
|
131
|
+
}
|
|
132
|
+
.actor-4 {
|
|
133
|
+
${t.actor4?`fill: ${t.actor4}`:""};
|
|
134
|
+
}
|
|
135
|
+
.actor-5 {
|
|
136
|
+
${t.actor5?`fill: ${t.actor5}`:""};
|
|
137
|
+
}
|
|
138
|
+
${Xe()}
|
|
139
|
+
`,"getStyles"),Lt=Rt,lt=e(function(t,r){return _r(t,r)},"drawRect"),Bt=e(function(t,r){let p=t.append("circle").attr("cx",r.cx).attr("cy",r.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",r.cx-5).attr("cy",r.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",r.cx+5).attr("cy",r.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function y(x){let k=Qt().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);x.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+r.cx+","+(r.cy+2)+")")}e(y,"smile");function g(x){let k=Qt().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);x.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+r.cx+","+(r.cy+7)+")")}e(g,"sad");function o(x){x.append("line").attr("class","mouth").attr("stroke",2).attr("x1",r.cx-5).attr("y1",r.cy+7).attr("x2",r.cx+5).attr("y2",r.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}if(e(o,"ambivalent"),r.score>3)y(i);else if(r.score<3)g(i);else o(i);return p},"drawFace"),xt=e(function(t,r){let a=t.append("circle");if(a.attr("cx",r.cx),a.attr("cy",r.cy),a.attr("class","actor-"+r.pos),a.attr("fill",r.fill),a.attr("stroke",r.stroke),a.attr("r",r.r),a.class!==void 0)a.attr("class",a.class);if(r.title!==void 0)a.append("title").text(r.title);return a},"drawCircle"),kt=e(function(t,r){return ul(t,r)},"drawText"),jt=e(function(t,r){function a(i,y,g,o,x){return i+","+y+" "+(i+g)+","+y+" "+(i+g)+","+(y+o-x)+" "+(i+g-x*1.2)+","+(y+o)+" "+i+","+(y+o)}e(a,"genPoints");let p=t.append("polygon");p.attr("points",a(r.x,r.y,50,20,7)),p.attr("class","labelBox"),r.y=r.y+r.labelMargin,r.x=r.x+0.5*r.labelMargin,kt(t,r)},"drawLabel"),Nt=e(function(t,r,a){let p=t.append("g"),i=ct();i.x=r.x,i.y=r.y,i.fill=r.fill,i.width=a.width*r.taskCount+a.diagramMarginX*(r.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+r.num,i.rx=3,i.ry=3,lt(p,i),bt(a)(r.text,p,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+r.num},a,r.colour)},"drawSection"),st=-1,zt=e(function(t,r,a,p){let i=r.x+a.width/2,y=t.append("g");st++;let g=450;y.append("line").attr("id",p+"-task"+st).attr("x1",i).attr("y1",r.y).attr("x2",i).attr("y2",g).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Bt(y,{cx:i,cy:300+(5-r.score)*30,score:r.score});let o=ct();o.x=r.x,o.y=r.y,o.fill=r.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+r.num,o.rx=3,o.ry=3,lt(y,o);let x=r.x+14;r.people.forEach((k)=>{let b=r.actors[k].color,h={cx:x,cy:r.y,r:7,fill:b,stroke:"#000",title:k,pos:r.actors[k].position};xt(y,h),x+=10}),bt(a)(r.task,y,o.x,o.y,o.width,o.height,{class:"task"},a,r.colour)},"drawTask"),Wt=e(function(t,r){Ca(t,r)},"drawBackgroundRect"),bt=function(){function t(i,y,g,o,x,k,b,h){let n=y.append("text").attr("x",g+x/2).attr("y",o+k/2+5).style("font-color",h).style("text-anchor","middle").text(i);p(n,b)}e(t,"byText");function r(i,y,g,o,x,k,b,h,n){let{taskFontSize:s,taskFontFamily:l}=h,d=i.split(/<br\s*\/?>/gi);for(let f=0;f<d.length;f++){let c=f*s-s*(d.length-1)/2,w=y.append("text").attr("x",g+x/2).attr("y",o).attr("fill",n).style("text-anchor","middle").style("font-size",s).style("font-family",l);w.append("tspan").attr("x",g+x/2).attr("dy",c).text(d[f]),w.attr("y",o+k/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),p(w,b)}}e(r,"byTspan");function a(i,y,g,o,x,k,b,h){let n=y.append("switch"),l=n.append("foreignObject").attr("x",g).attr("y",o).attr("width",x).attr("height",k).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),r(i,n,g,o,x,k,b,h),p(l,b)}e(a,"byFo");function p(i,y){for(let g in y)if(g in y)i.attr(g,y[g])}return e(p,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?t:r}}(),Ot=e(function(t,r){st=-1,t.append("defs").append("marker").attr("id",r+"-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"),H={drawRect:lt,drawCircle:xt,drawSection:Nt,drawText:kt,drawLabel:jt,drawTask:zt,drawBackgroundRect:Wt,initGraphics:Ot},Yt=e(function(t){Object.keys(t).forEach(function(a){P[a]=t[a]})},"setConf"),V={},J=0;function _t(t){let r=u().journey,a=r.maxLabelWidth;J=0;let p=60;Object.keys(V).forEach((i)=>{let y=V[i].color,g={cx:20,cy:p,r:7,fill:y,stroke:"#000",pos:V[i].position};H.drawCircle(t,g);let o=t.append("text").attr("visibility","hidden").text(i),x=o.node().getBoundingClientRect().width;o.remove();let k=[];if(x<=a)k=[i];else{let b=i.split(" "),h="";if(o=t.append("text").attr("visibility","hidden"),b.forEach((n)=>{let s=h?`${h} ${n}`:n;if(o.text(s),o.node().getBoundingClientRect().width>a){if(h)k.push(h);if(h=n,o.text(n),o.node().getBoundingClientRect().width>a){let d="";for(let f of n)if(d+=f,o.text(d+"-"),o.node().getBoundingClientRect().width>a)k.push(d.slice(0,-1)+"-"),d=f;h=d}}else h=s}),h)k.push(h);o.remove()}k.forEach((b,h)=>{let n={x:40,y:p+7+h*20,fill:"#666",text:b,textMargin:r.boxTextMargin??5},l=H.drawText(t,n).node().getBoundingClientRect().width;if(l>J&&l>r.leftMargin-l)J=l}),p+=Math.max(20,k.length*20)})}e(_t,"drawActorLegend");var P=u().journey,N=0,qt=e(function(t,r,a,p){let i=u(),y=i.journey.titleColor,g=i.journey.titleFontSize,o=i.journey.titleFontFamily,x=i.securityLevel,k;if(x==="sandbox")k=m("#i"+r);let b=x==="sandbox"?m(k.nodes()[0].contentDocument.body):m("body");C.init();let h=b.select("#"+r);H.initGraphics(h,r);let n=p.db.getTasks(),s=p.db.getDiagramTitle(),l=p.db.getActors();for(let B in V)delete V[B];let d=0;l.forEach((B)=>{V[B]={color:P.actorColours[d%P.actorColours.length],position:d},d++}),_t(h),N=P.leftMargin+J,C.insert(0,0,N,Object.keys(V).length*50),Xt(h,n,0,r);let f=C.getBounds();if(s)h.append("text").text(s).attr("x",N).attr("font-size",g).attr("font-weight","bold").attr("y",25).attr("fill",y).attr("font-family",o);let c=f.stopy-f.starty+2*P.diagramMarginY,w=N+f.stopx+2*P.diagramMarginX;j(h,c,w,P.useMaxWidth),h.append("line").attr("x1",N).attr("y1",P.height*4).attr("x2",w-N-4).attr("y2",P.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+r+"-arrowhead)");let _=s?70:0;h.attr("viewBox",`${f.startx} -25 ${w} ${c+_}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",c+_+25)},"draw"),C={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:e(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:e(function(t,r,a,p){if(t[r]===void 0)t[r]=a;else t[r]=p(a,t[r])},"updateVal"),updateBounds:e(function(t,r,a,p){let i=u().journey,y=this,g=0;function o(x){return e(function(b){g++;let h=y.sequenceItems.length-g+1;if(y.updateVal(b,"starty",r-h*i.boxMargin,Math.min),y.updateVal(b,"stopy",p+h*i.boxMargin,Math.max),y.updateVal(C.data,"startx",t-h*i.boxMargin,Math.min),y.updateVal(C.data,"stopx",a+h*i.boxMargin,Math.max),x!=="activation")y.updateVal(b,"startx",t-h*i.boxMargin,Math.min),y.updateVal(b,"stopx",a+h*i.boxMargin,Math.max),y.updateVal(C.data,"starty",r-h*i.boxMargin,Math.min),y.updateVal(C.data,"stopy",p+h*i.boxMargin,Math.max)},"updateItemBounds")}e(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:e(function(t,r,a,p){let i=Math.min(t,a),y=Math.max(t,a),g=Math.min(r,p),o=Math.max(r,p);this.updateVal(C.data,"startx",i,Math.min),this.updateVal(C.data,"starty",g,Math.min),this.updateVal(C.data,"stopx",y,Math.max),this.updateVal(C.data,"stopy",o,Math.max),this.updateBounds(i,g,y,o)},"insert"),bumpVerticalPos:e(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:e(function(){return this.verticalPos},"getVerticalPos"),getBounds:e(function(){return this.data},"getBounds")},{sectionFills:it,sectionColours:gt}=P,Xt=e(function(t,r,a,p){let i=u().journey,y="",g=i.height*2+i.diagramMarginY,o=a+g,x=0,k="#CCC",b="black",h=0;for(let[n,s]of r.entries()){if(y!==s.section){k=it[x%it.length],h=x%it.length,b=gt[x%gt.length];let d=0,f=s.section;for(let w=n;w<r.length;w++)if(r[w].section==f)d=d+1;else break;let c={x:n*i.taskMargin+n*i.width+N,y:50,text:s.section,fill:k,num:h,colour:b,taskCount:d};H.drawSection(t,c,i),y=s.section,x++}let l=s.people.reduce((d,f)=>{if(V[f])d[f]=V[f];return d},{});s.x=n*i.taskMargin+n*i.width+N,s.y=o,s.width=i.diagramMarginX,s.height=i.diagramMarginY,s.colour=b,s.fill=k,s.num=h,s.actors=l,H.drawTask(t,s,i,p),C.insert(s.x,s.y,s.x+s.width+i.taskMargin,450)}},"drawTasks"),mt={setConf:Yt,draw:qt},ee={parser:$t,db:pt,renderer:mt,styles:Lt,init:e((t)=>{mt.setConf(t.journey),pt.clear()},"init")};export{ee as diagram};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{e,n,ae,h,p,F,q,Tt,u,Y,ut,dt,Ft,St,gr}from"./index.fgsp5qqn.js";import{Xe}from"./index.eec12m3n.js";var se=function(){var t=e(function(A,s,r,o){for(r=r||{},o=A.length;o--;r[A[o]]=s);return r},"o"),f=[1,4],m=[1,13],a=[1,12],y=[1,15],N=[1,16],S=[1,20],g=[1,19],C=[6,7,8],T=[1,26],b=[1,24],P=[1,25],x=[6,7,11],z=[1,31],D=[6,7,11,24],U=[1,6,13,16,17,20,23],k=[1,35],V=[1,36],w=[1,6,7,11,13,16,17,20,23],X=[1,38],B={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:e(function(s,r,o,c,d,i,j){var l=i.length-1;switch(d){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",i[l-1].id),c.addNode(i[l-2].length,i[l-1].id,i[l-1].descr,i[l-1].type,i[l]);break;case 16:c.getLogger().info("Node: ",i[l].id),c.addNode(i[l-1].length,i[l].id,i[l].descr,i[l].type);break;case 17:c.getLogger().trace("Icon: ",i[l]),c.decorateNode({icon:i[l]});break;case 18:case 23:c.decorateNode({class:i[l]});break;case 19:c.getLogger().trace("SPACELIST");break;case 20:c.getLogger().trace("Node: ",i[l-1].id),c.addNode(0,i[l-1].id,i[l-1].descr,i[l-1].type,i[l]);break;case 21:c.getLogger().trace("Node: ",i[l].id),c.addNode(0,i[l].id,i[l].descr,i[l].type);break;case 22:c.decorateNode({icon:i[l]});break;case 27:c.getLogger().trace("node found ..",i[l-2]),this.$={id:i[l-1],descr:i[l-1],type:c.getType(i[l-2],i[l])};break;case 28:this.$={id:i[l],descr:i[l],type:0};break;case 29:c.getLogger().trace("node found ..",i[l-3]),this.$={id:i[l-3],descr:i[l-1],type:c.getType(i[l-2],i[l])};break;case 30:this.$=i[l-1]+i[l];break;case 31:this.$=i[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:m,7:[1,10],9:9,12:11,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},t(C,[2,3]),{1:[2,2]},t(C,[2,4]),t(C,[2,5]),{1:[2,6],6:m,12:21,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},{6:m,9:22,12:11,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},{6:T,7:b,10:23,11:P},t(x,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:g}),t(x,[2,19]),t(x,[2,21],{15:30,24:z}),t(x,[2,22]),t(x,[2,23]),t(D,[2,25]),t(D,[2,26]),t(D,[2,28],{20:[1,32]}),{21:[1,33]},{6:T,7:b,10:34,11:P},{1:[2,7],6:m,12:21,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},t(U,[2,14],{7:k,11:V}),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(x,[2,16],{15:37,24:z}),t(x,[2,17]),t(x,[2,18]),t(x,[2,20],{24:X}),t(D,[2,31]),{21:[1,39]},{22:[1,40]},t(U,[2,13],{7:k,11:V}),t(w,[2,11]),t(w,[2,12]),t(x,[2,15],{24:X}),t(D,[2,30]),{22:[1,41]},t(D,[2,27]),t(D,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(s,r){if(r.recoverable)this.trace(s);else{var o=Error(s);throw o.hash=r,o}},"parseError"),parse:e(function(s){var r=this,o=[0],c=[],d=[null],i=[],j=this.table,l="",K=0,he=0,ue=0,be=2,ge=1,ye=i.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var ee in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ee))G.yy[ee]=this.yy[ee];if(_.setInput(s,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var te=_.yylloc;i.push(te);var me=_.options&&_.options.ranges;if(typeof G.yy.parseError==="function")this.parseError=G.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ke(O){o.length=o.length-2*O,d.length=d.length-O,i.length=i.length-O}e(ke,"popStack");function de(){var O=c.pop()||_.lex()||ge;if(typeof O!=="number"){if(O instanceof Array)c=O,O=c.pop();O=r.symbols_[O]||O}return O}e(de,"lex");var v,ne,M,L,je,ie,W={},J,R,pe,Q;while(!0){if(M=o[o.length-1],this.defaultActions[M])L=this.defaultActions[M];else{if(v===null||typeof v>"u")v=de();L=j[M]&&j[M][v]}if(typeof L>"u"||!L.length||!L[0]){var re="";Q=[];for(J in j[M])if(this.terminals_[J]&&J>be)Q.push("'"+this.terminals_[J]+"'");if(_.showPosition)re="Parse error on line "+(K+1)+`:
|
|
2
|
+
`+_.showPosition()+`
|
|
3
|
+
Expecting `+Q.join(", ")+", got '"+(this.terminals_[v]||v)+"'";else re="Parse error on line "+(K+1)+": Unexpected "+(v==ge?"end of input":"'"+(this.terminals_[v]||v)+"'");this.parseError(re,{text:_.match,token:this.terminals_[v]||v,line:_.yylineno,loc:te,expected:Q})}if(L[0]instanceof Array&&L.length>1)throw Error("Parse Error: multiple actions possible at state: "+M+", token: "+v);switch(L[0]){case 1:if(o.push(v),d.push(_.yytext),i.push(_.yylloc),o.push(L[1]),v=null,!ne){if(he=_.yyleng,l=_.yytext,K=_.yylineno,te=_.yylloc,ue>0)ue--}else v=ne,ne=null;break;case 2:if(R=this.productions_[L[1]][1],W.$=d[d.length-R],W._$={first_line:i[i.length-(R||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(R||1)].first_column,last_column:i[i.length-1].last_column},me)W._$.range=[i[i.length-(R||1)].range[0],i[i.length-1].range[1]];if(ie=this.performAction.apply(W,[l,he,K,G.yy,L[1],d,i].concat(ye)),typeof ie<"u")return ie;if(R)o=o.slice(0,-1*R*2),d=d.slice(0,-1*R),i=i.slice(0,-1*R);o.push(this.productions_[L[1]][0]),d.push(W.$),i.push(W._$),pe=j[o[o.length-2]][o[o.length-1]],o.push(pe);break;case 3:return!0}}return!0},"parse")},Z=function(){var A={EOF:1,parseError:e(function(r,o){if(this.yy.parser)this.yy.parser.parseError(r,o);else throw Error(r)},"parseError"),setInput:e(function(s,r){if(this.yy=r||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];return this.offset=0,this},"setInput"),input:e(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var r=s.match(/(?:\r\n?|\n).*/g);if(r)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),s},"input"),unput:e(function(s){var r=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var c=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1)this.yylineno-=o.length-1;var d=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-r},this.options.ranges)this.yylloc.range=[d[0],d[0]+this.yyleng-r];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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:e(function(s){this.unput(this.match.slice(s))},"less"),pastInput:e(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:e(function(){var s=this.match;if(s.length<20)s+=this._input.substr(0,20-s.length);return(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var s=this.pastInput(),r=Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+r+"^"},"showPosition"),test_match:e(function(s,r){var o,c,d;if(this.options.backtrack_lexer){if(d={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)d.yylloc.range=this.yylloc.range.slice(0)}if(c=s[0].match(/(?:\r\n?|\n).*/g),c)this.yylineno+=c.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.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];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(o)return o;else if(this._backtrack){for(var i in d)this[i]=d[i];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var s,r,o,c;if(!this._more)this.yytext="",this.match="";var d=this._currentRules();for(var i=0;i<d.length;i++)if(o=this._input.match(this.rules[d[i]]),o&&(!r||o[0].length>r[0].length)){if(r=o,c=i,this.options.backtrack_lexer)if(s=this.test_match(o,d[i]),s!==!1)return s;else if(this._backtrack){r=!1;continue}else return!1;else if(!this.options.flex)break}if(r){if(s=this.test_match(r,d[c]),s!==!1)return s;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var r=this.next();if(r)return r;else return this.lex()},"lex"),begin:e(function(r){this.conditionStack.push(r)},"begin"),popState:e(function(){var r=this.conditionStack.length-1;if(r>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(r){if(r=this.conditionStack.length-1-Math.abs(r||0),r>=0)return this.conditionStack[r];else return"INITIAL"},"topState"),pushState:e(function(r){this.begin(r)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(r,o,c,d){var i=d;switch(c){case 0:return this.pushState("shapeData"),o.yytext="",24;break;case 1:return this.pushState("shapeDataStr"),24;break;case 2:return this.popState(),24;break;case 3:let j=/\n\s*/g;return o.yytext=o.yytext.replace(j,"<br/>"),24;break;case 4:return 24;case 5:this.popState();break;case 6:return r.getLogger().trace("Found comment",o.yytext),6;break;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;break;case 10:this.popState();break;case 11:r.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return r.getLogger().trace("SPACELINE"),6;break;case 13:return 7;case 14:return 16;case 15:r.getLogger().trace("end icon"),this.popState();break;case 16:return r.getLogger().trace("Exploding node"),this.begin("NODE"),20;break;case 17:return r.getLogger().trace("Cloud"),this.begin("NODE"),20;break;case 18:return r.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;break;case 19:return r.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;break;case 20:return this.begin("NODE"),20;break;case 21:return this.begin("NODE"),20;break;case 22:return this.begin("NODE"),20;break;case 23:return this.begin("NODE"),20;break;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:r.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return r.getLogger().trace("description:",o.yytext),"NODE_DESCR";break;case 32:this.popState();break;case 33:return this.popState(),r.getLogger().trace("node end ))"),"NODE_DEND";break;case 34:return this.popState(),r.getLogger().trace("node end )"),"NODE_DEND";break;case 35:return this.popState(),r.getLogger().trace("node end ...",o.yytext),"NODE_DEND";break;case 36:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 37:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 38:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 39:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 40:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 41:return r.getLogger().trace("Long description:",o.yytext),21;break;case 42:return r.getLogger().trace("Long description:",o.yytext),21;break}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return A}();B.lexer=Z;function H(){this.yy={}}return e(H,"Parser"),H.prototype=B,B.Parser=H,new H}();se.parser=se;var Ee=se,I=[],ce=[],oe=0,le={},_e=e(()=>{I=[],ce=[],oe=0,le={}},"clear"),Se=e((t)=>{if(I.length===0)return null;let f=I[0].level,m=null;for(let a=I.length-1;a>=0;a--){if(I[a].level===f&&!m)m=I[a];if(I[a].level<f)throw Error('Items without section detected, found section ("'+I[a].label+'")')}if(t===m?.level)return null;return m},"getSection"),fe=e(function(){return ce},"getSections"),Ne=e(function(){let t=[],f=[],m=fe(),a=u();for(let y of m){let N={id:y.id,label:q(y.label??"",a),labelType:"markdown",isGroup:!0,ticket:y.ticket,shape:"kanbanSection",level:y.level,look:a.look};f.push(N);let S=I.filter((g)=>g.parentId===y.id);for(let g of S){let C={id:g.id,parentId:y.id,label:q(g.label??"",a),labelType:"markdown",isGroup:!1,ticket:g?.ticket,priority:g?.priority,assigned:g?.assigned,icon:g?.icon,shape:"kanbanItem",level:g.level,rx:5,ry:5,cssStyles:["text-align: left"]};f.push(C)}}return{nodes:f,edges:t,other:{},config:u()}},"getData"),xe=e((t,f,m,a,y)=>{let N=u(),S=N.mindmap?.padding??F.mindmap.padding;switch(a){case E.ROUNDED_RECT:case E.RECT:case E.HEXAGON:S*=2}let g={id:q(f,N)||"kbn"+oe++,level:t,label:q(m,N),width:N.mindmap?.maxNodeWidth??F.mindmap.maxNodeWidth,padding:S,isGroup:!1};if(y!==void 0){let T;if(!y.includes(`
|
|
7
|
+
`))T=`{
|
|
8
|
+
`+y+`
|
|
9
|
+
}`;else T=y+`
|
|
10
|
+
`;let b=dt(T,{schema:ut});if(b.shape&&(b.shape!==b.shape.toLowerCase()||b.shape.includes("_")))throw Error(`No such shape: ${b.shape}. Shape names should be lowercase.`);if(b?.shape&&b.shape==="kanbanItem")g.shape=b?.shape;if(b?.label)g.label=b?.label;if(b?.icon)g.icon=b?.icon.toString();if(b?.assigned)g.assigned=b?.assigned.toString();if(b?.ticket)g.ticket=b?.ticket.toString();if(b?.priority)g.priority=b?.priority}let C=Se(t);if(C)g.parentId=C.id||"kbn"+oe++;else ce.push(g);I.push(g)},"addNode"),E={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ve=e((t,f)=>{switch(n.debug("In get type",t,f),t){case"[":return E.RECT;case"(":return f===")"?E.ROUNDED_RECT:E.CLOUD;case"((":return E.CIRCLE;case")":return E.CLOUD;case"))":return E.BANG;case"{{":return E.HEXAGON;default:return E.DEFAULT}},"getType"),De=e((t,f)=>{le[t]=f},"setElementForId"),Le=e((t)=>{if(!t)return;let f=u(),m=I[I.length-1];if(t.icon)m.icon=q(t.icon,f);if(t.class)m.cssClasses=q(t.class,f)},"decorateNode"),Oe=e((t)=>{switch(t){case E.DEFAULT:return"no-border";case E.RECT:return"rect";case E.ROUNDED_RECT:return"rounded-rect";case E.CIRCLE:return"circle";case E.CLOUD:return"cloud";case E.BANG:return"bang";case E.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Ie=e(()=>n,"getLogger"),Ce=e((t)=>le[t],"getElementById"),we={clear:_e,addNode:xe,getSections:fe,getData:Ne,nodeType:E,getType:ve,setElementForId:De,decorateNode:Le,type2Str:Oe,getLogger:Ie,getElementById:Ce},Ae=we,Te=e(async(t,f,m,a)=>{n.debug(`Rendering kanban diagram
|
|
11
|
+
`+t);let N=a.db.getData(),S=u();S.htmlLabels=!1;let g=Y(f);for(let k of N.nodes)k.domId=`${f}-${k.id}`;let C=g.append("g");C.attr("class","sections");let T=g.append("g");T.attr("class","items");let b=N.nodes.filter((k)=>k.isGroup),P=0,x=10,z=[],D=25;for(let k of b){let V=S?.kanban?.sectionWidth||200;P=P+1,k.x=V*P+(P-1)*x/2,k.width=V,k.y=0,k.height=V*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+P;let w=await gr(C,k);D=Math.max(D,w?.labelBBox?.height),z.push(w)}let U=0;for(let k of b){let V=z[U];U=U+1;let w=S?.kanban?.sectionWidth||200,X=-w*3/2+D,B=X,Z=N.nodes.filter((s)=>s.parentId===k.id);for(let s of Z){if(s.isGroup)throw Error("Groups within groups are not allowed in Kanban diagrams");s.x=k.x,s.width=w-1.5*x;let o=(await Ft(T,s,{config:S})).node().getBBox();s.y=B+o.height/2,await St(s),B=s.y+o.height/2+x/2}let H=V.cluster.select("rect"),A=Math.max(B-X+3*x,50)+(D-25);H.attr("height",A)}Tt(void 0,g,S.mindmap?.padding??F.kanban.padding,S.mindmap?.useMaxWidth??F.kanban.useMaxWidth)},"draw"),Re={draw:Te},Pe=e((t)=>{let f="";for(let a=0;a<t.THEME_COLOR_LIMIT;a++)if(t["lineColor"+a]=t["lineColor"+a]||t["cScaleInv"+a],ae(t["lineColor"+a]))t["lineColor"+a]=h(t["lineColor"+a],20);else t["lineColor"+a]=p(t["lineColor"+a],20);let m=e((a,y)=>t.darkMode?p(a,y):h(a,y),"adjuster");for(let a=0;a<t.THEME_COLOR_LIMIT;a++){let y=""+(17-3*a);f+=`
|
|
12
|
+
.section-${a-1} rect, .section-${a-1} path, .section-${a-1} circle, .section-${a-1} polygon, .section-${a-1} path {
|
|
13
|
+
fill: ${m(t["cScale"+a],10)};
|
|
14
|
+
stroke: ${m(t["cScale"+a],10)};
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
.section-${a-1} text {
|
|
18
|
+
fill: ${t["cScaleLabel"+a]};
|
|
19
|
+
}
|
|
20
|
+
.node-icon-${a-1} {
|
|
21
|
+
font-size: 40px;
|
|
22
|
+
color: ${t["cScaleLabel"+a]};
|
|
23
|
+
}
|
|
24
|
+
.section-edge-${a-1}{
|
|
25
|
+
stroke: ${t["cScale"+a]};
|
|
26
|
+
}
|
|
27
|
+
.edge-depth-${a-1}{
|
|
28
|
+
stroke-width: ${y};
|
|
29
|
+
}
|
|
30
|
+
.section-${a-1} line {
|
|
31
|
+
stroke: ${t["cScaleInv"+a]} ;
|
|
32
|
+
stroke-width: 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.disabled, .disabled circle, .disabled text {
|
|
36
|
+
fill: lightgray;
|
|
37
|
+
}
|
|
38
|
+
.disabled text {
|
|
39
|
+
fill: #efefef;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.node rect,
|
|
43
|
+
.node circle,
|
|
44
|
+
.node ellipse,
|
|
45
|
+
.node polygon,
|
|
46
|
+
.node path {
|
|
47
|
+
fill: ${t.background};
|
|
48
|
+
stroke: ${t.nodeBorder};
|
|
49
|
+
stroke-width: 1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.kanban-ticket-link {
|
|
53
|
+
fill: ${t.background};
|
|
54
|
+
stroke: ${t.nodeBorder};
|
|
55
|
+
text-decoration: underline;
|
|
56
|
+
}
|
|
57
|
+
`}return f},"genSections"),Ve=e((t)=>`
|
|
58
|
+
.edge {
|
|
59
|
+
stroke-width: 3;
|
|
60
|
+
}
|
|
61
|
+
${Pe(t)}
|
|
62
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
63
|
+
fill: ${t.git0};
|
|
64
|
+
}
|
|
65
|
+
.section-root text {
|
|
66
|
+
fill: ${t.gitBranchLabel0};
|
|
67
|
+
}
|
|
68
|
+
.icon-container {
|
|
69
|
+
height:100%;
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
}
|
|
74
|
+
.edge {
|
|
75
|
+
fill: none;
|
|
76
|
+
}
|
|
77
|
+
.cluster-label, .label {
|
|
78
|
+
color: ${t.textColor};
|
|
79
|
+
fill: ${t.textColor};
|
|
80
|
+
}
|
|
81
|
+
.kanban-label {
|
|
82
|
+
dy: 1em;
|
|
83
|
+
alignment-baseline: middle;
|
|
84
|
+
text-anchor: middle;
|
|
85
|
+
dominant-baseline: middle;
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
${Xe()}
|
|
89
|
+
`,"getStyles"),Be=Ve,tt={db:Ae,renderer:Re,parser:Ee,styles:Be};export{tt as diagram};
|