@marimo-team/frontend 0.11.3-dev2 → 0.11.3-dev20
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/{ConnectedDataExplorerComponent-DwNcuNsZ.js → ConnectedDataExplorerComponent-DYgbH2SL.js} +1 -1
- package/dist/assets/{VegaLite-Se7byBIM.js → VegaLite-DKSDGShP.js} +1 -1
- package/dist/assets/{_baseEach-CpYRJP2F.js → _baseEach-DKWVPuqo.js} +1 -1
- package/dist/assets/_baseMap-CGj4ygmV.js +1 -0
- package/dist/assets/{_baseUniq-EUu2zITv.js → _baseUniq-DkAXs6-8.js} +1 -1
- package/dist/assets/{any-language-editor-Dp0tWVxg.js → any-language-editor-CuJv5Ej3.js} +1 -1
- package/dist/assets/{architectureDiagram-UYN6MBPD-Cc7K55In.js → architectureDiagram-UYN6MBPD-BhvnCUzd.js} +1 -1
- package/dist/assets/{blockDiagram-ZHA2E4KO-Dvz06TRJ.js → blockDiagram-ZHA2E4KO-Cjv-qfIX.js} +1 -1
- package/dist/assets/{c4Diagram-6F5ED5ID-CAOyBT4s.js → c4Diagram-6F5ED5ID-DAwvaO6h.js} +1 -1
- package/dist/assets/channel-B7Ed6buy.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-BWY0wCSI.js → chunk-5HRBRIJM-csG9pIYY.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-C5sDvFeP.js → chunk-7U56Z5CX-BDWYjjsk.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-77p2hf4l.js → chunk-ASOPGD6M-Dj05Kznj.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-c985o3fS.js → chunk-KFBOBJHC-BhUa6Id0.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-Ety5bVrs.js → chunk-T2TOU4HS-CThBqK4s.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-CofmT0Pu.js → chunk-TMUBEWPD-DqpSlTeC.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-BSaqXWkD.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-BSaqXWkD.js +1 -0
- package/dist/assets/clone-CmZQfFeL.js +1 -0
- package/dist/assets/{compile-DOOVRIh-.js → compile-CV1DPAu1.js} +1 -1
- package/dist/assets/{createWsUrl-RTbiPAnj.js → createWsUrl-BK_khDYq.js} +1 -1
- package/dist/assets/{dagre-4EVJKHTY-BTxzNZRO.js → dagre-4EVJKHTY-Bxf9hs3p.js} +1 -1
- package/dist/assets/{data-editor-BjtSGG3j.js → data-editor-DVP25t8q.js} +1 -1
- package/dist/assets/{diagram-QW4FP2JN-BHEDh-ZI.js → diagram-QW4FP2JN-DhD79gik.js} +1 -1
- package/dist/assets/edit-page-8xLg269j.js +8 -0
- package/dist/assets/{erDiagram-6RL3IURR-zgcKRMJ7.js → erDiagram-6RL3IURR-CGqGkLGe.js} +1 -1
- package/dist/assets/{flowDiagram-7ASYPVHJ-Cz9gWrZ9.js → flowDiagram-7ASYPVHJ-CIanZNBk.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-DWwKBOVY.js → ganttDiagram-NTVNEXSI-BMa2Refd.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-DMejEUYa.js → gitGraph-YCYPL57B-bWG7e943.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NRZ2UAAF-Bm0PurbG.js → gitGraphDiagram-NRZ2UAAF-C52J6QOo.js} +1 -1
- package/dist/assets/{graph-CyBDXFkk.js → graph-DNcCME-7.js} +1 -1
- package/dist/assets/{home-page-D3tANUsI.js → home-page-CHOrvPUz.js} +1 -1
- package/dist/assets/{index-DCKbMV2u.js → index-B9XYC7js.js} +1 -1
- package/dist/assets/{index-DVGuKE4h.js → index-BbFFyba2.js} +1 -1
- package/dist/assets/{index-B67ZOMCT.js → index-CJ0D29ei.js} +1 -1
- package/dist/assets/{index-D-uz8XNH.js → index-CN0QN4rz.js} +1 -1
- package/dist/assets/{index-BoI9rNOE.js → index-CZqUmbos.js} +1 -1
- package/dist/assets/index-CmekZQwh.css +1 -0
- package/dist/assets/{index-BIU0L64i.js → index-CoAIVxIk.js} +1 -1
- package/dist/assets/{index-CU2ysXd9.js → index-DHguntX1.js} +1 -1
- package/dist/assets/{index-PfFm4JiS.js → index-DMWP8QKb.js} +1 -1
- package/dist/assets/{index-DxLwjtOQ.js → index-DN9y0OOS.js} +1 -1
- package/dist/assets/{index-BPbOAmhA.js → index-DRs639kd.js} +1 -1
- package/dist/assets/{index-gKvFhbLE.js → index-DSM3bZf9.js} +1 -1
- package/dist/assets/{index-B0UtBLy2.js → index-DbrAKNDJ.js} +1 -1
- package/dist/assets/{index-DyBwBRx5.js → index-Fo1BZp8O.js} +1 -1
- package/dist/assets/{index-C4flgGqq.js → index-IQWd7RWY.js} +1 -1
- package/dist/assets/{index-De5ctkOH.js → index-OBiNvDyK.js} +1 -1
- package/dist/assets/{index-DY8YBJB9.js → index-dpqyqZ9J.js} +6 -6
- package/dist/assets/{index-Ux4cWHW8.js → index-q6Vd2xG6.js} +1 -1
- package/dist/assets/{infoDiagram-A4XQUW5V-CTyzTEPZ.js → infoDiagram-A4XQUW5V-D6odwe1R.js} +1 -1
- package/dist/assets/{journeyDiagram-G5WM74LC-CUzb48cw.js → journeyDiagram-G5WM74LC-BkN_qyCN.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-BsZfkw06.js → kanban-definition-QRCXZQQD-DA1eNF0y.js} +1 -1
- package/dist/assets/{layout-TUuqKmq9.js → layout-BZqED293.js} +1 -1
- package/dist/assets/{linear-BcVBot2X.js → linear-BYn4QKaD.js} +1 -1
- package/dist/assets/{mermaid-iN17w3fk.js → mermaid-DAdEogzg.js} +3 -3
- package/dist/assets/{min-Bp89Egzy.js → min-Lg8ibOwg.js} +1 -1
- package/dist/assets/{mindmap-definition-GWI6TPTV-Dc31t1gS.js → mindmap-definition-GWI6TPTV-BH12bWUa.js} +1 -1
- package/dist/assets/{pieDiagram-YF2LJOPJ-BGDoL02y.js → pieDiagram-YF2LJOPJ-6OF7WjNC.js} +1 -1
- package/dist/assets/{quadrantDiagram-OS5C2QUG-CrVeYL__.js → quadrantDiagram-OS5C2QUG-BfELsugw.js} +1 -1
- package/dist/assets/{react-plotly-BpnTdqK-.js → react-plotly-6l1na3uS.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ-0x3J3yoe.js → requirementDiagram-MIRIMTAZ-B60DR0Q5.js} +1 -1
- package/dist/assets/{run-page-DHSR5vd4.js → run-page-CzlQAFPn.js} +1 -1
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-BySbLRW4.js → sankeyDiagram-Y46BX6SQ-DlSw5fzF.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-BJd6-X5a.js → sequenceDiagram-G6AWOVSC-8rpYELRi.js} +1 -1
- package/dist/assets/{slides-component-BA6XkTrN.js → slides-component-Oz3kan-l.js} +1 -1
- package/dist/assets/{sortBy-BUQT8EmF.js → sortBy-DcXIDfdq.js} +1 -1
- package/dist/assets/{stateDiagram-MAYHULR4-_6ung2Uj.js → stateDiagram-MAYHULR4-sS09chV_.js} +1 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-DafT0TPF.js +1 -0
- package/dist/assets/{terminal-okc7aeaU.js → terminal-DPAC_YSX.js} +1 -1
- package/dist/assets/{time-DIR0v7Td.js → time-BMycf1oc.js} +1 -1
- package/dist/assets/{timeline-definition-U7ZMHBDA-D-neYTry.js → timeline-definition-U7ZMHBDA-CzNqDgKr.js} +1 -1
- package/dist/assets/{tree-jGN1QpdP.js → tree-CO7FV-5u.js} +1 -1
- package/dist/assets/{useMarimoWebSocket-D-0NdIu4.js → useMarimoWebSocket-DIJNw5KY.js} +3 -3
- package/dist/assets/{vega-component-BI-50dxA.js → vega-component-Blv_Wjro.js} +1 -1
- package/dist/assets/{worker-BeIyzMbF.js → worker-DzWO0OVI.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-vDZMchYo.js → xychartDiagram-6QU3TZC5-zwGkZUcv.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +4 -3
- package/dist/assets/_baseMap-CCj9iaD5.js +0 -1
- package/dist/assets/channel-Bp6VvwqX.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-VRPxeSOD.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-VRPxeSOD.js +0 -1
- package/dist/assets/clone-DuYy0T7f.js +0 -1
- package/dist/assets/edit-page-Bmx0Hkby.js +0 -8
- package/dist/assets/index-CmfXdNXj.css +0 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-BEnepFaU.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,l as e,d as n,H as i,Y as s,$ as r,a0 as o,T as a,B as l,i as c,r as h,J as u,V as d,W as g,X as p}from"./mermaid-iN17w3fk.js";import"./index-DY8YBJB9.js";import"./transform-D6ULhE8R.js";import"./step-CaHXtLdi.js";var y=function(){var e=t((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],g=[6,7,11],p=[1,31],y=[6,7,11,24],f=[1,6,13,16,17,20,23],m=[1,35],_=[1,36],b=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t((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:t((function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(c,[2,3]),{1:[2,2]},e(c,[2,4]),e(c,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:h,7:u,10:23,11:d},e(g,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:l}),e(g,[2,19]),e(g,[2,21],{15:30,24:p}),e(g,[2,22]),e(g,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(f,[2,14],{7:m,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(g,[2,16],{15:37,24:p}),e(g,[2,17]),e(g,[2,18]),e(g,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(f,[2,13],{7:m,11:_}),e(b,[2,11]),e(b,[2,12]),e(g,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:t((function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(g.yy[p]=this.yy[p]);d.setInput(e,g.yy),g.yy.lexer=d,g.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;o.push(y);var f=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t}),"popStack"),t(m,"lex");for(var _,b,k,E,S,N,v,x,L={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==_&&(_=m()),k=a[b]&&a[b][_]),void 0===k||!k.length||!k[0]){var D="";for(S in x=[],a[b])this.terminals_[S]&&S>2&&x.push("'"+this.terminals_[S]+"'");D=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(D,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:y,expected:x})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(k[0]){case 1:i.push(_),r.push(d.yytext),o.push(d.yylloc),i.push(k[1]),_=null,h=d.yyleng,l=d.yytext,c=d.yylineno,y=d.yylloc;break;case 2:if(N=this.productions_[k[1]][1],L.$=r[r.length-N],L._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},f&&(L._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(L,[l,h,c,g.yy,k[1],r,o].concat(u))))return E;N&&(i=i.slice(0,-1*N*2),r=r.slice(0,-1*N),o=o.slice(0,-1*N)),i.push(this.productions_[k[1]][0]),r.push(L.$),o.push(L._$),v=a[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0}),"parse")},S=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((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:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}}),"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}}}}();function N(){this.yy={}}return E.lexer=S,t(N,"Parser"),N.prototype=E,E.Parser=N,new N}();y.parser=y;var f=y,m=[],_=[],b=0,k={},E=t((()=>{m=[],_=[],b=0,k={}}),"clear"),S=t((t=>{if(0===m.length)return null;const e=m[0].level;let n=null;for(let i=m.length-1;i>=0;i--)if(m[i].level!==e||n||(n=m[i]),m[i].level<e)throw new Error('Items without section detected, found section ("'+m[i].label+'")');return t===(null==n?void 0:n.level)?null:n}),"getSection"),N=t((function(){return _}),"getSections"),v=t((function(){const t=[],e=N(),i=n();for(const n of e){const e={id:n.id,label:c(n.label??"",i),isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=m.filter((t=>t.parentId===n.id));for(const r of s){const e={id:r.id,parentId:n.id,label:c(r.label??"",i),isGroup:!1,ticket:null==r?void 0:r.ticket,priority:null==r?void 0:r.priority,assigned:null==r?void 0:r.assigned,icon:null==r?void 0:r.icon,shape:"kanbanItem",level:r.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:n()}}),"getData"),x=t(((t,e,i,s,r)=>{var o,a;const d=n();let g=(null==(o=d.mindmap)?void 0:o.padding)??l.mindmap.padding;switch(s){case L.ROUNDED_RECT:case L.RECT:case L.HEXAGON:g*=2}const p={id:c(e,d)||"kbn"+b++,level:t,label:c(i,d),width:(null==(a=d.mindmap)?void 0:a.maxNodeWidth)??l.mindmap.maxNodeWidth,padding:g,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);(null==e?void 0:e.shape)&&"kanbanItem"===e.shape&&(p.shape=null==e?void 0:e.shape),(null==e?void 0:e.label)&&(p.label=null==e?void 0:e.label),(null==e?void 0:e.icon)&&(p.icon=null==e?void 0:e.icon.toString()),(null==e?void 0:e.assigned)&&(p.assigned=null==e?void 0:e.assigned.toString()),(null==e?void 0:e.ticket)&&(p.ticket=null==e?void 0:e.ticket.toString()),(null==e?void 0:e.priority)&&(p.priority=null==e?void 0:e.priority)}const y=S(t);y?p.parentId=y.id||"kbn"+b++:_.push(p),m.push(p)}),"addNode"),L={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},D={clear:E,addNode:x,getSections:N,getData:v,nodeType:L,getType:t(((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return L.RECT;case"(":return")"===n?L.ROUNDED_RECT:L.CLOUD;case"((":return L.CIRCLE;case")":return L.CLOUD;case"))":return L.BANG;case"{{":return L.HEXAGON;default:return L.DEFAULT}}),"getType"),setElementForId:t(((t,e)=>{k[t]=e}),"setElementForId"),decorateNode:t((t=>{if(!t)return;const e=n(),i=m[m.length-1];t.icon&&(i.icon=c(t.icon,e)),t.class&&(i.cssClasses=c(t.class,e))}),"decorateNode"),type2Str:t((t=>{switch(t){case L.DEFAULT:return"no-border";case L.RECT:return"rect";case L.ROUNDED_RECT:return"rounded-rect";case L.CIRCLE:return"circle";case L.CLOUD:return"cloud";case L.BANG:return"bang";case L.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),getLogger:t((()=>e),"getLogger"),getElementById:t((t=>k[t]),"getElementById")},I={draw:t((async(t,c,h,u)=>{var d,g,p,y,f;e.debug("Rendering kanban diagram\n"+t);const m=u.db.getData(),_=n();_.htmlLabels=!1;const b=i(c),k=b.append("g");k.attr("class","sections");const E=b.append("g");E.attr("class","items");const S=m.nodes.filter((t=>t.isGroup));let N=0;const v=[];let x=25;for(const e of S){const t=(null==(d=null==_?void 0:_.kanban)?void 0:d.sectionWidth)||200;N+=1,e.x=t*N+10*(N-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+N;const n=await s(k,e);x=Math.max(x,null==(g=null==n?void 0:n.labelBBox)?void 0:g.height),v.push(n)}let L=0;for(const e of S){const t=v[L];L+=1;const n=(null==(p=null==_?void 0:_.kanban)?void 0:p.sectionWidth)||200,i=3*-n/2+x;let s=i;const a=m.nodes.filter((t=>t.parentId===e.id));for(const h of a){if(h.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");h.x=e.x,h.width=n-15;const t=(await r(E,h,{config:_})).node().getBBox();h.y=s+t.height/2,await o(h),s=h.y+t.height/2+5}const l=t.cluster.select("rect"),c=Math.max(s-i+30,50)+(x-25);l.attr("height",c)}a(void 0,b,(null==(y=_.mindmap)?void 0:y.padding)??l.kanban.padding,(null==(f=_.mindmap)?void 0:f.useMaxWidth)??l.kanban.useMaxWidth)}),"draw")},O=t((e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],d(e["lineColor"+t])?e["lineColor"+t]=g(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t(((t,n)=>e.darkMode?p(t,n):g(t,n)),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n}),"genSections"),C={db:D,renderer:I,parser:f,styles:t((t=>`\n .edge {\n stroke-width: 3;\n }\n ${O(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")};export{C as diagram};
|
|
1
|
+
import{_ as t,l as e,d as n,H as i,Y as s,$ as r,a0 as o,T as a,B as l,i as c,r as h,J as u,V as d,W as g,X as p}from"./mermaid-DAdEogzg.js";import"./index-dpqyqZ9J.js";import"./transform-D6ULhE8R.js";import"./step-CaHXtLdi.js";var y=function(){var e=t((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],l=[1,19],c=[6,7,8],h=[1,26],u=[1,24],d=[1,25],g=[6,7,11],p=[1,31],y=[6,7,11,24],f=[1,6,13,16,17,20,23],m=[1,35],_=[1,36],b=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t((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:t((function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(c,[2,3]),{1:[2,2]},e(c,[2,4]),e(c,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},{6:h,7:u,10:23,11:d},e(g,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:l}),e(g,[2,19]),e(g,[2,21],{15:30,24:p}),e(g,[2,22]),e(g,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:l},e(f,[2,14],{7:m,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(g,[2,16],{15:37,24:p}),e(g,[2,17]),e(g,[2,18]),e(g,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(f,[2,13],{7:m,11:_}),e(b,[2,11]),e(b,[2,12]),e(g,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:t((function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(g.yy[p]=this.yy[p]);d.setInput(e,g.yy),g.yy.lexer=d,g.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var y=d.yylloc;o.push(y);var f=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t}),"popStack"),t(m,"lex");for(var _,b,k,E,S,N,v,x,L={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==_&&(_=m()),k=a[b]&&a[b][_]),void 0===k||!k.length||!k[0]){var D="";for(S in x=[],a[b])this.terminals_[S]&&S>2&&x.push("'"+this.terminals_[S]+"'");D=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(D,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:y,expected:x})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(k[0]){case 1:i.push(_),r.push(d.yytext),o.push(d.yylloc),i.push(k[1]),_=null,h=d.yyleng,l=d.yytext,c=d.yylineno,y=d.yylloc;break;case 2:if(N=this.productions_[k[1]][1],L.$=r[r.length-N],L._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},f&&(L._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(L,[l,h,c,g.yy,k[1],r,o].concat(u))))return E;N&&(i=i.slice(0,-1*N*2),r=r.slice(0,-1*N),o=o.slice(0,-1*N)),i.push(this.productions_[k[1]][0]),r.push(L.$),o.push(L._$),v=a[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0}),"parse")},S=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((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:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}}),"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}}}}();function N(){this.yy={}}return E.lexer=S,t(N,"Parser"),N.prototype=E,E.Parser=N,new N}();y.parser=y;var f=y,m=[],_=[],b=0,k={},E=t((()=>{m=[],_=[],b=0,k={}}),"clear"),S=t((t=>{if(0===m.length)return null;const e=m[0].level;let n=null;for(let i=m.length-1;i>=0;i--)if(m[i].level!==e||n||(n=m[i]),m[i].level<e)throw new Error('Items without section detected, found section ("'+m[i].label+'")');return t===(null==n?void 0:n.level)?null:n}),"getSection"),N=t((function(){return _}),"getSections"),v=t((function(){const t=[],e=N(),i=n();for(const n of e){const e={id:n.id,label:c(n.label??"",i),isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=m.filter((t=>t.parentId===n.id));for(const r of s){const e={id:r.id,parentId:n.id,label:c(r.label??"",i),isGroup:!1,ticket:null==r?void 0:r.ticket,priority:null==r?void 0:r.priority,assigned:null==r?void 0:r.assigned,icon:null==r?void 0:r.icon,shape:"kanbanItem",level:r.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:n()}}),"getData"),x=t(((t,e,i,s,r)=>{var o,a;const d=n();let g=(null==(o=d.mindmap)?void 0:o.padding)??l.mindmap.padding;switch(s){case L.ROUNDED_RECT:case L.RECT:case L.HEXAGON:g*=2}const p={id:c(e,d)||"kbn"+b++,level:t,label:c(i,d),width:(null==(a=d.mindmap)?void 0:a.maxNodeWidth)??l.mindmap.maxNodeWidth,padding:g,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);(null==e?void 0:e.shape)&&"kanbanItem"===e.shape&&(p.shape=null==e?void 0:e.shape),(null==e?void 0:e.label)&&(p.label=null==e?void 0:e.label),(null==e?void 0:e.icon)&&(p.icon=null==e?void 0:e.icon.toString()),(null==e?void 0:e.assigned)&&(p.assigned=null==e?void 0:e.assigned.toString()),(null==e?void 0:e.ticket)&&(p.ticket=null==e?void 0:e.ticket.toString()),(null==e?void 0:e.priority)&&(p.priority=null==e?void 0:e.priority)}const y=S(t);y?p.parentId=y.id||"kbn"+b++:_.push(p),m.push(p)}),"addNode"),L={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},D={clear:E,addNode:x,getSections:N,getData:v,nodeType:L,getType:t(((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return L.RECT;case"(":return")"===n?L.ROUNDED_RECT:L.CLOUD;case"((":return L.CIRCLE;case")":return L.CLOUD;case"))":return L.BANG;case"{{":return L.HEXAGON;default:return L.DEFAULT}}),"getType"),setElementForId:t(((t,e)=>{k[t]=e}),"setElementForId"),decorateNode:t((t=>{if(!t)return;const e=n(),i=m[m.length-1];t.icon&&(i.icon=c(t.icon,e)),t.class&&(i.cssClasses=c(t.class,e))}),"decorateNode"),type2Str:t((t=>{switch(t){case L.DEFAULT:return"no-border";case L.RECT:return"rect";case L.ROUNDED_RECT:return"rounded-rect";case L.CIRCLE:return"circle";case L.CLOUD:return"cloud";case L.BANG:return"bang";case L.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),getLogger:t((()=>e),"getLogger"),getElementById:t((t=>k[t]),"getElementById")},I={draw:t((async(t,c,h,u)=>{var d,g,p,y,f;e.debug("Rendering kanban diagram\n"+t);const m=u.db.getData(),_=n();_.htmlLabels=!1;const b=i(c),k=b.append("g");k.attr("class","sections");const E=b.append("g");E.attr("class","items");const S=m.nodes.filter((t=>t.isGroup));let N=0;const v=[];let x=25;for(const e of S){const t=(null==(d=null==_?void 0:_.kanban)?void 0:d.sectionWidth)||200;N+=1,e.x=t*N+10*(N-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+N;const n=await s(k,e);x=Math.max(x,null==(g=null==n?void 0:n.labelBBox)?void 0:g.height),v.push(n)}let L=0;for(const e of S){const t=v[L];L+=1;const n=(null==(p=null==_?void 0:_.kanban)?void 0:p.sectionWidth)||200,i=3*-n/2+x;let s=i;const a=m.nodes.filter((t=>t.parentId===e.id));for(const h of a){if(h.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");h.x=e.x,h.width=n-15;const t=(await r(E,h,{config:_})).node().getBBox();h.y=s+t.height/2,await o(h),s=h.y+t.height/2+5}const l=t.cluster.select("rect"),c=Math.max(s-i+30,50)+(x-25);l.attr("height",c)}a(void 0,b,(null==(y=_.mindmap)?void 0:y.padding)??l.kanban.padding,(null==(f=_.mindmap)?void 0:f.useMaxWidth)??l.kanban.useMaxWidth)}),"draw")},O=t((e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],d(e["lineColor"+t])?e["lineColor"+t]=g(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t(((t,n)=>e.darkMode?p(t,n):g(t,n)),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n}),"genSections"),C={db:D,renderer:I,parser:f,styles:t((t=>`\n .edge {\n stroke-width: 3;\n }\n ${O(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles")};export{C as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e}from"./graph-CyBDXFkk.js";import{cd as n,bM as r,cT as t,aj as o,cU as i,cM as a,cV as u,cW as d,ah as c,cX as s,cY as f}from"./index-DY8YBJB9.js";import{b as h,e as g,c as v,i as l,f as p,v as w,r as m}from"./_baseUniq-EUu2zITv.js";import{b,a as y,m as x,c as k,h as E,f as N,l as O,d as _}from"./min-Bp89Egzy.js";import{c as I,a as P}from"./_baseEach-CpYRJP2F.js";import{s as j}from"./sortBy-BUQT8EmF.js";function R(e,n){return e>n}function T(e,n){var r={};return n=P(n),I(e,(function(e,o,i){t(r,o,n(e,o,i))})),r}function M(e){return e&&e.length?b(e,o,R):void 0}function L(e,n){return e&&e.length?b(e,P(n),y):void 0}var C=0;function S(e){var n=++C;return i(e)+n}class G{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return V(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&V(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,F)),r=r._prev;return"["+e.join(", ")+"]"}}function V(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function F(e,n){if("_next"!==e&&"_prev"!==e)return n}function B(n,r){if(n.nodeCount()<=1)return[];var t=function(n,r){var t=new e,o=0,i=0;v(n.nodes(),(function(e){t.setNode(e,{v:e,in:0,out:0})})),v(n.edges(),(function(e){var n=t.edge(e.v,e.w)||0,a=r(e),u=n+a;t.setEdge(e.v,e.w,u),i=Math.max(i,t.node(e.v).out+=a),o=Math.max(o,t.node(e.w).in+=a)}));var a=d(i+o+3).map((function(){return new G})),u=o+1;return v(t.nodes(),(function(e){Y(a,u,t.node(e))})),{graph:t,buckets:a,zeroIdx:u}}(n,r),o=function(e,n,r){var t,o=[],i=n[n.length-1],a=n[0];for(;e.nodeCount();){for(;t=a.dequeue();)q(e,n,r,t);for(;t=i.dequeue();)q(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(q(e,n,r,t,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return u(x(o,(function(e){return n.outEdges(e.v,e.w)})))}function q(e,n,r,t,o){var i=o?[]:void 0;return v(e.inEdges(t.v),(function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,Y(n,r,u)})),v(e.outEdges(t.v),(function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,Y(n,r,a)})),e.removeNode(t.v),i}function Y(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function z(e){var n,r="greedy"===e.graph().acyclicer?B(e,(n=e,function(e){return n.edge(e).weight})):function(e){var n=[],r={},t={};function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,v(e.outEdges(i),(function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):o(e.w)})),delete r[i])}return v(e.nodes(),o),n}(e);v(r,(function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,S("rev"))}))}function D(e,n,r,t){var o;do{o=S(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function A(n){var r=new e({multigraph:n.isMultigraph()}).setGraph(n.graph());return v(n.nodes(),(function(e){n.children(e).length||r.setNode(e,n.node(e))})),v(n.edges(),(function(e){r.setEdge(e,n.edge(e))})),r}function U(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,d=e.width/2,c=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*d>Math.abs(a)*c?(u<0&&(c=-c),r=c*a/u,t=c):(a<0&&(d=-d),r=d,t=d*u/a),{x:o+r,y:i+t}}function J(e){var n=x(d(X(e)+1),(function(){return[]}));return v(e.nodes(),(function(r){var t=e.node(r),o=t.rank;l(o)||(n[o][t.order]=r)})),n}function W(e,n,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),D(e,"border",o,n)}function X(e){return M(x(e.nodes(),(function(n){var r=e.node(n).rank;if(!l(r))return r})))}function H(e,n){return n()}function K(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],d=D(e,"border",a,r);o[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Q(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){v(e.nodes(),(function(n){ee(e.node(n))})),v(e.edges(),(function(n){var r=e.edge(n);v(r.points,ee),Object.prototype.hasOwnProperty.call(r,"y")&&ee(r)}))}(e),"lr"!==n&&"rl"!==n||(!function(e){v(e.nodes(),(function(n){ne(e.node(n))})),v(e.edges(),(function(n){var r=e.edge(n);v(r.points,ne),Object.prototype.hasOwnProperty.call(r,"x")&&ne(r)}))}(e),Z(e))}function Z(e){v(e.nodes(),(function(n){$(e.node(n))})),v(e.edges(),(function(n){$(e.edge(n))}))}function $(e){var n=e.width;e.width=e.height,e.height=n}function ee(e){e.y=-e.y}function ne(e){var n=e.x;e.x=e.y,e.y=n}function re(e){e.graph().dummyChains=[],v(e.edges(),(function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i===t+1)return;e.removeEdge(n);var c,s,f=void 0;for(s=0,++t;t<i;++s,++t)u.points=[],c=D(e,"edge",f={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_d"),t===d&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),0===s&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}(e,n)}))}function te(e){var n={};v(e.sources(),(function r(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return o.rank;n[t]=!0;var i=k(x(e.outEdges(t),(function(n){return r(n.w)-e.edge(n).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))}function oe(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ie(n){var r,t,o=new e({directed:!1}),i=n.nodes()[0],a=n.nodeCount();for(o.setNode(i,{});ae(o,n)<a;)r=ue(o,n),t=o.hasNode(r.v)?oe(n,r):-oe(n,r),de(o,n,t);return o}function ae(e,n){return v(e.nodes(),(function r(t){v(n.nodeEdges(t),(function(o){var i=o.v,a=t===i?o.w:i;e.hasNode(a)||oe(n,o)||(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))}))})),e.nodeCount()}function ue(e,n){return L(n.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return oe(n,r)}))}function de(e,n,r){v(e.nodes(),(function(e){n.node(e).rank+=r}))}function ce(e,n,r){c(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return v(n,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);se(e,n,"post"===r,i,t,o)})),o}function se(e,n,r,t,o,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),v(o(n),(function(n){se(e,n,r,t,o,i)})),r&&i.push(n))}function fe(n){n=function(n){var r=(new e).setGraph(n.graph());return v(n.nodes(),(function(e){r.setNode(e,n.node(e))})),v(n.edges(),(function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(n),te(n);var r,t=ie(n);for(ve(t),he(t,n);r=pe(t);)me(t,n,r,we(t,n,r))}function he(e,n){var r=function(e,n){return ce(e,n,"post")}(e,e.nodes());r=r.slice(0,r.length-1),v(r,(function(r){!function(e,n,r){var t=e.node(r),o=t.parent;e.edge(r,o).cutvalue=ge(e,n,r)}(e,n,r)}))}function ge(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,v(n.nodeEdges(r),(function(i){var u,d,c=i.v===r,s=c?i.w:i.v;if(s!==t){var f=c===o,h=n.edge(i).weight;if(a+=f?h:-h,u=r,d=s,e.hasEdge(u,d)){var g=e.edge(r,s).cutvalue;a+=f?-g:g}}})),a}function ve(e,n){arguments.length<2&&(n=e.nodes()[0]),le(e,{},1,n)}function le(e,n,r,t,o){var i=r,a=e.node(t);return n[t]=!0,v(e.neighbors(t),(function(o){Object.prototype.hasOwnProperty.call(n,o)||(r=le(e,n,r,o,t))})),a.low=i,a.lim=r++,o?a.parent=o:delete a.parent,r}function pe(e){return N(e.edges(),(function(n){return e.edge(n).cutvalue<0}))}function we(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var i=e.node(t),a=e.node(o),u=i,d=!1;return i.lim>a.lim&&(u=a,d=!0),L(p(n.edges(),(function(n){return d===be(e,e.node(n.v),u)&&d!==be(e,e.node(n.w),u)})),(function(e){return oe(n,e)}))}function me(e,n,r,t){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(t.v,t.w,{}),ve(e),he(e,n),function(e,n){var r=N(e.nodes(),(function(e){return!n.node(e).parent})),t=function(e,n){return ce(e,n,"pre")}(e,r);t=t.slice(1),v(t,(function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function be(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function ye(e){switch(e.graph().ranker){case"network-simplex":default:ke(e);break;case"tight-tree":!function(e){te(e),ie(e)}(e);break;case"longest-path":xe(e)}}new Error,fe.initLowLimValues=ve,fe.initCutValues=he,fe.calcCutValue=ge,fe.leaveEdge=pe,fe.enterEdge=we,fe.exchangeEdges=me;var xe=te;function ke(e){fe(e)}function Ee(e){var n=D(e,"root",{},"_root"),r=function(e){var n={};function r(t,o){var i=e.children(t);i&&i.length&&v(i,(function(e){r(e,o+1)})),n[t]=o}return v(e.children(),(function(e){r(e,1)})),n}(e),t=M(w(r))-1,o=2*t+1;e.graph().nestingRoot=n,v(e.edges(),(function(n){e.edge(n).minlen*=o}));var i=function(e){return m(e.edges(),(function(n,r){return n+e.edge(r).weight}),0)}(e)+1;v(e.children(),(function(a){Ne(e,n,o,i,t,r,a)})),e.graph().nodeRankFactor=o}function Ne(e,n,r,t,o,i,a){var u=e.children(a);if(u.length){var d=W(e,"_bt"),c=W(e,"_bb"),s=e.node(a);e.setParent(d,a),s.borderTop=d,e.setParent(c,a),s.borderBottom=c,v(u,(function(u){Ne(e,n,r,t,o,i,u);var s=e.node(u),f=s.borderTop?s.borderTop:u,h=s.borderBottom?s.borderBottom:u,g=s.borderTop?t:2*t,v=f!==h?1:o-i[a]+1;e.setEdge(d,f,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(h,c,{weight:g,minlen:v,nestingEdge:!0})})),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:o+i[a]})}else a!==n&&e.setEdge(n,a,{weight:0,minlen:r})}function Oe(n,r,t){var o=function(e){var n;for(;e.hasNode(n=S("_root")););return n}(n),i=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return n.node(e)}));return v(n.nodes(),(function(e){var a=n.node(e),u=n.parent(e);(a.rank===r||a.minRank<=r&&r<=a.maxRank)&&(i.setNode(e),i.setParent(e,u||o),v(n[t](e),(function(r){var t=r.v===e?r.w:r.v,o=i.edge(t,e),a=l(o)?0:o.weight;i.setEdge(t,e,{weight:n.edge(r).weight+a})})),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(e,{borderLeft:a.borderLeft[r],borderRight:a.borderRight[r]}))})),i}function _e(e,n){for(var r=0,t=1;t<n.length;++t)r+=Ie(e,n[t-1],n[t]);return r}function Ie(e,n,r){for(var t,o,i=(t=r,o=x(r,(function(e,n){return n})),function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(t||[],o||[],a)),d=u(x(n,(function(n){return j(x(e.outEdges(n),(function(n){return{pos:i[n.w],weight:e.edge(n).weight}})),"pos")}))),c=1;c<r.length;)c<<=1;var s=2*c-1;c-=1;var f=x(new Array(s),(function(){return 0})),h=0;return v(d.forEach((function(e){var n=e.pos+c;f[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=f[n+1]),f[n=n-1>>1]+=e.weight;h+=e.weight*r}))),h}function Pe(e,n){var r={};return v(e,(function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};l(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)})),v(n.edges(),(function(e){var n=r[e.v],t=r[e.w];l(n)||l(t)||(t.indegree++,n.out.push(r[e.w]))})),function(e){var n=[];function r(e){return function(n){n.merged||(l(n.barycenter)||l(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight);n.weight&&(r+=n.barycenter*n.weight,t+=n.weight);e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function t(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();n.push(o),v(o.in.reverse(),r(o)),v(o.out,t(o))}return x(p(n,(function(e){return!e.merged})),(function(e){return s(e,["vs","i","barycenter","weight"])}))}(p(r,(function(e){return!e.indegree})))}function je(e,n){var r,t=function(e,n){var r={lhs:[],rhs:[]};return v(e,(function(e){n(e)?r.lhs.push(e):r.rhs.push(e)})),r}(e,(function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")})),o=t.lhs,i=j(t.rhs,(function(e){return-e.i})),a=[],d=0,c=0,s=0;o.sort((r=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:r?n.i-e.i:e.i-n.i})),s=Re(a,i,s),v(o,(function(e){s+=e.vs.length,a.push(e.vs),d+=e.barycenter*e.weight,c+=e.weight,s=Re(a,i,s)}));var f={vs:u(a)};return c&&(f.barycenter=d/c,f.weight=c),f}function Re(e,n,r){for(var t;n.length&&(t=O(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Te(e,n,r,t){var o=e.children(n),i=e.node(n),a=i?i.borderLeft:void 0,d=i?i.borderRight:void 0,c={};a&&(o=p(o,(function(e){return e!==a&&e!==d})));var s=function(e,n){return x(n,(function(n){var r=e.inEdges(n);if(r.length){var t=m(r,(function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}}),{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}}))}(e,o);v(s,(function(n){if(e.children(n.v).length){var o=Te(e,n.v,r,t);c[n.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&(a=o,l((i=n).barycenter)?(i.barycenter=a.barycenter,i.weight=a.weight):(i.barycenter=(i.barycenter*i.weight+a.barycenter*a.weight)/(i.weight+a.weight),i.weight+=a.weight))}var i,a}));var f=Pe(s,r);!function(e,n){v(e,(function(e){e.vs=u(e.vs.map((function(e){return n[e]?n[e].vs:e})))}))}(f,c);var h=je(f,t);if(a&&(h.vs=u([a,h.vs,d]),e.predecessors(a).length)){var g=e.node(e.predecessors(a)[0]),w=e.node(e.predecessors(d)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+g.order+w.order)/(h.weight+2),h.weight+=2}return h}function Me(e){var n=X(e),r=Le(e,d(1,n+1),"inEdges"),t=Le(e,d(n-1,-1,-1),"outEdges"),o=function(e){var n={},r=p(e.nodes(),(function(n){return!e.children(n).length})),t=M(x(r,(function(n){return e.node(n).rank}))),o=x(d(t+1),(function(){return[]})),i=j(r,(function(n){return e.node(n).rank}));return v(i,(function r(t){if(!E(n,t)){n[t]=!0;var i=e.node(t);o[i.rank].push(t),v(e.successors(t),r)}})),o}(e);Se(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){Ce(u%2?r:t,u%4>=2);var s=_e(e,o=J(e));s<a&&(c=0,i=h(o,5),a=s)}Se(e,i)}function Le(e,n,r){return x(n,(function(n){return Oe(e,n,r)}))}function Ce(n,r){var t=new e;v(n,(function(e){var n=e.graph().root,o=Te(e,n,t,r);v(o.vs,(function(n,r){e.node(n).order=r})),function(e,n,r){var t,o={};v(r,(function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}}))}(e,t,o.vs)}))}function Se(e,n){v(n,(function(n){v(n,(function(n,r){e.node(n).order=r}))}))}function Ge(e){var n=function(e){var n={},r=0;function t(o){var i=r;v(e.children(o),t),n[o]={low:i,lim:r++}}return v(e.children(),t),n}(e);v(e.graph().dummyChains,(function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],d=Math.min(n[r].low,n[t].low),c=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>d||c>n[o].lim));i=o,o=t;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}}))}function Ve(e,n){var r={};return m(n,(function(n,t){var o=0,i=0,a=n.length,u=O(t);return v(t,(function(n,d){var c=function(e,n){if(e.node(n).dummy)return N(e.predecessors(n),(function(n){return e.node(n).dummy}))}(e,n),s=c?e.node(c).order:a;(c||n===u)&&(v(t.slice(i,d+1),(function(n){v(e.predecessors(n),(function(t){var i=e.node(t),a=i.order;!(a<o||s<a)||i.dummy&&e.node(n).dummy||Fe(r,t,n)}))})),i=d+1,o=s)})),t})),r}function Fe(e,n,r){if(n>r){var t=n;n=r,r=t}var o=e[n];o||(e[n]=o={}),o[r]=!0}function Be(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function qe(n,r,t,o,i){var a={},u=function(n,r,t,o){var i=new e,a=n.graph(),u=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i),c=0;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=r?a:-a),a=0,c+=(u.dummy?n:e)/2,c+=(d.dummy?n:e)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(c+=r?a:-a),a=0,c}}(a.nodesep,a.edgesep,o);return v(r,(function(e){var r;v(e,(function(e){var o=t[e];if(i.setNode(o),r){var a=t[r],d=i.edge(a,o);i.setEdge(a,o,Math.max(u(n,e,r),d||0))}r=e}))})),i}(n,r,t,i),d=i?"borderLeft":"borderRight";function c(e,n){for(var r=u.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return c((function(e){a[e]=u.inEdges(e).reduce((function(e,n){return Math.max(e,a[n.v]+u.edge(n))}),0)}),u.predecessors.bind(u)),c((function(e){var r=u.outEdges(e).reduce((function(e,n){return Math.min(e,a[n.w]-u.edge(n))}),Number.POSITIVE_INFINITY),t=n.node(e);r!==Number.POSITIVE_INFINITY&&t.borderType!==d&&(a[e]=Math.max(a[e],r))}),u.successors.bind(u)),v(o,(function(e){a[e]=a[t[e]]})),a}function Ye(e,t){return L(w(t),(function(t){var o,i,a=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;return i=function(n,r){var t=function(e,n){return e.node(n).width}(e,r)/2;a=Math.max(n+t,a),u=Math.min(n-t,u)},null==(o=t)||n(o,g(i),r),a-u}))}function ze(e){var n,r=J(e),t=f(Ve(e,r),function(e,n){var r={};function t(n,t,o,i,a){var u;v(d(t,o),(function(t){u=n[t],e.node(u).dummy&&v(e.predecessors(u),(function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&Fe(r,n,u)}))}))}return m(n,(function(n,r){var o,i=-1,a=0;return v(r,(function(u,d){if("border"===e.node(u).dummy){var c=e.predecessors(u);c.length&&(o=e.node(c[0]).order,t(r,a,d,i,o),a=d,i=o)}t(r,a,r.length,o,n.length)})),r})),r}(e,r)),o={};v(["u","d"],(function(i){n="u"===i?r:w(r).reverse(),v(["l","r"],(function(r){"r"===r&&(n=x(n,(function(e){return w(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e),u=function(e,n,r,t){var o={},i={},a={};return v(n,(function(e){v(e,(function(e,n){o[e]=e,i[e]=e,a[e]=n}))})),v(n,(function(e){var n=-1;v(e,(function(e){var u=t(e);if(u.length)for(var d=((u=j(u,(function(e){return a[e]}))).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=u[c];i[e]===e&&n<a[f]&&!Be(r,e,f)&&(i[f]=e,i[e]=o[e]=o[f],n=a[f])}}))})),{root:o,align:i}}(0,n,t,a),d=qe(e,n,u.root,u.align,"r"===r);"r"===r&&(d=T(d,(function(e){return-e}))),o[i+r]=d}))}));var i=Ye(e,o);return function(e,n){var r=w(n),t=k(r),o=M(r);v(["u","d"],(function(r){v(["l","r"],(function(i){var a,u=r+i,d=e[u];if(d!==n){var c=w(d);(a="l"===i?t-k(c):o-M(c))&&(e[u]=T(d,(function(e){return e+a})))}}))}))}(o,i),function(e,n){return T(e.ul,(function(r,t){if(n)return e[n.toLowerCase()][t];var o=j(x(e,t));return(o[1]+o[2])/2}))}(o,e.graph().align)}function De(e){var n;(function(e){var n=J(e),r=e.graph().ranksep,t=0;v(n,(function(n){var o=M(x(n,(function(n){return e.node(n).height})));v(n,(function(n){e.node(n).y=t+o/2})),t+=o+r}))})(e=A(e)),n=ze(e),I(n,g((function(n,r){e.node(r).x=n})))}function Ae(n,r){var t=H;t("layout",(()=>{var r=t(" buildLayoutGraph",(()=>function(n){var r=new e({multigraph:!0,compound:!0}),t=en(n.graph());return r.setGraph(f({},Je,$e(t,Ue),s(t,We))),v(n.nodes(),(function(e){var t=en(n.node(e));r.setNode(e,_($e(t,Xe),He)),r.setParent(e,n.parent(e))})),v(n.edges(),(function(e){var t=en(n.edge(e));r.setEdge(e,f({},Qe,$e(t,Ke),s(t,Ze)))})),r}(n)));t(" runLayout",(()=>function(e,n){n(" makeSpaceForEdgeLabels",(()=>function(e){var n=e.graph();n.ranksep/=2,v(e.edges(),(function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)}))}(e))),n(" removeSelfEdges",(()=>function(e){v(e.edges(),(function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}}))}(e))),n(" acyclic",(()=>z(e))),n(" nestingGraph.run",(()=>Ee(e))),n(" rank",(()=>ye(A(e)))),n(" injectEdgeLabelProxies",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o={rank:(e.node(n.w).rank-t.rank)/2+t.rank,e:n};D(e,"edge-proxy",o,"_ep")}}))}(e))),n(" removeEmptyRanks",(()=>function(e){var n=k(x(e.nodes(),(function(n){return e.node(n).rank}))),r=[];v(e.nodes(),(function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)}));var t=0,o=e.graph().nodeRankFactor;v(r,(function(n,r){l(n)&&r%o!=0?--t:t&&v(n,(function(n){e.node(n).rank+=t}))}))}(e))),n(" nestingGraph.cleanup",(()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,v(e.edges(),(function(n){e.edge(n).nestingEdge&&e.removeEdge(n)}))}(e))),n(" normalizeRanks",(()=>function(e){var n=k(x(e.nodes(),(function(n){return e.node(n).rank})));v(e.nodes(),(function(r){var t=e.node(r);E(t,"rank")&&(t.rank-=n)}))}(e))),n(" assignRankMinMax",(()=>function(e){var n=0;v(e.nodes(),(function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=M(n,t.maxRank))})),e.graph().maxRank=n}(e))),n(" removeEdgeLabelProxies",(()=>function(e){v(e.nodes(),(function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))}))}(e))),n(" normalize.run",(()=>re(e))),n(" parentDummyChains",(()=>Ge(e))),n(" addBorderSegments",(()=>function(e){v(e.children(),(function n(r){var t=e.children(r),o=e.node(r);if(t.length&&v(t,n),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)K(e,"borderLeft","_bl",r,o,i),K(e,"borderRight","_br",r,o,i)}}))}(e))),n(" order",(()=>Me(e))),n(" insertSelfEdges",(()=>function(e){var n=J(e);v(n,(function(n){var r=0;v(n,(function(n,t){var o=e.node(n);o.order=t+r,v(o.selfEdges,(function(n){D(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")})),delete o.selfEdges}))}))}(e))),n(" adjustCoordinateSystem",(()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||Z(e)}(e))),n(" position",(()=>De(e))),n(" positionSelfEdges",(()=>function(e){v(e.nodes(),(function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}}))}(e))),n(" removeBorderNodes",(()=>function(e){v(e.nodes(),(function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(O(r.borderLeft)),a=e.node(O(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}})),v(e.nodes(),(function(n){"border"===e.node(n).dummy&&e.removeNode(n)}))}(e))),n(" normalize.undo",(()=>function(e){v(e.graph().dummyChains,(function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)}))}(e))),n(" fixupEdgeLabelCoords",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}(e))),n(" undoCoordinateSystem",(()=>Q(e))),n(" translateGraph",(()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function d(e){var i=e.x,a=e.y,u=e.width,d=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-d/2),o=Math.max(o,a+d/2)}v(e.nodes(),(function(n){d(e.node(n))})),v(e.edges(),(function(n){var r=e.edge(n);Object.prototype.hasOwnProperty.call(r,"x")&&d(r)})),n-=a,t-=u,v(e.nodes(),(function(r){var o=e.node(r);o.x-=n,o.y-=t})),v(e.edges(),(function(r){var o=e.edge(r);v(o.points,(function(e){e.x-=n,e.y-=t})),Object.prototype.hasOwnProperty.call(o,"x")&&(o.x-=n),Object.prototype.hasOwnProperty.call(o,"y")&&(o.y-=t)})),i.width=r-n+a,i.height=o-t+u}(e))),n(" assignNodeIntersects",(()=>function(e){v(e.edges(),(function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift(U(i,r)),o.points.push(U(a,t))}))}(e))),n(" reversePoints",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);r.reversed&&r.points.reverse()}))}(e))),n(" acyclic.undo",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}}))}(e)))}(r,t))),t(" updateInputGraph",(()=>function(e,n){v(e.nodes(),(function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))})),v(e.edges(),(function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)})),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(n,r)))}))}var Ue=["nodesep","edgesep","ranksep","marginx","marginy"],Je={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},We=["acyclicer","ranker","rankdir","align"],Xe=["width","height"],He={width:0,height:0},Ke=["minlen","weight","width","height","labeloffset"],Qe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ze=["labelpos"];function $e(e,n){return T(s(e,n),Number)}function en(e){var n={};return v(e,(function(e,r){n[r.toLowerCase()]=e})),n}export{Ae as l};
|
|
1
|
+
import{G as e}from"./graph-DNcCME-7.js";import{cd as n,bM as r,cT as t,aj as o,cU as i,cM as a,cV as u,cW as d,ah as c,cX as s,cY as f}from"./index-dpqyqZ9J.js";import{b as h,e as g,c as v,i as l,f as p,v as w,r as m}from"./_baseUniq-DkAXs6-8.js";import{b,a as y,m as x,c as k,h as E,f as N,l as O,d as _}from"./min-Lg8ibOwg.js";import{c as I,a as P}from"./_baseEach-DKWVPuqo.js";import{s as j}from"./sortBy-DcXIDfdq.js";function R(e,n){return e>n}function T(e,n){var r={};return n=P(n),I(e,(function(e,o,i){t(r,o,n(e,o,i))})),r}function M(e){return e&&e.length?b(e,o,R):void 0}function L(e,n){return e&&e.length?b(e,P(n),y):void 0}var C=0;function S(e){var n=++C;return i(e)+n}class G{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return V(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&V(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,F)),r=r._prev;return"["+e.join(", ")+"]"}}function V(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function F(e,n){if("_next"!==e&&"_prev"!==e)return n}function B(n,r){if(n.nodeCount()<=1)return[];var t=function(n,r){var t=new e,o=0,i=0;v(n.nodes(),(function(e){t.setNode(e,{v:e,in:0,out:0})})),v(n.edges(),(function(e){var n=t.edge(e.v,e.w)||0,a=r(e),u=n+a;t.setEdge(e.v,e.w,u),i=Math.max(i,t.node(e.v).out+=a),o=Math.max(o,t.node(e.w).in+=a)}));var a=d(i+o+3).map((function(){return new G})),u=o+1;return v(t.nodes(),(function(e){Y(a,u,t.node(e))})),{graph:t,buckets:a,zeroIdx:u}}(n,r),o=function(e,n,r){var t,o=[],i=n[n.length-1],a=n[0];for(;e.nodeCount();){for(;t=a.dequeue();)q(e,n,r,t);for(;t=i.dequeue();)q(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(q(e,n,r,t,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return u(x(o,(function(e){return n.outEdges(e.v,e.w)})))}function q(e,n,r,t,o){var i=o?[]:void 0;return v(e.inEdges(t.v),(function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,Y(n,r,u)})),v(e.outEdges(t.v),(function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,Y(n,r,a)})),e.removeNode(t.v),i}function Y(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function z(e){var n,r="greedy"===e.graph().acyclicer?B(e,(n=e,function(e){return n.edge(e).weight})):function(e){var n=[],r={},t={};function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,v(e.outEdges(i),(function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):o(e.w)})),delete r[i])}return v(e.nodes(),o),n}(e);v(r,(function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,S("rev"))}))}function D(e,n,r,t){var o;do{o=S(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function A(n){var r=new e({multigraph:n.isMultigraph()}).setGraph(n.graph());return v(n.nodes(),(function(e){n.children(e).length||r.setNode(e,n.node(e))})),v(n.edges(),(function(e){r.setEdge(e,n.edge(e))})),r}function U(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,d=e.width/2,c=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*d>Math.abs(a)*c?(u<0&&(c=-c),r=c*a/u,t=c):(a<0&&(d=-d),r=d,t=d*u/a),{x:o+r,y:i+t}}function J(e){var n=x(d(X(e)+1),(function(){return[]}));return v(e.nodes(),(function(r){var t=e.node(r),o=t.rank;l(o)||(n[o][t.order]=r)})),n}function W(e,n,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),D(e,"border",o,n)}function X(e){return M(x(e.nodes(),(function(n){var r=e.node(n).rank;if(!l(r))return r})))}function H(e,n){return n()}function K(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],d=D(e,"border",a,r);o[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Q(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){v(e.nodes(),(function(n){ee(e.node(n))})),v(e.edges(),(function(n){var r=e.edge(n);v(r.points,ee),Object.prototype.hasOwnProperty.call(r,"y")&&ee(r)}))}(e),"lr"!==n&&"rl"!==n||(!function(e){v(e.nodes(),(function(n){ne(e.node(n))})),v(e.edges(),(function(n){var r=e.edge(n);v(r.points,ne),Object.prototype.hasOwnProperty.call(r,"x")&&ne(r)}))}(e),Z(e))}function Z(e){v(e.nodes(),(function(n){$(e.node(n))})),v(e.edges(),(function(n){$(e.edge(n))}))}function $(e){var n=e.width;e.width=e.height,e.height=n}function ee(e){e.y=-e.y}function ne(e){var n=e.x;e.x=e.y,e.y=n}function re(e){e.graph().dummyChains=[],v(e.edges(),(function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i===t+1)return;e.removeEdge(n);var c,s,f=void 0;for(s=0,++t;t<i;++s,++t)u.points=[],c=D(e,"edge",f={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_d"),t===d&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),0===s&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}(e,n)}))}function te(e){var n={};v(e.sources(),(function r(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return o.rank;n[t]=!0;var i=k(x(e.outEdges(t),(function(n){return r(n.w)-e.edge(n).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))}function oe(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ie(n){var r,t,o=new e({directed:!1}),i=n.nodes()[0],a=n.nodeCount();for(o.setNode(i,{});ae(o,n)<a;)r=ue(o,n),t=o.hasNode(r.v)?oe(n,r):-oe(n,r),de(o,n,t);return o}function ae(e,n){return v(e.nodes(),(function r(t){v(n.nodeEdges(t),(function(o){var i=o.v,a=t===i?o.w:i;e.hasNode(a)||oe(n,o)||(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))}))})),e.nodeCount()}function ue(e,n){return L(n.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return oe(n,r)}))}function de(e,n,r){v(e.nodes(),(function(e){n.node(e).rank+=r}))}function ce(e,n,r){c(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return v(n,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);se(e,n,"post"===r,i,t,o)})),o}function se(e,n,r,t,o,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),v(o(n),(function(n){se(e,n,r,t,o,i)})),r&&i.push(n))}function fe(n){n=function(n){var r=(new e).setGraph(n.graph());return v(n.nodes(),(function(e){r.setNode(e,n.node(e))})),v(n.edges(),(function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(n),te(n);var r,t=ie(n);for(ve(t),he(t,n);r=pe(t);)me(t,n,r,we(t,n,r))}function he(e,n){var r=function(e,n){return ce(e,n,"post")}(e,e.nodes());r=r.slice(0,r.length-1),v(r,(function(r){!function(e,n,r){var t=e.node(r),o=t.parent;e.edge(r,o).cutvalue=ge(e,n,r)}(e,n,r)}))}function ge(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,v(n.nodeEdges(r),(function(i){var u,d,c=i.v===r,s=c?i.w:i.v;if(s!==t){var f=c===o,h=n.edge(i).weight;if(a+=f?h:-h,u=r,d=s,e.hasEdge(u,d)){var g=e.edge(r,s).cutvalue;a+=f?-g:g}}})),a}function ve(e,n){arguments.length<2&&(n=e.nodes()[0]),le(e,{},1,n)}function le(e,n,r,t,o){var i=r,a=e.node(t);return n[t]=!0,v(e.neighbors(t),(function(o){Object.prototype.hasOwnProperty.call(n,o)||(r=le(e,n,r,o,t))})),a.low=i,a.lim=r++,o?a.parent=o:delete a.parent,r}function pe(e){return N(e.edges(),(function(n){return e.edge(n).cutvalue<0}))}function we(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var i=e.node(t),a=e.node(o),u=i,d=!1;return i.lim>a.lim&&(u=a,d=!0),L(p(n.edges(),(function(n){return d===be(e,e.node(n.v),u)&&d!==be(e,e.node(n.w),u)})),(function(e){return oe(n,e)}))}function me(e,n,r,t){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(t.v,t.w,{}),ve(e),he(e,n),function(e,n){var r=N(e.nodes(),(function(e){return!n.node(e).parent})),t=function(e,n){return ce(e,n,"pre")}(e,r);t=t.slice(1),v(t,(function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function be(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function ye(e){switch(e.graph().ranker){case"network-simplex":default:ke(e);break;case"tight-tree":!function(e){te(e),ie(e)}(e);break;case"longest-path":xe(e)}}new Error,fe.initLowLimValues=ve,fe.initCutValues=he,fe.calcCutValue=ge,fe.leaveEdge=pe,fe.enterEdge=we,fe.exchangeEdges=me;var xe=te;function ke(e){fe(e)}function Ee(e){var n=D(e,"root",{},"_root"),r=function(e){var n={};function r(t,o){var i=e.children(t);i&&i.length&&v(i,(function(e){r(e,o+1)})),n[t]=o}return v(e.children(),(function(e){r(e,1)})),n}(e),t=M(w(r))-1,o=2*t+1;e.graph().nestingRoot=n,v(e.edges(),(function(n){e.edge(n).minlen*=o}));var i=function(e){return m(e.edges(),(function(n,r){return n+e.edge(r).weight}),0)}(e)+1;v(e.children(),(function(a){Ne(e,n,o,i,t,r,a)})),e.graph().nodeRankFactor=o}function Ne(e,n,r,t,o,i,a){var u=e.children(a);if(u.length){var d=W(e,"_bt"),c=W(e,"_bb"),s=e.node(a);e.setParent(d,a),s.borderTop=d,e.setParent(c,a),s.borderBottom=c,v(u,(function(u){Ne(e,n,r,t,o,i,u);var s=e.node(u),f=s.borderTop?s.borderTop:u,h=s.borderBottom?s.borderBottom:u,g=s.borderTop?t:2*t,v=f!==h?1:o-i[a]+1;e.setEdge(d,f,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(h,c,{weight:g,minlen:v,nestingEdge:!0})})),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:o+i[a]})}else a!==n&&e.setEdge(n,a,{weight:0,minlen:r})}function Oe(n,r,t){var o=function(e){var n;for(;e.hasNode(n=S("_root")););return n}(n),i=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return n.node(e)}));return v(n.nodes(),(function(e){var a=n.node(e),u=n.parent(e);(a.rank===r||a.minRank<=r&&r<=a.maxRank)&&(i.setNode(e),i.setParent(e,u||o),v(n[t](e),(function(r){var t=r.v===e?r.w:r.v,o=i.edge(t,e),a=l(o)?0:o.weight;i.setEdge(t,e,{weight:n.edge(r).weight+a})})),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(e,{borderLeft:a.borderLeft[r],borderRight:a.borderRight[r]}))})),i}function _e(e,n){for(var r=0,t=1;t<n.length;++t)r+=Ie(e,n[t-1],n[t]);return r}function Ie(e,n,r){for(var t,o,i=(t=r,o=x(r,(function(e,n){return n})),function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(t||[],o||[],a)),d=u(x(n,(function(n){return j(x(e.outEdges(n),(function(n){return{pos:i[n.w],weight:e.edge(n).weight}})),"pos")}))),c=1;c<r.length;)c<<=1;var s=2*c-1;c-=1;var f=x(new Array(s),(function(){return 0})),h=0;return v(d.forEach((function(e){var n=e.pos+c;f[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=f[n+1]),f[n=n-1>>1]+=e.weight;h+=e.weight*r}))),h}function Pe(e,n){var r={};return v(e,(function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};l(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)})),v(n.edges(),(function(e){var n=r[e.v],t=r[e.w];l(n)||l(t)||(t.indegree++,n.out.push(r[e.w]))})),function(e){var n=[];function r(e){return function(n){n.merged||(l(n.barycenter)||l(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight);n.weight&&(r+=n.barycenter*n.weight,t+=n.weight);e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function t(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();n.push(o),v(o.in.reverse(),r(o)),v(o.out,t(o))}return x(p(n,(function(e){return!e.merged})),(function(e){return s(e,["vs","i","barycenter","weight"])}))}(p(r,(function(e){return!e.indegree})))}function je(e,n){var r,t=function(e,n){var r={lhs:[],rhs:[]};return v(e,(function(e){n(e)?r.lhs.push(e):r.rhs.push(e)})),r}(e,(function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")})),o=t.lhs,i=j(t.rhs,(function(e){return-e.i})),a=[],d=0,c=0,s=0;o.sort((r=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:r?n.i-e.i:e.i-n.i})),s=Re(a,i,s),v(o,(function(e){s+=e.vs.length,a.push(e.vs),d+=e.barycenter*e.weight,c+=e.weight,s=Re(a,i,s)}));var f={vs:u(a)};return c&&(f.barycenter=d/c,f.weight=c),f}function Re(e,n,r){for(var t;n.length&&(t=O(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Te(e,n,r,t){var o=e.children(n),i=e.node(n),a=i?i.borderLeft:void 0,d=i?i.borderRight:void 0,c={};a&&(o=p(o,(function(e){return e!==a&&e!==d})));var s=function(e,n){return x(n,(function(n){var r=e.inEdges(n);if(r.length){var t=m(r,(function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}}),{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}}))}(e,o);v(s,(function(n){if(e.children(n.v).length){var o=Te(e,n.v,r,t);c[n.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&(a=o,l((i=n).barycenter)?(i.barycenter=a.barycenter,i.weight=a.weight):(i.barycenter=(i.barycenter*i.weight+a.barycenter*a.weight)/(i.weight+a.weight),i.weight+=a.weight))}var i,a}));var f=Pe(s,r);!function(e,n){v(e,(function(e){e.vs=u(e.vs.map((function(e){return n[e]?n[e].vs:e})))}))}(f,c);var h=je(f,t);if(a&&(h.vs=u([a,h.vs,d]),e.predecessors(a).length)){var g=e.node(e.predecessors(a)[0]),w=e.node(e.predecessors(d)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+g.order+w.order)/(h.weight+2),h.weight+=2}return h}function Me(e){var n=X(e),r=Le(e,d(1,n+1),"inEdges"),t=Le(e,d(n-1,-1,-1),"outEdges"),o=function(e){var n={},r=p(e.nodes(),(function(n){return!e.children(n).length})),t=M(x(r,(function(n){return e.node(n).rank}))),o=x(d(t+1),(function(){return[]})),i=j(r,(function(n){return e.node(n).rank}));return v(i,(function r(t){if(!E(n,t)){n[t]=!0;var i=e.node(t);o[i.rank].push(t),v(e.successors(t),r)}})),o}(e);Se(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){Ce(u%2?r:t,u%4>=2);var s=_e(e,o=J(e));s<a&&(c=0,i=h(o,5),a=s)}Se(e,i)}function Le(e,n,r){return x(n,(function(n){return Oe(e,n,r)}))}function Ce(n,r){var t=new e;v(n,(function(e){var n=e.graph().root,o=Te(e,n,t,r);v(o.vs,(function(n,r){e.node(n).order=r})),function(e,n,r){var t,o={};v(r,(function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}}))}(e,t,o.vs)}))}function Se(e,n){v(n,(function(n){v(n,(function(n,r){e.node(n).order=r}))}))}function Ge(e){var n=function(e){var n={},r=0;function t(o){var i=r;v(e.children(o),t),n[o]={low:i,lim:r++}}return v(e.children(),t),n}(e);v(e.graph().dummyChains,(function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],d=Math.min(n[r].low,n[t].low),c=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>d||c>n[o].lim));i=o,o=t;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}}))}function Ve(e,n){var r={};return m(n,(function(n,t){var o=0,i=0,a=n.length,u=O(t);return v(t,(function(n,d){var c=function(e,n){if(e.node(n).dummy)return N(e.predecessors(n),(function(n){return e.node(n).dummy}))}(e,n),s=c?e.node(c).order:a;(c||n===u)&&(v(t.slice(i,d+1),(function(n){v(e.predecessors(n),(function(t){var i=e.node(t),a=i.order;!(a<o||s<a)||i.dummy&&e.node(n).dummy||Fe(r,t,n)}))})),i=d+1,o=s)})),t})),r}function Fe(e,n,r){if(n>r){var t=n;n=r,r=t}var o=e[n];o||(e[n]=o={}),o[r]=!0}function Be(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function qe(n,r,t,o,i){var a={},u=function(n,r,t,o){var i=new e,a=n.graph(),u=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i),c=0;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=r?a:-a),a=0,c+=(u.dummy?n:e)/2,c+=(d.dummy?n:e)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(c+=r?a:-a),a=0,c}}(a.nodesep,a.edgesep,o);return v(r,(function(e){var r;v(e,(function(e){var o=t[e];if(i.setNode(o),r){var a=t[r],d=i.edge(a,o);i.setEdge(a,o,Math.max(u(n,e,r),d||0))}r=e}))})),i}(n,r,t,i),d=i?"borderLeft":"borderRight";function c(e,n){for(var r=u.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return c((function(e){a[e]=u.inEdges(e).reduce((function(e,n){return Math.max(e,a[n.v]+u.edge(n))}),0)}),u.predecessors.bind(u)),c((function(e){var r=u.outEdges(e).reduce((function(e,n){return Math.min(e,a[n.w]-u.edge(n))}),Number.POSITIVE_INFINITY),t=n.node(e);r!==Number.POSITIVE_INFINITY&&t.borderType!==d&&(a[e]=Math.max(a[e],r))}),u.successors.bind(u)),v(o,(function(e){a[e]=a[t[e]]})),a}function Ye(e,t){return L(w(t),(function(t){var o,i,a=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;return i=function(n,r){var t=function(e,n){return e.node(n).width}(e,r)/2;a=Math.max(n+t,a),u=Math.min(n-t,u)},null==(o=t)||n(o,g(i),r),a-u}))}function ze(e){var n,r=J(e),t=f(Ve(e,r),function(e,n){var r={};function t(n,t,o,i,a){var u;v(d(t,o),(function(t){u=n[t],e.node(u).dummy&&v(e.predecessors(u),(function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&Fe(r,n,u)}))}))}return m(n,(function(n,r){var o,i=-1,a=0;return v(r,(function(u,d){if("border"===e.node(u).dummy){var c=e.predecessors(u);c.length&&(o=e.node(c[0]).order,t(r,a,d,i,o),a=d,i=o)}t(r,a,r.length,o,n.length)})),r})),r}(e,r)),o={};v(["u","d"],(function(i){n="u"===i?r:w(r).reverse(),v(["l","r"],(function(r){"r"===r&&(n=x(n,(function(e){return w(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e),u=function(e,n,r,t){var o={},i={},a={};return v(n,(function(e){v(e,(function(e,n){o[e]=e,i[e]=e,a[e]=n}))})),v(n,(function(e){var n=-1;v(e,(function(e){var u=t(e);if(u.length)for(var d=((u=j(u,(function(e){return a[e]}))).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=u[c];i[e]===e&&n<a[f]&&!Be(r,e,f)&&(i[f]=e,i[e]=o[e]=o[f],n=a[f])}}))})),{root:o,align:i}}(0,n,t,a),d=qe(e,n,u.root,u.align,"r"===r);"r"===r&&(d=T(d,(function(e){return-e}))),o[i+r]=d}))}));var i=Ye(e,o);return function(e,n){var r=w(n),t=k(r),o=M(r);v(["u","d"],(function(r){v(["l","r"],(function(i){var a,u=r+i,d=e[u];if(d!==n){var c=w(d);(a="l"===i?t-k(c):o-M(c))&&(e[u]=T(d,(function(e){return e+a})))}}))}))}(o,i),function(e,n){return T(e.ul,(function(r,t){if(n)return e[n.toLowerCase()][t];var o=j(x(e,t));return(o[1]+o[2])/2}))}(o,e.graph().align)}function De(e){var n;(function(e){var n=J(e),r=e.graph().ranksep,t=0;v(n,(function(n){var o=M(x(n,(function(n){return e.node(n).height})));v(n,(function(n){e.node(n).y=t+o/2})),t+=o+r}))})(e=A(e)),n=ze(e),I(n,g((function(n,r){e.node(r).x=n})))}function Ae(n,r){var t=H;t("layout",(()=>{var r=t(" buildLayoutGraph",(()=>function(n){var r=new e({multigraph:!0,compound:!0}),t=en(n.graph());return r.setGraph(f({},Je,$e(t,Ue),s(t,We))),v(n.nodes(),(function(e){var t=en(n.node(e));r.setNode(e,_($e(t,Xe),He)),r.setParent(e,n.parent(e))})),v(n.edges(),(function(e){var t=en(n.edge(e));r.setEdge(e,f({},Qe,$e(t,Ke),s(t,Ze)))})),r}(n)));t(" runLayout",(()=>function(e,n){n(" makeSpaceForEdgeLabels",(()=>function(e){var n=e.graph();n.ranksep/=2,v(e.edges(),(function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)}))}(e))),n(" removeSelfEdges",(()=>function(e){v(e.edges(),(function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}}))}(e))),n(" acyclic",(()=>z(e))),n(" nestingGraph.run",(()=>Ee(e))),n(" rank",(()=>ye(A(e)))),n(" injectEdgeLabelProxies",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o={rank:(e.node(n.w).rank-t.rank)/2+t.rank,e:n};D(e,"edge-proxy",o,"_ep")}}))}(e))),n(" removeEmptyRanks",(()=>function(e){var n=k(x(e.nodes(),(function(n){return e.node(n).rank}))),r=[];v(e.nodes(),(function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)}));var t=0,o=e.graph().nodeRankFactor;v(r,(function(n,r){l(n)&&r%o!=0?--t:t&&v(n,(function(n){e.node(n).rank+=t}))}))}(e))),n(" nestingGraph.cleanup",(()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,v(e.edges(),(function(n){e.edge(n).nestingEdge&&e.removeEdge(n)}))}(e))),n(" normalizeRanks",(()=>function(e){var n=k(x(e.nodes(),(function(n){return e.node(n).rank})));v(e.nodes(),(function(r){var t=e.node(r);E(t,"rank")&&(t.rank-=n)}))}(e))),n(" assignRankMinMax",(()=>function(e){var n=0;v(e.nodes(),(function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=M(n,t.maxRank))})),e.graph().maxRank=n}(e))),n(" removeEdgeLabelProxies",(()=>function(e){v(e.nodes(),(function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))}))}(e))),n(" normalize.run",(()=>re(e))),n(" parentDummyChains",(()=>Ge(e))),n(" addBorderSegments",(()=>function(e){v(e.children(),(function n(r){var t=e.children(r),o=e.node(r);if(t.length&&v(t,n),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)K(e,"borderLeft","_bl",r,o,i),K(e,"borderRight","_br",r,o,i)}}))}(e))),n(" order",(()=>Me(e))),n(" insertSelfEdges",(()=>function(e){var n=J(e);v(n,(function(n){var r=0;v(n,(function(n,t){var o=e.node(n);o.order=t+r,v(o.selfEdges,(function(n){D(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")})),delete o.selfEdges}))}))}(e))),n(" adjustCoordinateSystem",(()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||Z(e)}(e))),n(" position",(()=>De(e))),n(" positionSelfEdges",(()=>function(e){v(e.nodes(),(function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}}))}(e))),n(" removeBorderNodes",(()=>function(e){v(e.nodes(),(function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(O(r.borderLeft)),a=e.node(O(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}})),v(e.nodes(),(function(n){"border"===e.node(n).dummy&&e.removeNode(n)}))}(e))),n(" normalize.undo",(()=>function(e){v(e.graph().dummyChains,(function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)}))}(e))),n(" fixupEdgeLabelCoords",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}(e))),n(" undoCoordinateSystem",(()=>Q(e))),n(" translateGraph",(()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function d(e){var i=e.x,a=e.y,u=e.width,d=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-d/2),o=Math.max(o,a+d/2)}v(e.nodes(),(function(n){d(e.node(n))})),v(e.edges(),(function(n){var r=e.edge(n);Object.prototype.hasOwnProperty.call(r,"x")&&d(r)})),n-=a,t-=u,v(e.nodes(),(function(r){var o=e.node(r);o.x-=n,o.y-=t})),v(e.edges(),(function(r){var o=e.edge(r);v(o.points,(function(e){e.x-=n,e.y-=t})),Object.prototype.hasOwnProperty.call(o,"x")&&(o.x-=n),Object.prototype.hasOwnProperty.call(o,"y")&&(o.y-=t)})),i.width=r-n+a,i.height=o-t+u}(e))),n(" assignNodeIntersects",(()=>function(e){v(e.edges(),(function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift(U(i,r)),o.points.push(U(a,t))}))}(e))),n(" reversePoints",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);r.reversed&&r.points.reverse()}))}(e))),n(" acyclic.undo",(()=>function(e){v(e.edges(),(function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}}))}(e)))}(r,t))),t(" updateInputGraph",(()=>function(e,n){v(e.nodes(),(function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))})),v(e.edges(),(function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)})),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(n,r)))}))}var Ue=["nodesep","edgesep","ranksep","marginx","marginy"],Je={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},We=["acyclicer","ranker","rankdir","align"],Xe=["width","height"],He={width:0,height:0},Ke=["minlen","weight","width","height","labeloffset"],Qe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ze=["labelpos"];function $e(e,n){return T(s(e,n),Number)}function en(e){var n={};return v(e,(function(e,r){n[r.toLowerCase()]=e})),n}export{Ae as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as n,y as r,z as t,A as e,B as a}from"./step-CaHXtLdi.js";import{bi as i,ce as u,bj as o,cf as c,cg as f,ch as s,ci as l,cj as h,ck as p,cl as m,cm as g}from"./index-
|
|
1
|
+
import{x as n,y as r,z as t,A as e,B as a}from"./step-CaHXtLdi.js";import{bi as i,ce as u,bj as o,cf as c,cg as f,ch as s,ci as l,cj as h,ck as p,cl as m,cm as g}from"./index-dpqyqZ9J.js";import{i as v}from"./init-DLRA0X12.js";function y(n){return null===n?NaN:+n}function*M(n,r){if(void 0===r)for(let t of n)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(let e of n)null!=(e=r(e,++t,n))&&(e=+e)>=e&&(yield e)}}const N=i(u),b=N.right,d=N.left;function w(n,r){r||(r=[]);var t,e=n?Math.min(r.length,n.length):0,a=r.slice();return function(i){for(t=0;t<e;++t)a[t]=n[t]*(1-i)+r[t]*i;return a}}function A(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function k(n,r){return(A(r)?w:j)(n,r)}function j(n,r){var t,e=r?r.length:0,a=n?Math.min(e,n.length):0,i=new Array(a),u=new Array(e);for(t=0;t<a;++t)i[t]=B(n[t],r[t]);for(;t<e;++t)u[t]=r[t];return function(n){for(t=0;t<a;++t)u[t]=i[t](n);return u}}function x(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function D(n,r){var t,e={},a={};for(t in null!==n&&"object"==typeof n||(n={}),null!==r&&"object"==typeof r||(r={}),r)t in n?e[t]=B(n[t],r[t]):a[t]=r[t];return function(n){for(t in e)a[t]=e[t](n);return a}}function B(i,u){var o,c=typeof u;return null==u||"boolean"===c?n(u):("number"===c?r:"string"===c?(o=t(u))?(u=o,e):a:u instanceof t?e:u instanceof Date?x:A(u)?w:Array.isArray(u)?j:"function"!=typeof u.valueOf&&"function"!=typeof u.toString||isNaN(u)?D:r)(i,u)}function V(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function q(n){return+n}i(y).center;var z=[0,1];function F(n){return n}function O(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:(t=isNaN(r)?NaN:.5,function(){return t});var t}function R(n,r,t){var e=n[0],a=n[1],i=r[0],u=r[1];return a<e?(e=O(a,e),i=t(u,i)):(e=O(e,a),i=t(i,u)),function(n){return i(e(n))}}function S(n,r,t){var e=Math.min(n.length,r.length)-1,a=new Array(e),i=new Array(e),u=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++u<e;)a[u]=O(n[u],n[u+1]),i[u]=t(r[u],r[u+1]);return function(r){var t=b(n,r,1,e)-1;return i[t](a[t](r))}}function T(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function C(){var n,t,e,a,i,u,o=z,c=z,f=B,s=F;function l(){var n,r,t,e=Math.min(o.length,c.length);return s!==F&&(n=o[0],r=o[e-1],n>r&&(t=n,n=r,r=t),s=function(t){return Math.max(n,Math.min(r,t))}),a=e>2?S:R,i=u=null,h}function h(r){return null==r||isNaN(r=+r)?e:(i||(i=a(o.map(n),c,f)))(n(s(r)))}return h.invert=function(e){return s(t((u||(u=a(c,o.map(n),r)))(e)))},h.domain=function(n){return arguments.length?(o=Array.from(n,q),l()):o.slice()},h.range=function(n){return arguments.length?(c=Array.from(n),l()):c.slice()},h.rangeRound=function(n){return c=Array.from(n),f=V,l()},h.clamp=function(n){return arguments.length?(s=!!n||F,l()):s!==F},h.interpolate=function(n){return arguments.length?(f=n,l()):f},h.unknown=function(n){return arguments.length?(e=n,h):e},function(r,e){return n=r,t=e,l()}}function E(){return C()(F,F)}function G(n,r,t,e){var a,i=o(n,r,t);switch((e=c(null==e?",f":e)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(r));return null!=e.precision||isNaN(a=l(i,u))||(e.precision=a),h(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=s(i,Math.max(Math.abs(n),Math.abs(r))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=f(i))||(e.precision=a-2*("%"===e.type))}return p(e)}function H(n){var r=n.domain;return n.ticks=function(n){var t=r();return m(t[0],t[t.length-1],null==n?10:n)},n.tickFormat=function(n,t){var e=r();return G(e[0],e[e.length-1],null==n?10:n,t)},n.nice=function(t){null==t&&(t=10);var e,a,i=r(),u=0,o=i.length-1,c=i[u],f=i[o],s=10;for(f<c&&(a=c,c=f,f=a,a=u,u=o,o=a);s-- >0;){if((a=g(c,f,t))===e)return i[u]=c,i[o]=f,r(i);if(a>0)c=Math.floor(c/a)*a,f=Math.ceil(f/a)*a;else{if(!(a<0))break;c=Math.ceil(c*a)/a,f=Math.floor(f*a)/a}e=a}return n},n}function I(){var n=E();return n.copy=function(){return T(n,I())},v.apply(n,arguments),H(n)}export{T as a,y as b,E as c,k as d,x as e,w as f,V as g,q as h,B as i,H as j,F as k,I as l,b as m,M as n,D as o,G as p,d as q,C as t};
|