@marimo-team/frontend 0.11.6-dev0 → 0.11.6-dev3

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.
Files changed (86) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-BJrsb2v-.js → ConnectedDataExplorerComponent-BKW0VVLp.js} +1 -1
  2. package/dist/assets/{VegaLite-DrlJbHmX.js → VegaLite-By_E-0eL.js} +1 -1
  3. package/dist/assets/{_baseEach-ikVNrrLw.js → _baseEach-DF2lMatG.js} +1 -1
  4. package/dist/assets/_baseMap-BlK-P_Bv.js +1 -0
  5. package/dist/assets/{_baseUniq-D8AYVFBF.js → _baseUniq-PgltSSM2.js} +1 -1
  6. package/dist/assets/{any-language-editor-DsuJVX2F.js → any-language-editor-Cf2XEEN0.js} +1 -1
  7. package/dist/assets/{architectureDiagram-UYN6MBPD-gjHWb4HP.js → architectureDiagram-UYN6MBPD-BQEIECau.js} +1 -1
  8. package/dist/assets/{blockDiagram-ZHA2E4KO-Da_cm_Lz.js → blockDiagram-ZHA2E4KO-zy9Jpss7.js} +1 -1
  9. package/dist/assets/{c4Diagram-6F5ED5ID-BKElWxn9.js → c4Diagram-6F5ED5ID-DxgLMHQF.js} +1 -1
  10. package/dist/assets/channel-CkyO4pwN.js +1 -0
  11. package/dist/assets/{chunk-5HRBRIJM-BlvQGEtM.js → chunk-5HRBRIJM-C8b1q02j.js} +1 -1
  12. package/dist/assets/{chunk-7U56Z5CX-DhXpR1Ob.js → chunk-7U56Z5CX-CMnWW1Q5.js} +1 -1
  13. package/dist/assets/{chunk-ASOPGD6M-CS9ifOFb.js → chunk-ASOPGD6M-BjDNxzq7.js} +1 -1
  14. package/dist/assets/{chunk-KFBOBJHC-CNDlgoVP.js → chunk-KFBOBJHC-CKNjePvk.js} +1 -1
  15. package/dist/assets/{chunk-T2TOU4HS-Dpq3Xriq.js → chunk-T2TOU4HS-DsKgt2ZA.js} +1 -1
  16. package/dist/assets/{chunk-TMUBEWPD-CB-Xz4Au.js → chunk-TMUBEWPD-Chlga08K.js} +1 -1
  17. package/dist/assets/classDiagram-LNE6IOMH-DfQbr5HY.js +1 -0
  18. package/dist/assets/classDiagram-v2-MQ7JQ4JX-DfQbr5HY.js +1 -0
  19. package/dist/assets/clone-JnMG0QEx.js +1 -0
  20. package/dist/assets/{compile-D61BeNWL.js → compile-DyqDLFuZ.js} +1 -1
  21. package/dist/assets/{createWsUrl-DpnvBbzH.js → createWsUrl-RJs09Kmj.js} +1 -1
  22. package/dist/assets/{dagre-4EVJKHTY-ucsdD4Ki.js → dagre-4EVJKHTY-DhkjMkul.js} +1 -1
  23. package/dist/assets/{data-editor-CTi2Cxz_.js → data-editor-CpXZg-C-.js} +1 -1
  24. package/dist/assets/{diagram-QW4FP2JN-f4OWMKJJ.js → diagram-QW4FP2JN-DGrGdkZp.js} +1 -1
  25. package/dist/assets/{edit-page-vmd73V0q.js → edit-page-D7OY_9v5.js} +3 -3
  26. package/dist/assets/{erDiagram-6RL3IURR-BEXFtPrF.js → erDiagram-6RL3IURR-CEdwoQP2.js} +1 -1
  27. package/dist/assets/{flowDiagram-7ASYPVHJ-CRrfhNb2.js → flowDiagram-7ASYPVHJ-DZ5FvSEM.js} +1 -1
  28. package/dist/assets/{ganttDiagram-NTVNEXSI-BYkYuzH2.js → ganttDiagram-NTVNEXSI-BIDl85YD.js} +1 -1
  29. package/dist/assets/{gitGraph-YCYPL57B-C0ELKjxQ.js → gitGraph-YCYPL57B-04U27GVQ.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-NRZ2UAAF-DbmCpzdy.js → gitGraphDiagram-NRZ2UAAF-DDpT7UJU.js} +1 -1
  31. package/dist/assets/{graph-PvsVbbr9.js → graph-BaBU5kNK.js} +1 -1
  32. package/dist/assets/{home-page-BelELDaD.js → home-page-CCSaKt1C.js} +1 -1
  33. package/dist/assets/{index-CzwnDfXo.js → index-6rsTvEWg.js} +1 -1
  34. package/dist/assets/{index-CXDHEAmJ.js → index-A6Pbcks5.js} +1 -1
  35. package/dist/assets/{index-C0gXqa2q.js → index-B8D-eVPw.js} +1 -1
  36. package/dist/assets/{index-C3qTzOa8.js → index-BYPIi4Aa.js} +1 -1
  37. package/dist/assets/{index-DZrkXrhT.js → index-BnYzd2X3.js} +1 -1
  38. package/dist/assets/{index-CMbTVupo.js → index-C-111bQw.js} +1 -1
  39. package/dist/assets/{index-xpLznwFl.js → index-Ca7eaXdk.js} +1 -1
  40. package/dist/assets/{index-Cu-10zyB.js → index-CaCDIPhE.js} +1 -1
  41. package/dist/assets/{index-ORMsHVHM.js → index-Ccv4W_Bg.js} +1 -1
  42. package/dist/assets/{index-eW7-iZ6a.js → index-D7v8RQc-.js} +1 -1
  43. package/dist/assets/{index-GK0MZKTa.js → index-DFmYBu3Y.js} +1 -1
  44. package/dist/assets/{index-bG0_pxp0.js → index-DgK5Iajq.js} +1 -1
  45. package/dist/assets/{index-DA_9Xzp8.js → index-bBRIUKAN.js} +4 -4
  46. package/dist/assets/{index-DlrP6U0N.js → index-jSLzHFVU.js} +1 -1
  47. package/dist/assets/{index-CYIVhoC4.js → index-sUOTmutM.js} +1 -1
  48. package/dist/assets/{index-sf0HoURo.js → index-xxpjQ2lI.js} +1 -1
  49. package/dist/assets/{index-BuEJmS9O.js → index-yUr0bKOa.js} +1 -1
  50. package/dist/assets/{infoDiagram-A4XQUW5V-Cyc4cIVC.js → infoDiagram-A4XQUW5V-CQ_gqUgb.js} +1 -1
  51. package/dist/assets/{journeyDiagram-G5WM74LC-yaWI-m8S.js → journeyDiagram-G5WM74LC-Cq6Decau.js} +1 -1
  52. package/dist/assets/{kanban-definition-QRCXZQQD-CiGEtYzn.js → kanban-definition-QRCXZQQD-DN8oQjxC.js} +1 -1
  53. package/dist/assets/{layout-2MuNO-VW.js → layout-C8I0UdqO.js} +1 -1
  54. package/dist/assets/{linear-BV4Hv62W.js → linear-DhXjXuha.js} +1 -1
  55. package/dist/assets/{mermaid-DWJ-75tM.js → mermaid-Bu9eLlNE.js} +3 -3
  56. package/dist/assets/{min-DUQ_07bN.js → min-Bjoph6T1.js} +1 -1
  57. package/dist/assets/{mindmap-definition-GWI6TPTV-Dj4hdaum.js → mindmap-definition-GWI6TPTV-CloBacUO.js} +1 -1
  58. package/dist/assets/{pieDiagram-YF2LJOPJ-C4LXZhqe.js → pieDiagram-YF2LJOPJ-D0EgqadI.js} +1 -1
  59. package/dist/assets/{quadrantDiagram-OS5C2QUG-BHGmZ3VO.js → quadrantDiagram-OS5C2QUG-C2-6xMx6.js} +1 -1
  60. package/dist/assets/{react-plotly-e04Sp89Y.js → react-plotly-C01b6TFd.js} +1 -1
  61. package/dist/assets/{requirementDiagram-MIRIMTAZ-JPAXT0Lh.js → requirementDiagram-MIRIMTAZ-BtqgW8UI.js} +1 -1
  62. package/dist/assets/{run-page-BbMOPOXN.js → run-page-D_zc3zAl.js} +1 -1
  63. package/dist/assets/{sankeyDiagram-Y46BX6SQ-CY6FXTy4.js → sankeyDiagram-Y46BX6SQ-D-eqHIzs.js} +1 -1
  64. package/dist/assets/{save-worker-DTSnJ47D.js → save-worker-BwuET9oo.js} +1 -1
  65. package/dist/assets/{sequenceDiagram-G6AWOVSC-DJ1WpXIY.js → sequenceDiagram-G6AWOVSC-CwFso4tO.js} +1 -1
  66. package/dist/assets/{slides-component-D6BcdEGP.js → slides-component-WwfGDCyr.js} +1 -1
  67. package/dist/assets/{sortBy-DlR_wEdD.js → sortBy-B6dyzMNp.js} +1 -1
  68. package/dist/assets/{stateDiagram-MAYHULR4-B2FAT7N-.js → stateDiagram-MAYHULR4-BAYst6o4.js} +1 -1
  69. package/dist/assets/stateDiagram-v2-4JROLMXI-C5CqepzN.js +1 -0
  70. package/dist/assets/{terminal-DGFZ0y7h.js → terminal-MXg7LE9T.js} +1 -1
  71. package/dist/assets/{time-CIdJ7-co.js → time-BXwQtuRS.js} +1 -1
  72. package/dist/assets/{timeline-definition-U7ZMHBDA-DLSrhH79.js → timeline-definition-U7ZMHBDA-8Krb_Ob1.js} +1 -1
  73. package/dist/assets/{tree-CmpjLpgm.js → tree-gVKyHBoX.js} +1 -1
  74. package/dist/assets/{useMarimoWebSocket-DDCV4AaU.js → useMarimoWebSocket-BlrXa45k.js} +3 -3
  75. package/dist/assets/{vega-component-D908cJsV.js → vega-component-4q-dkMWy.js} +1 -1
  76. package/dist/assets/{worker-BHRnpHsl.js → worker-CUYqvMbU.js} +1 -1
  77. package/dist/assets/{worker-DzWO0OVI.js → worker-DLFs-pr_.js} +1 -1
  78. package/dist/assets/{xychartDiagram-6QU3TZC5-C64cy1Lm.js → xychartDiagram-6QU3TZC5-Dm5KTWuG.js} +1 -1
  79. package/dist/index.html +1 -1
  80. package/package.json +2 -2
  81. package/dist/assets/_baseMap-Dg8xkOC2.js +0 -1
  82. package/dist/assets/channel-CRPdntGH.js +0 -1
  83. package/dist/assets/classDiagram-LNE6IOMH-BzQqbaIZ.js +0 -1
  84. package/dist/assets/classDiagram-v2-MQ7JQ4JX-BzQqbaIZ.js +0 -1
  85. package/dist/assets/clone-BCeiqX78.js +0 -1
  86. package/dist/assets/stateDiagram-v2-4JROLMXI-BWZ1vFZN.js +0 -1
