cc-viewer 1.7.8 → 1.7.10

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 (115) hide show
  1. package/dist/assets/{App-DtsIVPu6.js → App-shurMzn5.js} +2 -2
  2. package/dist/assets/{MdxEditorPanel-DWPAEnpm.js → MdxEditorPanel-BKAywPEt.js} +1 -1
  3. package/dist/assets/{Mobile-DHwMZG4N.js → Mobile-C05_paB4.js} +1 -1
  4. package/dist/assets/{ProxyStatsModal-D9lTz0-T.js → ProxyStatsModal-C9ENPPkE.js} +1 -1
  5. package/dist/assets/_baseUniq-aTokVjQN.js +1 -0
  6. package/dist/assets/arc-mxp8gSRQ.js +1 -0
  7. package/dist/assets/architectureDiagram-Q4EWVU46-msh8IODx.js +1 -0
  8. package/dist/assets/blockDiagram-DXYQGD6D-BUatNJTI.js +1 -0
  9. package/dist/assets/{c4Diagram-LMCZKHZV-C2QvkF2i.js → c4Diagram-AHTNJAMY-CJ92TNZe.js} +1 -1
  10. package/dist/assets/{channel-ClOiNc35.js → channel-CTM7CJrB.js} +1 -1
  11. package/dist/assets/{chunk-JWPE2WC7-D5RR93-U.js → chunk-4BX2VUAB-Bdv98T9c.js} +1 -1
  12. package/dist/assets/chunk-4TB4RGXK-DaIEuSP0.js +1 -0
  13. package/dist/assets/{chunk-XXDRQBXY-Blw-tThR.js → chunk-55IACEB6-Bi9130Nu.js} +1 -1
  14. package/dist/assets/{chunk-VR4S4FIN-BR0zG1Ep.js → chunk-EDXVE4YY-CZw-Vwwn.js} +1 -1
  15. package/dist/assets/{chunk-5VM5RSS4-CMJWLQsQ.js → chunk-FMBD7UC4-BBI7swjg.js} +1 -1
  16. package/dist/assets/chunk-OYMX7WX6-CHKotm_J.js +1 -0
  17. package/dist/assets/{chunk-2Q5K7J3B-BvZ7-Ft4.js → chunk-QZHKN3VN-ECW0McUe.js} +1 -1
  18. package/dist/assets/{chunk-32BRIVSS-Dg3PlJIt.js → chunk-YZCP3GAM-DLdAqU2z.js} +1 -1
  19. package/dist/assets/classDiagram-6PBFFD2Q-CkmfHfqf.js +1 -0
  20. package/dist/assets/classDiagram-v2-HSJHXN6E-CkmfHfqf.js +1 -0
  21. package/dist/assets/clone-pjnYCaC4.js +1 -0
  22. package/dist/assets/{cose-bilkent-JH36ORCC-BnDDyyuN.js → cose-bilkent-S5V4N54A-CfMuBnZy.js} +1 -1
  23. package/dist/assets/cytoscape.esm-CT1mZavR.js +9 -0
  24. package/dist/assets/dagre-KV5264BT-xxdATAWV.js +1 -0
  25. package/dist/assets/diagram-5BDNPKRD-s8izYXws.js +1 -0
  26. package/dist/assets/diagram-G4DWMVQ6-BaZWrq-d.js +1 -0
  27. package/dist/assets/diagram-MMDJMWI5-DlzU0RKB.js +1 -0
  28. package/dist/assets/diagram-TYMM5635-Fej8ir1x.js +1 -0
  29. package/dist/assets/erDiagram-SMLLAGMA-Bwg0_DNs.js +1 -0
  30. package/dist/assets/flowDiagram-DWJPFMVM-pJ8Bv6wt.js +1 -0
  31. package/dist/assets/{ganttDiagram-NO4QXBWP-_4nnZ3ta.js → ganttDiagram-T4ZO3ILL-DvgJ4Q6n.js} +1 -1
  32. package/dist/assets/gitGraphDiagram-UUTBAWPF-Du8KitZ0.js +1 -0
  33. package/dist/assets/graph-57Q-0mNG.js +1 -0
  34. package/dist/assets/{index-CPAQ767L.js → index-BOryMxum.js} +1 -1
  35. package/dist/assets/{index-DuUUHxox.js → index-Bt7QsK9T.js} +1 -1
  36. package/dist/assets/{index-BJ9Xm7_G.js → index-CVh-Zo2A.js} +1 -1
  37. package/dist/assets/{index-BiYKFU6w.js → index-Cf77lzSr.js} +1 -1
  38. package/dist/assets/{index-By8aqIvN.js → index-ClB3znal.js} +2 -2
  39. package/dist/assets/{index-7VeS_xrl.js → index-Cn0akK9k.js} +1 -1
  40. package/dist/assets/{index-CBix0zSu.js → index-EFFRo37G.js} +1 -1
  41. package/dist/assets/{index-_pxC-jz_.js → index-zljZK-NO.js} +1 -1
  42. package/dist/assets/infoDiagram-42DDH7IO-DZz6OAQe.js +1 -0
  43. package/dist/assets/{ishikawaDiagram-FXEZZL3T-DHHu_UGe.js → ishikawaDiagram-UXIWVN3A-Chrlpw73.js} +1 -1
  44. package/dist/assets/{journeyDiagram-5HDEW3XC-Bx06Sp3y.js → journeyDiagram-VCZTEJTY-D-fCEwg9.js} +1 -1
  45. package/dist/assets/{jszip.min-Bn5J9HN-.js → jszip.min-mU_-As7x.js} +1 -1
  46. package/dist/assets/{kanban-definition-HUTT4EX6-BuEuKkQp.js → kanban-definition-6JOO6SKY-DFdrm5t-.js} +1 -1
  47. package/dist/assets/layout-Dh-E01gA.js +1 -0
  48. package/dist/assets/{linear-BJRZNsdX.js → linear-BjXnK-6T.js} +1 -1
  49. package/dist/assets/mermaid.core-Cbqxn86C.js +7 -0
  50. package/dist/assets/min-B4n9eIGL.js +1 -0
  51. package/dist/assets/{mindmap-definition-LN4V7U3C-DYtgJ2f4.js → mindmap-definition-QFDTVHPH-Bw49x4oU.js} +1 -1
  52. package/dist/assets/pieDiagram-DEJITSTG-D-iq9rKK.js +1 -0
  53. package/dist/assets/quadrantDiagram-34T5L4WZ-QtFjo8i4.js +1 -0
  54. package/dist/assets/{requirementDiagram-TGXJPOKE-Cwb2FU3N.js → requirementDiagram-MS252O5E-BwmEZf4F.js} +1 -1
  55. package/dist/assets/sankeyDiagram-XADWPNL6-CTtXN32x.js +1 -0
  56. package/dist/assets/{seqResourceLoaders-C-pxCjNh.js → seqResourceLoaders-CYkWTxGA.js} +2 -2
  57. package/dist/assets/sequenceDiagram-FGHM5R23-DC00gRqs.js +1 -0
  58. package/dist/assets/stateDiagram-FHFEXIEX-CT963BWJ.js +1 -0
  59. package/dist/assets/stateDiagram-v2-QKLJ7IA2-1T7yDlvQ.js +1 -0
  60. package/dist/assets/{timeline-definition-FHXFAJF6-CK8MkCLz.js → timeline-definition-GMOUNBTQ-CDu66c9j.js} +1 -1
  61. package/dist/assets/{vendor-antd-DNUTLr77.js → vendor-antd-DADYo_zg.js} +3 -3
  62. package/dist/assets/{vendor-codemirror-6ck0hLRU.js → vendor-codemirror-tF6HNoR6.js} +1 -1
  63. package/dist/assets/vendor-markdown-DOJHsAxX.js +3 -0
  64. package/dist/assets/{vendor-mdxeditor-DT0rad22.js → vendor-mdxeditor-CFAmRN3Y.js} +2 -2
  65. package/dist/assets/{vendor-qrcode-CPmWG6hm.js → vendor-qrcode-DYKmbePy.js} +1 -1
  66. package/dist/assets/{vendor-virtuoso-YwK7i7L6.js → vendor-virtuoso-TxPxvPjL.js} +1 -1
  67. package/dist/assets/{vennDiagram-L72KCM5P-CWA2Gdi_.js → vennDiagram-DHZGUBPP-DSm6yR_C.js} +1 -1
  68. package/dist/assets/wardley-RL74JXVD-kFdCN4XL.js +1 -0
  69. package/dist/assets/wardleyDiagram-NUSXRM2D-BY1GQbCO.js +1 -0
  70. package/dist/assets/xychartDiagram-5P7HB3ND-ONnFdWbS.js +1 -0
  71. package/dist/index.html +4 -4
  72. package/findcc.js +7 -2
  73. package/package.json +1 -1
  74. package/dist/assets/abnfDiagram-VRR7QNED-9ax220Vv.js +0 -1
  75. package/dist/assets/arc-Cshrl52z.js +0 -1
  76. package/dist/assets/architectureDiagram-ZJ3FMSHR-QtERolgF.js +0 -1
  77. package/dist/assets/blockDiagram-677ZJIJ3-BaCd4R0Z.js +0 -1
  78. package/dist/assets/chunk-EX3LRPZG-CmoC-M2G.js +0 -1
  79. package/dist/assets/chunk-MOJQB5TN-JXgBLjCY.js +0 -1
  80. package/dist/assets/chunk-RYQCIY6F-gT-v276m.js +0 -1
  81. package/dist/assets/chunk-V7JOEXUC-Cl-E_fxl.js +0 -1
  82. package/dist/assets/classDiagram-OUVF2IWQ-ClkcbuHu.js +0 -1
  83. package/dist/assets/classDiagram-v2-EOCWNBFH-ClkcbuHu.js +0 -1
  84. package/dist/assets/cynefin-VYW2F7L2-Ch8_Ihra.js +0 -15
  85. package/dist/assets/cynefinDiagram-TSTJHNR4-CuX_xTSU.js +0 -1
  86. package/dist/assets/cytoscape.esm-D0POlJZ1.js +0 -9
  87. package/dist/assets/dagre-VKFMJZFB-DHDO7DUw.js +0 -1
  88. package/dist/assets/diagram-FQU43EPY-CxDVpL25.js +0 -1
  89. package/dist/assets/diagram-G47NLZAW-DHX7L6pT.js +0 -1
  90. package/dist/assets/diagram-NH7WQ7WH-HlwtIdWA.js +0 -1
  91. package/dist/assets/diagram-OA4YK3LP-BnTSu9CG.js +0 -1
  92. package/dist/assets/diagram-WEI45ONY-C712tBJk.js +0 -1
  93. package/dist/assets/ebnfDiagram-CCIWWBDH-DzMcH3cz.js +0 -1
  94. package/dist/assets/erDiagram-Q63AITRT-0fyhQG92.js +0 -1
  95. package/dist/assets/flowDiagram-23GEKE2U-lgfs10IO.js +0 -1
  96. package/dist/assets/gitGraphDiagram-IHSO6WYX-DrgEKJkZ.js +0 -1
  97. package/dist/assets/graph-CnJdn47S.js +0 -1
  98. package/dist/assets/infoDiagram-FWYZ7A6U-Cki8RIbq.js +0 -1
  99. package/dist/assets/layout-CCUE9ZRw.js +0 -1
  100. package/dist/assets/map-DQeg2hXV.js +0 -1
  101. package/dist/assets/mermaid.core-DH-sQJgr.js +0 -7
  102. package/dist/assets/pegDiagram-2B236MQR-BVN6OIEN.js +0 -1
  103. package/dist/assets/pieDiagram-ENE6RG2P-mVeQtQTD.js +0 -1
  104. package/dist/assets/quadrantDiagram-ABIIQ3AL-Croqf1qH.js +0 -1
  105. package/dist/assets/railroadDiagram-RFXS5EU6-jkGuNfMY.js +0 -1
  106. package/dist/assets/sankeyDiagram-HTMAVEWB-D-HWOuX0.js +0 -1
  107. package/dist/assets/sequenceDiagram-DBY2YBRQ-Bh3XgPxy.js +0 -1
  108. package/dist/assets/sizeCapture-X5ZJPWSS-C_acEkFf.js +0 -1
  109. package/dist/assets/stateDiagram-2N3HPSRC-CmbRj6R7.js +0 -1
  110. package/dist/assets/stateDiagram-v2-6OUMAXLB-ClrX-Ofc.js +0 -1
  111. package/dist/assets/swimlanes-5IMT3BWC-CIfoRrLM.js +0 -2
  112. package/dist/assets/swimlanesDiagram-G3AALYLV-DZuW0-dQ.js +0 -1
  113. package/dist/assets/vendor-markdown-DBlfs4dR.js +0 -3
  114. package/dist/assets/wardleyDiagram-EHGQE667-U22kgZ8v.js +0 -1
  115. package/dist/assets/xychartDiagram-FW5EYKEG-BiGsMUKC.js +0 -1