@@ -1 +1 @@
1
- import{d as t,f as e,g as n,b as i}from"./chunk-ASOPGD6M-CS9ifOFb.js";import{_ as s,d as r,p as a,q as o,s as c,g as l,c as h,b as u,v as p,j as y}from"./mermaid-DWJ-75tM.js";import{s as d}from"./transform-D6ULhE8R.js";import{d as f}from"./arc-BTlVLyGF.js";import"./index-DA_9Xzp8.js";import"./step-CaHXtLdi.js";var g=function(){var t=s((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],r=[1,11],a=[1,12],o=[1,13],c=[1,14],l={trace:s((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s((function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:i,14:r,16:a,17:o,18:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:r,16:a,17:o,18:c},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],i=[],r=[null],a=[],o=this.table,c="",l=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s((function(t){n.length=n.length-2*t,r.length=r.length-t,a.length=a.length-t}),"popStack"),s(m,"lex");for(var x,k,_,b,v,w,$,T,M={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=o[k]&&o[k][x]),void 0===_||!_.length||!_[0]){var S="";for(v in T=[],o[k])this.terminals_[v]&&v>2&&T.push("'"+this.terminals_[v]+"'");S=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(S,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:T})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),r.push(p.yytext),a.push(p.yylloc),n.push(_[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,f=p.yylloc;break;case 2:if(w=this.productions_[_[1]][1],M.$=r[r.length-w],M._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},g&&(M._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(M,[c,h,l,y.yy,_[1],r,a].concat(u))))return b;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[_[1]][0]),r.push(M.$),a.push(M._$),$=o[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0}),"parse")},h=function(){return{EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((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:s((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:s((function(){return this._more=!0,this}),"more"),reject:s((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:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((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:s((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:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function u(){this.yy={}}return l.lexer=h,s(u,"Parser"),u.prototype=l,l.Parser=u,new u}();g.parser=g;var m=g,x="",k=[],_=[],b=[],v=s((function(){k.length=0,_.length=0,x="",b.length=0,p()}),"clear"),w=s((function(t){x=t,k.push(t)}),"addSection"),$=s((function(){return k}),"getSections"),T=s((function(){let t=E();let e=0;for(;!t&&e<100;)t=E(),e++;return _.push(...b),_}),"getTasks"),M=s((function(){const t=[];_.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),S=s((function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map((t=>t.trim())),a={section:x,type:x,people:r,task:t,score:i};b.push(a)}),"addTask"),A=s((function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)}),"addTaskOrg"),E=s((function(){const t=s((function(t){return b[t].processed}),"compileTask");let e=!0;for(const[n,i]of b.entries())t(n),e=e&&i.processed;return e}),"compileTasks"),P=s((function(){return M()}),"getActors"),I={getConfig:s((()=>r().journey),"getConfig"),clear:v,setDiagramTitle:a,getDiagramTitle:o,setAccTitle:c,getAccTitle:l,setAccDescription:h,getAccDescription:u,addSection:w,getSections:$,getTasks:T,addTask:S,addTaskOrg:A,getActors:P},j=s((t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`),"getStyles"),C=s((function(e,n){return t(e,n)}),"drawRect"),V=s((function(t,e){const n=15,i=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=t.append("g");function a(t){const i=f().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const i=f().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function c(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(c,"ambivalent"),e.score>3?a(r):e.score<3?o(r):c(r),i}),"drawFace"),O=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),L=s((function(t,n){return e(t,n)}),"drawText"),D=s((function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}s(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,L(t,e)}),"drawLabel"),F=s((function(t,e,i){const s=t.append("g"),r=n();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,C(s,r),z(i)(e.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},i,e.colour)}),"drawSection"),B=-1,N=s((function(t,e,i){const s=e.x+i.width/2,r=t.append("g");B++;r.append("line").attr("id","task"+B).attr("x1",s).attr("y1",e.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),V(r,{cx:s,cy:300+30*(5-e.score),score:e.score});const a=n();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=i.width,a.height=i.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,C(r,a);let o=e.x+14;e.people.forEach((t=>{const n=e.actors[t].color,i={cx:o,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};O(r,i),o+=10})),z(i)(e.task,r,a.x,a.y,a.width,a.height,{class:"task"},i,e.colour)}),"drawTask"),R=s((function(t,e){i(t,e)}),"drawBackgroundRect"),z=function(){function t(t,e,n,s,r,a,o,c){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,p=t.split(/<br\s*\/?>/gi);for(let y=0;y<p.length;y++){const t=y*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",n+r/2).attr("dy",t).text(p[y]),c.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function n(t,n,s,r,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,c,l),i(u,c)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Y={drawRect:C,drawCircle:O,drawSection:F,drawText:L,drawLabel:D,drawTask:N,drawBackgroundRect:R,initGraphics:s((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")}),"initGraphics")},q=s((function(t){Object.keys(t).forEach((function(e){G[e]=t[e]}))}),"setConf"),W={};function X(t){const e=r().journey;let n=60;Object.keys(W).forEach((i=>{const s=W[i].color,r={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:W[i].position};Y.drawCircle(t,r);const a={x:40,y:n+7,fill:"#666",text:i,textMargin:5|e.boxTextMargin};Y.drawText(t,a),n+=20}))}s(X,"drawActorLegend");var G=r().journey,U=G.leftMargin,H=s((function(t,e,n,i){const s=r().journey,a=r().securityLevel;let o;"sandbox"===a&&(o=d("#i"+e));const c=d("sandbox"===a?o.nodes()[0].contentDocument.body:"body");Z.init();const l=c.select("#"+e);Y.initGraphics(l);const h=i.db.getTasks(),u=i.db.getDiagramTitle(),p=i.db.getActors();for(const r in W)delete W[r];let f=0;p.forEach((t=>{W[t]={color:s.actorColours[f%s.actorColours.length],position:f},f++})),X(l),Z.insert(0,0,U,50*Object.keys(W).length),Q(l,h,0);const g=Z.getBounds();u&&l.append("text").text(u).attr("x",U).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const m=g.stopy-g.starty+2*s.diagramMarginY,x=U+g.stopx+2*s.diagramMarginX;y(l,m,x,s.useMaxWidth),l.append("line").attr("x1",U).attr("y1",4*s.height).attr("x2",x-U-4).attr("y2",4*s.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const k=u?70:0;l.attr("viewBox",`${g.startx} -25 ${x} ${m+k}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",m+k+25)}),"draw"),Z={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:s((function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,i){const a=r().journey,o=this;let c=0;function l(r){return s((function(s){c++;const l=o.sequenceItems.length-c+1;o.updateVal(s,"starty",e-l*a.boxMargin,Math.min),o.updateVal(s,"stopy",i+l*a.boxMargin,Math.max),o.updateVal(Z.data,"startx",t-l*a.boxMargin,Math.min),o.updateVal(Z.data,"stopx",n+l*a.boxMargin,Math.max),"activation"!==r&&(o.updateVal(s,"startx",t-l*a.boxMargin,Math.min),o.updateVal(s,"stopx",n+l*a.boxMargin,Math.max),o.updateVal(Z.data,"starty",e-l*a.boxMargin,Math.min),o.updateVal(Z.data,"stopy",i+l*a.boxMargin,Math.max))}),"updateItemBounds")}s(l,"updateFn"),this.sequenceItems.forEach(l())}),"updateBounds"),insert:s((function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(Z.data,"startx",s,Math.min),this.updateVal(Z.data,"starty",a,Math.min),this.updateVal(Z.data,"stopx",r,Math.max),this.updateVal(Z.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)}),"insert"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return this.data}),"getBounds")},J=G.sectionFills,K=G.sectionColours,Q=s((function(t,e,n){const i=r().journey;let s="";const a=n+(2*i.height+i.diagramMarginY);let o=0,c="#CCC",l="black",h=0;for(const[r,u]of e.entries()){if(s!==u.section){c=J[o%J.length],h=o%J.length,l=K[o%K.length];let n=0;const a=u.section;for(let t=r;t<e.length&&e[t].section==a;t++)n+=1;const p={x:r*i.taskMargin+r*i.width+U,y:50,text:u.section,fill:c,num:h,colour:l,taskCount:n};Y.drawSection(t,p,i),s=u.section,o++}const n=u.people.reduce(((t,e)=>(W[e]&&(t[e]=W[e]),t)),{});u.x=r*i.taskMargin+r*i.width+U,u.y=a,u.width=i.diagramMarginX,u.height=i.diagramMarginY,u.colour=l,u.fill=c,u.num=h,u.actors=n,Y.drawTask(t,u,i),Z.insert(u.x,u.y,u.x+u.width+i.taskMargin,450)}}),"drawTasks"),tt={setConf:q,draw:H},et={parser:m,db:I,renderer:tt,styles:j,init:s((t=>{tt.setConf(t.journey),I.clear()}),"init")};export{et as diagram};
1
+ import{d as t,f as e,g as n,b as i}from"./chunk-ASOPGD6M-BjDNxzq7.js";import{_ as s,d as r,p as a,q as o,s as c,g as l,c as h,b as u,v as p,j as y}from"./mermaid-Bu9eLlNE.js";import{s as d}from"./transform-D6ULhE8R.js";import{d as f}from"./arc-BTlVLyGF.js";import"./index-bBRIUKAN.js";import"./step-CaHXtLdi.js";var g=function(){var t=s((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],r=[1,11],a=[1,12],o=[1,13],c=[1,14],l={trace:s((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s((function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:i,14:r,16:a,17:o,18:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:r,16:a,17:o,18:c},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s((function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)}),"parseError"),parse:s((function(t){var e=this,n=[0],i=[],r=[null],a=[],o=this.table,c="",l=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s((function(t){n.length=n.length-2*t,r.length=r.length-t,a.length=a.length-t}),"popStack"),s(m,"lex");for(var x,k,_,b,v,w,$,T,M={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=o[k]&&o[k][x]),void 0===_||!_.length||!_[0]){var S="";for(v in T=[],o[k])this.terminals_[v]&&v>2&&T.push("'"+this.terminals_[v]+"'");S=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(S,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:T})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),r.push(p.yytext),a.push(p.yylloc),n.push(_[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,f=p.yylloc;break;case 2:if(w=this.productions_[_[1]][1],M.$=r[r.length-w],M._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},g&&(M._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(M,[c,h,l,y.yy,_[1],r,a].concat(u))))return b;w&&(n=n.slice(0,-1*w*2),r=r.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[_[1]][0]),r.push(M.$),a.push(M._$),$=o[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0}),"parse")},h=function(){return{EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((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:s((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:s((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:s((function(){return this._more=!0,this}),"more"),reject:s((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:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((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:s((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:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((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:s((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:s((function(){var t=this.next();return t||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:s((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}}),"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function u(){this.yy={}}return l.lexer=h,s(u,"Parser"),u.prototype=l,l.Parser=u,new u}();g.parser=g;var m=g,x="",k=[],_=[],b=[],v=s((function(){k.length=0,_.length=0,x="",b.length=0,p()}),"clear"),w=s((function(t){x=t,k.push(t)}),"addSection"),$=s((function(){return k}),"getSections"),T=s((function(){let t=E();let e=0;for(;!t&&e<100;)t=E(),e++;return _.push(...b),_}),"getTasks"),M=s((function(){const t=[];_.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),S=s((function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map((t=>t.trim())),a={section:x,type:x,people:r,task:t,score:i};b.push(a)}),"addTask"),A=s((function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)}),"addTaskOrg"),E=s((function(){const t=s((function(t){return b[t].processed}),"compileTask");let e=!0;for(const[n,i]of b.entries())t(n),e=e&&i.processed;return e}),"compileTasks"),P=s((function(){return M()}),"getActors"),I={getConfig:s((()=>r().journey),"getConfig"),clear:v,setDiagramTitle:a,getDiagramTitle:o,setAccTitle:c,getAccTitle:l,setAccDescription:h,getAccDescription:u,addSection:w,getSections:$,getTasks:T,addTask:S,addTaskOrg:A,getActors:P},j=s((t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`),"getStyles"),C=s((function(e,n){return t(e,n)}),"drawRect"),V=s((function(t,e){const n=15,i=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=t.append("g");function a(t){const i=f().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function o(t){const i=f().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function c(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s(a,"smile"),s(o,"sad"),s(c,"ambivalent"),e.score>3?a(r):e.score<3?o(r):c(r),i}),"drawFace"),O=s((function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n}),"drawCircle"),L=s((function(t,n){return e(t,n)}),"drawText"),D=s((function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}s(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,L(t,e)}),"drawLabel"),F=s((function(t,e,i){const s=t.append("g"),r=n();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,C(s,r),z(i)(e.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},i,e.colour)}),"drawSection"),B=-1,N=s((function(t,e,i){const s=e.x+i.width/2,r=t.append("g");B++;r.append("line").attr("id","task"+B).attr("x1",s).attr("y1",e.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),V(r,{cx:s,cy:300+30*(5-e.score),score:e.score});const a=n();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=i.width,a.height=i.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,C(r,a);let o=e.x+14;e.people.forEach((t=>{const n=e.actors[t].color,i={cx:o,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};O(r,i),o+=10})),z(i)(e.task,r,a.x,a.y,a.width,a.height,{class:"task"},i,e.colour)}),"drawTask"),R=s((function(t,e){i(t,e)}),"drawBackgroundRect"),z=function(){function t(t,e,n,s,r,a,o,c){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,p=t.split(/<br\s*\/?>/gi);for(let y=0;y<p.length;y++){const t=y*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",n+r/2).attr("dy",t).text(p[y]),c.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function n(t,n,s,r,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,c,l),i(u,c)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return s(t,"byText"),s(e,"byTspan"),s(n,"byFo"),s(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Y={drawRect:C,drawCircle:O,drawSection:F,drawText:L,drawLabel:D,drawTask:N,drawBackgroundRect:R,initGraphics:s((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")}),"initGraphics")},q=s((function(t){Object.keys(t).forEach((function(e){G[e]=t[e]}))}),"setConf"),W={};function X(t){const e=r().journey;let n=60;Object.keys(W).forEach((i=>{const s=W[i].color,r={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:W[i].position};Y.drawCircle(t,r);const a={x:40,y:n+7,fill:"#666",text:i,textMargin:5|e.boxTextMargin};Y.drawText(t,a),n+=20}))}s(X,"drawActorLegend");var G=r().journey,U=G.leftMargin,H=s((function(t,e,n,i){const s=r().journey,a=r().securityLevel;let o;"sandbox"===a&&(o=d("#i"+e));const c=d("sandbox"===a?o.nodes()[0].contentDocument.body:"body");Z.init();const l=c.select("#"+e);Y.initGraphics(l);const h=i.db.getTasks(),u=i.db.getDiagramTitle(),p=i.db.getActors();for(const r in W)delete W[r];let f=0;p.forEach((t=>{W[t]={color:s.actorColours[f%s.actorColours.length],position:f},f++})),X(l),Z.insert(0,0,U,50*Object.keys(W).length),Q(l,h,0);const g=Z.getBounds();u&&l.append("text").text(u).attr("x",U).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const m=g.stopy-g.starty+2*s.diagramMarginY,x=U+g.stopx+2*s.diagramMarginX;y(l,m,x,s.useMaxWidth),l.append("line").attr("x1",U).attr("y1",4*s.height).attr("x2",x-U-4).attr("y2",4*s.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const k=u?70:0;l.attr("viewBox",`${g.startx} -25 ${x} ${m+k}`),l.attr("preserveAspectRatio","xMinYMin meet"),l.attr("height",m+k+25)}),"draw"),Z={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:s((function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])}),"updateVal"),updateBounds:s((function(t,e,n,i){const a=r().journey,o=this;let c=0;function l(r){return s((function(s){c++;const l=o.sequenceItems.length-c+1;o.updateVal(s,"starty",e-l*a.boxMargin,Math.min),o.updateVal(s,"stopy",i+l*a.boxMargin,Math.max),o.updateVal(Z.data,"startx",t-l*a.boxMargin,Math.min),o.updateVal(Z.data,"stopx",n+l*a.boxMargin,Math.max),"activation"!==r&&(o.updateVal(s,"startx",t-l*a.boxMargin,Math.min),o.updateVal(s,"stopx",n+l*a.boxMargin,Math.max),o.updateVal(Z.data,"starty",e-l*a.boxMargin,Math.min),o.updateVal(Z.data,"stopy",i+l*a.boxMargin,Math.max))}),"updateItemBounds")}s(l,"updateFn"),this.sequenceItems.forEach(l())}),"updateBounds"),insert:s((function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(Z.data,"startx",s,Math.min),this.updateVal(Z.data,"starty",a,Math.min),this.updateVal(Z.data,"stopx",r,Math.max),this.updateVal(Z.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)}),"insert"),bumpVerticalPos:s((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:s((function(){return this.verticalPos}),"getVerticalPos"),getBounds:s((function(){return this.data}),"getBounds")},J=G.sectionFills,K=G.sectionColours,Q=s((function(t,e,n){const i=r().journey;let s="";const a=n+(2*i.height+i.diagramMarginY);let o=0,c="#CCC",l="black",h=0;for(const[r,u]of e.entries()){if(s!==u.section){c=J[o%J.length],h=o%J.length,l=K[o%K.length];let n=0;const a=u.section;for(let t=r;t<e.length&&e[t].section==a;t++)n+=1;const p={x:r*i.taskMargin+r*i.width+U,y:50,text:u.section,fill:c,num:h,colour:l,taskCount:n};Y.drawSection(t,p,i),s=u.section,o++}const n=u.people.reduce(((t,e)=>(W[e]&&(t[e]=W[e]),t)),{});u.x=r*i.taskMargin+r*i.width+U,u.y=a,u.width=i.diagramMarginX,u.height=i.diagramMarginY,u.colour=l,u.fill=c,u.num=h,u.actors=n,Y.drawTask(t,u,i),Z.insert(u.x,u.y,u.x+u.width+i.taskMargin,450)}}),"drawTasks"),tt={setConf:q,draw:H},et={parser:m,db:I,renderer:tt,styles:j,init:s((t=>{tt.setConf(t.journey),I.clear()}),"init")};export{et as diagram};
@@ -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-DWJ-75tM.js";import"./index-DA_9Xzp8.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-Bu9eLlNE.js";import"./index-bBRIUKAN.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-PvsVbbr9.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-DA_9Xzp8.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-D8AYVFBF.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-DUQ_07bN.js";import{c as I,a as P}from"./_baseEach-ikVNrrLw.js";import{s as j}from"./sortBy-DlR_wEdD.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-BaBU5kNK.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-bBRIUKAN.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-PgltSSM2.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-Bjoph6T1.js";import{c as I,a as P}from"./_baseEach-DF2lMatG.js";import{s as j}from"./sortBy-B6dyzMNp.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-DA_9Xzp8.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};
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-bBRIUKAN.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};