@@ -1 +0,0 @@
1
- import{g as getIconStyles}from"./chunk-5VM5RSS4-CMJWLQsQ.js";import{az as isPrimitive,aA as getTag,aB as isTypedArray,aC as uint32ArrayTag,aD as uint16ArrayTag,aE as uint8ClampedArrayTag,aF as uint8ArrayTag,aG as symbolTag,aH as stringTag,aI as setTag,aJ as regexpTag,aK as objectTag,aL as numberTag,aM as mapTag,aN as int32ArrayTag,aO as int16ArrayTag,aP as int8ArrayTag,aQ as float64ArrayTag,aR as float32ArrayTag,aS as dateTag,aT as booleanTag,aU as dataViewTag,aV as arrayBufferTag,aW as arrayTag,aX as argumentsTag,_ as __name,y as getConfig,d as select,e as configureSvgSize,l as log,p as clear,r as rgba,c as getConfig2,aY as getLineFunctionsWithOffset,O as line,P as curveBasis,L as getUrl,aZ as getEffectiveHtmlLabels,a_ as createText,a$ as computeLabelTransform,ar as getSubGraphTitleMargins,x as utils_default,k as common_default,b0 as getStylesFromArray,i as sanitizeText,b1 as decodeEntities,b2 as configureLabelImages}from"./mermaid.core-DH-sQJgr.js";import{G as Graph}from"./graph-CnJdn47S.js";import{c as channel}from"./channel-ClOiNc35.js";import"./vendor-mdxeditor-DT0rad22.js";import"./vendor-antd-DNUTLr77.js";import"./vendor-codemirror-6ck0hLRU.js";import"./vendor-markdown-DBlfs4dR.js";function clone(obj){if(isPrimitive(obj))return obj;const tag=getTag(obj);if(!function(object){switch(getTag(object)){case argumentsTag:case arrayTag:case arrayBufferTag:case dataViewTag:case booleanTag:case dateTag:case float32ArrayTag:case float64ArrayTag:case int8ArrayTag:case int16ArrayTag:case int32ArrayTag:case mapTag:case numberTag:case objectTag:case regexpTag:case setTag:case stringTag:case symbolTag:case uint8ArrayTag:case uint8ClampedArrayTag:case uint16ArrayTag:case uint32ArrayTag:return!0;default:return!1}}(obj))return{};if(value=obj,Array.isArray(value)){const result2=Array.from(obj);return obj.length>0&&"string"==typeof obj[0]&&Object.hasOwn(obj,"index")&&(result2.index=obj.index,result2.input=obj.input),result2}var value;if(isTypedArray(obj)){const typedArray=obj;return new(0,typedArray.constructor)(typedArray.buffer,typedArray.byteOffset,typedArray.length)}if("[object ArrayBuffer]"===tag)return new ArrayBuffer(obj.byteLength);if("[object DataView]"===tag){const dataView=obj,buffer=dataView.buffer,byteOffset=dataView.byteOffset,byteLength=dataView.byteLength,clonedBuffer=new ArrayBuffer(byteLength),srcView=new Uint8Array(buffer,byteOffset,byteLength);return new Uint8Array(clonedBuffer).set(srcView),new DataView(clonedBuffer)}if("[object Boolean]"===tag||"[object Number]"===tag||"[object String]"===tag){const clone2=new(0,obj.constructor)(obj.valueOf());return"[object String]"===tag?function(target,source){const stringLength=source.valueOf().length;for(const key in source)Object.hasOwn(source,key)&&(Number.isNaN(Number(key))||Number(key)>=stringLength)&&(target[key]=source[key])}(clone2,obj):copyOwnProperties(clone2,obj),clone2}if("[object Date]"===tag)return new Date(Number(obj));if("[object RegExp]"===tag){const regExp=obj,clone2=new RegExp(regExp.source,regExp.flags);return clone2.lastIndex=regExp.lastIndex,clone2}if("[object Symbol]"===tag)return Object(Symbol.prototype.valueOf.call(obj));if("[object Map]"===tag){const map=obj,result2=new Map;return map.forEach((obj2,key)=>{result2.set(key,obj2)}),result2}if("[object Set]"===tag){const set=obj,result2=new Set;return set.forEach(obj2=>{result2.add(obj2)}),result2}if("[object Arguments]"===tag){const args=obj,result2={};return copyOwnProperties(result2,args),result2.length=args.length,result2[Symbol.iterator]=args[Symbol.iterator],result2}const result={};return function(target,source){const proto=Object.getPrototypeOf(source);null!==proto&&"function"==typeof source.constructor&&Object.setPrototypeOf(target,proto)}(result,obj),copyOwnProperties(result,obj),function(target,source){const symbols=Object.getOwnPropertySymbols(source);for(let i=0;i<symbols.length;i++){const symbol=symbols[i];Object.prototype.propertyIsEnumerable.call(source,symbol)&&(target[symbol]=source[symbol])}}(result,obj),result}function copyOwnProperties(target,source){for(const key in source)Object.hasOwn(source,key)&&(target[key]=source[key])}var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[1,15],$V1=[1,7],$V2=[1,13],$V3=[1,14],$V4=[1,19],$V5=[1,16],$V6=[1,17],$V7=[1,18],$V8=[8,30],$V9=[8,10,21,28,29,30,31,39,43,46],$Va=[1,23],$Vb=[1,24],$Vc=[8,10,15,16,21,28,29,30,31,39,43,46],$Vd=[8,10,15,16,21,27,28,29,30,31,39,43,46],$Ve=[1,49],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 4:yy.getLogger().debug("Rule: separator (NL) ");break;case 5:yy.getLogger().debug("Rule: separator (Space) ");break;case 6:yy.getLogger().debug("Rule: separator (EOF) ");break;case 7:yy.getLogger().debug("Rule: hierarchy: ",$$[$0-1]),yy.setHierarchy($$[$0-1]);break;case 8:yy.getLogger().debug("Stop NL ");break;case 9:yy.getLogger().debug("Stop EOF ");break;case 10:yy.getLogger().debug("Stop NL2 ");break;case 11:yy.getLogger().debug("Stop EOF2 ");break;case 12:yy.getLogger().debug("Rule: statement: ",$$[$0]),"number"==typeof $$[$0].length?this.$=$$[$0]:this.$=[$$[$0]];break;case 13:yy.getLogger().debug("Rule: statement #2: ",$$[$0-1]),this.$=[$$[$0-1]].concat($$[$0]);break;case 14:yy.getLogger().debug("Rule: link: ",$$[$0],yytext),this.$={edgeTypeStr:$$[$0],label:""};break;case 15:yy.getLogger().debug("Rule: LABEL link: ",$$[$0-3],$$[$0-1],$$[$0]),this.$={edgeTypeStr:$$[$0],label:$$[$0-1]};break;case 18:const num=parseInt($$[$0]),spaceId=yy.generateId();this.$={id:spaceId,type:"space",label:"",width:num,children:[]};break;case 23:yy.getLogger().debug("Rule: (nodeStatement link node) ",$$[$0-2],$$[$0-1],$$[$0]," typestr: ",$$[$0-1].edgeTypeStr);const edgeData=yy.edgeStrToEdgeData($$[$0-1].edgeTypeStr),startEdgeData=yy.edgeStrToEdgeStartData($$[$0-1].edgeTypeStr),lineThickness=yy.edgeStrToThickness($$[$0-1].edgeTypeStr),linePattern=yy.edgeStrToPattern($$[$0-1].edgeTypeStr);this.$=[{id:$$[$0-2].id,label:$$[$0-2].label,type:$$[$0-2].type,directions:$$[$0-2].directions},{id:$$[$0-2].id+"-"+$$[$0].id,start:$$[$0-2].id,end:$$[$0].id,label:$$[$0-1].label,type:"edge",thickness:lineThickness,pattern:linePattern,directions:$$[$0].directions,arrowTypeEnd:edgeData,arrowTypeStart:startEdgeData},{id:$$[$0].id,label:$$[$0].label,type:yy.typeStr2Type($$[$0].typeStr),directions:$$[$0].directions}];break;case 24:yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ",$$[$0-1],$$[$0]),this.$={id:$$[$0-1].id,label:$$[$0-1].label,type:yy.typeStr2Type($$[$0-1].typeStr),directions:$$[$0-1].directions,widthInColumns:parseInt($$[$0],10)};break;case 25:yy.getLogger().debug("Rule: nodeStatement (node) ",$$[$0]),this.$={id:$$[$0].id,label:$$[$0].label,type:yy.typeStr2Type($$[$0].typeStr),directions:$$[$0].directions,widthInColumns:1};break;case 26:yy.getLogger().debug("APA123",this?this:"na"),yy.getLogger().debug("COLUMNS: ",$$[$0]),this.$={type:"column-setting",columns:"auto"===$$[$0]?-1:parseInt($$[$0])};break;case 27:yy.getLogger().debug("Rule: id-block statement : ",$$[$0-2],$$[$0-1]),yy.generateId(),this.$={...$$[$0-2],type:"composite",children:$$[$0-1]};break;case 28:yy.getLogger().debug("Rule: blockStatement : ",$$[$0-2],$$[$0-1],$$[$0]);const id=yy.generateId();this.$={id:id,type:"composite",label:"",children:$$[$0-1]};break;case 29:yy.getLogger().debug("Rule: node (NODE_ID separator): ",$$[$0]),this.$={id:$$[$0]};break;case 30:yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",$$[$0-1],$$[$0]),this.$={id:$$[$0-1],label:$$[$0].label,typeStr:$$[$0].typeStr,directions:$$[$0].directions};break;case 31:yy.getLogger().debug("Rule: dirList: ",$$[$0]),this.$=[$$[$0]];break;case 32:yy.getLogger().debug("Rule: dirList: ",$$[$0-1],$$[$0]),this.$=[$$[$0-1]].concat($$[$0]);break;case 33:yy.getLogger().debug("Rule: nodeShapeNLabel: ",$$[$0-2],$$[$0-1],$$[$0]),this.$={typeStr:$$[$0-2]+$$[$0],label:$$[$0-1]};break;case 34:yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",$$[$0-3],$$[$0-2]," #3:",$$[$0-1],$$[$0]),this.$={typeStr:$$[$0-3]+$$[$0],label:$$[$0-2],directions:$$[$0-1]};break;case 35:case 36:this.$={type:"classDef",id:$$[$0-1].trim(),css:$$[$0].trim()};break;case 37:this.$={type:"applyClass",id:$$[$0-1].trim(),styleClass:$$[$0].trim()};break;case 38:this.$={type:"applyStyles",id:$$[$0-1].trim(),stylesStr:$$[$0].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:$V0,11:3,13:4,19:5,20:6,21:$V1,22:8,23:9,24:10,25:11,26:12,28:$V2,29:$V3,31:$V4,39:$V5,43:$V6,46:$V7},{8:[1,20]},o($V8,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:$V0,21:$V1,28:$V2,29:$V3,31:$V4,39:$V5,43:$V6,46:$V7}),o($V9,[2,16],{14:22,15:$Va,16:$Vb}),o($V9,[2,17]),o($V9,[2,18]),o($V9,[2,19]),o($V9,[2,20]),o($V9,[2,21]),o($V9,[2,22]),o($Vc,[2,25],{27:[1,25]}),o($V9,[2,26]),{19:26,26:12,31:$V4},{10:$V0,11:27,13:4,19:5,20:6,21:$V1,22:8,23:9,24:10,25:11,26:12,28:$V2,29:$V3,31:$V4,39:$V5,43:$V6,46:$V7},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},o($Vd,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},o($V8,[2,13]),{26:35,31:$V4},{31:[2,14]},{17:[1,36]},o($Vc,[2,24]),{10:$V0,11:37,13:4,14:22,15:$Va,16:$Vb,19:5,20:6,21:$V1,22:8,23:9,24:10,25:11,26:12,28:$V2,29:$V3,31:$V4,39:$V5,43:$V6,46:$V7},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},o($Vd,[2,30]),{18:[1,43]},{18:[1,44]},o($Vc,[2,23]),{18:[1,45]},{30:[1,46]},o($V9,[2,28]),o($V9,[2,35]),o($V9,[2,36]),o($V9,[2,37]),o($V9,[2,38]),{36:[1,47]},{33:48,34:$Ve},{15:[1,50]},o($V9,[2,27]),o($Vd,[2,33]),{38:[1,51]},{33:52,34:$Ve,38:[2,31]},{31:[2,15]},o($Vd,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,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:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.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),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=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),lines.length-1&&(this.yylineno-=lines.length-1);var r=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:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(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:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={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&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,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(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===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:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(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:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:return yy.getLogger().debug("Found block-beta"),10;case 1:return yy.getLogger().debug("Found id-block"),29;case 2:return yy.getLogger().debug("Found block"),10;case 3:yy.getLogger().debug(".",yy_.yytext);break;case 4:yy.getLogger().debug("_",yy_.yytext);break;case 5:return 5;case 6:return yy_.yytext=-1,28;case 7:return yy_.yytext=yy_.yytext.replace(/columns\s+/,""),yy.getLogger().debug("COLUMNS (LEX)",yy_.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:yy.getLogger().debug("LEX: POPPING STR:",yy_.yytext),this.popState();break;case 13:return yy.getLogger().debug("LEX: STR end:",yy_.yytext),"STR";case 14:return yy_.yytext=yy_.yytext.replace(/space\:/,""),yy.getLogger().debug("SPACE NUM (LEX)",yy_.yytext),21;case 15:return yy_.yytext="1",yy.getLogger().debug("COLUMNS (LEX)",yy_.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),yy.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),yy.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),yy.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),yy.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),yy.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),yy.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),yy.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),yy.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),yy.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),yy.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),yy.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),yy.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return yy.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return yy.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return yy.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return yy.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return yy.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return yy.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return yy.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return yy.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),yy.getLogger().debug("LEX ARR START"),37;case 74:return yy.getLogger().debug("Lex: NODE_ID",yy_.yytext),31;case 75:return yy.getLogger().debug("Lex: EOF",yy_.yytext),8;case 78:return"NODE_DESCR";case 80:yy.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:yy.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return yy.getLogger().debug("LEX: NODE_DESCR:",yy_.yytext),"NODE_DESCR";case 83:yy.getLogger().debug("LEX POPPING"),this.popState();break;case 84:yy.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return yy_.yytext=yy_.yytext.replace(/^,\s*/,""),yy.getLogger().debug("Lex (right): dir:",yy_.yytext),"DIR";case 86:return yy_.yytext=yy_.yytext.replace(/^,\s*/,""),yy.getLogger().debug("Lex (left):",yy_.yytext),"DIR";case 87:return yy_.yytext=yy_.yytext.replace(/^,\s*/,""),yy.getLogger().debug("Lex (x):",yy_.yytext),"DIR";case 88:return yy_.yytext=yy_.yytext.replace(/^,\s*/,""),yy.getLogger().debug("Lex (y):",yy_.yytext),"DIR";case 89:return yy_.yytext=yy_.yytext.replace(/^,\s*/,""),yy.getLogger().debug("Lex (up):",yy_.yytext),"DIR";case 90:return yy_.yytext=yy_.yytext.replace(/^,\s*/,""),yy.getLogger().debug("Lex (down):",yy_.yytext),"DIR";case 91:return yy_.yytext="]>",yy.getLogger().debug("Lex (ARROW_DIR end):",yy_.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return yy.getLogger().debug("Lex: LINK","#"+yy_.yytext+"#"),15;case 93:case 94:case 95:return yy.getLogger().debug("Lex: LINK",yy_.yytext),15;case 96:case 97:case 98:return yy.getLogger().debug("Lex: START_LINK",yy_.yytext),this.pushState("LLABEL"),16;case 100:return yy.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),yy.getLogger().debug("Lex: LINK","#"+yy_.yytext+"#"),15;case 102:case 103:return this.popState(),yy.getLogger().debug("Lex: LINK",yy_.yytext),15;case 104:return yy.getLogger().debug("Lex: COLON",yy_.yytext),yy_.yytext=yy_.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var block_default=parser,blockDatabase=new Map,edgeList=[],edgeCount=new Map,classes=new Map,diagramId="",sanitizeText2=__name(txt=>common_default.sanitizeText(txt,getConfig2()),"sanitizeText"),addStyleClass=__name(function(id,styleAttributes=""){let foundClass=classes.get(id);foundClass||(foundClass={id:id,styles:[],textStyles:[]},classes.set(id,foundClass)),null!=styleAttributes&&styleAttributes.split(",").forEach(attrib=>{const fixedAttrib=attrib.replace(/([^;]*);/,"$1").trim();if(RegExp("color").exec(attrib)){const newStyle2=fixedAttrib.replace("fill","bgFill").replace("color","fill");foundClass.textStyles.push(newStyle2)}foundClass.styles.push(fixedAttrib)})},"addStyleClass"),addStyle2Node=__name(function(id,styles=""){const foundBlock=blockDatabase.get(id);null!=styles&&(foundBlock.styles=styles.split(","))},"addStyle2Node"),setCssClass=__name(function(itemIds,cssClassName){itemIds.split(",").forEach(function(id){let foundBlock=blockDatabase.get(id);if(void 0===foundBlock){const trimmedId=id.trim();foundBlock={id:trimmedId,type:"na",children:[]},blockDatabase.set(trimmedId,foundBlock)}foundBlock.classes||(foundBlock.classes=[]),foundBlock.classes.push(cssClassName)})},"setCssClass"),populateBlockDatabase=__name((_blockList,parent)=>{const blockList=_blockList.flat(),children=[],columnSettingBlock=blockList.find(b=>"column-setting"===(null==b?void 0:b.type)),column=(null==columnSettingBlock?void 0:columnSettingBlock.columns)??-1;for(const block of blockList)if("number"==typeof column&&column>0&&"column-setting"!==block.type&&"number"==typeof block.widthInColumns&&block.widthInColumns>column&&log.warn(`Block ${block.id} width ${block.widthInColumns} exceeds configured column width ${column}`),block.label&&(block.label=sanitizeText2(block.label)),"classDef"!==block.type)if("applyClass"!==block.type)if("applyStyles"!==block.type)if("column-setting"===block.type)parent.columns=block.columns??-1;else if("edge"===block.type){const count=(edgeCount.get(block.id)??0)+1;edgeCount.set(block.id,count),block.id=count+"-"+block.id,edgeList.push(block)}else{block.label||("composite"===block.type?block.label="":block.label=block.id);const existingBlock=blockDatabase.get(block.id);if(void 0===existingBlock?blockDatabase.set(block.id,block):("na"!==block.type&&(existingBlock.type=block.type),block.label!==block.id&&(existingBlock.label=block.label)),block.children&&populateBlockDatabase(block.children,block),"space"===block.type){const w=block.width??1;for(let j=0;j<w;j++){const newBlock=clone(block);newBlock.id=newBlock.id+"-"+j,blockDatabase.set(newBlock.id,newBlock),children.push(newBlock)}}else void 0===existingBlock&&children.push(block)}else(null==block?void 0:block.stylesStr)&&addStyle2Node(block.id,null==block?void 0:block.stylesStr);else setCssClass(block.id,(null==block?void 0:block.styleClass)??"");else addStyleClass(block.id,block.css);parent.children=children},"populateBlockDatabase"),blocks=[],rootBlock={id:"root",type:"composite",children:[],columns:-1},clear2=__name(()=>{log.debug("Clear called"),clear(),rootBlock={id:"root",type:"composite",children:[],columns:-1},blockDatabase=new Map([["root",rootBlock]]),blocks=[],classes=new Map,edgeList=[],edgeCount=new Map,diagramId=""},"clear");function typeStr2Type(typeStr){switch(log.debug("typeStr2Type",typeStr),typeStr){case"[]":return"square";case"()":return log.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function edgeTypeStr2Type(typeStr){return log.debug("typeStr2Type",typeStr),"=="===typeStr?"thick":"normal"}function edgeStrToEdgeData(typeStr){switch(typeStr.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function edgeStrToEdgeStartData(typeStr){switch(typeStr.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function edgeStrToThickness(typeStr){return typeStr.includes("==")?"thick":"normal"}function edgeStrToPattern(typeStr){return typeStr.includes(".-")?"dotted":"solid"}__name(typeStr2Type,"typeStr2Type"),__name(edgeTypeStr2Type,"edgeTypeStr2Type"),__name(edgeStrToEdgeData,"edgeStrToEdgeData"),__name(edgeStrToEdgeStartData,"edgeStrToEdgeStartData"),__name(edgeStrToThickness,"edgeStrToThickness"),__name(edgeStrToPattern,"edgeStrToPattern");var cnt=0,generateId=__name(()=>(cnt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+cnt),"generateId"),setHierarchy=__name(block=>{rootBlock.children=block,populateBlockDatabase(block,rootBlock),blocks=rootBlock.children},"setHierarchy"),getColumns=__name(blockId=>{const block=blockDatabase.get(blockId);return block?block.columns?block.columns:block.children?block.children.length:-1:-1},"getColumns"),getBlocksFlat=__name(()=>[...blockDatabase.values()],"getBlocksFlat"),getBlocks=__name(()=>blocks||[],"getBlocks"),getEdges=__name(()=>edgeList,"getEdges"),getBlock=__name(id=>blockDatabase.get(id),"getBlock"),setBlock=__name(block=>{blockDatabase.set(block.id,block)},"setBlock"),setDiagramId=__name(id=>{diagramId=id},"setDiagramId"),getDiagramId=__name(()=>diagramId,"getDiagramId"),getLogger=__name(()=>log,"getLogger"),getClasses=__name(function(){return classes},"getClasses"),blockDB_default={getConfig:__name(()=>getConfig().block,"getConfig"),typeStr2Type:typeStr2Type,edgeTypeStr2Type:edgeTypeStr2Type,edgeStrToEdgeData:edgeStrToEdgeData,edgeStrToEdgeStartData:edgeStrToEdgeStartData,edgeStrToThickness:edgeStrToThickness,edgeStrToPattern:edgeStrToPattern,getLogger:getLogger,getBlocksFlat:getBlocksFlat,getBlocks:getBlocks,getEdges:getEdges,setHierarchy:setHierarchy,getBlock:getBlock,setBlock:setBlock,getColumns:getColumns,getClasses:getClasses,clear:clear2,generateId:generateId,setDiagramId:setDiagramId,getDiagramId:getDiagramId},fade=__name((color,opacity)=>{const channel2=channel,r=channel2(color,"r"),g=channel2(color,"g"),b=channel2(color,"b");return rgba(r,g,b,opacity)},"fade"),styles_default=__name(options=>`.label {\n font-family: ${options.fontFamily};\n color: ${options.nodeTextColor||options.textColor};\n }\n .cluster-label text {\n fill: ${options.titleColor};\n }\n .cluster-label span,p {\n color: ${options.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${options.nodeTextColor||options.textColor};\n color: ${options.nodeTextColor||options.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${options.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${options.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${options.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${options.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\n }\n rect {\n opacity: 0.5;\n background-color: ${options.edgeLabelBackground};\n fill: ${options.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${options.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${fade(options.mainBkg,.5)};\n fill: ${fade(options.clusterBkg,.5)};\n stroke: ${fade(options.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${options.titleColor};\n }\n\n .cluster span,p {\n color: ${options.titleColor};\n }\n /* .cluster div {\n color: ${options.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${options.fontFamily};\n font-size: 12px;\n background: ${options.tertiaryColor};\n border: 1px solid ${options.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${options.textColor};\n }\n ${getIconStyles()}\n`,"getStyles"),insertMarkers=__name((elem,markerArray,type,id)=>{markerArray.forEach(markerName=>{markers[markerName](elem,type,id)})},"insertMarkers"),markers={extension:__name((elem,type,id)=>{log.trace("Making markers for ",id),elem.append("defs").append("marker").attr("id",id+"_"+type+"-extensionStart").attr("class","marker extension "+type).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),elem.append("defs").append("marker").attr("id",id+"_"+type+"-extensionEnd").attr("class","marker extension "+type).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),composition:__name((elem,type,id)=>{elem.append("defs").append("marker").attr("id",id+"_"+type+"-compositionStart").attr("class","marker composition "+type).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),elem.append("defs").append("marker").attr("id",id+"_"+type+"-compositionEnd").attr("class","marker composition "+type).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),aggregation:__name((elem,type,id)=>{elem.append("defs").append("marker").attr("id",id+"_"+type+"-aggregationStart").attr("class","marker aggregation "+type).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),elem.append("defs").append("marker").attr("id",id+"_"+type+"-aggregationEnd").attr("class","marker aggregation "+type).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dependency:__name((elem,type,id)=>{elem.append("defs").append("marker").attr("id",id+"_"+type+"-dependencyStart").attr("class","marker dependency "+type).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),elem.append("defs").append("marker").attr("id",id+"_"+type+"-dependencyEnd").attr("class","marker dependency "+type).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lollipop:__name((elem,type,id)=>{elem.append("defs").append("marker").attr("id",id+"_"+type+"-lollipopStart").attr("class","marker lollipop "+type).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),elem.append("defs").append("marker").attr("id",id+"_"+type+"-lollipopEnd").attr("class","marker lollipop "+type).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),point:__name((elem,type,id)=>{elem.append("marker").attr("id",id+"_"+type+"-pointEnd").attr("class","marker "+type).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),elem.append("marker").attr("id",id+"_"+type+"-pointStart").attr("class","marker "+type).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),circle:__name((elem,type,id)=>{elem.append("marker").attr("id",id+"_"+type+"-circleEnd").attr("class","marker "+type).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),elem.append("marker").attr("id",id+"_"+type+"-circleStart").attr("class","marker "+type).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),cross:__name((elem,type,id)=>{elem.append("marker").attr("id",id+"_"+type+"-crossEnd").attr("class","marker cross "+type).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),elem.append("marker").attr("id",id+"_"+type+"-crossStart").attr("class","marker cross "+type).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),barb:__name((elem,type,id)=>{elem.append("defs").append("marker").attr("id",id+"_"+type+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb")},markers_default=insertMarkers;function calculateBlockPosition(columns,position){if(0===columns||!Number.isInteger(columns))throw new Error("Columns must be an integer !== 0.");if(position<0||!Number.isInteger(position))throw new Error("Position must be a non-negative integer."+position);if(columns<0)return{px:position,py:0};if(1===columns)return{px:0,py:position};return{px:position%columns,py:Math.floor(position/columns)}}__name(calculateBlockPosition,"calculateBlockPosition");var getMaxChildSize=__name(block=>{let maxWidth=0,maxHeight=0;for(const child of block.children){const{width:width,height:height,x:x,y:y}=child.size??{width:0,height:0,x:0,y:0};if(log.debug("getMaxChildSize abc95 child:",child.id,"width:",width,"height:",height,"x:",x,"y:",y,child.type),"space"===child.type)continue;const normalizedWidth=width/(child.widthInColumns??1);normalizedWidth>maxWidth&&(maxWidth=normalizedWidth),height>maxHeight&&(maxHeight=height)}return{width:maxWidth,height:maxHeight}},"getMaxChildSize");function setBlockSizes(block,db2,siblingWidth=0,siblingHeight=0,padding=8){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k;log.debug("setBlockSizes abc95 (start)",block.id,null==(_a=null==block?void 0:block.size)?void 0:_a.x,"block width =",null==block?void 0:block.size,"siblingWidth",siblingWidth),(null==(_b=null==block?void 0:block.size)?void 0:_b.width)||(block.size={width:siblingWidth,height:siblingHeight,x:0,y:0});let maxWidth=0,maxHeight=0;if((null==(_c=block.children)?void 0:_c.length)>0){for(const child of block.children)setBlockSizes(child,db2,0,0,padding);const childSize=getMaxChildSize(block);maxWidth=childSize.width,maxHeight=childSize.height,log.debug("setBlockSizes abc95 maxWidth of",block.id,":s children is ",maxWidth,maxHeight);for(const child of block.children)child.size&&(log.debug(`abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}`),child.size.width=maxWidth*(child.widthInColumns??1)+padding*((child.widthInColumns??1)-1),child.size.height=maxHeight,child.size.x=0,child.size.y=0,log.debug(`abc95 updating size of ${block.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}`));for(const child of block.children)setBlockSizes(child,db2,maxWidth,maxHeight,padding);const columns=block.columns??-1;let numItems=0;for(const child of block.children)numItems+=child.widthInColumns??1;let xSize=block.children.length;columns>0&&columns<numItems&&(xSize=columns);const ySize=Math.ceil(numItems/xSize);let width=xSize*(maxWidth+padding)+padding,height=ySize*(maxHeight+padding)+padding;if(width<siblingWidth){log.debug(`Detected to small sibling: abc95 ${block.id} siblingWidth ${siblingWidth} siblingHeight ${siblingHeight} width ${width}`),width=siblingWidth,height=siblingHeight;const childWidth=(siblingWidth-xSize*padding-padding)/xSize,childHeight=(siblingHeight-ySize*padding-padding)/ySize;log.debug("Size indata abc88",block.id,"childWidth",childWidth,"maxWidth",maxWidth),log.debug("Size indata abc88",block.id,"childHeight",childHeight,"maxHeight",maxHeight),log.debug("Size indata abc88 xSize",xSize,"padding",padding);for(const child of block.children)child.size&&(child.size.width=childWidth,child.size.height=childHeight,child.size.x=0,child.size.y=0)}if(log.debug(`abc95 (finale calc) ${block.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block.children.length} width=${Math.max(width,(null==(_d=block.size)?void 0:_d.width)||0)}`),width<((null==(_e=null==block?void 0:block.size)?void 0:_e.width)||0)){width=(null==(_f=null==block?void 0:block.size)?void 0:_f.width)||0;const num=columns>0?Math.min(block.children.length,columns):block.children.length;if(num>0){const childWidth=(width-num*padding-padding)/num;log.debug("abc95 (growing to fit) width",block.id,width,null==(_g=block.size)?void 0:_g.width,childWidth);for(const child of block.children)child.size&&(child.size.width=childWidth)}}block.size={width:width,height:height,x:0,y:0}}log.debug("setBlockSizes abc94 (done)",block.id,null==(_h=null==block?void 0:block.size)?void 0:_h.x,null==(_i=null==block?void 0:block.size)?void 0:_i.width,null==(_j=null==block?void 0:block.size)?void 0:_j.y,null==(_k=null==block?void 0:block.size)?void 0:_k.height)}function layoutBlocks(block,db2,padding=8){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_p,_q;log.debug(`abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${null==(_a=null==block?void 0:block.size)?void 0:_a.x} y: ${null==(_b=null==block?void 0:block.size)?void 0:_b.y} width: ${null==(_c=null==block?void 0:block.size)?void 0:_c.width}`);const columns=block.columns??-1;if(log.debug("layoutBlocks columns abc95",block.id,"=>",columns,block),block.children&&block.children.length>0){const width=(null==(_e=null==(_d=null==block?void 0:block.children[0])?void 0:_d.size)?void 0:_e.width)??0,widthOfChildren=block.children.length*width+(block.children.length-1)*padding;log.debug("widthOfChildren 88",widthOfChildren,"posX");const rowHeights=new Map;{let colPos=0;for(const child of block.children){if(!child.size)continue;const{py:py}=calculateBlockPosition(columns,colPos),currentMax=rowHeights.get(py)??0;child.size.height>currentMax&&rowHeights.set(py,child.size.height);let filled=(null==child?void 0:child.widthInColumns)??1;columns>0&&(filled=Math.min(filled,columns-colPos%columns)),colPos+=filled}}const rowYOffsets=new Map;{let offset=0;const rows=[...rowHeights.keys()].sort((a,b)=>a-b);for(const row of rows)rowYOffsets.set(row,offset),offset+=(rowHeights.get(row)??0)+padding}let columnPos=0;log.debug("abc91 block?.size?.x",block.id,null==(_f=null==block?void 0:block.size)?void 0:_f.x);let startingPosX=(null==(_g=null==block?void 0:block.size)?void 0:_g.x)?(null==(_h=null==block?void 0:block.size)?void 0:_h.x)+(-(null==(_i=null==block?void 0:block.size)?void 0:_i.width)/2||0):-padding,rowPos=0;for(const child of block.children){const parent=block;if(!child.size)continue;const{width:width2,height:height}=child.size,{px:px,py:py}=calculateBlockPosition(columns,columnPos);if(py!=rowPos&&(rowPos=py,startingPosX=(null==(_j=null==block?void 0:block.size)?void 0:_j.x)?(null==(_k=null==block?void 0:block.size)?void 0:_k.x)+(-(null==(_l=null==block?void 0:block.size)?void 0:_l.width)/2||0):-padding,log.debug("New row in layout for block",block.id," and child ",child.id,rowPos)),log.debug(`abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${null==(_m=null==parent?void 0:parent.size)?void 0:_m.x},${null==(_n=null==parent?void 0:parent.size)?void 0:_n.y}) parent: ${parent.id} width: ${width2}${padding}`),parent.size){const halfWidth=width2/2;child.size.x=startingPosX+padding+halfWidth,log.debug(`abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width2} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width2*((null==child?void 0:child.widthInColumns)??1)/2}`),startingPosX=child.size.x+halfWidth;const rowYOffset=rowYOffsets.get(py)??0,rowHeight=rowHeights.get(py)??height;child.size.y=parent.size.y-parent.size.height/2+rowYOffset+rowHeight/2+padding,log.debug(`abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width2*((null==child?void 0:child.widthInColumns)??1)/2}`)}child.children&&layoutBlocks(child,db2,padding);let columnsFilled=(null==child?void 0:child.widthInColumns)??1;columns>0&&(columnsFilled=Math.min(columnsFilled,columns-columnPos%columns)),columnPos+=columnsFilled,log.debug("abc88 columnsPos",child,columnPos)}}log.debug(`layout blocks (<==layoutBlocks) ${block.id} x: ${null==(_o=null==block?void 0:block.size)?void 0:_o.x} y: ${null==(_p=null==block?void 0:block.size)?void 0:_p.y} width: ${null==(_q=null==block?void 0:block.size)?void 0:_q.width}`)}function findBounds(block,{minX:minX,minY:minY,maxX:maxX,maxY:maxY}={minX:0,minY:0,maxX:0,maxY:0}){if(block.size&&"root"!==block.id){const{x:x,y:y,width:width,height:height}=block.size;x-width/2<minX&&(minX=x-width/2),y-height/2<minY&&(minY=y-height/2),x+width/2>maxX&&(maxX=x+width/2),y+height/2>maxY&&(maxY=y+height/2)}if(block.children)for(const child of block.children)({minX:minX,minY:minY,maxX:maxX,maxY:maxY}=findBounds(child,{minX:minX,minY:minY,maxX:maxX,maxY:maxY}));return{minX:minX,minY:minY,maxX:maxX,maxY:maxY}}function layout(db2){var _a,_b;const root=db2.getBlock("root");if(!root)return;const padding=(null==(_b=null==(_a=getConfig2())?void 0:_a.block)?void 0:_b.padding)??8;setBlockSizes(root,db2,0,0,padding),layoutBlocks(root,db2,padding),log.debug("getBlocks",JSON.stringify(root,null,2));const{minX:minX,minY:minY,maxX:maxX,maxY:maxY}=findBounds(root);return{x:minX,y:minY,width:maxX-minX,height:maxY-minY}}__name(setBlockSizes,"setBlockSizes"),__name(layoutBlocks,"layoutBlocks"),__name(findBounds,"findBounds"),__name(layout,"layout");var createLabel_default=__name(async(element,_vertexText,style,isTitle=!1,isNode=!1)=>{let vertexText=_vertexText||"";"object"==typeof vertexText&&(vertexText=vertexText[0]);const config=getConfig2(),useHtmlLabels=getEffectiveHtmlLabels(config);return await createText(element,vertexText,{style:style,isTitle:isTitle,useHtmlLabels:useHtmlLabels,markdown:!1,isNode:isNode,width:Number.POSITIVE_INFINITY},config)},"createLabel"),addEdgeMarkers=__name((svgPath,edge,url,id,diagramType)=>{edge.arrowTypeStart&&addEdgeMarker(svgPath,"start",edge.arrowTypeStart,url,id,diagramType),edge.arrowTypeEnd&&addEdgeMarker(svgPath,"end",edge.arrowTypeEnd,url,id,diagramType)},"addEdgeMarkers"),arrowTypesMap={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},addEdgeMarker=__name((svgPath,position,arrowType,url,id,diagramType)=>{const endMarkerType=arrowTypesMap[arrowType];if(!endMarkerType)return void log.warn(`Unknown arrow type: ${arrowType}`);const suffix="start"===position?"Start":"End";svgPath.attr(`marker-${position}`,`url(${url}#${id}_${diagramType}-${endMarkerType}${suffix})`)},"addEdgeMarker"),edgeLabels={},terminalLabels={},insertEdgeLabel=__name(async(elem,edge)=>{const config=getConfig2(),useHtmlLabels=getEffectiveHtmlLabels(config),edgeLabel=elem.insert("g").attr("class","edgeLabel"),label=edgeLabel.insert("g").attr("class","label"),isMarkdown="markdown"===edge.labelType,labelElement=await createText(elem,edge.label,{style:edge.labelStyle,useHtmlLabels:useHtmlLabels,addSvgBackground:isMarkdown,isNode:!1,markdown:isMarkdown,width:isMarkdown?void 0:Number.POSITIVE_INFINITY},config);label.node().appendChild(labelElement);let fo,bbox=labelElement.getBBox(),transformBbox=bbox;if(useHtmlLabels){const div=labelElement.children[0],dv=select(labelElement);bbox=div.getBoundingClientRect(),transformBbox=bbox,dv.attr("width",bbox.width),dv.attr("height",bbox.height)}else{const textEl=select(labelElement).select("text").node();textEl&&"function"==typeof textEl.getBBox&&(transformBbox=textEl.getBBox())}if(label.attr("transform",computeLabelTransform(transformBbox,useHtmlLabels)),edgeLabels[edge.id]=edgeLabel,edge.width=bbox.width,edge.height=bbox.height,edge.startLabelLeft){const startEdgeLabelLeft=elem.insert("g").attr("class","edgeTerminals"),inner=startEdgeLabelLeft.insert("g").attr("class","inner"),startLabelElement=await createLabel_default(inner,edge.startLabelLeft,edge.labelStyle);fo=startLabelElement;let slBox=startLabelElement.getBBox();if(useHtmlLabels){const div=startLabelElement.children[0],dv=select(startLabelElement);slBox=div.getBoundingClientRect(),dv.attr("width",slBox.width),dv.attr("height",slBox.height)}inner.attr("transform",computeLabelTransform(slBox,useHtmlLabels)),terminalLabels[edge.id]||(terminalLabels[edge.id]={}),terminalLabels[edge.id].startLeft=startEdgeLabelLeft,setTerminalWidth(fo,edge.startLabelLeft)}if(edge.startLabelRight){const startEdgeLabelRight=elem.insert("g").attr("class","edgeTerminals"),inner=startEdgeLabelRight.insert("g").attr("class","inner"),startLabelElement=await createLabel_default(inner,edge.startLabelRight,edge.labelStyle);fo=startLabelElement;let slBox=startLabelElement.getBBox();if(useHtmlLabels){const div=startLabelElement.children[0],dv=select(startLabelElement);slBox=div.getBoundingClientRect(),dv.attr("width",slBox.width),dv.attr("height",slBox.height)}inner.attr("transform",computeLabelTransform(slBox,useHtmlLabels)),terminalLabels[edge.id]||(terminalLabels[edge.id]={}),terminalLabels[edge.id].startRight=startEdgeLabelRight,setTerminalWidth(fo,edge.startLabelRight)}if(edge.endLabelLeft){const endEdgeLabelLeft=elem.insert("g").attr("class","edgeTerminals"),inner=endEdgeLabelLeft.insert("g").attr("class","inner"),endLabelElement=await createLabel_default(endEdgeLabelLeft,edge.endLabelLeft,edge.labelStyle);fo=endLabelElement;let slBox=endLabelElement.getBBox();if(useHtmlLabels){const div=endLabelElement.children[0],dv=select(endLabelElement);slBox=div.getBoundingClientRect(),dv.attr("width",slBox.width),dv.attr("height",slBox.height)}inner.attr("transform",computeLabelTransform(slBox,useHtmlLabels)),terminalLabels[edge.id]||(terminalLabels[edge.id]={}),terminalLabels[edge.id].endLeft=endEdgeLabelLeft,setTerminalWidth(fo,edge.endLabelLeft)}if(edge.endLabelRight){const endEdgeLabelRight=elem.insert("g").attr("class","edgeTerminals"),inner=endEdgeLabelRight.insert("g").attr("class","inner"),endLabelElement=await createLabel_default(endEdgeLabelRight,edge.endLabelRight,edge.labelStyle);fo=endLabelElement;let slBox=endLabelElement.getBBox();if(useHtmlLabels){const div=endLabelElement.children[0],dv=select(endLabelElement);slBox=div.getBoundingClientRect(),dv.attr("width",slBox.width),dv.attr("height",slBox.height)}inner.attr("transform",computeLabelTransform(slBox,useHtmlLabels)),terminalLabels[edge.id]||(terminalLabels[edge.id]={}),terminalLabels[edge.id].endRight=endEdgeLabelRight,setTerminalWidth(fo,edge.endLabelRight)}return labelElement},"insertEdgeLabel");function setTerminalWidth(fo,value){getEffectiveHtmlLabels(getConfig2())&&fo&&(fo.style.width=9*value.length+"px",fo.style.height="12px")}__name(setTerminalWidth,"setTerminalWidth");var positionEdgeLabel=__name((edge,paths)=>{log.debug("Moving label abc88 ",edge.id,edge.label,edgeLabels[edge.id],paths);let path=paths.updatedPath?paths.updatedPath:paths.originalPath;const siteConfig=getConfig2(),{subGraphTitleTotalMargin:subGraphTitleTotalMargin}=getSubGraphTitleMargins(siteConfig);if(edge.label){const el=edgeLabels[edge.id];let x=edge.x,y=edge.y;if(path){const pos=utils_default.calcLabelPosition(path);log.debug("Moving label "+edge.label+" from (",x,",",y,") to (",pos.x,",",pos.y,") abc88"),paths.updatedPath&&(x=pos.x,y=pos.y)}el.attr("transform",`translate(${x}, ${y+subGraphTitleTotalMargin/2})`)}if(edge.startLabelLeft){const el=terminalLabels[edge.id].startLeft;let x=edge.x,y=edge.y;if(path){const pos=utils_default.calcTerminalLabelPosition(edge.arrowTypeStart?10:0,"start_left",path);x=pos.x,y=pos.y}el.attr("transform",`translate(${x}, ${y})`)}if(edge.startLabelRight){const el=terminalLabels[edge.id].startRight;let x=edge.x,y=edge.y;if(path){const pos=utils_default.calcTerminalLabelPosition(edge.arrowTypeStart?10:0,"start_right",path);x=pos.x,y=pos.y}el.attr("transform",`translate(${x}, ${y})`)}if(edge.endLabelLeft){const el=terminalLabels[edge.id].endLeft;let x=edge.x,y=edge.y;if(path){const pos=utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd?10:0,"end_left",path);x=pos.x,y=pos.y}el.attr("transform",`translate(${x}, ${y})`)}if(edge.endLabelRight){const el=terminalLabels[edge.id].endRight;let x=edge.x,y=edge.y;if(path){const pos=utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd?10:0,"end_right",path);x=pos.x,y=pos.y}el.attr("transform",`translate(${x}, ${y})`)}},"positionEdgeLabel"),outsideNode=__name((node,point2)=>{const x=node.x,y=node.y,dx=Math.abs(point2.x-x),dy=Math.abs(point2.y-y),w=node.width/2,h=node.height/2;return dx>=w||dy>=h},"outsideNode"),intersection=__name((node,outsidePoint,insidePoint)=>{log.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(outsidePoint)}\n insidePoint : ${JSON.stringify(insidePoint)}\n node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);const x=node.x,y=node.y,dx=Math.abs(x-insidePoint.x),w=node.width/2;let r=insidePoint.x<outsidePoint.x?w-dx:w+dx;const h=node.height/2,Q=Math.abs(outsidePoint.y-insidePoint.y),R=Math.abs(outsidePoint.x-insidePoint.x);if(Math.abs(y-outsidePoint.y)*w>Math.abs(x-outsidePoint.x)*h){let q=insidePoint.y<outsidePoint.y?outsidePoint.y-h-y:y-h-outsidePoint.y;r=R*q/Q;const res={x:insidePoint.x<outsidePoint.x?insidePoint.x+r:insidePoint.x-R+r,y:insidePoint.y<outsidePoint.y?insidePoint.y+Q-q:insidePoint.y-Q+q};return 0===r&&(res.x=outsidePoint.x,res.y=outsidePoint.y),0===R&&(res.x=outsidePoint.x),0===Q&&(res.y=outsidePoint.y),log.debug(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`,res),res}{r=insidePoint.x<outsidePoint.x?outsidePoint.x-w-x:x-w-outsidePoint.x;let q=Q*r/R,_x=insidePoint.x<outsidePoint.x?insidePoint.x+R-r:insidePoint.x-R+r,_y=insidePoint.y<outsidePoint.y?insidePoint.y+q:insidePoint.y-q;return log.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`,{_x:_x,_y:_y}),0===r&&(_x=outsidePoint.x,_y=outsidePoint.y),0===R&&(_x=outsidePoint.x),0===Q&&(_y=outsidePoint.y),{x:_x,y:_y}}},"intersection"),cutPathAtIntersect=__name((_points,boundaryNode)=>{log.debug("abc88 cutPathAtIntersect",_points,boundaryNode);let points=[],lastPointOutside=_points[0],isInside=!1;return _points.forEach(point2=>{if(outsideNode(boundaryNode,point2)||isInside)lastPointOutside=point2,isInside||points.push(point2);else{const inter=intersection(boundaryNode,lastPointOutside,point2);let pointPresent=!1;points.forEach(p=>{pointPresent=pointPresent||p.x===inter.x&&p.y===inter.y}),points.some(e=>e.x===inter.x&&e.y===inter.y)||points.push(inter),isInside=!0}}),points},"cutPathAtIntersect"),insertEdge=__name(function(elem,e,edge,clusterDb,diagramType,graph,id){let points=edge.points;log.debug("abc88 InsertEdge: edge=",edge,"e=",e);let pointsHasChanged=!1;const tail=graph.node(e.v);var head=graph.node(e.w);(null==head?void 0:head.intersect)&&(null==tail?void 0:tail.intersect)&&(points=points.slice(1,edge.points.length-1),points.unshift(tail.intersect(points[0])),points.push(head.intersect(points[points.length-1]))),edge.toCluster&&(log.debug("to cluster abc88",clusterDb[edge.toCluster]),points=cutPathAtIntersect(edge.points,clusterDb[edge.toCluster].node),pointsHasChanged=!0),edge.fromCluster&&(log.debug("from cluster abc88",clusterDb[edge.fromCluster]),points=cutPathAtIntersect(points.reverse(),clusterDb[edge.fromCluster].node).reverse(),pointsHasChanged=!0);const lineData=points.filter(p=>!Number.isNaN(p.y));let curve=curveBasis;!edge.curve||"graph"!==diagramType&&"flowchart"!==diagramType||(curve=edge.curve);const{x:x,y:y}=getLineFunctionsWithOffset(edge),lineFunction=line().x(x).y(y).curve(curve);let strokeClasses;switch(edge.thickness){case"normal":strokeClasses="edge-thickness-normal";break;case"thick":case"invisible":strokeClasses="edge-thickness-thick";break;default:strokeClasses=""}switch(edge.pattern){case"solid":strokeClasses+=" edge-pattern-solid";break;case"dotted":strokeClasses+=" edge-pattern-dotted";break;case"dashed":strokeClasses+=" edge-pattern-dashed"}const svgPath=elem.append("path").attr("d",lineFunction(lineData)).attr("id",edge.id).attr("class"," "+strokeClasses+(edge.classes?" "+edge.classes:"")).attr("style",edge.style);let url="";(getConfig2().flowchart.arrowMarkerAbsolute||getConfig2().state.arrowMarkerAbsolute)&&(url=getUrl(!0)),addEdgeMarkers(svgPath,edge,url,id,diagramType);let paths={};return pointsHasChanged&&(paths.updatedPath=points),paths.originalPath=edge.points,paths},"insertEdge"),expandAndDeduplicateDirections=__name(directions=>{const uniqueDirections=new Set;for(const direction of directions)switch(direction){case"x":uniqueDirections.add("right"),uniqueDirections.add("left");break;case"y":uniqueDirections.add("up"),uniqueDirections.add("down");break;default:uniqueDirections.add(direction)}return uniqueDirections},"expandAndDeduplicateDirections"),getArrowPoints=__name((duplicatedDirections,bbox,node,totalWidth)=>{const directions=expandAndDeduplicateDirections(duplicatedDirections),height=bbox.height+2*node.padding,midpoint=height/2,width=totalWidth??bbox.width+2*midpoint+node.padding,padding=node.padding/2;return directions.has("right")&&directions.has("left")&&directions.has("up")&&directions.has("down")?[{x:0,y:0},{x:midpoint,y:0},{x:width/2,y:2*padding},{x:width-midpoint,y:0},{x:width,y:0},{x:width,y:-height/3},{x:width+2*padding,y:-height/2},{x:width,y:-2*height/3},{x:width,y:-height},{x:width-midpoint,y:-height},{x:width/2,y:-height-2*padding},{x:midpoint,y:-height},{x:0,y:-height},{x:0,y:-2*height/3},{x:-2*padding,y:-height/2},{x:0,y:-height/3}]:directions.has("right")&&directions.has("left")&&directions.has("up")?[{x:midpoint,y:0},{x:width-midpoint,y:0},{x:width,y:-height/2},{x:width-midpoint,y:-height},{x:midpoint,y:-height},{x:0,y:-height/2}]:directions.has("right")&&directions.has("left")&&directions.has("down")?[{x:0,y:0},{x:midpoint,y:-height},{x:width-midpoint,y:-height},{x:width,y:0}]:directions.has("right")&&directions.has("up")&&directions.has("down")?[{x:0,y:0},{x:width,y:-midpoint},{x:width,y:-height+midpoint},{x:0,y:-height}]:directions.has("left")&&directions.has("up")&&directions.has("down")?[{x:width,y:0},{x:0,y:-midpoint},{x:0,y:-height+midpoint},{x:width,y:-height}]:directions.has("right")&&directions.has("left")?[{x:midpoint,y:0},{x:midpoint,y:-padding},{x:width-midpoint,y:-padding},{x:width-midpoint,y:0},{x:width,y:-height/2},{x:width-midpoint,y:-height},{x:width-midpoint,y:-height+padding},{x:midpoint,y:-height+padding},{x:midpoint,y:-height},{x:0,y:-height/2}]:directions.has("up")&&directions.has("down")?[{x:width/2,y:0},{x:0,y:-padding},{x:midpoint,y:-padding},{x:midpoint,y:-height+padding},{x:0,y:-height+padding},{x:width/2,y:-height},{x:width,y:-height+padding},{x:width-midpoint,y:-height+padding},{x:width-midpoint,y:-padding},{x:width,y:-padding}]:directions.has("right")&&directions.has("up")?[{x:0,y:0},{x:width,y:-midpoint},{x:0,y:-height}]:directions.has("right")&&directions.has("down")?[{x:0,y:0},{x:width,y:0},{x:0,y:-height}]:directions.has("left")&&directions.has("up")?[{x:width,y:0},{x:0,y:-midpoint},{x:width,y:-height}]:directions.has("left")&&directions.has("down")?[{x:width,y:0},{x:0,y:0},{x:width,y:-height}]:directions.has("right")?[{x:midpoint,y:-padding},{x:midpoint,y:-padding},{x:width-midpoint,y:-padding},{x:width-midpoint,y:0},{x:width,y:-height/2},{x:width-midpoint,y:-height},{x:width-midpoint,y:-height+padding},{x:midpoint,y:-height+padding},{x:midpoint,y:-height+padding}]:directions.has("left")?[{x:midpoint,y:0},{x:midpoint,y:-padding},{x:width-midpoint,y:-padding},{x:width-midpoint,y:-height+padding},{x:midpoint,y:-height+padding},{x:midpoint,y:-height},{x:0,y:-height/2}]:directions.has("up")?[{x:midpoint,y:-padding},{x:midpoint,y:-height+padding},{x:0,y:-height+padding},{x:width/2,y:-height},{x:width,y:-height+padding},{x:width-midpoint,y:-height+padding},{x:width-midpoint,y:-padding}]:directions.has("down")?[{x:width/2,y:0},{x:0,y:-padding},{x:midpoint,y:-padding},{x:midpoint,y:-height+padding},{x:width-midpoint,y:-height+padding},{x:width-midpoint,y:-padding},{x:width,y:-padding}]:[{x:0,y:0}]},"getArrowPoints");function intersectNode(node,point2){return node.intersect(point2)}__name(intersectNode,"intersectNode");var intersect_node_default=intersectNode;function intersectEllipse(node,rx,ry,point2){var cx=node.x,cy=node.y,px=cx-point2.x,py=cy-point2.y,det=Math.sqrt(rx*rx*py*py+ry*ry*px*px),dx=Math.abs(rx*ry*px/det);point2.x<cx&&(dx=-dx);var dy=Math.abs(rx*ry*py/det);return point2.y<cy&&(dy=-dy),{x:cx+dx,y:cy+dy}}__name(intersectEllipse,"intersectEllipse");var intersect_ellipse_default=intersectEllipse;function intersectCircle(node,rx,point2){return intersect_ellipse_default(node,rx,rx,point2)}__name(intersectCircle,"intersectCircle");var intersect_circle_default=intersectCircle;function intersectLine(p1,p2,q1,q2){var a1,a2,b1,b2,c1,c2,r1,r2,r3,r4,denom,offset,num;if(a1=p2.y-p1.y,b1=p1.x-p2.x,c1=p2.x*p1.y-p1.x*p2.y,r3=a1*q1.x+b1*q1.y+c1,r4=a1*q2.x+b1*q2.y+c1,!(0!==r3&&0!==r4&&sameSign(r3,r4)||(a2=q2.y-q1.y,b2=q1.x-q2.x,c2=q2.x*q1.y-q1.x*q2.y,r1=a2*p1.x+b2*p1.y+c2,r2=a2*p2.x+b2*p2.y+c2,0!==r1&&0!==r2&&sameSign(r1,r2)||0===(denom=a1*b2-a2*b1))))return offset=Math.abs(denom/2),{x:(num=b1*c2-b2*c1)<0?(num-offset)/denom:(num+offset)/denom,y:(num=a2*c1-a1*c2)<0?(num-offset)/denom:(num+offset)/denom}}function sameSign(r1,r2){return r1*r2>0}__name(intersectLine,"intersectLine"),__name(sameSign,"sameSign");var intersect_line_default=intersectLine,intersect_polygon_default=intersectPolygon;function intersectPolygon(node,polyPoints,point2){var x1=node.x,y1=node.y,intersections=[],minX=Number.POSITIVE_INFINITY,minY=Number.POSITIVE_INFINITY;"function"==typeof polyPoints.forEach?polyPoints.forEach(function(entry){minX=Math.min(minX,entry.x),minY=Math.min(minY,entry.y)}):(minX=Math.min(minX,polyPoints.x),minY=Math.min(minY,polyPoints.y));for(var left=x1-node.width/2-minX,top=y1-node.height/2-minY,i=0;i<polyPoints.length;i++){var p1=polyPoints[i],p2=polyPoints[i<polyPoints.length-1?i+1:0],intersect=intersect_line_default(node,point2,{x:left+p1.x,y:top+p1.y},{x:left+p2.x,y:top+p2.y});intersect&&intersections.push(intersect)}return intersections.length?(intersections.length>1&&intersections.sort(function(p,q){var pdx=p.x-point2.x,pdy=p.y-point2.y,distp=Math.sqrt(pdx*pdx+pdy*pdy),qdx=q.x-point2.x,qdy=q.y-point2.y,distq=Math.sqrt(qdx*qdx+qdy*qdy);return distp<distq?-1:distp===distq?0:1}),intersections[0]):node}__name(intersectPolygon,"intersectPolygon");var intersect_default={node:intersect_node_default,circle:intersect_circle_default,ellipse:intersect_ellipse_default,polygon:intersect_polygon_default,rect:__name((node,point2)=>{var sx,sy,x=node.x,y=node.y,dx=point2.x-x,dy=point2.y-y,w=node.width/2,h=node.height/2;return Math.abs(dy)*w>Math.abs(dx)*h?(dy<0&&(h=-h),sx=0===dy?0:h*dx/dy,sy=h):(dx<0&&(w=-w),sx=w,sy=0===dx?0:w*dy/dx),{x:x+sx,y:y+sy}},"intersectRect")},labelHelper=__name(async(parent,node,_classes,isNode)=>{const config=getConfig2();let classes2;const useHtmlLabels=node.useHtmlLabels||getEffectiveHtmlLabels(config);classes2=_classes||"node default";const shapeSvg=parent.insert("g").attr("class",classes2).attr("id",node.domId||node.id),label=shapeSvg.insert("g").attr("class","label").attr("style",node.labelStyle);let labelText,text;labelText=void 0===node.labelText?"":"string"==typeof node.labelText?node.labelText:node.labelText[0],text="markdown"===node.labelType?createText(label,sanitizeText(decodeEntities(labelText),config),{useHtmlLabels:useHtmlLabels,width:node.width||config.flowchart.wrappingWidth,classes:"markdown-node-label"},config):await createLabel_default(label,sanitizeText(decodeEntities(labelText),config),node.labelStyle,!1,isNode);let bbox=text.getBBox();const halfPadding=node.padding/2;if(getEffectiveHtmlLabels(config)){const div=text.children[0],dv=select(text);await configureLabelImages(div,labelText),bbox=div.getBoundingClientRect(),dv.attr("width",bbox.width),dv.attr("height",bbox.height)}return useHtmlLabels?label.attr("transform","translate("+-bbox.width/2+", "+-bbox.height/2+")"):label.attr("transform","translate(0, "+-bbox.height/2+")"),node.centerLabel&&label.attr("transform","translate("+-bbox.width/2+", "+-bbox.height/2+")"),label.insert("rect",":first-child"),{shapeSvg:shapeSvg,bbox:bbox,halfPadding:halfPadding,label:label}},"labelHelper"),updateNodeBounds=__name((node,element)=>{const bbox=element.node().getBBox();node.width=bbox.width,node.height=bbox.height},"updateNodeBounds");function insertPolygonShape(parent,w,h,points){return parent.insert("polygon",":first-child").attr("points",points.map(function(d){return d.x+","+d.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-w/2+","+h/2+")")}__name(insertPolygonShape,"insertPolygonShape");var note_default=__name(async(parent,node)=>{node.useHtmlLabels||getEffectiveHtmlLabels(getConfig2())||(node.centerLabel=!0);const{shapeSvg:shapeSvg,bbox:bbox,halfPadding:halfPadding}=await labelHelper(parent,node,"node "+node.classes,!0);log.info("Classes = ",node.classes);const rect2=shapeSvg.insert("rect",":first-child");return rect2.attr("rx",node.rx).attr("ry",node.ry).attr("x",-bbox.width/2-halfPadding).attr("y",-bbox.height/2-halfPadding).attr("width",bbox.width+node.padding).attr("height",bbox.height+node.padding),updateNodeBounds(node,rect2),node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"note"),formatClass=__name(str=>str?" "+str:"","formatClass"),getClassesFromNode=__name((node,otherClasses)=>`${otherClasses||"node default"}${formatClass(node.classes)} ${formatClass(node.class)}`,"getClassesFromNode"),question=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),s=bbox.width+node.padding+(bbox.height+node.padding),points=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];log.info("Question main (Circle)");const questionElem=insertPolygonShape(shapeSvg,s,s,points);return questionElem.attr("style",node.style),updateNodeBounds(node,questionElem),node.intersect=function(point2){return log.warn("Intersect called"),intersect_default.polygon(node,points,point2)},shapeSvg},"question"),choice=__name((parent,node)=>{const shapeSvg=parent.insert("g").attr("class","node default").attr("id",node.domId||node.id),points=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return shapeSvg.insert("polygon",":first-child").attr("points",points.map(function(d){return d.x+","+d.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),node.width=28,node.height=28,node.intersect=function(point2){return intersect_default.circle(node,14,point2)},shapeSvg},"choice"),hexagon=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),h=node.positioned?node.height:bbox.height+node.padding,m=h/4,w=node.positioned?node.width:bbox.width+2*m+node.padding,points=[{x:m,y:0},{x:w-m,y:0},{x:w,y:-h/2},{x:w-m,y:-h},{x:m,y:-h},{x:0,y:-h/2}],hex=insertPolygonShape(shapeSvg,w,h,points);return hex.attr("style",node.style),updateNodeBounds(node,hex),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"hexagon"),block_arrow=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,void 0,!0),h=bbox.height+2*node.padding,m=h/2,naturalW=bbox.width+2*m+node.padding,w=node.positioned&&(node.widthInColumns??1)>1&&node.width>naturalW?node.width:naturalW,points=getArrowPoints(node.directions,bbox,node,w),blockArrow=insertPolygonShape(shapeSvg,w,h,points);return blockArrow.attr("style",node.style),updateNodeBounds(node,blockArrow),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"block_arrow"),rect_left_inv_arrow=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),w=bbox.width+node.padding,h=bbox.height+node.padding,points=[{x:-h/2,y:0},{x:w,y:0},{x:w,y:-h},{x:-h/2,y:-h},{x:0,y:-h/2}];return insertPolygonShape(shapeSvg,w,h,points).attr("style",node.style),node.width=w+h,node.height=h,node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"rect_left_inv_arrow"),lean_right=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node),!0),w=bbox.width+node.padding,h=bbox.height+node.padding,points=[{x:-2*h/6,y:0},{x:w-h/6,y:0},{x:w+2*h/6,y:-h},{x:h/6,y:-h}],el=insertPolygonShape(shapeSvg,w,h,points);return el.attr("style",node.style),updateNodeBounds(node,el),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"lean_right"),lean_left=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),w=bbox.width+node.padding,h=bbox.height+node.padding,points=[{x:2*h/6,y:0},{x:w+h/6,y:0},{x:w-2*h/6,y:-h},{x:-h/6,y:-h}],el=insertPolygonShape(shapeSvg,w,h,points);return el.attr("style",node.style),updateNodeBounds(node,el),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"lean_left"),trapezoid=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),w=bbox.width+node.padding,h=bbox.height+node.padding,points=[{x:-2*h/6,y:0},{x:w+2*h/6,y:0},{x:w-h/6,y:-h},{x:h/6,y:-h}],el=insertPolygonShape(shapeSvg,w,h,points);return el.attr("style",node.style),updateNodeBounds(node,el),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"trapezoid"),inv_trapezoid=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),w=bbox.width+node.padding,h=bbox.height+node.padding,points=[{x:h/6,y:0},{x:w-h/6,y:0},{x:w+2*h/6,y:-h},{x:-2*h/6,y:-h}],el=insertPolygonShape(shapeSvg,w,h,points);return el.attr("style",node.style),updateNodeBounds(node,el),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"inv_trapezoid"),rect_right_inv_arrow=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),w=bbox.width+node.padding,h=bbox.height+node.padding,points=[{x:0,y:0},{x:w+h/2,y:0},{x:w,y:-h/2},{x:w+h/2,y:-h},{x:0,y:-h}],el=insertPolygonShape(shapeSvg,w,h,points);return el.attr("style",node.style),updateNodeBounds(node,el),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"rect_right_inv_arrow"),cylinder=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),w=bbox.width+node.padding,rx=w/2,ry=rx/(2.5+w/50),h=bbox.height+ry+node.padding,shape="M 0,"+ry+" a "+rx+","+ry+" 0,0,0 "+w+" 0 a "+rx+","+ry+" 0,0,0 "+-w+" 0 l 0,"+h+" a "+rx+","+ry+" 0,0,0 "+w+" 0 l 0,"+-h,el=shapeSvg.attr("label-offset-y",ry).insert("path",":first-child").attr("style",node.style).attr("d",shape).attr("transform","translate("+-w/2+","+-(h/2+ry)+")");return updateNodeBounds(node,el),node.intersect=function(point2){const pos=intersect_default.rect(node,point2),x=pos.x-node.x;if(0!=rx&&(Math.abs(x)<node.width/2||Math.abs(x)==node.width/2&&Math.abs(pos.y-node.y)>node.height/2-ry)){let y=ry*ry*(1-x*x/(rx*rx));0!=y&&(y=Math.sqrt(y)),y=ry-y,point2.y-node.y>0&&(y=-y),pos.y+=y}return pos},shapeSvg},"cylinder"),rect=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox,halfPadding:halfPadding}=await labelHelper(parent,node,"node "+node.classes+" "+node.class,!0),rect2=shapeSvg.insert("rect",":first-child"),totalWidth=node.positioned?node.width:bbox.width+node.padding,totalHeight=node.positioned?node.height:bbox.height+node.padding,x=node.positioned?-totalWidth/2:-bbox.width/2-halfPadding,y=node.positioned?-totalHeight/2:-bbox.height/2-halfPadding;if(rect2.attr("class","basic label-container").attr("style",node.style).attr("rx",node.rx).attr("ry",node.ry).attr("x",x).attr("y",y).attr("width",totalWidth).attr("height",totalHeight),node.props){const propKeys=new Set(Object.keys(node.props));node.props.borders&&(applyNodePropertyBorders(rect2,node.props.borders,totalWidth,totalHeight),propKeys.delete("borders")),propKeys.forEach(propKey=>{log.warn(`Unknown node property ${propKey}`)})}return updateNodeBounds(node,rect2),node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"rect"),composite=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox,halfPadding:halfPadding}=await labelHelper(parent,node,"node "+node.classes,!0),rect2=shapeSvg.insert("rect",":first-child"),totalWidth=node.positioned?node.width:bbox.width+node.padding,totalHeight=node.positioned?node.height:bbox.height+node.padding,x=node.positioned?-totalWidth/2:-bbox.width/2-halfPadding,y=node.positioned?-totalHeight/2:-bbox.height/2-halfPadding;if(rect2.attr("class","basic cluster composite label-container").attr("style",node.style).attr("rx",node.rx).attr("ry",node.ry).attr("x",x).attr("y",y).attr("width",totalWidth).attr("height",totalHeight),node.props){const propKeys=new Set(Object.keys(node.props));node.props.borders&&(applyNodePropertyBorders(rect2,node.props.borders,totalWidth,totalHeight),propKeys.delete("borders")),propKeys.forEach(propKey=>{log.warn(`Unknown node property ${propKey}`)})}return updateNodeBounds(node,rect2),node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"composite"),labelRect=__name(async(parent,node)=>{const{shapeSvg:shapeSvg}=await labelHelper(parent,node,"label",!0);log.trace("Classes = ",node.class);const rect2=shapeSvg.insert("rect",":first-child");if(rect2.attr("width",0).attr("height",0),shapeSvg.attr("class","label edgeLabel"),node.props){const propKeys=new Set(Object.keys(node.props));node.props.borders&&(applyNodePropertyBorders(rect2,node.props.borders,0,0),propKeys.delete("borders")),propKeys.forEach(propKey=>{log.warn(`Unknown node property ${propKey}`)})}return updateNodeBounds(node,rect2),node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"labelRect");function applyNodePropertyBorders(rect2,borders,totalWidth,totalHeight){const strokeDashArray=[],addBorder=__name(length=>{strokeDashArray.push(length,0)},"addBorder"),skipBorder=__name(length=>{strokeDashArray.push(0,length)},"skipBorder");borders.includes("t")?(log.debug("add top border"),addBorder(totalWidth)):skipBorder(totalWidth),borders.includes("r")?(log.debug("add right border"),addBorder(totalHeight)):skipBorder(totalHeight),borders.includes("b")?(log.debug("add bottom border"),addBorder(totalWidth)):skipBorder(totalWidth),borders.includes("l")?(log.debug("add left border"),addBorder(totalHeight)):skipBorder(totalHeight),rect2.attr("stroke-dasharray",strokeDashArray.join(" "))}__name(applyNodePropertyBorders,"applyNodePropertyBorders");var rectWithTitle=__name(async(parent,node)=>{let classes2;classes2=node.classes?"node "+node.classes:"node default";const shapeSvg=parent.insert("g").attr("class",classes2).attr("id",node.domId||node.id),rect2=shapeSvg.insert("rect",":first-child"),innerLine=shapeSvg.insert("line"),label=shapeSvg.insert("g").attr("class","label"),text2=node.labelText.flat?node.labelText.flat():node.labelText;let title="";title="object"==typeof text2?text2[0]:text2,log.info("Label text abc79",title,text2,"object"==typeof text2);const text=await createLabel_default(label,title,node.labelStyle,!0,!0);let bbox={width:0,height:0};if(getEffectiveHtmlLabels(getConfig2())){const div=text.children[0],dv=select(text);bbox=div.getBoundingClientRect(),dv.attr("width",bbox.width),dv.attr("height",bbox.height)}log.info("Text 2",text2);const textRows=text2.slice(1,text2.length);let titleBox=text.getBBox();const descr=await createLabel_default(label,textRows.join?textRows.join("<br/>"):textRows,node.labelStyle,!0,!0);if(getEffectiveHtmlLabels(getConfig2())){const div=descr.children[0],dv=select(descr);bbox=div.getBoundingClientRect(),dv.attr("width",bbox.width),dv.attr("height",bbox.height)}const halfPadding=node.padding/2;return select(descr).attr("transform","translate( "+(bbox.width>titleBox.width?0:(titleBox.width-bbox.width)/2)+", "+(titleBox.height+halfPadding+5)+")"),select(text).attr("transform","translate( "+(bbox.width<titleBox.width?0:-(titleBox.width-bbox.width)/2)+", 0)"),bbox=label.node().getBBox(),label.attr("transform","translate("+-bbox.width/2+", "+(-bbox.height/2-halfPadding+3)+")"),rect2.attr("class","outer title-state").attr("x",-bbox.width/2-halfPadding).attr("y",-bbox.height/2-halfPadding).attr("width",bbox.width+node.padding).attr("height",bbox.height+node.padding),innerLine.attr("class","divider").attr("x1",-bbox.width/2-halfPadding).attr("x2",bbox.width/2+halfPadding).attr("y1",-bbox.height/2-halfPadding+titleBox.height+halfPadding).attr("y2",-bbox.height/2-halfPadding+titleBox.height+halfPadding),updateNodeBounds(node,rect2),node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"rectWithTitle"),stadium=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),h=bbox.height+node.padding,w=bbox.width+h/4+node.padding,rect2=shapeSvg.insert("rect",":first-child").attr("style",node.style).attr("rx",h/2).attr("ry",h/2).attr("x",-w/2).attr("y",-h/2).attr("width",w).attr("height",h);return updateNodeBounds(node,rect2),node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"stadium"),circle2=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox,halfPadding:halfPadding}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),circle3=shapeSvg.insert("circle",":first-child");return circle3.attr("style",node.style).attr("rx",node.rx).attr("ry",node.ry).attr("r",bbox.width/2+halfPadding).attr("width",bbox.width+node.padding).attr("height",bbox.height+node.padding),log.info("Circle main"),updateNodeBounds(node,circle3),node.intersect=function(point2){return log.info("Circle intersect",node,bbox.width/2+halfPadding,point2),intersect_default.circle(node,bbox.width/2+halfPadding,point2)},shapeSvg},"circle"),doublecircle=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox,halfPadding:halfPadding}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),circleGroup=shapeSvg.insert("g",":first-child"),outerCircle=circleGroup.insert("circle"),innerCircle=circleGroup.insert("circle");return circleGroup.attr("class",node.class),outerCircle.attr("style",node.style).attr("rx",node.rx).attr("ry",node.ry).attr("r",bbox.width/2+halfPadding+5).attr("width",bbox.width+node.padding+10).attr("height",bbox.height+node.padding+10),innerCircle.attr("style",node.style).attr("rx",node.rx).attr("ry",node.ry).attr("r",bbox.width/2+halfPadding).attr("width",bbox.width+node.padding).attr("height",bbox.height+node.padding),log.info("DoubleCircle main"),updateNodeBounds(node,outerCircle),node.intersect=function(point2){return log.info("DoubleCircle intersect",node,bbox.width/2+halfPadding+5,point2),intersect_default.circle(node,bbox.width/2+halfPadding+5,point2)},shapeSvg},"doublecircle"),subroutine=__name(async(parent,node)=>{const{shapeSvg:shapeSvg,bbox:bbox}=await labelHelper(parent,node,getClassesFromNode(node,void 0),!0),w=bbox.width+node.padding,h=bbox.height+node.padding,points=[{x:0,y:0},{x:w,y:0},{x:w,y:-h},{x:0,y:-h},{x:0,y:0},{x:-8,y:0},{x:w+8,y:0},{x:w+8,y:-h},{x:-8,y:-h},{x:-8,y:0}],el=insertPolygonShape(shapeSvg,w,h,points);return el.attr("style",node.style),updateNodeBounds(node,el),node.intersect=function(point2){return intersect_default.polygon(node,points,point2)},shapeSvg},"subroutine"),start=__name((parent,node)=>{const shapeSvg=parent.insert("g").attr("class","node default").attr("id",node.domId||node.id),circle3=shapeSvg.insert("circle",":first-child");return circle3.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),updateNodeBounds(node,circle3),node.intersect=function(point2){return intersect_default.circle(node,7,point2)},shapeSvg},"start"),forkJoin=__name((parent,node,dir)=>{const shapeSvg=parent.insert("g").attr("class","node default").attr("id",node.domId||node.id);let width=70,height=10;"LR"===dir&&(width=10,height=70);const shape=shapeSvg.append("rect").attr("x",-1*width/2).attr("y",-1*height/2).attr("width",width).attr("height",height).attr("class","fork-join");return updateNodeBounds(node,shape),node.height=node.height+node.padding/2,node.width=node.width+node.padding/2,node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"forkJoin"),shapes={rhombus:question,composite:composite,question:question,rect:rect,labelRect:labelRect,rectWithTitle:rectWithTitle,choice:choice,circle:circle2,doublecircle:doublecircle,stadium:stadium,hexagon:hexagon,block_arrow:block_arrow,rect_left_inv_arrow:rect_left_inv_arrow,lean_right:lean_right,lean_left:lean_left,trapezoid:trapezoid,inv_trapezoid:inv_trapezoid,rect_right_inv_arrow:rect_right_inv_arrow,cylinder:cylinder,start:start,end:__name((parent,node)=>{const shapeSvg=parent.insert("g").attr("class","node default").attr("id",node.domId||node.id),innerCircle=shapeSvg.insert("circle",":first-child"),circle3=shapeSvg.insert("circle",":first-child");return circle3.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),innerCircle.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),updateNodeBounds(node,circle3),node.intersect=function(point2){return intersect_default.circle(node,7,point2)},shapeSvg},"end"),note:note_default,subroutine:subroutine,fork:forkJoin,join:forkJoin,class_box:__name(async(parent,node)=>{var _a;const halfPadding=node.padding/2;let classes2;classes2=node.classes?"node "+node.classes:"node default";const shapeSvg=parent.insert("g").attr("class",classes2).attr("id",node.domId||node.id),rect2=shapeSvg.insert("rect",":first-child"),topLine=shapeSvg.insert("line"),bottomLine=shapeSvg.insert("line");let maxWidth=0,maxHeight=4;const labelContainer=shapeSvg.insert("g").attr("class","label");let verticalPos=0;const hasInterface=null==(_a=node.classData.annotations)?void 0:_a[0],interfaceLabelText=node.classData.annotations[0]?"«"+node.classData.annotations[0]+"»":"",interfaceLabel=await createLabel_default(labelContainer,interfaceLabelText,node.labelStyle,!0,!0);let interfaceBBox=interfaceLabel.getBBox();if(getEffectiveHtmlLabels(getConfig2())){const div=interfaceLabel.children[0],dv=select(interfaceLabel);interfaceBBox=div.getBoundingClientRect(),dv.attr("width",interfaceBBox.width),dv.attr("height",interfaceBBox.height)}node.classData.annotations[0]&&(maxHeight+=interfaceBBox.height+4,maxWidth+=interfaceBBox.width);let classTitleString=node.classData.label;void 0!==node.classData.type&&""!==node.classData.type&&(getEffectiveHtmlLabels(getConfig2())?classTitleString+="&lt;"+node.classData.type+"&gt;":classTitleString+="<"+node.classData.type+">");const classTitleLabel=await createLabel_default(labelContainer,classTitleString,node.labelStyle,!0,!0);select(classTitleLabel).attr("class","classTitle");let classTitleBBox=classTitleLabel.getBBox();if(getEffectiveHtmlLabels(getConfig2())){const div=classTitleLabel.children[0],dv=select(classTitleLabel);classTitleBBox=div.getBoundingClientRect(),dv.attr("width",classTitleBBox.width),dv.attr("height",classTitleBBox.height)}maxHeight+=classTitleBBox.height+4,classTitleBBox.width>maxWidth&&(maxWidth=classTitleBBox.width);const classAttributes=[];node.classData.members.forEach(async member=>{const parsedInfo=member.getDisplayDetails();let parsedText=parsedInfo.displayText;getEffectiveHtmlLabels(getConfig2())&&(parsedText=parsedText.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const lbl=await createLabel_default(labelContainer,parsedText,parsedInfo.cssStyle?parsedInfo.cssStyle:node.labelStyle,!0,!0);let bbox=lbl.getBBox();if(getEffectiveHtmlLabels(getConfig2())){const div=lbl.children[0],dv=select(lbl);bbox=div.getBoundingClientRect(),dv.attr("width",bbox.width),dv.attr("height",bbox.height)}bbox.width>maxWidth&&(maxWidth=bbox.width),maxHeight+=bbox.height+4,classAttributes.push(lbl)}),maxHeight+=8;const classMethods=[];if(node.classData.methods.forEach(async member=>{const parsedInfo=member.getDisplayDetails();let displayText=parsedInfo.displayText;getEffectiveHtmlLabels(getConfig2())&&(displayText=displayText.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const lbl=await createLabel_default(labelContainer,displayText,parsedInfo.cssStyle?parsedInfo.cssStyle:node.labelStyle,!0,!0);let bbox=lbl.getBBox();if(getEffectiveHtmlLabels(getConfig2())){const div=lbl.children[0],dv=select(lbl);bbox=div.getBoundingClientRect(),dv.attr("width",bbox.width),dv.attr("height",bbox.height)}bbox.width>maxWidth&&(maxWidth=bbox.width),maxHeight+=bbox.height+4,classMethods.push(lbl)}),maxHeight+=8,hasInterface){let diffX2=(maxWidth-interfaceBBox.width)/2;select(interfaceLabel).attr("transform","translate( "+(-1*maxWidth/2+diffX2)+", "+-1*maxHeight/2+")"),verticalPos=interfaceBBox.height+4}let diffX=(maxWidth-classTitleBBox.width)/2;return select(classTitleLabel).attr("transform","translate( "+(-1*maxWidth/2+diffX)+", "+(-1*maxHeight/2+verticalPos)+")"),verticalPos+=classTitleBBox.height+4,topLine.attr("class","divider").attr("x1",-maxWidth/2-halfPadding).attr("x2",maxWidth/2+halfPadding).attr("y1",-maxHeight/2-halfPadding+8+verticalPos).attr("y2",-maxHeight/2-halfPadding+8+verticalPos),verticalPos+=8,classAttributes.forEach(lbl=>{select(lbl).attr("transform","translate( "+-maxWidth/2+", "+(-1*maxHeight/2+verticalPos+4)+")");const memberBBox=null==lbl?void 0:lbl.getBBox();verticalPos+=((null==memberBBox?void 0:memberBBox.height)??0)+4}),verticalPos+=8,bottomLine.attr("class","divider").attr("x1",-maxWidth/2-halfPadding).attr("x2",maxWidth/2+halfPadding).attr("y1",-maxHeight/2-halfPadding+8+verticalPos).attr("y2",-maxHeight/2-halfPadding+8+verticalPos),verticalPos+=8,classMethods.forEach(lbl=>{select(lbl).attr("transform","translate( "+-maxWidth/2+", "+(-1*maxHeight/2+verticalPos)+")");const memberBBox=null==lbl?void 0:lbl.getBBox();verticalPos+=((null==memberBBox?void 0:memberBBox.height)??0)+4}),rect2.attr("style",node.style).attr("class","outer title-state").attr("x",-maxWidth/2-halfPadding).attr("y",-maxHeight/2-halfPadding).attr("width",maxWidth+node.padding).attr("height",maxHeight+node.padding),updateNodeBounds(node,rect2),node.intersect=function(point2){return intersect_default.rect(node,point2)},shapeSvg},"class_box")},nodeElems={},insertNode=__name(async(elem,node,renderOptions)=>{let newEl,el;if(node.link){let target;"sandbox"===getConfig2().securityLevel?target="_top":node.linkTarget&&(target=node.linkTarget||"_blank"),newEl=elem.insert("svg:a").attr("xlink:href",node.link).attr("target",target),el=await shapes[node.shape](newEl,node,renderOptions)}else el=await shapes[node.shape](elem,node,renderOptions),newEl=el;return node.tooltip&&el.attr("title",node.tooltip),node.class&&el.attr("class","node default "+node.class),nodeElems[node.id]=newEl,node.haveCallback&&nodeElems[node.id].attr("class",nodeElems[node.id].attr("class")+" clickable"),newEl},"insertNode"),positionNode=__name(node=>{const el=nodeElems[node.id];log.trace("Transforming node",node.diff,node,"translate("+(node.x-node.width/2-5)+", "+node.width/2+")");const diff=node.diff||0;return node.clusterNode?el.attr("transform","translate("+(node.x+diff-node.width/2)+", "+(node.y-node.height/2-8)+")"):el.attr("transform","translate("+node.x+", "+node.y+")"),diff},"positionNode");function getNodeFromBlock(block,db2,positioned=!1){var _a,_b,_c;const vertex=block;let classStr="default";((null==(_a=null==vertex?void 0:vertex.classes)?void 0:_a.length)||0)>0&&(classStr=((null==vertex?void 0:vertex.classes)??[]).join(" ")),classStr+=" flowchart-label";let padding,radius=0,shape="";switch(vertex.type){case"round":radius=5,shape="rect";break;case"composite":radius=0,shape="composite",padding=0;break;case"square":case"group":default:shape="rect";break;case"diamond":shape="question";break;case"hexagon":shape="hexagon";break;case"block_arrow":shape="block_arrow";break;case"odd":case"rect_left_inv_arrow":shape="rect_left_inv_arrow";break;case"lean_right":shape="lean_right";break;case"lean_left":shape="lean_left";break;case"trapezoid":shape="trapezoid";break;case"inv_trapezoid":shape="inv_trapezoid";break;case"circle":shape="circle";break;case"ellipse":shape="ellipse";break;case"stadium":shape="stadium";break;case"subroutine":shape="subroutine";break;case"cylinder":shape="cylinder";break;case"doublecircle":shape="doublecircle"}const styles=getStylesFromArray((null==vertex?void 0:vertex.styles)??[]),vertexText=vertex.label,bounds=vertex.size??{width:0,height:0,x:0,y:0},dbDiagramId=db2.getDiagramId();return{labelStyle:styles.labelStyle,shape:shape,labelText:vertexText,rx:radius,ry:radius,class:classStr,style:styles.style,id:vertex.id,domId:dbDiagramId?`${dbDiagramId}-${vertex.id}`:vertex.id,directions:vertex.directions,width:bounds.width,height:bounds.height,x:bounds.x,y:bounds.y,positioned:positioned,intersect:void 0,type:vertex.type,padding:padding??(null==(_c=null==(_b=getConfig())?void 0:_b.block)?void 0:_c.padding)??0,widthInColumns:vertex.widthInColumns??1}}async function calculateBlockSize(elem,block,db2){const node=getNodeFromBlock(block,db2,!1);if("group"===node.type)return;const config=getConfig(),nodeEl=await insertNode(elem,node,{config:config}),boundingBox=nodeEl.node().getBBox(),obj=db2.getBlock(node.id);obj.size={width:boundingBox.width,height:boundingBox.height,x:0,y:0,node:nodeEl},db2.setBlock(obj),nodeEl.remove()}async function insertBlockPositioned(elem,block,db2){const node=getNodeFromBlock(block,db2,!0);if("space"!==db2.getBlock(node.id).type){const config=getConfig();await insertNode(elem,node,{config:config}),block.intersect=null==node?void 0:node.intersect,positionNode(node)}}async function performOperations(elem,blocks2,db2,operation){for(const block of blocks2)await operation(elem,block,db2),block.children&&await performOperations(elem,block.children,db2,operation)}async function calculateBlockSizes(elem,blocks2,db2){await performOperations(elem,blocks2,db2,calculateBlockSize)}async function insertBlocks(elem,blocks2,db2){await performOperations(elem,blocks2,db2,insertBlockPositioned)}async function insertEdges(elem,edges,blocks2,db2,id){const g=new Graph({multigraph:!0,compound:!0});g.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const block of blocks2)block.size&&g.setNode(block.id,{width:block.size.width,height:block.size.height,intersect:block.intersect});for(const edge of edges)if(edge.start&&edge.end){const startBlock=db2.getBlock(edge.start),endBlock=db2.getBlock(edge.end);if((null==startBlock?void 0:startBlock.size)&&(null==endBlock?void 0:endBlock.size)){const start2=startBlock.size,end2=endBlock.size,points=[{x:start2.x,y:start2.y},{x:start2.x+(end2.x-start2.x)/2,y:start2.y+(end2.y-start2.y)/2},{x:end2.x,y:end2.y}],prefixedEdgeId=id?`${id}-${edge.id}`:edge.id,dynamicClasses=`${"thick"===edge.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===edge.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;insertEdge(elem,{v:edge.start,w:edge.end,name:prefixedEdgeId},{...edge,id:prefixedEdgeId,arrowTypeEnd:edge.arrowTypeEnd,arrowTypeStart:edge.arrowTypeStart,points:points,classes:dynamicClasses},void 0,"block",g,id),edge.label&&(await insertEdgeLabel(elem,{...edge,label:edge.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:edge.arrowTypeEnd,arrowTypeStart:edge.arrowTypeStart,points:points,classes:dynamicClasses}),positionEdgeLabel({...edge,x:points[1].x,y:points[1].y},{originalPath:points}))}}}__name(getNodeFromBlock,"getNodeFromBlock"),__name(calculateBlockSize,"calculateBlockSize"),__name(insertBlockPositioned,"insertBlockPositioned"),__name(performOperations,"performOperations"),__name(calculateBlockSizes,"calculateBlockSizes"),__name(insertBlocks,"insertBlocks"),__name(insertEdges,"insertEdges");var getClasses2=__name(function(text,diagObj){return diagObj.db.getClasses()},"getClasses"),diagram={parser:block_default,db:blockDB_default,renderer:{draw:__name(async function(text,id,_version,diagObj){const{securityLevel:securityLevel,block:conf}=getConfig(),db2=diagObj.db;let sandboxElement;db2.setDiagramId(id),"sandbox"===securityLevel&&(sandboxElement=select("#i"+id));const root=select("sandbox"===securityLevel?sandboxElement.nodes()[0].contentDocument.body:"body"),svg="sandbox"===securityLevel?root.select(`[id="${id}"]`):select(`[id="${id}"]`);markers_default(svg,["point","circle","cross"],diagObj.type,id);const bl=db2.getBlocks(),blArr=db2.getBlocksFlat(),edges=db2.getEdges(),nodes=svg.insert("g").attr("class","block");await calculateBlockSizes(nodes,bl,db2);const bounds=layout(db2);if(await insertBlocks(nodes,bl,db2),await insertEdges(nodes,edges,blArr,db2,id),bounds){const bounds2=bounds,magicFactor=Math.max(1,Math.round(bounds2.width/bounds2.height*.125)),height=bounds2.height+magicFactor+10,width=bounds2.width+10,{useMaxWidth:useMaxWidth}=conf;configureSvgSize(svg,height,width,!!useMaxWidth),log.debug("Here Bounds",bounds,bounds2),svg.attr("viewBox",`${bounds2.x-5} ${bounds2.y-5} ${bounds2.width+10} ${bounds2.height+10}`)}},"draw"),getClasses:getClasses2},styles:styles_default};export{diagram};
@@ -1 +0,0 @@
1
- var _a;import{g as getDiagramElement}from"./chunk-XXDRQBXY-Blw-tThR.js";import{s as setupViewPortForSVG}from"./chunk-VR4S4FIN-BR0zG1Ep.js";import{_ as __name,l as log,c as getConfig2,v as render,x as utils_default,a as getAccTitle,b as setAccTitle,g as getAccDescription,s as setAccDescription,n as setDiagramTitle,o as getDiagramTitle,Q as generateId,k as common_default,p as clear,d as select}from"./mermaid.core-DH-sQJgr.js";import{f as createTooltip}from"./chunk-32BRIVSS-Dg3PlJIt.js";import{p as purify}from"./vendor-markdown-DBlfs4dR.js";var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[1,2],$V1=[1,3],$V2=[1,4],$V3=[2,4],$V4=[1,9],$V5=[1,11],$V6=[1,16],$V7=[1,17],$V8=[1,18],$V9=[1,19],$Va=[1,33],$Vb=[1,20],$Vc=[1,21],$Vd=[1,22],$Ve=[1,23],$Vf=[1,24],$Vg=[1,26],$Vh=[1,27],$Vi=[1,28],$Vj=[1,29],$Vk=[1,30],$Vl=[1,31],$Vm=[1,32],$Vn=[1,35],$Vo=[1,36],$Vp=[1,37],$Vq=[1,38],$Vr=[1,34],$Vs=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$Vt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],$Vu=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 3:return yy.setRootDoc($$[$0]),$$[$0];case 4:this.$=[];break;case 5:"nl"!=$$[$0]&&($$[$0-1].push($$[$0]),this.$=$$[$0-1]);break;case 6:case 7:case 12:this.$=$$[$0];break;case 8:this.$="nl";break;case 13:const stateStmt=$$[$0-1];stateStmt.description=yy.trimColon($$[$0]),this.$=stateStmt;break;case 14:this.$={stmt:"relation",state1:$$[$0-2],state2:$$[$0]};break;case 15:const relDescription=yy.trimColon($$[$0]);this.$={stmt:"relation",state1:$$[$0-3],state2:$$[$0-1],description:relDescription};break;case 19:this.$={stmt:"state",id:$$[$0-3],type:"default",description:"",doc:$$[$0-1]};break;case 20:var id=$$[$0],description=$$[$0-2].trim();if($$[$0].match(":")){var parts=$$[$0].split(":");id=parts[0],description=[description,parts[1]]}this.$={stmt:"state",id:id,type:"default",description:description};break;case 21:this.$={stmt:"state",id:$$[$0-3],type:"default",description:$$[$0-5],doc:$$[$0-1]};break;case 22:this.$={stmt:"state",id:$$[$0],type:"fork"};break;case 23:this.$={stmt:"state",id:$$[$0],type:"join"};break;case 24:this.$={stmt:"state",id:$$[$0],type:"choice"};break;case 25:this.$={stmt:"state",id:yy.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:$$[$0-1].trim(),note:{position:$$[$0-2].trim(),text:$$[$0].trim()}};break;case 29:this.$=$$[$0].trim(),yy.setAccTitle(this.$);break;case 30:case 31:this.$=$$[$0].trim(),yy.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:$$[$0-3],url:$$[$0-2],tooltip:$$[$0-1]};break;case 33:this.$={stmt:"click",id:$$[$0-3],url:$$[$0-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:$$[$0-1].trim(),classes:$$[$0].trim()};break;case 36:this.$={stmt:"style",id:$$[$0-1].trim(),styleClass:$$[$0].trim()};break;case 37:this.$={stmt:"applyClass",id:$$[$0-1].trim(),styleClass:$$[$0].trim()};break;case 38:yy.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:yy.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:yy.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:yy.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:$$[$0].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:$$[$0-2].trim(),classes:[$$[$0].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:$V0,5:$V1,6:$V2},{1:[3]},{3:5,4:$V0,5:$V1,6:$V2},{3:6,4:$V0,5:$V1,6:$V2},o([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$V3,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:$V4,5:$V5,8:8,9:10,10:12,11:13,12:14,13:15,16:$V6,17:$V7,19:$V8,22:$V9,24:$Va,25:$Vb,26:$Vc,27:$Vd,28:$Ve,29:$Vf,32:25,33:$Vg,35:$Vh,37:$Vi,38:$Vj,41:$Vk,45:$Vl,48:$Vm,51:$Vn,52:$Vo,53:$Vp,54:$Vq,57:$Vr},o($Vs,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:$V6,17:$V7,19:$V8,22:$V9,24:$Va,25:$Vb,26:$Vc,27:$Vd,28:$Ve,29:$Vf,32:25,33:$Vg,35:$Vh,37:$Vi,38:$Vj,41:$Vk,45:$Vl,48:$Vm,51:$Vn,52:$Vo,53:$Vp,54:$Vq,57:$Vr},o($Vs,[2,7]),o($Vs,[2,8]),o($Vs,[2,9]),o($Vs,[2,10]),o($Vs,[2,11]),o($Vs,[2,12],{14:[1,40],15:[1,41]}),o($Vs,[2,16]),{18:[1,42]},o($Vs,[2,18],{20:[1,43]}),{23:[1,44]},o($Vs,[2,22]),o($Vs,[2,23]),o($Vs,[2,24]),o($Vs,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},o($Vs,[2,28]),{34:[1,49]},{36:[1,50]},o($Vs,[2,31]),{13:51,24:$Va,57:$Vr},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},o($Vt,[2,44],{58:[1,56]}),o($Vt,[2,45],{58:[1,57]}),o($Vs,[2,38]),o($Vs,[2,39]),o($Vs,[2,40]),o($Vs,[2,41]),o($Vs,[2,6]),o($Vs,[2,13]),{13:58,24:$Va,57:$Vr},o($Vs,[2,17]),o($Vu,$V3,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},o($Vs,[2,29]),o($Vs,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},o($Vs,[2,14],{14:[1,71]}),{4:$V4,5:$V5,8:8,9:10,10:12,11:13,12:14,13:15,16:$V6,17:$V7,19:$V8,21:[1,72],22:$V9,24:$Va,25:$Vb,26:$Vc,27:$Vd,28:$Ve,29:$Vf,32:25,33:$Vg,35:$Vh,37:$Vi,38:$Vj,41:$Vk,45:$Vl,48:$Vm,51:$Vn,52:$Vo,53:$Vp,54:$Vq,57:$Vr},o($Vs,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},o($Vs,[2,34]),o($Vs,[2,35]),o($Vs,[2,36]),o($Vs,[2,37]),o($Vt,[2,46]),o($Vt,[2,47]),o($Vs,[2,15]),o($Vs,[2,19]),o($Vu,$V3,{7:78}),o($Vs,[2,26]),o($Vs,[2,27]),{5:[1,79]},{5:[1,80]},{4:$V4,5:$V5,8:8,9:10,10:12,11:13,12:14,13:15,16:$V6,17:$V7,19:$V8,21:[1,81],22:$V9,24:$Va,25:$Vb,26:$Vc,27:$Vd,28:$Ve,29:$Vf,32:25,33:$Vg,35:$Vh,37:$Vi,38:$Vj,41:$Vk,45:$Vl,48:$Vm,51:$Vn,52:$Vo,53:$Vp,54:$Vq,57:$Vr},o($Vs,[2,32]),o($Vs,[2,33]),o($Vs,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,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:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.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),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=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),lines.length-1&&(this.yylineno-=lines.length-1);var r=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:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(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:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={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&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,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(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===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:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(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:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){function processId(){const idx=yy_.yytext.indexOf("%%");if(0===idx)return!1;if(idx>0){const before=yy_.yytext.slice(0,idx),after=yy_.yytext.slice(idx);after&&yy.lexer.unput(after),yy_.yytext=before}return!0}switch(__name(processId,"processId"),$avoiding_name_collisions){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),yy_.yytext=yy_.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),yy_.yytext=yy_.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),yy_.yytext=yy_.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!processId())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+yy_.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!processId())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),yy_.yytext=yy_.yytext.substr(2).trim(),31;case 68:return this.popState(),yy_.yytext=yy_.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!processId())return;return 24;case 74:return yy_.yytext=yy_.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var stateDiagram_default=parser,getDir=__name((parsedItem,defaultDir="TB")=>{if(!parsedItem.doc)return defaultDir;let dir=defaultDir;for(const parsedItemDoc of parsedItem.doc)"dir"===parsedItemDoc.stmt&&(dir=parsedItemDoc.value);return dir},"getDir"),stateRenderer_v3_unified_default={getClasses:__name(function(text,diagramObj){return diagramObj.db.getClasses()},"getClasses"),draw:__name(async function(text,id,_version,diag){log.info("REF0:"),log.info("Drawing state diagram (v2)",id);const{securityLevel:securityLevel,state:conf,layout:layout}=getConfig2();diag.db.extract(diag.db.getRootDocV2());const data4Layout=diag.db.getData(),svg=getDiagramElement(id,securityLevel);data4Layout.type=diag.type,data4Layout.layoutAlgorithm=layout,data4Layout.nodeSpacing=(null==conf?void 0:conf.nodeSpacing)||50,data4Layout.rankSpacing=(null==conf?void 0:conf.rankSpacing)||50;"neo"===getConfig2().look?data4Layout.markers=["barbNeo"]:data4Layout.markers=["barb"],data4Layout.diagramId=id,await render(data4Layout,svg);try{("function"==typeof diag.db.getLinks?diag.db.getLinks():new Map).forEach((linkInfo,key)=>{var _a2;const stateId="string"==typeof key?key:"string"==typeof(null==key?void 0:key.id)?key.id:"",stateNode=data4Layout.nodes.find(node=>node.id===stateId);if(!stateId)return void log.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(key));const allNodes=null==(_a2=svg.node())?void 0:_a2.querySelectorAll("g.node, g.rough-node");let matchedElem;if(null==allNodes||allNodes.forEach(g=>{var _a3;const text2=null==(_a3=g.textContent)?void 0:_a3.trim();g.id!==(null==stateNode?void 0:stateNode.domId)&&text2!==stateId||(matchedElem=g)}),!matchedElem)return void log.warn("⚠️ Could not find node matching text:",stateId);const parent=matchedElem.parentNode;if(!parent)return void log.warn("⚠️ Node has no parent, cannot wrap:",stateId);const a=document.createElementNS("http://www.w3.org/2000/svg","a"),cleanedUrl=linkInfo.url.replace(/^"+|"+$/g,"");if(a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",cleanedUrl),a.setAttribute("target","_blank"),linkInfo.tooltip){const tooltip=linkInfo.tooltip.replace(/^"+|"+$/g,"");a.setAttribute("title",tooltip),matchedElem.setAttribute("title",tooltip)}parent.replaceChild(a,matchedElem),a.appendChild(matchedElem),log.info("🔗 Wrapped node in <a> tag for:",stateId,linkInfo.url)})}catch(err){log.error("❌ Error injecting clickable links:",err)}utils_default.insertTitle(svg,"statediagramTitleText",(null==conf?void 0:conf.titleTopMargin)??25,diag.db.getDiagramTitle()),setupViewPortForSVG(svg,8,"statediagram",(null==conf?void 0:conf.useMaxWidth)??!0)},"draw"),getDir:getDir},nodeDb=new Map,graphItemCount=0;function stateDomId(itemId="",counter=0,type="",typeSpacer="----"){return`state-${itemId}${null!==type&&type.length>0?`${typeSpacer}${type}`:""}-${counter}`}__name(stateDomId,"stateDomId");var setupDoc=__name((parentParsedItem,doc,diagramStates,nodes,edges,altFlag,look,classes)=>{log.trace("items",doc),doc.forEach(item=>{switch(item.stmt){case"state":case"default":dataFetcher(parentParsedItem,item,diagramStates,nodes,edges,altFlag,look,classes);break;case"relation":{dataFetcher(parentParsedItem,item.state1,diagramStates,nodes,edges,altFlag,look,classes),dataFetcher(parentParsedItem,item.state2,diagramStates,nodes,edges,altFlag,look,classes);const isNeo="neo"===look,edgeData={id:"edge"+graphItemCount,start:item.state1.id,end:item.state2.id,arrowhead:"normal",arrowTypeEnd:isNeo?"arrow_barb_neo":"arrow_barb",style:"fill:none",labelStyle:"",label:common_default.sanitizeText(item.description??"",getConfig2()),arrowheadStyle:"fill: #333",labelpos:"c",labelType:"markdown",thickness:"normal",classes:"transition",look:look};edges.push(edgeData),graphItemCount++}}})},"setupDoc"),getDir2=__name((parsedItem,defaultDir="TB")=>{let dir=defaultDir;if(parsedItem.doc)for(const parsedItemDoc of parsedItem.doc)"dir"===parsedItemDoc.stmt&&(dir=parsedItemDoc.value);return dir},"getDir");function insertOrUpdateNode(nodes,nodeData,classes){if(!nodeData.id||"</join></fork>"===nodeData.id||"</choice>"===nodeData.id)return;nodeData.cssClasses&&(Array.isArray(nodeData.cssCompiledStyles)||(nodeData.cssCompiledStyles=[]),nodeData.cssClasses.split(" ").forEach(cssClass=>{const classDef=classes.get(cssClass);classDef&&(nodeData.cssCompiledStyles=[...nodeData.cssCompiledStyles??[],...classDef.styles])}));const existingNodeData=nodes.find(node=>node.id===nodeData.id);existingNodeData?Object.assign(existingNodeData,nodeData):nodes.push(nodeData)}function getClassesFromDbInfo(dbInfoItem){var _a2;return(null==(_a2=null==dbInfoItem?void 0:dbInfoItem.classes)?void 0:_a2.join(" "))??""}function getStylesFromDbInfo(dbInfoItem){return(null==dbInfoItem?void 0:dbInfoItem.styles)??[]}__name(insertOrUpdateNode,"insertOrUpdateNode"),__name(getClassesFromDbInfo,"getClassesFromDbInfo"),__name(getStylesFromDbInfo,"getStylesFromDbInfo");var dataFetcher=__name((parent,parsedItem,diagramStates,nodes,edges,altFlag,look,classes)=>{var _a2,_b,_c;const itemId=parsedItem.id,dbState=diagramStates.get(itemId),classStr=getClassesFromDbInfo(dbState),style=getStylesFromDbInfo(dbState),config=getConfig2();if(log.info("dataFetcher parsedItem",parsedItem,dbState,style),"root"!==itemId){let shape="rect";!0===parsedItem.start?shape="stateStart":!1===parsedItem.start&&(shape="stateEnd"),"default"!==parsedItem.type&&(shape=parsedItem.type),nodeDb.get(itemId)||nodeDb.set(itemId,{id:itemId,shape:shape,description:common_default.sanitizeText(itemId,config),cssClasses:`${classStr} statediagram-state`,cssStyles:style});const newNode=nodeDb.get(itemId);parsedItem.description&&(Array.isArray(newNode.description)?(newNode.shape="rectWithTitle",newNode.description.push(parsedItem.description)):(null==(_a2=newNode.description)?void 0:_a2.length)&&newNode.description.length>0?(newNode.shape="rectWithTitle",newNode.description===itemId?newNode.description=[parsedItem.description]:newNode.description=[newNode.description,parsedItem.description]):(newNode.shape="rect",newNode.description=parsedItem.description),newNode.description=common_default.sanitizeTextOrArray(newNode.description,config)),1===(null==(_b=newNode.description)?void 0:_b.length)&&"rectWithTitle"===newNode.shape&&("group"===newNode.type?newNode.shape="roundedWithTitle":newNode.shape="rect"),!newNode.type&&parsedItem.doc&&(log.info("Setting cluster for XCX",itemId,getDir2(parsedItem)),newNode.type="group",newNode.isGroup=!0,newNode.dir=getDir2(parsedItem),newNode.explicitDir=parsedItem.doc.some(s=>"dir"===s.stmt),newNode.shape="divider"===parsedItem.type?"divider":"roundedWithTitle",newNode.cssClasses=`${newNode.cssClasses} statediagram-cluster ${altFlag?"statediagram-cluster-alt":""}`);const nodeData={labelStyle:"",shape:newNode.shape,label:newNode.description,cssClasses:newNode.cssClasses,cssCompiledStyles:[],cssStyles:newNode.cssStyles,id:itemId,dir:newNode.dir,domId:stateDomId(itemId,graphItemCount),type:newNode.type,isGroup:"group"===newNode.type,padding:8,rx:10,ry:10,look:look,labelType:"markdown"};if("divider"===nodeData.shape&&(nodeData.label=""),parent&&"root"!==parent.id&&(log.trace("Setting node ",itemId," to be child of its parent ",parent.id),nodeData.parentId=parent.id),nodeData.centerLabel=!0,parsedItem.note){const noteData={labelStyle:"",shape:"note",label:parsedItem.note.text,labelType:"markdown",cssClasses:"statediagram-note",cssStyles:[],cssCompiledStyles:[],id:itemId+"----note-"+graphItemCount,domId:stateDomId(itemId,graphItemCount,"note"),type:newNode.type,isGroup:"group"===newNode.type,padding:null==(_c=config.flowchart)?void 0:_c.padding,look:look,position:parsedItem.note.position},parentNodeId=itemId+"----parent",groupData={labelStyle:"",shape:"noteGroup",label:parsedItem.note.text,cssClasses:newNode.cssClasses,cssStyles:[],id:itemId+"----parent",domId:stateDomId(itemId,graphItemCount,"parent"),type:"group",isGroup:!0,padding:16,look:look,position:parsedItem.note.position};graphItemCount++,groupData.id=parentNodeId,noteData.parentId=parentNodeId,insertOrUpdateNode(nodes,groupData,classes),insertOrUpdateNode(nodes,noteData,classes),insertOrUpdateNode(nodes,nodeData,classes);let from=itemId,to=noteData.id;"left of"===parsedItem.note.position&&(from=noteData.id,to=itemId),edges.push({id:from+"-"+to,start:from,end:to,arrowhead:"none",arrowTypeEnd:"",style:"fill:none",labelStyle:"",classes:"transition note-edge",arrowheadStyle:"fill: #333",labelpos:"c",labelType:"markdown",thickness:"normal",look:look})}else insertOrUpdateNode(nodes,nodeData,classes)}parsedItem.doc&&(log.trace("Adding nodes children "),setupDoc(parsedItem,parsedItem.doc,diagramStates,nodes,edges,!altFlag,look,classes))},"dataFetcher"),reset=__name(()=>{nodeDb.clear(),graphItemCount=0},"reset"),CONSTANTS_START_NODE="[*]",CONSTANTS_START_TYPE="start",CONSTANTS_END_NODE="[*]",CONSTANTS_END_TYPE="end",CONSTANTS_COLOR_KEYWORD="color",CONSTANTS_FILL_KEYWORD="fill",CONSTANTS_BG_FILL="bgFill",CONSTANTS_STYLECLASS_SEP=",",newClassesList=__name(()=>new Map,"newClassesList"),newDoc=__name(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),clone=__name(o=>JSON.parse(JSON.stringify(o)),"clone"),StateDB=(__name(_a=class{constructor(version){this.version=version,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=newClassesList(),this.documents={root:newDoc()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=getAccTitle,this.setAccTitle=setAccTitle,this.getAccDescription=getAccDescription,this.setAccDescription=setAccDescription,this.setDiagramTitle=setDiagramTitle,this.getDiagramTitle=getDiagramTitle,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(statements){this.clear(!0);for(const item of Array.isArray(statements)?statements:statements.doc)switch(item.stmt){case"state":this.addState(item.id.trim(),item.type,item.doc,item.description,item.note);break;case"relation":this.addRelation(item.state1,item.state2,item.description);break;case"classDef":this.addStyleClass(item.id.trim(),item.classes);break;case"style":this.handleStyleDef(item);break;case"applyClass":this.setCssClass(item.id.trim(),item.styleClass);break;case"click":this.addLink(item.id,item.url,item.tooltip)}const diagramStates=this.getStates(),config=getConfig2();reset(),dataFetcher(void 0,this.getRootDocV2(),diagramStates,this.nodes,this.edges,!0,config.look,this.classes);for(const node of this.nodes)if(Array.isArray(node.label)){if(node.description=node.label.slice(1),node.isGroup&&node.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${node.id}]`);node.label=node.label[0]}}handleStyleDef(item){const ids=item.id.trim().split(","),styles=item.styleClass.split(",");for(const id of ids){let state=this.getState(id);if(!state){const trimmedId=id.trim();this.addState(trimmedId),state=this.getState(trimmedId)}state&&(state.styles=styles.map(s=>{var _a2;return null==(_a2=s.replace(/;/g,""))?void 0:_a2.trim()}))}}setRootDoc(o){log.info("Setting root doc",o),this.rootDoc=o,1===this.version?this.extract(o):this.extract(this.getRootDocV2())}docTranslator(parent,node,first){if("relation"===node.stmt)return this.docTranslator(parent,node.state1,!0),void this.docTranslator(parent,node.state2,!1);if("state"===node.stmt&&(node.id===CONSTANTS_START_NODE?(node.id=parent.id+(first?"_start":"_end"),node.start=first):node.id=node.id.trim()),"root"!==node.stmt&&"state"!==node.stmt||!node.doc)return;const doc=[];let currentDoc=[];for(const stmt of node.doc)if("divider"===stmt.type){const newNode=clone(stmt);newNode.doc=clone(currentDoc),doc.push(newNode),currentDoc=[]}else currentDoc.push(stmt);if(doc.length>0&&currentDoc.length>0){const newNode={stmt:"state",id:generateId(),type:"divider",doc:clone(currentDoc)};doc.push(clone(newNode)),node.doc=doc}node.doc.forEach(docNode=>this.docTranslator(node,docNode,!0))}getRootDocV2(){return this.docTranslator({id:"root",stmt:"root"},{id:"root",stmt:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}}addState(id,type="default",doc=void 0,descr=void 0,note=void 0,classes=void 0,styles=void 0,textStyles=void 0){const trimmedId=null==id?void 0:id.trim();if(this.currentDocument.states.has(trimmedId)){const state=this.currentDocument.states.get(trimmedId);if(!state)throw new Error(`State not found: ${trimmedId}`);state.doc||(state.doc=doc),state.type||(state.type=type)}else log.info("Adding state ",trimmedId,descr),this.currentDocument.states.set(trimmedId,{stmt:"state",id:trimmedId,descriptions:[],type:type,doc:doc,note:note,classes:[],styles:[],textStyles:[]});if(descr){log.info("Setting state description",trimmedId,descr);(Array.isArray(descr)?descr:[descr]).forEach(des=>this.addDescription(trimmedId,des.trim()))}if(note){const doc2=this.currentDocument.states.get(trimmedId);if(!doc2)throw new Error(`State not found: ${trimmedId}`);doc2.note=note,doc2.note.text=common_default.sanitizeText(doc2.note.text,getConfig2())}if(classes){log.info("Setting state classes",trimmedId,classes);(Array.isArray(classes)?classes:[classes]).forEach(cssClass=>this.setCssClass(trimmedId,cssClass.trim()))}if(styles){log.info("Setting state styles",trimmedId,styles);(Array.isArray(styles)?styles:[styles]).forEach(style=>this.setStyle(trimmedId,style.trim()))}if(textStyles){log.info("Setting state styles",trimmedId,styles);(Array.isArray(textStyles)?textStyles:[textStyles]).forEach(textStyle=>this.setTextStyle(trimmedId,textStyle.trim()))}}clear(saveCommon){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:newDoc()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=newClassesList(),saveCommon||(this.links=new Map,clear())}getState(id){return this.currentDocument.states.get(id)}getStates(){return this.currentDocument.states}logDocuments(){log.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(stateId,url,tooltip){this.links.set(stateId,{url:url,tooltip:tooltip}),log.warn("Adding link",stateId,url,tooltip)}getLinks(){return this.links}startIdIfNeeded(id=""){return id===CONSTANTS_START_NODE?(this.startEndCount++,`${CONSTANTS_START_TYPE}${this.startEndCount}`):id}startTypeIfNeeded(id="",type="default"){return id===CONSTANTS_START_NODE?CONSTANTS_START_TYPE:type}endIdIfNeeded(id=""){return id===CONSTANTS_END_NODE?(this.startEndCount++,`${CONSTANTS_END_TYPE}${this.startEndCount}`):id}endTypeIfNeeded(id="",type="default"){return id===CONSTANTS_END_NODE?CONSTANTS_END_TYPE:type}addRelationObjs(item1,item2,relationTitle=""){const id1=this.startIdIfNeeded(item1.id.trim()),type1=this.startTypeIfNeeded(item1.id.trim(),item1.type),id2=this.startIdIfNeeded(item2.id.trim()),type2=this.startTypeIfNeeded(item2.id.trim(),item2.type);this.addState(id1,type1,item1.doc,item1.description,item1.note,item1.classes,item1.styles,item1.textStyles),this.addState(id2,type2,item2.doc,item2.description,item2.note,item2.classes,item2.styles,item2.textStyles),this.currentDocument.relations.push({id1:id1,id2:id2,relationTitle:common_default.sanitizeText(relationTitle,getConfig2())})}addRelation(item1,item2,title){if("object"==typeof item1&&"object"==typeof item2)this.addRelationObjs(item1,item2,title);else if("string"==typeof item1&&"string"==typeof item2){const id1=this.startIdIfNeeded(item1.trim()),type1=this.startTypeIfNeeded(item1),id2=this.endIdIfNeeded(item2.trim()),type2=this.endTypeIfNeeded(item2);this.addState(id1,type1),this.addState(id2,type2),this.currentDocument.relations.push({id1:id1,id2:id2,relationTitle:title?common_default.sanitizeText(title,getConfig2()):void 0})}}addDescription(id,descr){var _a2;const theState=this.currentDocument.states.get(id),_descr=descr.startsWith(":")?descr.replace(":","").trim():descr;null==(_a2=null==theState?void 0:theState.descriptions)||_a2.push(common_default.sanitizeText(_descr,getConfig2()))}cleanupLabel(label){return label.startsWith(":")?label.slice(2).trim():label.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(id,styleAttributes=""){this.classes.has(id)||this.classes.set(id,{id:id,styles:[],textStyles:[]});const foundClass=this.classes.get(id);styleAttributes&&foundClass&&styleAttributes.split(CONSTANTS_STYLECLASS_SEP).forEach(attrib=>{const fixedAttrib=attrib.replace(/([^;]*);/,"$1").trim();if(RegExp(CONSTANTS_COLOR_KEYWORD).exec(attrib)){const newStyle2=fixedAttrib.replace(CONSTANTS_FILL_KEYWORD,CONSTANTS_BG_FILL).replace(CONSTANTS_COLOR_KEYWORD,CONSTANTS_FILL_KEYWORD);foundClass.textStyles.push(newStyle2)}foundClass.styles.push(fixedAttrib)})}getClasses(){return this.classes}setupToolTips(element){const tooltipElem=createTooltip();select(element).select("svg").selectAll("g.node, g.rough-node").on("mouseover",e=>{var _a2;const el=select(e.currentTarget),title=el.attr("title");if(null===title)return;const rect=null==(_a2=e.currentTarget)?void 0:_a2.getBoundingClientRect();tooltipElem.transition().duration(200).style("opacity",".9"),tooltipElem.style("left",window.scrollX+rect.left+(rect.right-rect.left)/2+"px").style("top",window.scrollY+rect.bottom+"px"),tooltipElem.html(purify.sanitize(title)),el.classed("hover",!0)}).on("mouseout",e=>{tooltipElem.transition().duration(500).style("opacity",0);select(e.currentTarget).classed("hover",!1)})}setCssClass(itemIds,cssClassName){itemIds.split(",").forEach(id=>{var _a2;let foundState=this.getState(id);if(!foundState){const trimmedId=id.trim();this.addState(trimmedId),foundState=this.getState(trimmedId)}null==(_a2=null==foundState?void 0:foundState.classes)||_a2.push(cssClassName)})}setStyle(itemId,styleText){var _a2,_b;null==(_b=null==(_a2=this.getState(itemId))?void 0:_a2.styles)||_b.push(styleText)}setTextStyle(itemId,cssClassName){var _a2,_b;null==(_b=null==(_a2=this.getState(itemId))?void 0:_a2.textStyles)||_b.push(cssClassName)}bindFunctions(element){this.funs.forEach(fun=>{fun(element)})}getDirectionStatement(){return this.rootDoc.find(doc=>"dir"===doc.stmt)}getDirection(){var _a2;return(null==(_a2=this.getDirectionStatement())?void 0:_a2.value)??"TB"}setDirection(dir){const doc=this.getDirectionStatement();doc?doc.value=dir:this.rootDoc.unshift({stmt:"dir",value:dir})}trimColon(str){return str.startsWith(":")?str.slice(1).trim():str.trim()}getData(){const config=getConfig2();return{nodes:this.nodes,edges:this.edges,other:{},config:config,direction:getDir(this.getRootDocV2())}}getConfig(){return getConfig2().state}},"StateDB"),_a.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},_a),styles_default=__name(options=>`\ndefs [id$="-barbEnd"] {\n fill: ${options.transitionColor};\n stroke: ${options.transitionColor};\n }\ng.stateGroup text {\n fill: ${options.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${options.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${options.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${options.lineColor};\n stroke-width: ${options.strokeWidth||1};\n}\n\n.transition {\n stroke: ${options.transitionColor};\n stroke-width: ${options.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${options.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${options.noteBorderColor};\n fill: ${options.noteBkgColor};\n\n text {\n fill: ${options.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${options.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${options.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${options.edgeLabelBackground};\n p {\n background-color: ${options.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${options.edgeLabelBackground};\n fill: ${options.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${options.transitionLabelColor||options.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${options.transitionLabelColor||options.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${options.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${options.specialStateColor};\n stroke: ${options.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${options.specialStateColor};\n stroke: ${options.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${options.innerEndBackground};\n stroke: ${options.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${options.compositeBackground||options.background};\n // stroke: ${options.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${options.stateBkg||options.mainBkg};\n stroke: ${options.stateBorder||options.nodeBorder};\n stroke-width: ${options.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${options.mainBkg};\n stroke: ${options.stateBorder||options.nodeBorder};;\n stroke-width: ${options.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${options.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${options.compositeTitleBackground};\n stroke: ${options.stateBorder||options.nodeBorder};\n stroke-width: ${options.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${options.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${options.stateBorder||options.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${options.compositeBackground||options.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${options.altBackground?options.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${options.altBackground?options.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${options.noteBkgColor};\n stroke: ${options.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${options.noteBkgColor};\n stroke: ${options.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${options.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${options.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${options.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${options.lineColor};\n stroke: ${options.lineColor};\n stroke-width: ${options.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${options.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${options.mainBkg};\n stroke: ${options.useGradient?"url("+options.svgId+"-gradient)":options.stateBorder||options.nodeBorder};\n stroke-width: ${options.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${options.radius}px;\n ry: ${options.radius}px;\n filter: ${options.dropShadow?options.dropShadow.replace("url(#drop-shadow)",`url(${options.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles");export{StateDB as S,stateDiagram_default as a,stateRenderer_v3_unified_default as b,styles_default as s};
@@ -1 +0,0 @@
1
- var _a,_b;import{_ as __name,l as log,D as selectSvgElement,y as getConfig,p as clear,E as getThemeVariables3,e as configureSvgSize,i as sanitizeText,c as getConfig2}from"./mermaid.core-DH-sQJgr.js";var diagramTitle="",accTitle="",accDescription="",rules=[],ruleMap=new Map,sanitizeText2=__name(text=>sanitizeText(text,getConfig2()),"sanitizeText"),sanitizeAstNode=__name(node=>{switch(node.type){case"terminal":return{...node,value:sanitizeText2(node.value)};case"nonterminal":return{...node,name:sanitizeText2(node.name)};case"sequence":return{...node,elements:node.elements.map(sanitizeAstNode)};case"choice":return{...node,alternatives:node.alternatives.map(sanitizeAstNode)};case"optional":return{...node,element:sanitizeAstNode(node.element)};case"repetition":return{...node,element:sanitizeAstNode(node.element),separator:node.separator?sanitizeAstNode(node.separator):void 0};case"special":return{...node,text:sanitizeText2(node.text)}}},"sanitizeAstNode"),clear2=__name(()=>{diagramTitle="",accTitle="",accDescription="",rules.length=0,ruleMap.clear(),clear(),log.debug("[Railroad] Database cleared")},"clear"),setTitle=__name(text=>{diagramTitle=sanitizeText2(text),log.debug("[Railroad] Title set:",text)},"setTitle"),getTitle=__name(()=>diagramTitle,"getTitle"),db={clear:clear2,setTitle:setTitle,getTitle:getTitle,addRule:__name(rule=>{const sanitizedRule={...rule,name:sanitizeText2(rule.name),definition:sanitizeAstNode(rule.definition),comment:rule.comment?sanitizeText2(rule.comment):void 0};log.debug("[Railroad] Adding rule:",sanitizedRule.name),ruleMap.has(sanitizedRule.name)&&log.warn(`[Railroad] Rule '${sanitizedRule.name}' is already defined. Overwriting.`),rules.push(sanitizedRule),ruleMap.set(sanitizedRule.name,sanitizedRule)},"addRule"),getRules:__name(()=>rules,"getRules"),getRule:__name(name=>ruleMap.get(name),"getRule"),setAccTitle:__name(text=>{accTitle=sanitizeText2(text).replace(/^\s+/g,""),log.debug("[Railroad] Accessibility title set:",text)},"setAccTitle"),getAccTitle:__name(()=>accTitle,"getAccTitle"),setAccDescription:__name(text=>{accDescription=sanitizeText2(text).replace(/\n\s+/g,"\n"),log.debug("[Railroad] Accessibility description set:",text)},"setAccDescription"),getAccDescription:__name(()=>accDescription,"getAccDescription"),setDiagramTitle:setTitle,getDiagramTitle:getTitle},DEFAULT_RAILROAD_CONFIG={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},COLOR_VALUE_PATTERN=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,FONT_FAMILY_PATTERN=/^[\w "',.-]+$/,RAILROAD_STYLE_OPTION_KEYS=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),isRailroadStyleOptions=__name(options=>!!options&&Object.keys(options).every(key=>"railroad"===key||RAILROAD_STYLE_OPTION_KEYS.has(key)),"isRailroadStyleOptions"),extractRailroadOverrides=__name(options=>options?"railroad"in options&&options.railroad?options.railroad:isRailroadStyleOptions(options)?options:{}:{},"extractRailroadOverrides"),extractThemeOverrides=__name(options=>{if(!options||isRailroadStyleOptions(options))return{};const{railroad:_railroad,svgId:_svgId,theme:_theme,look:_look,...themeOverrides}=options;return themeOverrides},"extractThemeOverrides"),sanitizeColorValue=__name((value,fallback)=>{if("string"!=typeof value)return fallback;const normalized=value.trim();return COLOR_VALUE_PATTERN.test(normalized)?normalized:fallback},"sanitizeColorValue"),sanitizeFontFamilyValue=__name((value,fallback)=>{if("string"!=typeof value)return fallback;const normalized=value.trim();return FONT_FAMILY_PATTERN.test(normalized)?normalized:fallback},"sanitizeFontFamilyValue"),sanitizeNumberValue=__name((value,fallback)=>{const parsed="number"==typeof value?value:"string"==typeof value?Number.parseFloat(value):Number.NaN;return Number.isFinite(parsed)&&parsed>=0?parsed:fallback},"sanitizeNumberValue"),parseThemeFontSize=__name(value=>{const parsed="number"==typeof value?value:"string"==typeof value?Number.parseFloat(value):Number.NaN;return Number.isFinite(parsed)&&parsed>0?parsed:void 0},"parseThemeFontSize"),buildThemeDefaults=__name(themeVariables=>{const fontFamily=sanitizeFontFamilyValue(themeVariables.fontFamily,DEFAULT_RAILROAD_CONFIG.fontFamily),fontSize=parseThemeFontSize(themeVariables.fontSize)??DEFAULT_RAILROAD_CONFIG.fontSize;return{...DEFAULT_RAILROAD_CONFIG,fontFamily:fontFamily,fontSize:fontSize,terminalFill:sanitizeColorValue(themeVariables.secondBkg??themeVariables.secondaryColor,DEFAULT_RAILROAD_CONFIG.terminalFill),terminalStroke:sanitizeColorValue(themeVariables.secondaryBorderColor??themeVariables.lineColor,DEFAULT_RAILROAD_CONFIG.terminalStroke),terminalTextColor:sanitizeColorValue(themeVariables.secondaryTextColor??themeVariables.textColor,DEFAULT_RAILROAD_CONFIG.terminalTextColor),nonTerminalFill:sanitizeColorValue(themeVariables.mainBkg??themeVariables.background,DEFAULT_RAILROAD_CONFIG.nonTerminalFill),nonTerminalStroke:sanitizeColorValue(themeVariables.primaryBorderColor??themeVariables.lineColor,DEFAULT_RAILROAD_CONFIG.nonTerminalStroke),nonTerminalTextColor:sanitizeColorValue(themeVariables.primaryTextColor??themeVariables.textColor,DEFAULT_RAILROAD_CONFIG.nonTerminalTextColor),lineColor:sanitizeColorValue(themeVariables.lineColor,DEFAULT_RAILROAD_CONFIG.lineColor),markerFill:sanitizeColorValue(themeVariables.lineColor,DEFAULT_RAILROAD_CONFIG.markerFill),commentFill:sanitizeColorValue(themeVariables.labelBackground??themeVariables.tertiaryColor,DEFAULT_RAILROAD_CONFIG.commentFill),commentStroke:sanitizeColorValue(themeVariables.tertiaryBorderColor??themeVariables.lineColor,DEFAULT_RAILROAD_CONFIG.commentStroke),commentTextColor:sanitizeColorValue(themeVariables.tertiaryTextColor??themeVariables.textColor,DEFAULT_RAILROAD_CONFIG.commentTextColor),specialFill:sanitizeColorValue(themeVariables.tertiaryColor??themeVariables.secondaryColor,DEFAULT_RAILROAD_CONFIG.specialFill),specialStroke:sanitizeColorValue(themeVariables.tertiaryBorderColor??themeVariables.secondaryBorderColor,DEFAULT_RAILROAD_CONFIG.specialStroke),ruleNameColor:sanitizeColorValue(themeVariables.titleColor??themeVariables.textColor,DEFAULT_RAILROAD_CONFIG.ruleNameColor)}},"buildThemeDefaults"),buildRailroadStyleOptions=__name(options=>{const currentConfig=getConfig(),themeVariables={...getThemeVariables3(),...currentConfig.themeVariables??{},...extractThemeOverrides(options)},themeDefaults=buildThemeDefaults(themeVariables),railroadOptions={...currentConfig.railroad??{},...extractRailroadOverrides(options)};return{compactMode:railroadOptions.compactMode??themeDefaults.compactMode,padding:sanitizeNumberValue(railroadOptions.padding,themeDefaults.padding),verticalSeparation:sanitizeNumberValue(railroadOptions.verticalSeparation,themeDefaults.verticalSeparation),horizontalSeparation:sanitizeNumberValue(railroadOptions.horizontalSeparation,themeDefaults.horizontalSeparation),arcRadius:sanitizeNumberValue(railroadOptions.arcRadius,themeDefaults.arcRadius),fontSize:sanitizeNumberValue(railroadOptions.fontSize,themeDefaults.fontSize),fontFamily:sanitizeFontFamilyValue(railroadOptions.fontFamily,themeDefaults.fontFamily),terminalFill:sanitizeColorValue(railroadOptions.terminalFill,themeDefaults.terminalFill),terminalStroke:sanitizeColorValue(railroadOptions.terminalStroke,themeDefaults.terminalStroke),terminalTextColor:sanitizeColorValue(railroadOptions.terminalTextColor,themeDefaults.terminalTextColor),nonTerminalFill:sanitizeColorValue(railroadOptions.nonTerminalFill,themeDefaults.nonTerminalFill),nonTerminalStroke:sanitizeColorValue(railroadOptions.nonTerminalStroke,themeDefaults.nonTerminalStroke),nonTerminalTextColor:sanitizeColorValue(railroadOptions.nonTerminalTextColor,themeDefaults.nonTerminalTextColor),lineColor:sanitizeColorValue(railroadOptions.lineColor,themeDefaults.lineColor),strokeWidth:sanitizeNumberValue(railroadOptions.strokeWidth,themeDefaults.strokeWidth),markerFill:sanitizeColorValue(railroadOptions.markerFill,themeDefaults.markerFill),commentFill:sanitizeColorValue(railroadOptions.commentFill,themeDefaults.commentFill),commentStroke:sanitizeColorValue(railroadOptions.commentStroke,themeDefaults.commentStroke),commentTextColor:sanitizeColorValue(railroadOptions.commentTextColor,themeDefaults.commentTextColor),specialFill:sanitizeColorValue(railroadOptions.specialFill,themeDefaults.specialFill),specialStroke:sanitizeColorValue(railroadOptions.specialStroke,themeDefaults.specialStroke),ruleNameColor:sanitizeColorValue(railroadOptions.ruleNameColor,themeDefaults.ruleNameColor),showMarkers:railroadOptions.showMarkers??themeDefaults.showMarkers,markerRadius:sanitizeNumberValue(railroadOptions.markerRadius,themeDefaults.markerRadius)}},"buildRailroadStyleOptions"),getStyles=__name(options=>{const{fontFamily:fontFamily,fontSize:fontSize,terminalFill:terminalFill,terminalStroke:terminalStroke,terminalTextColor:terminalTextColor,nonTerminalFill:nonTerminalFill,nonTerminalStroke:nonTerminalStroke,nonTerminalTextColor:nonTerminalTextColor,lineColor:lineColor,strokeWidth:strokeWidth,markerFill:markerFill,commentFill:commentFill,commentStroke:commentStroke,commentTextColor:commentTextColor,specialFill:specialFill,specialStroke:specialStroke,ruleNameColor:ruleNameColor}=buildRailroadStyleOptions(options);return`\n .railroad-diagram {\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n }\n\n .railroad-terminal rect {\n fill: ${terminalFill};\n stroke: ${terminalStroke};\n stroke-width: ${strokeWidth}px;\n }\n\n .railroad-terminal text {\n fill: ${terminalTextColor};\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-nonterminal rect {\n fill: ${nonTerminalFill};\n stroke: ${nonTerminalStroke};\n stroke-width: ${strokeWidth}px;\n }\n\n .railroad-nonterminal text {\n fill: ${nonTerminalTextColor};\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-line {\n stroke: ${lineColor};\n stroke-width: ${strokeWidth}px;\n fill: none;\n }\n\n .railroad-start circle,\n .railroad-end circle {\n fill: ${markerFill};\n }\n\n .railroad-comment ellipse {\n fill: ${commentFill};\n stroke: ${commentStroke};\n stroke-width: ${strokeWidth}px;\n }\n\n .railroad-comment text {\n fill: ${commentTextColor};\n font-style: italic;\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-special rect {\n fill: ${specialFill};\n stroke: ${specialStroke};\n stroke-width: ${strokeWidth}px;\n stroke-dasharray: 5,3;\n }\n\n .railroad-special text {\n fill: ${nonTerminalTextColor};\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-rule-name {\n font-weight: bold;\n fill: ${ruleNameColor};\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n }\n\n .railroad-group {\n /* Grouping container, no specific styles */\n }\n`},"getStyles"),PathBuilder=(__name(_a=class{constructor(){this.d=""}moveTo(x,y){return this.d+=`M ${x} ${y} `,this}lineTo(x,y){return this.d+=`L ${x} ${y} `,this}horizontalTo(x){return this.d+=`H ${x} `,this}verticalTo(y){return this.d+=`V ${y} `,this}arcTo(rx,ry,rotation,largeArc,sweep,x,y){return this.d+=`A ${rx} ${ry} ${rotation} ${largeArc?1:0} ${sweep?1:0} ${x} ${y} `,this}build(){return this.d.trim()}},"PathBuilder"),_a),RailroadRenderer=(__name(_b=class{constructor(svg,config=buildRailroadStyleOptions()){this.textCache=new Map,this.svg=svg,this.config=config}measureText(text){if(this.textCache.has(text))return this.textCache.get(text);const tempText=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(text),bbox=tempText.node().getBBox(),dimensions={width:bbox.width,height:bbox.height};return tempText.remove(),this.textCache.set(text,dimensions),dimensions}renderTerminal(parent,value){const textDim=this.measureText(value),width=textDim.width+2*this.config.padding,height=textDim.height+2*this.config.padding,group=parent.append("g").attr("class","railroad-terminal");return group.append("rect").attr("x",0).attr("y",0).attr("width",width).attr("height",height).attr("rx",10).attr("ry",10),group.append("text").attr("x",width/2).attr("y",height/2).text(value),{element:group.node(),dimensions:{width:width,height:height,up:height/2,down:height/2}}}renderNonTerminal(parent,name){const textDim=this.measureText(name),width=textDim.width+2*this.config.padding,height=textDim.height+2*this.config.padding,group=parent.append("g").attr("class","railroad-nonterminal");return group.append("rect").attr("x",0).attr("y",0).attr("width",width).attr("height",height),group.append("text").attr("x",width/2).attr("y",height/2).text(name),{element:group.node(),dimensions:{width:width,height:height,up:height/2,down:height/2}}}renderSequence(parent,elements){const rendered=elements.map(e=>this.renderExpression(parent,e));let totalWidth=0,maxUp=0,maxDown=0;for(const r of rendered)totalWidth+=r.dimensions.width,maxUp=Math.max(maxUp,r.dimensions.up),maxDown=Math.max(maxDown,r.dimensions.down);totalWidth+=(rendered.length-1)*this.config.horizontalSeparation;const group=parent.append("g").attr("class","railroad-sequence");let x=0;for(let i=0;i<rendered.length;i++){const r=rendered[i],y=maxUp-r.dimensions.up;if(group.node().appendChild(r.element).setAttribute("transform",`translate(${x}, ${y})`),i<rendered.length-1){const lineX1=x+r.dimensions.width,lineX2=lineX1+this.config.horizontalSeparation,lineY=maxUp;group.append("path").attr("class","railroad-line").attr("d",(new PathBuilder).moveTo(lineX1,lineY).lineTo(lineX2,lineY).build())}x+=r.dimensions.width+this.config.horizontalSeparation}return{element:group.node(),dimensions:{width:totalWidth,height:maxUp+maxDown,up:maxUp,down:maxDown}}}renderChoice(parent,alternatives){const rendered=alternatives.map(a=>this.renderExpression(parent,a));let maxWidth=0,totalHeight=0;for(const r of rendered)maxWidth=Math.max(maxWidth,r.dimensions.width),totalHeight+=r.dimensions.height;totalHeight+=(rendered.length-1)*this.config.verticalSeparation;const arcRadius=this.config.arcRadius,totalWidth=maxWidth+4*arcRadius,group=parent.append("g").attr("class","railroad-choice");let y=0;const centerY=totalHeight/2;for(const r of rendered){const elemY=y,elemCenterY=elemY+r.dimensions.up,elemX=2*arcRadius+(maxWidth-r.dimensions.width)/2;group.node().appendChild(r.element).setAttribute("transform",`translate(${elemX}, ${elemY})`);const leftPath=new PathBuilder,isBelowCenter=elemCenterY>centerY;elemCenterY===centerY?leftPath.moveTo(0,centerY).lineTo(elemX,elemCenterY):leftPath.moveTo(0,centerY).arcTo(arcRadius,arcRadius,0,!1,isBelowCenter,arcRadius,centerY+(isBelowCenter?arcRadius:-arcRadius)).lineTo(arcRadius,elemCenterY-(isBelowCenter?arcRadius:-arcRadius)).arcTo(arcRadius,arcRadius,0,!1,!isBelowCenter,2*arcRadius,elemCenterY).lineTo(elemX,elemCenterY),group.append("path").attr("class","railroad-line").attr("d",leftPath.build());const rightPath=new PathBuilder,rightStart=elemX+r.dimensions.width,rightLaneX=totalWidth-2*arcRadius;elemCenterY===centerY?rightPath.moveTo(rightStart,elemCenterY).lineTo(totalWidth,centerY):rightPath.moveTo(rightStart,elemCenterY).lineTo(rightLaneX,elemCenterY).arcTo(arcRadius,arcRadius,0,!1,!isBelowCenter,totalWidth-arcRadius,elemCenterY+(isBelowCenter?-arcRadius:arcRadius)).lineTo(totalWidth-arcRadius,centerY+(isBelowCenter?arcRadius:-arcRadius)).arcTo(arcRadius,arcRadius,0,!1,isBelowCenter,totalWidth,centerY),group.append("path").attr("class","railroad-line").attr("d",rightPath.build()),y+=r.dimensions.height+this.config.verticalSeparation}return{element:group.node(),dimensions:{width:totalWidth,height:totalHeight,up:centerY,down:totalHeight-centerY}}}renderOptional(parent,element){const inner=this.renderExpression(parent,element),arcRadius=this.config.arcRadius,arcHeight=2*arcRadius,totalWidth=inner.dimensions.width+4*arcRadius,totalHeight=inner.dimensions.height+arcHeight,group=parent.append("g").attr("class","railroad-optional"),elemX=2*arcRadius,elemY=arcHeight;group.node().appendChild(inner.element).setAttribute("transform",`translate(${elemX}, ${elemY})`);const centerY=elemY+inner.dimensions.up,lowerPath=(new PathBuilder).moveTo(0,centerY).lineTo(2*arcRadius,centerY);group.append("path").attr("class","railroad-line").attr("d",lowerPath.build());const lowerPath2=(new PathBuilder).moveTo(elemX+inner.dimensions.width,centerY).lineTo(totalWidth,centerY);group.append("path").attr("class","railroad-line").attr("d",lowerPath2.build());const bypassPath=(new PathBuilder).moveTo(0,centerY).arcTo(arcRadius,arcRadius,0,!1,!1,arcRadius,centerY-arcRadius).lineTo(arcRadius,arcRadius).arcTo(arcRadius,arcRadius,0,!1,!0,2*arcRadius,0).lineTo(totalWidth-2*arcRadius,0).arcTo(arcRadius,arcRadius,0,!1,!0,totalWidth-arcRadius,arcRadius).lineTo(totalWidth-arcRadius,centerY-arcRadius).arcTo(arcRadius,arcRadius,0,!1,!1,totalWidth,centerY);return group.append("path").attr("class","railroad-line").attr("d",bypassPath.build()),{element:group.node(),dimensions:{width:totalWidth,height:totalHeight,up:centerY,down:totalHeight-centerY}}}renderRepetition(parent,element,min){const inner=this.renderExpression(parent,element),arcRadius=this.config.arcRadius,arcHeight=2*arcRadius,totalWidth=inner.dimensions.width+4*arcRadius,hasBypass=0===min,totalHeight=inner.dimensions.height+arcHeight+(hasBypass?arcHeight:0),group=parent.append("g").attr("class","railroad-repetition"),elemX=2*arcRadius,elemY=hasBypass?arcHeight:0;group.node().appendChild(inner.element).setAttribute("transform",`translate(${elemX}, ${elemY})`);const centerY=elemY+inner.dimensions.up;group.append("path").attr("class","railroad-line").attr("d",(new PathBuilder).moveTo(0,centerY).lineTo(2*arcRadius,centerY).build()),group.append("path").attr("class","railroad-line").attr("d",(new PathBuilder).moveTo(elemX+inner.dimensions.width,centerY).lineTo(totalWidth,centerY).build());const loopY=elemY+inner.dimensions.height+arcRadius,loopPath=(new PathBuilder).moveTo(elemX+inner.dimensions.width,centerY).arcTo(arcRadius,arcRadius,0,!1,!0,elemX+inner.dimensions.width+arcRadius,centerY+arcRadius).lineTo(elemX+inner.dimensions.width+arcRadius,loopY).arcTo(arcRadius,arcRadius,0,!1,!0,elemX+inner.dimensions.width,loopY+arcRadius).lineTo(2*arcRadius,loopY+arcRadius).arcTo(arcRadius,arcRadius,0,!1,!0,arcRadius,loopY).lineTo(arcRadius,centerY+arcRadius).arcTo(arcRadius,arcRadius,0,!1,!0,2*arcRadius,centerY);if(group.append("path").attr("class","railroad-line").attr("d",loopPath.build()),hasBypass){const bypassPath=(new PathBuilder).moveTo(0,centerY).arcTo(arcRadius,arcRadius,0,!1,!1,arcRadius,centerY-arcRadius).lineTo(arcRadius,arcRadius).arcTo(arcRadius,arcRadius,0,!1,!0,2*arcRadius,0).lineTo(totalWidth-2*arcRadius,0).arcTo(arcRadius,arcRadius,0,!1,!0,totalWidth-arcRadius,arcRadius).lineTo(totalWidth-arcRadius,centerY-arcRadius).arcTo(arcRadius,arcRadius,0,!1,!1,totalWidth,centerY);group.append("path").attr("class","railroad-line").attr("d",bypassPath.build())}return{element:group.node(),dimensions:{width:totalWidth,height:totalHeight,up:centerY,down:totalHeight-centerY}}}renderSpecial(parent,text){const textDim=this.measureText("? "+text+" ?"),width=textDim.width+2*this.config.padding,height=textDim.height+2*this.config.padding,group=parent.append("g").attr("class","railroad-special");return group.append("rect").attr("x",0).attr("y",0).attr("width",width).attr("height",height),group.append("text").attr("x",width/2).attr("y",height/2).text("? "+text+" ?"),{element:group.node(),dimensions:{width:width,height:height,up:height/2,down:height/2}}}renderExpression(parent,node){switch(node.type){case"terminal":return this.renderTerminal(parent,node.value);case"nonterminal":return this.renderNonTerminal(parent,node.name);case"sequence":return this.renderSequence(parent,node.elements);case"choice":return this.renderChoice(parent,node.alternatives);case"optional":return this.renderOptional(parent,node.element);case"repetition":return this.renderRepetition(parent,node.element,node.min);case"special":return this.renderSpecial(parent,node.text);default:throw new Error(`Unknown node type: ${node.type}`)}}renderRule(rule,y){const group=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${y})`),ruleName=rule.name+" =",nameWidth=this.measureText(ruleName).width+20,definitionX=nameWidth+20,defGroup=group.append("g"),result=this.renderExpression(defGroup,rule.definition),baselineY=Math.max(20,result.dimensions.up),definitionY=baselineY-result.dimensions.up;defGroup.attr("transform",`translate(${definitionX}, ${definitionY})`);group.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",baselineY).text(ruleName);group.append("g").attr("class","railroad-start").append("circle").attr("cx",nameWidth).attr("cy",baselineY).attr("r",this.config.markerRadius);return group.append("g").attr("class","railroad-end").append("circle").attr("cx",definitionX+result.dimensions.width+10).attr("cy",baselineY).attr("r",this.config.markerRadius),group.append("path").attr("class","railroad-line").attr("d",(new PathBuilder).moveTo(nameWidth+this.config.markerRadius,baselineY).lineTo(definitionX,baselineY).build()),group.append("path").attr("class","railroad-line").attr("d",(new PathBuilder).moveTo(definitionX+result.dimensions.width,baselineY).lineTo(definitionX+result.dimensions.width+10-this.config.markerRadius,baselineY).build()),{height:Math.max(40,definitionY+result.dimensions.height+2*this.config.padding),width:definitionX+result.dimensions.width+10+this.config.markerRadius}}renderDiagram(rules2){let y=this.config.padding,maxWidth=0;for(const rule of rules2){const result=this.renderRule(rule,y);y+=result.height+this.config.verticalSeparation,maxWidth=Math.max(maxWidth,result.width)}return{width:maxWidth+2*this.config.padding,height:y+this.config.padding}}},"RailroadRenderer"),_b),configureRailroadSvgSize=__name((svg,dimensions,useMaxWidth)=>{configureSvgSize(svg,dimensions.height,dimensions.width,useMaxWidth),svg.attr("viewBox",`0 0 ${dimensions.width} ${dimensions.height}`)},"configureRailroadSvgSize"),renderer={draw:__name((text,id,_version)=>{log.debug("[Railroad] Rendering diagram\n"+text);try{const svg=selectSvgElement(id);svg.attr("class","railroad-diagram");const railroadConfig=getConfig().railroad,useMaxWidth=(null==railroadConfig?void 0:railroadConfig.useMaxWidth)??!0,rules2=db.getRules();if(log.debug(`[Railroad] Rendering ${rules2.length} rules`),0===rules2.length)return log.warn("[Railroad] No rules to render"),void configureRailroadSvgSize(svg,{height:100,width:200},useMaxWidth);const dimensions=new RailroadRenderer(svg,buildRailroadStyleOptions()).renderDiagram(rules2);configureRailroadSvgSize(svg,dimensions,useMaxWidth),log.debug("[Railroad] Render complete")}catch(error){throw log.error("[Railroad] Render error:",error),error}},"draw")};export{db as d,getStyles as g,renderer as r};
@@ -1 +0,0 @@
1
- import{_ as __name,l as log}from"./mermaid.core-DH-sQJgr.js";import{i as isUndefined,G as Graph}from"./graph-CnJdn47S.js";import{b as baseClone,m as map}from"./map-DQeg2hXV.js";function write(g){var value,json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};return isUndefined(g.graph())||(json.value=(value=g.graph(),baseClone(value,4))),json}function writeNodes(g){return map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};return isUndefined(nodeValue)||(node.value=nodeValue),isUndefined(parent)||(node.parent=parent),node})}function writeEdges(g){return map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};return isUndefined(e.name)||(edge.name=e.name),isUndefined(edgeValue)||(edge.value=edgeValue),edge})}var clusterDb=new Map,descendants=new Map,parents=new Map,clear=__name(()=>{descendants.clear(),parents.clear(),clusterDb.clear()},"clear"),isDescendant=__name((id,ancestorId)=>{const ancestorDescendants=descendants.get(ancestorId)||[];return log.trace("In isDescendant",ancestorId," ",id," = ",ancestorDescendants.includes(id)),ancestorDescendants.includes(id)},"isDescendant"),edgeInCluster=__name((edge,clusterId)=>{const clusterDescendants=descendants.get(clusterId)||[];return log.info("Descendants of ",clusterId," is ",clusterDescendants),log.info("Edge is ",edge),edge.v!==clusterId&&edge.w!==clusterId&&(clusterDescendants?clusterDescendants.includes(edge.v)||isDescendant(edge.v,clusterId)||isDescendant(edge.w,clusterId)||clusterDescendants.includes(edge.w):(log.debug("Tilt, ",clusterId,",not in descendants"),!1))},"edgeInCluster"),copy=__name((clusterId,graph,newGraph,rootId)=>{log.warn("Copying children of ",clusterId,"root",rootId,"data",graph.node(clusterId),rootId);const nodes=graph.children(clusterId)||[];clusterId!==rootId&&nodes.push(clusterId),log.warn("Copying (nodes) clusterId",clusterId,"nodes",nodes),nodes.forEach(node=>{if(graph.children(node).length>0)copy(node,graph,newGraph,rootId);else{const data=graph.node(node);log.info("cp ",node," to ",rootId," with parent ",clusterId),newGraph.setNode(node,data),rootId!==graph.parent(node)&&(log.warn("Setting parent",node,graph.parent(node)),newGraph.setParent(node,graph.parent(node))),clusterId!==rootId&&node!==clusterId?(log.debug("Setting parent",node,clusterId),newGraph.setParent(node,clusterId)):(log.info("In copy ",clusterId,"root",rootId,"data",graph.node(clusterId),rootId),log.debug("Not Setting parent for node=",node,"cluster!==rootId",clusterId!==rootId,"node!==clusterId",node!==clusterId));const edges=graph.edges(node);log.debug("Copying Edges",edges),edges.forEach(edge=>{log.info("Edge",edge);const data2=graph.edge(edge.v,edge.w,edge.name);log.info("Edge data",data2,rootId);try{if(edgeInCluster(edge,rootId)){const rootDescendants=descendants.get(rootId)||[],vIn=rootDescendants.includes(edge.v)||isDescendant(edge.v,rootId)||edge.v===rootId,wIn=rootDescendants.includes(edge.w)||isDescendant(edge.w,rootId)||edge.w===rootId;if(vIn&&wIn)log.info("Copying as ",edge.v,edge.w,data2,edge.name),newGraph.setEdge(edge.v,edge.w,data2,edge.name),log.info("newGraph edges ",newGraph.edges(),newGraph.edge(newGraph.edges()[0]));else{const newV=vIn?rootId:edge.v,newW=wIn?rootId:edge.w;log.info("Rebinding cross-boundary edge as ",newV,newW,data2,edge.name),graph.setEdge(newV,newW,data2,edge.name)}}else log.info("Skipping copy of edge ",edge.v,"--\x3e",edge.w," rootId: ",rootId," clusterId:",clusterId)}catch(e){log.error(e)}})}log.debug("Removing node",node),graph.removeNode(node)})},"copy"),extractDescendants=__name((id,graph)=>{const children=graph.children(id);let res=[...children];for(const child of children)parents.set(child,id),res=[...res,...extractDescendants(child,graph)];return res},"extractDescendants"),findCommonEdges=__name((graph,id1,id2)=>{const edges1=graph.edges().filter(edge=>edge.v===id1||edge.w===id1),edges2=graph.edges().filter(edge=>edge.v===id2||edge.w===id2),edges1Prim=edges1.map(edge=>({v:edge.v===id1?id2:edge.v,w:edge.w===id1?id1:edge.w})),edges2Prim=edges2.map(edge=>({v:edge.v,w:edge.w}));return edges1Prim.filter(edgeIn1=>edges2Prim.some(edge=>edgeIn1.v===edge.v&&edgeIn1.w===edge.w))},"findCommonEdges"),findNonClusterChild=__name((id,graph,clusterId)=>{const children=graph.children(id);if(log.trace("Searching children of id ",id,children),children.length<1)return id;let reserve;for(const child of children){const _id=findNonClusterChild(child,graph,clusterId),commonEdges=findCommonEdges(graph,clusterId,_id);if(_id){if(!(commonEdges.length>0))return _id;reserve=_id}}return reserve},"findNonClusterChild"),getAnchorId=__name(id=>clusterDb.has(id)&&clusterDb.get(id).externalConnections&&clusterDb.has(id)?clusterDb.get(id).id:id,"getAnchorId"),adjustClustersAndEdges=__name((graph,depth)=>{var _a;if(!graph||depth>10)log.debug("Opting out, no graph ");else{log.debug("Opting in, graph "),graph.nodes().forEach(function(id){graph.children(id).length>0&&(log.warn("Cluster identified",id," Replacement id in edges: ",findNonClusterChild(id,graph,id)),descendants.set(id,extractDescendants(id,graph)),clusterDb.set(id,{id:findNonClusterChild(id,graph,id),clusterData:graph.node(id)}))}),graph.nodes().forEach(function(id){const children=graph.children(id),edges=graph.edges();children.length>0?(log.debug("Cluster identified",id,descendants),edges.forEach(edge=>{isDescendant(edge.v,id)^isDescendant(edge.w,id)&&(log.warn("Edge: ",edge," leaves cluster ",id),log.warn("Descendants of XXX ",id,": ",descendants.get(id)),clusterDb.get(id).externalConnections=!0)})):log.debug("Not a cluster ",id,descendants)});for(let id of clusterDb.keys()){const nonClusterChild=clusterDb.get(id).id,parent=graph.parent(nonClusterChild);parent!==id&&clusterDb.has(parent)&&!clusterDb.get(parent).externalConnections&&(clusterDb.get(id).id=parent);const hasDirectOutgoingEdge=graph.edges().some(edge=>edge.v===id);if(nonClusterChild&&(null==(_a=clusterDb.get(id))?void 0:_a.externalConnections)&&hasDirectOutgoingEdge&&isNodeInExtractableCluster(graph,nonClusterChild,id)){const safeAnchor=findSafeAnchorNode(graph,id,graph.parent(nonClusterChild));safeAnchor&&(clusterDb.get(id).id=safeAnchor)}}graph.edges().forEach(function(e){const edge=graph.edge(e);log.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),log.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(graph.edge(e)));let v=e.v,w=e.w;if(log.warn("Fix XXX",clusterDb,"ids:",e.v,e.w,"Translating: ",clusterDb.get(e.v)," --- ",clusterDb.get(e.w)),clusterDb.get(e.v)||clusterDb.get(e.w)){if(log.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),v=getAnchorId(e.v),w=getAnchorId(e.w),graph.removeEdge(e.v,e.w,e.name),v!==e.v){const parent=graph.parent(v);clusterDb.get(parent).externalConnections=!0,edge.fromCluster=e.v}if(w!==e.w){const parent=graph.parent(w);clusterDb.get(parent).externalConnections=!0,edge.toCluster=e.w}log.warn("Fix Replacing with XXX",v,w,e.name),graph.setEdge(v,w,edge,e.name)}}),log.warn("Adjusted Graph",write(graph)),extractor(graph,0),log.trace(clusterDb)}},"adjustClustersAndEdges"),extractor=__name((graph,depth)=>{var _a,_b,_c,_d;if(log.warn("extractor - ",depth,write(graph),graph.children("D")),depth>10)return void log.error("Bailing out");let nodes=graph.nodes(),hasChildren=!1;for(const node of nodes){const children=graph.children(node);hasChildren=hasChildren||children.length>0}if(hasChildren){log.debug("Nodes = ",nodes,depth);for(const node of nodes)if(log.debug("Extracting node",node,clusterDb,clusterDb.has(node)&&!clusterDb.get(node).externalConnections,!graph.parent(node),graph.node(node),graph.children("D")," Depth ",depth),clusterDb.has(node))if((null==(_b=null==(_a=clusterDb.get(node))?void 0:_a.clusterData)?void 0:_b.explicitDir)&&graph.children(node)&&graph.children(node).length>0){log.warn("Cluster with explicit dir, creating subgraph for children",node,depth);const dir=clusterDb.get(node).clusterData.dir,clusterGraph=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:dir,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});copy(node,graph,clusterGraph,node);const clusterNodeData=graph.node(node)||{};graph.setNode(node,{...clusterNodeData,clusterNode:!0,id:node,clusterData:clusterDb.get(node).clusterData,label:clusterDb.get(node).label,graph:clusterGraph}),log.warn("Subgraph for cluster with explicit dir created:",node,write(clusterGraph))}else if(!clusterDb.get(node).externalConnections&&graph.children(node)&&graph.children(node).length>0){log.warn("Cluster without external connections, without a parent and with children",node,depth);let dir="TB"===graph.graph().rankdir?"LR":"TB";(null==(_d=null==(_c=clusterDb.get(node))?void 0:_c.clusterData)?void 0:_d.dir)&&(dir=clusterDb.get(node).clusterData.dir,log.warn("Fixing dir",clusterDb.get(node).clusterData.dir,dir));const clusterGraph=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:dir,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});copy(node,graph,clusterGraph,node);const clusterNodeData=graph.node(node)||{};graph.setNode(node,{...clusterNodeData,clusterNode:!0,id:node,clusterData:clusterDb.get(node).clusterData,label:clusterDb.get(node).label,graph:clusterGraph}),log.debug("Old graph after copy",write(graph))}else log.warn("Cluster ** ",node," **not meeting the criteria !externalConnections:",!clusterDb.get(node).externalConnections," no parent: ",!graph.parent(node)," children ",graph.children(node)&&graph.children(node).length>0,graph.children("D"),depth),log.debug(clusterDb);else log.debug("Not a cluster",node,depth);nodes=graph.nodes(),log.warn("New list of nodes",nodes);for(const node of nodes){const data=graph.node(node);log.warn(" Now next level",node,data),(null==data?void 0:data.clusterNode)&&extractor(data.graph,depth+1)}}else log.debug("Done, no node has children",graph.nodes())},"extractor"),sorter=__name((graph,nodes)=>{if(0===nodes.length)return[];let result=Object.assign([],nodes);return nodes.forEach(node=>{const children=graph.children(node),sorted=sorter(graph,children);result=[...result,...sorted]}),result},"sorter"),sortNodesByHierarchy=__name(graph=>sorter(graph,graph.children()),"sortNodesByHierarchy"),isNodeInExtractableCluster=__name((graph,node,rootId)=>{let parent=graph.parent(node);for(;parent&&parent!==rootId;){const cluster=clusterDb.get(parent);if(cluster&&!cluster.externalConnections)return!0;parent=graph.parent(parent)}return!1},"isNodeInExtractableCluster"),findSafeAnchorNode=__name((graph,clusterId,excludedCluster)=>{const children=graph.children(clusterId)??[];for(const child of children){if(child===excludedCluster||isDescendant(child,excludedCluster))continue;const candidate=findNonClusterChild(child,graph,clusterId);if(candidate&&!isNodeInExtractableCluster(graph,candidate,clusterId))return candidate}return null},"findSafeAnchorNode");export{adjustClustersAndEdges as a,clusterDb as b,clear as c,findNonClusterChild as f,sortNodesByHierarchy as s,write as w};