vibelet 1.2.249 → 1.2.251

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 (147) hide show
  1. package/dist/index.cjs +7 -1
  2. package/dist/inventory-scan-worker.cjs +1 -1
  3. package/dist/runtime-version.cjs +1 -1
  4. package/dist/web/assets/App-Bx92ZYqP.js +2 -0
  5. package/dist/web/assets/App-C7OILF5b.css +97 -0
  6. package/dist/web/assets/{BrowserControlPanel-ChZyiZg8.js → BrowserControlPanel-BSBCQsTC.js} +1 -1
  7. package/dist/web/assets/ChatPane-CNkEpPZD.js +1 -0
  8. package/dist/web/assets/{ChipGroup-0exv9rzn.js → ChipGroup-BGteDQAS.js} +1 -1
  9. package/dist/web/assets/ComposerMenus-7XnPTSod.js +1 -0
  10. package/dist/web/assets/{DiffDrawer-D4eELjEe.js → DiffDrawer-DLUBB9ig.js} +1 -1
  11. package/dist/web/assets/FilesControlPanel-BC8Kvjf2.js +1 -0
  12. package/dist/web/assets/GlobalPendingDialog-ZjYyhVoG.js +1 -0
  13. package/dist/web/assets/{ImageViewer-BojwpCb-.js → ImageViewer-D_-eK1aP.js} +1 -1
  14. package/dist/web/assets/InteractionPolish-CQwU9CEi.css +1 -0
  15. package/dist/web/assets/{LanguageSettingsPanel-C1ZHQpVG.js → LanguageSettingsPanel-Btyc58mw.js} +1 -1
  16. package/dist/web/assets/{MarkdownModePanel-B4iVncFO.js → MarkdownModePanel-q63q8r9N.js} +1 -1
  17. package/dist/web/assets/{NewSessionDialog-eX_6NPbk.css → NewSessionDialog-CWW1T1s7.css} +1 -1
  18. package/dist/web/assets/NewSessionDialog-Cqymzgm4.js +1 -0
  19. package/dist/web/assets/{NotificationSettingsPanel-BA0Lj4kT.js → NotificationSettingsPanel-CKYNiUya.js} +1 -1
  20. package/dist/web/assets/{PanelFind-D_pRPFBN.js → PanelFind-BA1eUXgS.js} +1 -1
  21. package/dist/web/assets/{RemoteLifeOSBlock-CZkQLmE5.js → RemoteLifeOSBlock-Bq3YQBy7.js} +2 -2
  22. package/dist/web/assets/RemoteWorkspaceSettings-Cs_zzqpf.css +1 -0
  23. package/dist/web/assets/RemoteWorkspaceSettings-D8_jQ7Wt.js +1 -0
  24. package/dist/web/assets/{SessionTerminalPanel-B-TvX4Fz.js → SessionTerminalPanel-Dmt2m_B6.js} +2 -2
  25. package/dist/web/assets/{SpeechInputSettingsPanel-Buqwjrth.js → SpeechInputSettingsPanel-9qu4_cQx.js} +1 -1
  26. package/dist/web/assets/{ThemeSettingsPanel-Bph9zVcN.js → ThemeSettingsPanel-zefRQEDV.js} +1 -1
  27. package/dist/web/assets/{__vite-browser-external-2447137e-Dbwxx6PZ.js → __vite-browser-external-2447137e-BMiSckAV.js} +1 -1
  28. package/dist/web/assets/_baseMerge-CwDZKfvJ.js +1 -0
  29. package/dist/web/assets/{_initCloneObject-CgHgrY9n.js → _initCloneObject-C781OlVa.js} +1 -1
  30. package/dist/web/assets/{abnfDiagram-VRR7QNED-dJfL32qR.js → abnfDiagram-VRR7QNED-THI3SIgB.js} +1 -1
  31. package/dist/web/assets/arc-DgeTKeM5.js +1 -0
  32. package/dist/web/assets/{architectureDiagram-ZJ3FMSHR-LXgKoYZv.js → architectureDiagram-ZJ3FMSHR-CPVnaW5G.js} +1 -1
  33. package/dist/web/assets/{arrow-left-CagvtJU8.js → arrow-left-dANl3leX.js} +1 -1
  34. package/dist/web/assets/{arrow-right-CW797wzk.js → arrow-right-DTaF5t16.js} +1 -1
  35. package/dist/web/assets/{blockDiagram-677ZJIJ3-BOLqwY0y.js → blockDiagram-677ZJIJ3-BDME3ZFA.js} +1 -1
  36. package/dist/web/assets/{c4Diagram-LMCZKHZV-BvwC7DIr.js → c4Diagram-LMCZKHZV-CMY3o7XE.js} +1 -1
  37. package/dist/web/assets/channel-BE7FnnNv.js +1 -0
  38. package/dist/web/assets/chevron-up-C3_IR2td.js +1 -0
  39. package/dist/web/assets/{chunk-2Q5K7J3B-D2B_BdaG.js → chunk-2Q5K7J3B-Brbuto5C.js} +1 -1
  40. package/dist/web/assets/{chunk-32BRIVSS-B93XkYif.js → chunk-32BRIVSS-BGCuhDXk.js} +1 -1
  41. package/dist/web/assets/{chunk-5VM5RSS4-Uv1D4oA2.js → chunk-5VM5RSS4-D85xFHwk.js} +1 -1
  42. package/dist/web/assets/{chunk-EX3LRPZG-xZrFFOcj.js → chunk-EX3LRPZG-W6U7GsD7.js} +1 -1
  43. package/dist/web/assets/{chunk-JWPE2WC7-1--FpPFR.js → chunk-JWPE2WC7-CKdx8e0r.js} +1 -1
  44. package/dist/web/assets/{chunk-MOJQB5TN-BLOL5fhw.js → chunk-MOJQB5TN-Cjf1dDyf.js} +1 -1
  45. package/dist/web/assets/{chunk-RYQCIY6F-z7wmcSRp.js → chunk-RYQCIY6F-DFxqNYlG.js} +1 -1
  46. package/dist/web/assets/{chunk-V7JOEXUC-DPvobQwd.js → chunk-V7JOEXUC-lwXYy3Zq.js} +1 -1
  47. package/dist/web/assets/{chunk-VR4S4FIN-DD3Gj91z.js → chunk-VR4S4FIN-BxiP-OR0.js} +1 -1
  48. package/dist/web/assets/{chunk-XXDRQBXY-DoVRk31D.js → chunk-XXDRQBXY-BhED1rK6.js} +1 -1
  49. package/dist/web/assets/classDiagram-OUVF2IWQ-C0-VAw-b.js +1 -0
  50. package/dist/web/assets/classDiagram-v2-EOCWNBFH-C0-VAw-b.js +1 -0
  51. package/dist/web/assets/{clsx-DoZLeicy.js → clsx-Dy3K9oBb.js} +1 -1
  52. package/dist/web/assets/{collectMessageImages-B2EAkrhU.js → collectMessageImages-DEnoDhBs.js} +1 -1
  53. package/dist/web/assets/composerOptions-0DZvXA1-.js +1 -0
  54. package/dist/web/assets/{cose-bilkent-JH36ORCC-BQknAy25.js → cose-bilkent-JH36ORCC-DC9M3QOS.js} +1 -1
  55. package/dist/web/assets/{cynefin-VYW2F7L2-09uNSfvT.js → cynefin-VYW2F7L2-D1LRWQeS.js} +1 -1
  56. package/dist/web/assets/{cynefinDiagram-TSTJHNR4-CgKhj0m5.js → cynefinDiagram-TSTJHNR4-BJvzO8nK.js} +1 -1
  57. package/dist/web/assets/{dagre-VKFMJZFB-CLCxvrOo.js → dagre-VKFMJZFB-u4EU1mWb.js} +1 -1
  58. package/dist/web/assets/{diagram-FQU43EPY-B4VfNgsF.js → diagram-FQU43EPY-DfvPNd6F.js} +1 -1
  59. package/dist/web/assets/{diagram-G47NLZAW-CQC0I6zX.js → diagram-G47NLZAW-DlJwWs1J.js} +1 -1
  60. package/dist/web/assets/{diagram-NH7WQ7WH-CSBbTiMh.js → diagram-NH7WQ7WH-DcgpOjQV.js} +1 -1
  61. package/dist/web/assets/{diagram-OA4YK3LP-CkUx0v34.js → diagram-OA4YK3LP-BrNCuljO.js} +1 -1
  62. package/dist/web/assets/{diagram-WEI45ONY-dlEY_W2R.js → diagram-WEI45ONY-DxT28KUR.js} +1 -1
  63. package/dist/web/assets/{ebnfDiagram-CCIWWBDH-BsxdwE2E.js → ebnfDiagram-CCIWWBDH-FD63emzf.js} +1 -1
  64. package/dist/web/assets/{erDiagram-Q63AITRT-CE8BUsrY.js → erDiagram-Q63AITRT-COEH4rgh.js} +1 -1
  65. package/dist/web/assets/{file-editor-FileCodeEditor-HR6Wsm5I.js → file-editor-FileCodeEditor-B0qv9YKs.js} +2 -2
  66. package/dist/web/assets/{file-editor-ObsidianCodeEditor-BMcU5Aqo.js → file-editor-ObsidianCodeEditor-q_YWJSDk.js} +1 -1
  67. package/dist/web/assets/file-editor-ObsidianFileEditor-bdzeuwke.js +2 -0
  68. package/dist/web/assets/{file-editor-index-BXupf89-.js → file-editor-index-B6XepRuc.js} +1 -1
  69. package/dist/web/assets/{file-editor-index-DuqNWTkz.js → file-editor-index-BUPn4zC8.js} +1 -1
  70. package/dist/web/assets/{file-editor-index-Dc4mA3Mx.js → file-editor-index-BmcxkKR_.js} +1 -1
  71. package/dist/web/assets/{file-editor-index-ORJkxheE.js → file-editor-index-C-sivrT3.js} +1 -1
  72. package/dist/web/assets/{file-editor-index-D3hWXNQc.js → file-editor-index-C8hW6Muj.js} +1 -1
  73. package/dist/web/assets/{file-editor-index-CP7DVsyc.js → file-editor-index-CthnNAMC.js} +1 -1
  74. package/dist/web/assets/{file-editor-index-Ce_Hrot9.js → file-editor-index-DOP_6x0k.js} +1 -1
  75. package/dist/web/assets/{file-editor-index-BEhJJ-2S.js → file-editor-index-Db8cbNln.js} +1 -1
  76. package/dist/web/assets/{file-editor-index-CIj8OyuX.js → file-editor-index-Dg5e3Cpy.js} +1 -1
  77. package/dist/web/assets/{file-editor-index-DX8Fwz0S.js → file-editor-index-DqKTONJ4.js} +1 -1
  78. package/dist/web/assets/{file-editor-index-CrvkFqLZ.js → file-editor-index-JhH0nqee.js} +1 -1
  79. package/dist/web/assets/{file-editor-index-7BDUBERb.js → file-editor-index-WDJmssCC.js} +1 -1
  80. package/dist/web/assets/{file-editor-index-DL4CfMoo.js → file-editor-index-YBbEVrxT.js} +1 -1
  81. package/dist/web/assets/{flowDiagram-23GEKE2U-DUiI830l.js → flowDiagram-23GEKE2U-kWBomx5I.js} +1 -1
  82. package/dist/web/assets/{folder-plus-Byi2WQUY.js → folder-plus-ChLrua3z.js} +1 -1
  83. package/dist/web/assets/ganttDiagram-NO4QXBWP-bd158wNu.js +1 -0
  84. package/dist/web/assets/{gitGraphDiagram-IHSO6WYX-BJA7zQjW.js → gitGraphDiagram-IHSO6WYX-BsWMZB1T.js} +1 -1
  85. package/dist/web/assets/{highlighted-body-TPN3WLV5-lW0JmP5H.js → highlighted-body-TPN3WLV5-BcvTxHra.js} +1 -1
  86. package/dist/web/assets/index-kcB9N5v8.js +2 -0
  87. package/dist/web/assets/{infoDiagram-FWYZ7A6U-BfA2fWjL.js → infoDiagram-FWYZ7A6U-DtvGyYt0.js} +1 -1
  88. package/dist/web/assets/{ishikawaDiagram-FXEZZL3T-B7WW0j7E.js → ishikawaDiagram-FXEZZL3T-CHsj8iVR.js} +1 -1
  89. package/dist/web/assets/{journeyDiagram-5HDEW3XC-BEMtGLhR.js → journeyDiagram-5HDEW3XC-Ben3XW9L.js} +1 -1
  90. package/dist/web/assets/{kanban-definition-HUTT4EX6-DqIkrGPA.js → kanban-definition-HUTT4EX6-w1H0lvRK.js} +1 -1
  91. package/dist/web/assets/{key-round-y1oxWXOB.js → key-round-Csanuqei.js} +1 -1
  92. package/dist/web/assets/{layout-CAp4KseL.js → layout-DvVF2R1Q.js} +1 -1
  93. package/dist/web/assets/{linear-DRFQGBEA.js → linear-CYqpDCXS.js} +1 -1
  94. package/dist/web/assets/{map-XtUTTYLw.js → map-yP9qyz-l.js} +1 -1
  95. package/dist/web/assets/{mermaid-O7DHMXV3-9HC6mORt.js → mermaid-O7DHMXV3-DUoHFycq.js} +2 -2
  96. package/dist/web/assets/{mermaid-O7DHMXV3-DHmcgJGk.css → mermaid-O7DHMXV3-rMhXRrUE.css} +1 -1
  97. package/dist/web/assets/{mermaid.core-LEKKQwXZ.js → mermaid.core-CSuHyCbU.js} +2 -2
  98. package/dist/web/assets/{mic-BOKcmdUn.js → mic-D6yq4BVC.js} +1 -1
  99. package/dist/web/assets/{mindmap-definition-LN4V7U3C-Bt6LtGWO.js → mindmap-definition-LN4V7U3C-BariZ1mC.js} +1 -1
  100. package/dist/web/assets/newSessionDefaults-DY7-PuSf.js +1 -0
  101. package/dist/web/assets/pegDiagram-2B236MQR-DsjvsiG-.js +1 -0
  102. package/dist/web/assets/{pieDiagram-ENE6RG2P-CeQnXIl7.js → pieDiagram-ENE6RG2P-CVDkx6T3.js} +1 -1
  103. package/dist/web/assets/{quadrantDiagram-ABIIQ3AL-DNGl4Hse.js → quadrantDiagram-ABIIQ3AL-CZfhv8B5.js} +1 -1
  104. package/dist/web/assets/{railroadDiagram-RFXS5EU6-BiFr0x3V.js → railroadDiagram-RFXS5EU6-DPiV-o4k.js} +1 -1
  105. package/dist/web/assets/{requirementDiagram-TGXJPOKE-DIx4dpS7.js → requirementDiagram-TGXJPOKE-ifd3KNkN.js} +1 -1
  106. package/dist/web/assets/{sankeyDiagram-HTMAVEWB-D_zRhmQ_.js → sankeyDiagram-HTMAVEWB-BTgBAMv9.js} +1 -1
  107. package/dist/web/assets/{sequenceDiagram-DBY2YBRQ-ChMRMmPd.js → sequenceDiagram-DBY2YBRQ-6-7v8n8u.js} +1 -1
  108. package/dist/web/assets/{sizeCapture-X5ZJPWSS-CLVxFMDT.js → sizeCapture-X5ZJPWSS-BRFGoPEh.js} +1 -1
  109. package/dist/web/assets/{square-K9kFBDil.js → square-Dl4fOYPP.js} +1 -1
  110. package/dist/web/assets/{stateDiagram-2N3HPSRC-Dn7yCHtf.js → stateDiagram-2N3HPSRC-BBiXuN7R.js} +1 -1
  111. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-DRJJe0JN.js +1 -0
  112. package/dist/web/assets/{swimlanes-5IMT3BWC-Dhut6RY-.js → swimlanes-5IMT3BWC-C40_UKFy.js} +2 -2
  113. package/dist/web/assets/swimlanesDiagram-G3AALYLV-DEaTTKbV.js +1 -0
  114. package/dist/web/assets/{timeline-definition-FHXFAJF6-D_9aY3SL.js → timeline-definition-FHXFAJF6-cuYaryrF.js} +1 -1
  115. package/dist/web/assets/useComposerCompletion-DBl1CTPC.js +1 -0
  116. package/dist/web/assets/{vennDiagram-L72KCM5P-Bxsjs1td.js → vennDiagram-L72KCM5P-BjSt5IQl.js} +1 -1
  117. package/dist/web/assets/{wardleyDiagram-EHGQE667-B8vO0orG.js → wardleyDiagram-EHGQE667-DAJYQgOm.js} +1 -1
  118. package/dist/web/assets/{xychartDiagram-FW5EYKEG-CUBLdGVB.js → xychartDiagram-FW5EYKEG-DwQxHkEv.js} +1 -1
  119. package/dist/web/assets/zap-D3JafXHq.js +1 -0
  120. package/dist/web/index.html +1 -1
  121. package/dist/web/obsidian-editor-assets.json +1 -1
  122. package/package.json +1 -1
  123. package/dist/web/assets/App-CqANyaMK.css +0 -97
  124. package/dist/web/assets/App-gwVbOIB1.js +0 -2
  125. package/dist/web/assets/ChatPane-fH0IY48w.js +0 -1
  126. package/dist/web/assets/ComposerMenus-DhMX49q9.js +0 -1
  127. package/dist/web/assets/FilesControlPanel-Bz4i0bf2.js +0 -1
  128. package/dist/web/assets/GlobalPendingDialog-tews3DVC.js +0 -1
  129. package/dist/web/assets/InteractionPolish-Nkww8pqM.css +0 -1
  130. package/dist/web/assets/NewSessionDialog-CsOHExrY.js +0 -1
  131. package/dist/web/assets/RemoteWorkspaceSettings-7jz8oX59.css +0 -1
  132. package/dist/web/assets/RemoteWorkspaceSettings-tDqbDqj4.js +0 -1
  133. package/dist/web/assets/_baseMerge-YHvLFG89.js +0 -1
  134. package/dist/web/assets/arc-BYAxnPQ_.js +0 -1
  135. package/dist/web/assets/channel-DpGkajT1.js +0 -1
  136. package/dist/web/assets/chevron-up-DfL2d5fV.js +0 -1
  137. package/dist/web/assets/classDiagram-OUVF2IWQ-oZMIKKng.js +0 -1
  138. package/dist/web/assets/classDiagram-v2-EOCWNBFH-oZMIKKng.js +0 -1
  139. package/dist/web/assets/file-editor-ObsidianFileEditor-BuzsfQwA.js +0 -2
  140. package/dist/web/assets/ganttDiagram-NO4QXBWP-x0WR7K4r.js +0 -1
  141. package/dist/web/assets/index-c9Eb0rEZ.js +0 -2
  142. package/dist/web/assets/pegDiagram-2B236MQR-DVdodUA1.js +0 -1
  143. package/dist/web/assets/shield-check-DM9poYLJ.js +0 -1
  144. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-DkgnQPrP.js +0 -1
  145. package/dist/web/assets/swimlanesDiagram-G3AALYLV-D62G5R34.js +0 -1
  146. package/dist/web/assets/useComposerCompletion-DcHhaHlX.js +0 -1
  147. package/dist/web/assets/zap-4rbaTb6R.js +0 -1
@@ -1 +1 @@
1
- import{_ as e,l as r,F as t,e as i}from"./mermaid.core-LEKKQwXZ.js";import{p as s}from"./cynefin-VYW2F7L2-09uNSfvT.js";import"./index-c9Eb0rEZ.js";import"./RemoteLifeOSBlock-CZkQLmE5.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-gwVbOIB1.js";import"./square-K9kFBDil.js";import"./chevron-up-DfL2d5fV.js";import"./__vite-browser-external-2447137e-Dbwxx6PZ.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var o={parser:{parse:e(async e=>{const t=await s("info",e);r.debug(t)},"parse")},db:{getVersion:e(()=>"11.16.0","getVersion")},renderer:{draw:e((e,s,o)=>{r.debug("rendering info diagram\n"+e);const a=t(s);i(a,100,400,!0),a.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw")}};export{o as diagram};
1
+ import{_ as e,l as r,F as t,e as i}from"./mermaid.core-CSuHyCbU.js";import{p as s}from"./cynefin-VYW2F7L2-D1LRWQeS.js";import"./index-kcB9N5v8.js";import"./RemoteLifeOSBlock-Bq3YQBy7.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-Bx92ZYqP.js";import"./square-Dl4fOYPP.js";import"./chevron-up-C3_IR2td.js";import"./__vite-browser-external-2447137e-BMiSckAV.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var o={parser:{parse:e(async e=>{const t=await s("info",e);r.debug(t)},"parse")},db:{getVersion:e(()=>"11.16.0","getVersion")},renderer:{draw:e((e,s,o)=>{r.debug("rendering info diagram\n"+e);const a=t(s);i(a,100,400,!0),a.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw")}};export{o as diagram};
@@ -1 +1 @@
1
- var t;import{_ as e,c as i,a1 as n,F as s,ak as a,q as r,k as h,o,a as l,b as c,g as u,s as d,p as y,e as p}from"./mermaid.core-LEKKQwXZ.js";import"./RemoteLifeOSBlock-CZkQLmE5.js";import"./index-c9Eb0rEZ.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-gwVbOIB1.js";import"./square-K9kFBDil.js";import"./chevron-up-DfL2d5fV.js";import"./__vite-browser-external-2447137e-Dbwxx6PZ.js";var g=function(){var t=e(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),i=[1,4],n=[1,14],s=[1,12],a=[1,13],r=[6,7,8],h=[1,20],o=[1,18],l=[1,19],c=[6,7,11],u=[1,6,13,14],d=[1,23],y=[1,24],p=[1,6,7,11,13,14],g={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(t,e,i,n,s,a,r){var h=a.length-1;switch(s){case 6:case 7:return n;case 15:n.addNode(a[h-1].length,a[h].trim());break;case 16:n.addNode(0,a[h].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:i},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:i},{6:n,7:[1,10],9:9,12:11,13:s,14:a},t(r,[2,3]),{1:[2,2]},t(r,[2,4]),t(r,[2,5]),{1:[2,6],6:n,12:15,13:s,14:a},{6:n,9:16,12:11,13:s,14:a},{6:h,7:o,10:17,11:l},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:h,7:o,10:22,11:l},{1:[2,7],6:n,12:15,13:s,14:a},t(u,[2,14],{7:d,11:y}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(c,[2,15]),t(u,[2,13],{7:d,11:y}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:e(function(t){var i=this,n=[0],s=[],a=[null],r=[],h=this.table,o="",l=0,c=0,u=r.slice.call(arguments,1),d=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);d.setInput(t,y.yy),y.yy.lexer=d,y.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;r.push(g);var f=d.options&&d.options.ranges;function k(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e(function(t){n.length=n.length-2*t,a.length=a.length-t,r.length=r.length-t},"popStack"),e(k,"lex");for(var m,w,x,_,b,v,S,$,I={};;){if(w=n[n.length-1],this.defaultActions[w]?x=this.defaultActions[w]:(null==m&&(m=k()),x=h[w]&&h[w][m]),void 0===x||!x.length||!x[0]){var A;for(b in $=[],h[w])this.terminals_[b]&&b>2&&$.push("'"+this.terminals_[b]+"'");A=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+$.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:g,expected:$})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+m);switch(x[0]){case 1:n.push(m),a.push(d.yytext),r.push(d.yylloc),n.push(x[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(v=this.productions_[x[1]][1],I.$=a[a.length-v],I._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},f&&(I._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(_=this.performAction.apply(I,[o,c,l,y.yy,x[1],a,r].concat(u))))return _;v&&(n=n.slice(0,-1*v*2),a=a.slice(0,-1*v),r=r.slice(0,-1*v)),n.push(this.productions_[x[1]][0]),a.push(I.$),r.push(I._$),S=h[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},f=function(){return{EOF:1,parseError:e(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:e(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:e(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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:e(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:e(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((i=this._input.match(this.rules[s[a]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){return this.next()||this.lex()},"lex"),begin:e(function(t){this.conditionStack.push(t)},"begin"),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e(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:e(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:e(function(t){this.begin(t)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(t,e,i,n){switch(i){case 0:case 3:return 6;case 1:case 2:return 8;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function k(){this.yy={}}return g.lexer=f,e(k,"Parser"),k.prototype=g,g.Parser=k,new k}();g.parser=g;var f=g,k=(e(t=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,r()}getRoot(){return this.root}addNode(t,e){const n=h.sanitizeText(e,i());if(!this.root)return this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],void o(n);this.baseLevel??=t;let s=t-this.baseLevel+1;for(s<=0&&(s=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=s;)this.stack.pop();const a={text:n,children:[]};this.stack[this.stack.length-1].node.children.push(a),this.stack.push({level:s,node:a})}getAccTitle(){return l()}setAccTitle(t){c(t)}getAccDescription(){return u()}setAccDescription(t){d(t)}getDiagramTitle(){return y()}setDiagramTitle(t){o(t)}},"IshikawaDB"),t),m=250,w=82*Math.PI/180,x=Math.cos(w),_=Math.sin(w),b=e((t,e,i)=>{const n=t.node().getBBox(),s=n.width+2*e,a=n.height+2*e;p(t,a,s,i),t.attr("viewBox",`${n.x-e} ${n.y-e} ${s} ${a}`)},"applyPaddedViewBox"),v=e((t,e,r,h)=>{const o=h.db.getRoot();if(!o)return;const l=i(),{look:c,handDrawnSeed:u,themeVariables:d}=l,y=n(l.fontSize)[0]??14,p="handDrawn"===c,g=o.children??[],f=l.ishikawa?.diagramPadding??20,k=l.ishikawa?.useMaxWidth??!1,w=s(e),x=w.append("g").attr("class","ishikawa"),_=p?a.svg(w.node()):void 0,v=_?{roughSvg:_,seed:u??0,lineColor:d?.lineColor??"#333",fillColor:d?.mainBkg??"#fff"}:void 0,I=`ishikawa-arrow-${e}`;p||x.append("defs").append("marker").attr("id",I).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let A=0,E=m;const L=p?void 0:T(x,A,E,A,E,"ishikawa-spine");if($(x,A,E,o.text,y,v),!g.length)return p&&T(x,A,E,A,E,"ishikawa-spine",v),void b(w,f,k);A-=20;const M=g.filter((t,e)=>e%2==0),j=g.filter((t,e)=>e%2==1),P=S(M),B=S(j),N=P.total+B.total;let O=m,D=m;if(N>0){const t=500,e=75;O=Math.max(e,t*(P.total/N)),D=Math.max(e,t*(B.total/N))}const W=2*y;O=Math.max(O,P.max*W),D=Math.max(D,B.max*W),E=Math.max(O,m),L&&L.attr("y1",E).attr("y2",E),x.select(".ishikawa-head-group").attr("transform",`translate(0,${E})`);const R=Math.ceil(g.length/2);for(let i=0;i<R;i++){const t=x.append("g").attr("class","ishikawa-pair");for(const[e,n,s]of[[g[2*i],-1,O],[g[2*i+1],1,D]])e&&C(t,e,A,E,n,s,y,v);A=t.selectAll("text").nodes().reduce((t,e)=>Math.min(t,e.getBBox().x),1/0)}if(p)T(x,A,E,0,E,"ishikawa-spine",v);else{L.attr("x1",A);const t=`url(#${I})`;x.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",t)}b(w,f,k)},"draw"),S=e(t=>{const i=e(t=>t.children.reduce((t,e)=>t+1+i(e),0),"countDescendants");return t.reduce((t,e)=>{const n=i(e);return t.total+=n,t.max=Math.max(t.max,n),t},{total:0,max:0})},"sideStats"),$=e((t,e,i,n,s,a)=>{const r=Math.max(6,Math.floor(110/(.6*s))),h=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${i})`),o=j(h,M(n,r),0,0,"ishikawa-head-label","start",s),l=o.node().getBBox(),c=Math.max(60,l.width+6),u=Math.max(40,2*l.height+40),d=`M 0 ${-u/2} L 0 ${u/2} Q ${2.4*c} 0 0 ${-u/2} Z`;if(a){const t=a.roughSvg.path(d,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-head")}else h.insert("path",":first-child").attr("class","ishikawa-head").attr("d",d);o.attr("transform",`translate(${(c-l.width)/2-l.x+3},${-l.y-l.height/2})`)},"drawHead"),I=e((t,i)=>{const n=[],s=[],a=e((t,e,r)=>{const h=-1===i?[...t].reverse():t;for(const i of h){const t=n.length,h=i.children??[];n.push({depth:r,text:M(i.text,15),parentIndex:e,childCount:h.length}),r%2==0?(s.push(t),h.length&&a(h,t,r+1)):(h.length&&a(h,t,r+1),s.push(t))}},"walk");return a(t,-1,2),{entries:n,yOrder:s}},"flattenTree"),A=e((t,e,i,n,s,a,r)=>{const h=t.append("g").attr("class","ishikawa-label-group"),o=j(h,e,i,n+11*s,"ishikawa-label cause","middle",a).node().getBBox();if(r){const t=r.roughSvg.rectangle(o.x-20,o.y-2,o.width+40,o.height+4,{roughness:1.5,seed:r.seed,fill:r.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:r.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-label-box")}else h.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",o.x-20).attr("y",o.y-2).attr("width",o.width+40).attr("height",o.height+4)},"drawCauseLabel"),E=e((t,e,i,n,s,a)=>{const r=Math.sqrt(n*n+s*s);if(0===r)return;const h=n/r,o=s/r,l=6*-o,c=6*h,u=`M ${e} ${i} L ${e-6*h*2+l} ${i-6*o*2+c} L ${e-6*h*2-l} ${i-6*o*2-c} Z`,d=a.roughSvg.path(u,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>d)},"drawArrowMarker"),C=e((t,e,i,n,s,a,r,h)=>{const o=e.children??[],l=a*(o.length?1:.2),c=_*l*s,u=i+-x*l,d=n+c;if(T(t,i,n,u,d,"ishikawa-branch",h),h&&E(t,i,n,i-u,n-d,h),A(t,e.text,u,d,s,r,h),!o.length)return;const{entries:y,yOrder:p}=I(o,s),g=y.length,f=new Array(g);for(const[x,_]of p.entries())f[_]=n+c*((x+1)/(g+1));const k=new Map;k.set(-1,{x0:i,y0:n,x1:u,y1:d,childCount:o.length,childrenDrawn:0});const m=-x,w=_*s,b=s<0?"ishikawa-label up":"ishikawa-label down";for(const[x,_]of y.entries()){const e=f[x],i=k.get(_.parentIndex),n=t.append("g").attr("class","ishikawa-sub-group");let s=0,a=0,o=0;if(_.depth%2==0){const t=i.y1-i.y0;s=P(i.x0,i.x1,t?(e-i.y0)/t:.5),a=e,o=s-(_.childCount>0?60+5*_.childCount:30),T(n,s,e,o,e,"ishikawa-sub-branch",h),h&&E(n,s,e,1,0,h),j(n,_.text,o,e,"ishikawa-label align","end",r)}else{const t=i.childrenDrawn++;s=P(i.x0,i.x1,(i.childCount-t)/(i.childCount+1)),a=i.y0,o=s+m*((e-a)/w),T(n,s,a,o,e,"ishikawa-sub-branch",h),h&&E(n,s,a,s-o,a-e,h),j(n,_.text,o,e,b,"end",r)}_.childCount>0&&k.set(x,{x0:s,y0:a,x1:o,y1:e,childCount:_.childCount,childrenDrawn:0})}},"drawBranch"),L=e(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),M=e((t,e)=>{if(t.length<=e)return t;const i=[];for(const n of t.split(/\s+/)){const t=i.length-1;t>=0&&i[t].length+1+n.length<=e?i[t]+=" "+n:i.push(n)}return i.join("\n")},"wrapText"),j=e((t,e,i,n,s,a,r)=>{const h=L(e),o=1.05*r,l=t.append("text").attr("class",s).attr("text-anchor",a).attr("x",i).attr("y",n-(h.length-1)*o/2);for(const[c,u]of h.entries())l.append("tspan").attr("x",i).attr("dy",0===c?0:o).text(u);return l},"drawMultilineText"),P=e((t,e,i)=>t+(e-t)*i,"lerp"),T=e((t,e,i,n,s,a,r)=>{if(r){const h=r.roughSvg.line(e,i,n,s,{roughness:1.5,seed:r.seed,stroke:r.lineColor,strokeWidth:2});return void t.append(()=>h).attr("class",a)}return t.append("line").attr("class",a).attr("x1",e).attr("y1",i).attr("x2",n).attr("y2",s)},"drawLine"),B={draw:v},N=e(t=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${t.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${t.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n fill: ${t.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),O={parser:f,get db(){return new k},renderer:B,styles:N};export{O as diagram};
1
+ var t;import{_ as e,c as i,a1 as n,F as s,ak as a,q as r,k as h,o,a as l,b as c,g as u,s as d,p as y,e as p}from"./mermaid.core-CSuHyCbU.js";import"./RemoteLifeOSBlock-Bq3YQBy7.js";import"./index-kcB9N5v8.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-Bx92ZYqP.js";import"./square-Dl4fOYPP.js";import"./chevron-up-C3_IR2td.js";import"./__vite-browser-external-2447137e-BMiSckAV.js";var g=function(){var t=e(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),i=[1,4],n=[1,14],s=[1,12],a=[1,13],r=[6,7,8],h=[1,20],o=[1,18],l=[1,19],c=[6,7,11],u=[1,6,13,14],d=[1,23],y=[1,24],p=[1,6,7,11,13,14],g={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(t,e,i,n,s,a,r){var h=a.length-1;switch(s){case 6:case 7:return n;case 15:n.addNode(a[h-1].length,a[h].trim());break;case 16:n.addNode(0,a[h].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:i},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:i},{6:n,7:[1,10],9:9,12:11,13:s,14:a},t(r,[2,3]),{1:[2,2]},t(r,[2,4]),t(r,[2,5]),{1:[2,6],6:n,12:15,13:s,14:a},{6:n,9:16,12:11,13:s,14:a},{6:h,7:o,10:17,11:l},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:h,7:o,10:22,11:l},{1:[2,7],6:n,12:15,13:s,14:a},t(u,[2,14],{7:d,11:y}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(c,[2,15]),t(u,[2,13],{7:d,11:y}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:e(function(t){var i=this,n=[0],s=[],a=[null],r=[],h=this.table,o="",l=0,c=0,u=r.slice.call(arguments,1),d=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);d.setInput(t,y.yy),y.yy.lexer=d,y.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;r.push(g);var f=d.options&&d.options.ranges;function k(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e(function(t){n.length=n.length-2*t,a.length=a.length-t,r.length=r.length-t},"popStack"),e(k,"lex");for(var m,w,x,_,b,v,S,$,I={};;){if(w=n[n.length-1],this.defaultActions[w]?x=this.defaultActions[w]:(null==m&&(m=k()),x=h[w]&&h[w][m]),void 0===x||!x.length||!x[0]){var A;for(b in $=[],h[w])this.terminals_[b]&&b>2&&$.push("'"+this.terminals_[b]+"'");A=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+$.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:g,expected:$})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+m);switch(x[0]){case 1:n.push(m),a.push(d.yytext),r.push(d.yylloc),n.push(x[1]),m=null,c=d.yyleng,o=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(v=this.productions_[x[1]][1],I.$=a[a.length-v],I._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},f&&(I._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(_=this.performAction.apply(I,[o,c,l,y.yy,x[1],a,r].concat(u))))return _;v&&(n=n.slice(0,-1*v*2),a=a.slice(0,-1*v),r=r.slice(0,-1*v)),n.push(this.productions_[x[1]][0]),a.push(I.$),r.push(I._$),S=h[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},f=function(){return{EOF:1,parseError:e(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:e(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:e(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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:e(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:e(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((i=this._input.match(this.rules[s[a]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){return this.next()||this.lex()},"lex"),begin:e(function(t){this.conditionStack.push(t)},"begin"),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e(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:e(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:e(function(t){this.begin(t)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(t,e,i,n){switch(i){case 0:case 3:return 6;case 1:case 2:return 8;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function k(){this.yy={}}return g.lexer=f,e(k,"Parser"),k.prototype=g,g.Parser=k,new k}();g.parser=g;var f=g,k=(e(t=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,r()}getRoot(){return this.root}addNode(t,e){const n=h.sanitizeText(e,i());if(!this.root)return this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],void o(n);this.baseLevel??=t;let s=t-this.baseLevel+1;for(s<=0&&(s=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=s;)this.stack.pop();const a={text:n,children:[]};this.stack[this.stack.length-1].node.children.push(a),this.stack.push({level:s,node:a})}getAccTitle(){return l()}setAccTitle(t){c(t)}getAccDescription(){return u()}setAccDescription(t){d(t)}getDiagramTitle(){return y()}setDiagramTitle(t){o(t)}},"IshikawaDB"),t),m=250,w=82*Math.PI/180,x=Math.cos(w),_=Math.sin(w),b=e((t,e,i)=>{const n=t.node().getBBox(),s=n.width+2*e,a=n.height+2*e;p(t,a,s,i),t.attr("viewBox",`${n.x-e} ${n.y-e} ${s} ${a}`)},"applyPaddedViewBox"),v=e((t,e,r,h)=>{const o=h.db.getRoot();if(!o)return;const l=i(),{look:c,handDrawnSeed:u,themeVariables:d}=l,y=n(l.fontSize)[0]??14,p="handDrawn"===c,g=o.children??[],f=l.ishikawa?.diagramPadding??20,k=l.ishikawa?.useMaxWidth??!1,w=s(e),x=w.append("g").attr("class","ishikawa"),_=p?a.svg(w.node()):void 0,v=_?{roughSvg:_,seed:u??0,lineColor:d?.lineColor??"#333",fillColor:d?.mainBkg??"#fff"}:void 0,I=`ishikawa-arrow-${e}`;p||x.append("defs").append("marker").attr("id",I).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let A=0,E=m;const L=p?void 0:T(x,A,E,A,E,"ishikawa-spine");if($(x,A,E,o.text,y,v),!g.length)return p&&T(x,A,E,A,E,"ishikawa-spine",v),void b(w,f,k);A-=20;const M=g.filter((t,e)=>e%2==0),j=g.filter((t,e)=>e%2==1),P=S(M),B=S(j),O=P.total+B.total;let N=m,D=m;if(O>0){const t=500,e=75;N=Math.max(e,t*(P.total/O)),D=Math.max(e,t*(B.total/O))}const W=2*y;N=Math.max(N,P.max*W),D=Math.max(D,B.max*W),E=Math.max(N,m),L&&L.attr("y1",E).attr("y2",E),x.select(".ishikawa-head-group").attr("transform",`translate(0,${E})`);const z=Math.ceil(g.length/2);for(let i=0;i<z;i++){const t=x.append("g").attr("class","ishikawa-pair");for(const[e,n,s]of[[g[2*i],-1,N],[g[2*i+1],1,D]])e&&C(t,e,A,E,n,s,y,v);A=t.selectAll("text").nodes().reduce((t,e)=>Math.min(t,e.getBBox().x),1/0)}if(p)T(x,A,E,0,E,"ishikawa-spine",v);else{L.attr("x1",A);const t=`url(#${I})`;x.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",t)}b(w,f,k)},"draw"),S=e(t=>{const i=e(t=>t.children.reduce((t,e)=>t+1+i(e),0),"countDescendants");return t.reduce((t,e)=>{const n=i(e);return t.total+=n,t.max=Math.max(t.max,n),t},{total:0,max:0})},"sideStats"),$=e((t,e,i,n,s,a)=>{const r=Math.max(6,Math.floor(110/(.6*s))),h=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${i})`),o=j(h,M(n,r),0,0,"ishikawa-head-label","start",s),l=o.node().getBBox(),c=Math.max(60,l.width+6),u=Math.max(40,2*l.height+40),d=`M 0 ${-u/2} L 0 ${u/2} Q ${2.4*c} 0 0 ${-u/2} Z`;if(a){const t=a.roughSvg.path(d,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-head")}else h.insert("path",":first-child").attr("class","ishikawa-head").attr("d",d);o.attr("transform",`translate(${(c-l.width)/2-l.x+3},${-l.y-l.height/2})`)},"drawHead"),I=e((t,i)=>{const n=[],s=[],a=e((t,e,r)=>{const h=-1===i?[...t].reverse():t;for(const i of h){const t=n.length,h=i.children??[];n.push({depth:r,text:M(i.text,15),parentIndex:e,childCount:h.length}),r%2==0?(s.push(t),h.length&&a(h,t,r+1)):(h.length&&a(h,t,r+1),s.push(t))}},"walk");return a(t,-1,2),{entries:n,yOrder:s}},"flattenTree"),A=e((t,e,i,n,s,a,r)=>{const h=t.append("g").attr("class","ishikawa-label-group"),o=j(h,e,i,n+11*s,"ishikawa-label cause","middle",a).node().getBBox();if(r){const t=r.roughSvg.rectangle(o.x-20,o.y-2,o.width+40,o.height+4,{roughness:1.5,seed:r.seed,fill:r.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:r.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-label-box")}else h.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",o.x-20).attr("y",o.y-2).attr("width",o.width+40).attr("height",o.height+4)},"drawCauseLabel"),E=e((t,e,i,n,s,a)=>{const r=Math.sqrt(n*n+s*s);if(0===r)return;const h=n/r,o=s/r,l=6*-o,c=6*h,u=`M ${e} ${i} L ${e-6*h*2+l} ${i-6*o*2+c} L ${e-6*h*2-l} ${i-6*o*2-c} Z`,d=a.roughSvg.path(u,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>d)},"drawArrowMarker"),C=e((t,e,i,n,s,a,r,h)=>{const o=e.children??[],l=a*(o.length?1:.2),c=_*l*s,u=i+-x*l,d=n+c;if(T(t,i,n,u,d,"ishikawa-branch",h),h&&E(t,i,n,i-u,n-d,h),A(t,e.text,u,d,s,r,h),!o.length)return;const{entries:y,yOrder:p}=I(o,s),g=y.length,f=new Array(g);for(const[x,_]of p.entries())f[_]=n+c*((x+1)/(g+1));const k=new Map;k.set(-1,{x0:i,y0:n,x1:u,y1:d,childCount:o.length,childrenDrawn:0});const m=-x,w=_*s,b=s<0?"ishikawa-label up":"ishikawa-label down";for(const[x,_]of y.entries()){const e=f[x],i=k.get(_.parentIndex),n=t.append("g").attr("class","ishikawa-sub-group");let s=0,a=0,o=0;if(_.depth%2==0){const t=i.y1-i.y0;s=P(i.x0,i.x1,t?(e-i.y0)/t:.5),a=e,o=s-(_.childCount>0?60+5*_.childCount:30),T(n,s,e,o,e,"ishikawa-sub-branch",h),h&&E(n,s,e,1,0,h),j(n,_.text,o,e,"ishikawa-label align","end",r)}else{const t=i.childrenDrawn++;s=P(i.x0,i.x1,(i.childCount-t)/(i.childCount+1)),a=i.y0,o=s+m*((e-a)/w),T(n,s,a,o,e,"ishikawa-sub-branch",h),h&&E(n,s,a,s-o,a-e,h),j(n,_.text,o,e,b,"end",r)}_.childCount>0&&k.set(x,{x0:s,y0:a,x1:o,y1:e,childCount:_.childCount,childrenDrawn:0})}},"drawBranch"),L=e(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),M=e((t,e)=>{if(t.length<=e)return t;const i=[];for(const n of t.split(/\s+/)){const t=i.length-1;t>=0&&i[t].length+1+n.length<=e?i[t]+=" "+n:i.push(n)}return i.join("\n")},"wrapText"),j=e((t,e,i,n,s,a,r)=>{const h=L(e),o=1.05*r,l=t.append("text").attr("class",s).attr("text-anchor",a).attr("x",i).attr("y",n-(h.length-1)*o/2);for(const[c,u]of h.entries())l.append("tspan").attr("x",i).attr("dy",0===c?0:o).text(u);return l},"drawMultilineText"),P=e((t,e,i)=>t+(e-t)*i,"lerp"),T=e((t,e,i,n,s,a,r)=>{if(r){const h=r.roughSvg.line(e,i,n,s,{roughness:1.5,seed:r.seed,stroke:r.lineColor,strokeWidth:2});return void t.append(()=>h).attr("class",a)}return t.append("line").attr("class",a).attr("x1",e).attr("y1",i).attr("x2",n).attr("y2",s)},"drawLine"),B={draw:v},O=e(t=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${t.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${t.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n fill: ${t.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),N={parser:f,get db(){return new k},renderer:B,styles:O};export{N as diagram};
@@ -1 +1 @@
1
- import{g as t}from"./chunk-5VM5RSS4-Uv1D4oA2.js";import{a as e,g as n,h as i,d as s}from"./chunk-32BRIVSS-B93XkYif.js";import{_ as r,g as a,s as o,a as l,b as c,p as h,o as u,c as p,d as y,e as d,q as f}from"./mermaid.core-LEKKQwXZ.js";import"./RemoteLifeOSBlock-CZkQLmE5.js";import{d as g}from"./arc-BYAxnPQ_.js";import"./index-c9Eb0rEZ.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-gwVbOIB1.js";import"./square-K9kFBDil.js";import"./chevron-up-DfL2d5fV.js";import"./__vite-browser-external-2447137e-Dbwxx6PZ.js";var m=function(){var t=r(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],s=[1,11],a=[1,12],o=[1,13],l=[1,14],c={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:r(function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:i,14:s,16:a,17:o,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:s,16:a,17:o,18:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:r(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:r(function(t){var e=this,n=[0],i=[],s=[null],a=[],o=this.table,l="",c=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,r(function(t){n.length=n.length-2*t,s.length=s.length-t,a.length=a.length-t},"popStack"),r(m,"lex");for(var x,k,_,b,w,v,$,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=o[k]&&o[k][x]),void 0===_||!_.length||!_[0]){var T;for(w in S=[],o[k])this.terminals_[w]&&w>2&&S.push("'"+this.terminals_[w]+"'");T=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:S})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),s.push(p.yytext),a.push(p.yylloc),n.push(_[1]),x=null,h=p.yyleng,l=p.yytext,c=p.yylineno,f=p.yylloc;break;case 2:if(v=this.productions_[_[1]][1],M.$=s[s.length-v],M._$={first_line:a[a.length-(v||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(v||1)].first_column,last_column:a[a.length-1].last_column},g&&(M._$.range=[a[a.length-(v||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(M,[l,h,c,y.yy,_[1],s,a].concat(u))))return b;v&&(n=n.slice(0,-1*v*2),s=s.slice(0,-1*v),a=a.slice(0,-1*v)),n.push(this.productions_[_[1]][0]),s.push(M.$),a.push(M._$),$=o[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0},"parse")},h=function(){return{EOF:1,parseError:r(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:r(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:r(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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:r(function(t){this.unput(this.match.slice(t))},"less"),pastInput:r(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:r(function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r(function(){return this.next()||this.lex()},"lex"),begin:r(function(t){this.conditionStack.push(t)},"begin"),popState:r(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(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:r(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:r(function(t){this.begin(t)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function u(){this.yy={}}return c.lexer=h,r(u,"Parser"),u.prototype=c,c.Parser=u,new u}();m.parser=m;var x=m,k="",_=[],b=[],w=[],v=r(function(){_.length=0,b.length=0,k="",w.length=0,f()},"clear"),$=r(function(t){k=t,_.push(t)},"addSection"),S=r(function(){return _},"getSections"),M=r(function(){let t=E(),e=0;for(;!t&&e<100;)t=E(),e++;return b.push(...w),b},"getTasks"),T=r(function(){const t=[];return b.forEach(e=>{e.people&&t.push(...e.people)}),[...new Set(t)].sort()},"updateActors"),j=r(function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map(t=>t.trim()),a={section:k,type:k,people:r,task:t,score:i};w.push(a)},"addTask"),C=r(function(t){const e={section:k,type:k,description:t,task:t,classes:[]};b.push(e)},"addTaskOrg"),E=r(function(){const t=r(function(t){return w[t].processed},"compileTask");let e=!0;for(const[n,i]of w.entries())t(n),e=e&&i.processed;return e},"compileTasks"),A=r(function(){return T()},"getActors"),I={getConfig:r(()=>p().journey,"getConfig"),clear:v,setDiagramTitle:u,getDiagramTitle:h,setAccTitle:c,getAccTitle:l,setAccDescription:o,getAccDescription:a,addSection:$,getSections:S,getTasks:M,addTask:j,addTaskOrg:C,getActors:A},P=r(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${e.textColor}\n }\n\n .legend {\n fill: ${e.textColor};\n font-family: ${e.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${e.textColor}\n }\n\n .face {\n ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${e.fillType0?`fill: ${e.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${e.fillType0?`fill: ${e.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${e.fillType0?`fill: ${e.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${e.fillType0?`fill: ${e.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${e.fillType0?`fill: ${e.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${e.fillType0?`fill: ${e.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${e.fillType0?`fill: ${e.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${e.fillType0?`fill: ${e.fillType7}`:""};\n }\n\n .actor-0 {\n ${e.actor0?`fill: ${e.actor0}`:""};\n }\n .actor-1 {\n ${e.actor1?`fill: ${e.actor1}`:""};\n }\n .actor-2 {\n ${e.actor2?`fill: ${e.actor2}`:""};\n }\n .actor-3 {\n ${e.actor3?`fill: ${e.actor3}`:""};\n }\n .actor-4 {\n ${e.actor4?`fill: ${e.actor4}`:""};\n }\n .actor-5 {\n ${e.actor5?`fill: ${e.actor5}`:""};\n }\n ${t()}\n`,"getStyles"),V=r(function(t,e){return s(t,e)},"drawRect"),B=r(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function s(t){const n=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function a(t){const n=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function o(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r(s,"smile"),r(a,"sad"),r(o,"ambivalent"),e.score>3?s(i):e.score<3?a(i):o(i),n},"drawFace"),F=r(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),R=r(function(t,e){return i(t,e)},"drawText"),L=r(function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}r(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,R(t,e)},"drawLabel"),O=r(function(t,e,i){const s=t.append("g"),r=n();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,V(s,r),q(i)(e.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),D=-1,N=r(function(t,e,i,s){const r=e.x+i.width/2,a=t.append("g");D++,a.append("line").attr("id",s+"-task"+D).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),B(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const o=n();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=i.width,o.height=i.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,V(a,o);let l=e.x+14;e.people.forEach(t=>{const n=e.actors[t].color,i={cx:l,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};F(a,i),l+=10}),q(i)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},i,e.colour)},"drawTask"),z=r(function(t,n){e(t,n)},"drawBackgroundRect"),q=function(){function t(t,e,n,s,r,a,o,l){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,p=t.split(/<br\s*\/?>/gi);for(let y=0;y<p.length;y++){const t=y*h-h*(p.length-1)/2,l=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);l.append("tspan").attr("x",n+r/2).attr("dy",t).text(p[y]),l.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(l,o)}}function n(t,n,s,r,a,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,l,c),i(u,l)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return r(t,"byText"),r(e,"byTspan"),r(n,"byFo"),r(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Y={drawRect:V,drawCircle:F,drawSection:O,drawText:R,drawLabel:L,drawTask:N,drawBackgroundRect:z,initGraphics:r(function(t,e){D=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics")},W=r(function(t){Object.keys(t).forEach(function(e){U[e]=t[e]})},"setConf"),X={},G=0;function H(t){const e=p().journey,n=e.maxLabelWidth;G=0;let i=60;Object.keys(X).forEach(s=>{const r=X[s].color,a={cx:20,cy:i,r:7,fill:r,stroke:"#000",pos:X[s].position};Y.drawCircle(t,a);let o=t.append("text").attr("visibility","hidden").text(s);const l=o.node().getBoundingClientRect().width;o.remove();let c=[];if(l<=n)c=[s];else{const e=s.split(" ");let i="";o=t.append("text").attr("visibility","hidden"),e.forEach(t=>{const e=i?`${i} ${t}`:t;if(o.text(e),o.node().getBoundingClientRect().width>n){if(i&&c.push(i),i=t,o.text(t),o.node().getBoundingClientRect().width>n){let e="";for(const i of t)e+=i,o.text(e+"-"),o.node().getBoundingClientRect().width>n&&(c.push(e.slice(0,-1)+"-"),e=i);i=e}}else i=e}),i&&c.push(i),o.remove()}c.forEach((n,s)=>{const r={x:40,y:i+7+20*s,fill:"#666",text:n,textMargin:e.boxTextMargin??5},a=Y.drawText(t,r).node().getBoundingClientRect().width;a>G&&a>e.leftMargin-a&&(G=a)}),i+=Math.max(20,20*c.length)})}r(H,"drawActorLegend");var U=p().journey,K=0,Q=r(function(t,e,n,i){const s=p(),r=s.journey.titleColor,a=s.journey.titleFontSize,o=s.journey.titleFontFamily,l=s.securityLevel;let c;"sandbox"===l&&(c=y("#i"+e));const h=y("sandbox"===l?c.nodes()[0].contentDocument.body:"body");Z.init();const u=h.select("#"+e);Y.initGraphics(u,e);const f=i.db.getTasks(),g=i.db.getDiagramTitle(),m=i.db.getActors();for(const p in X)delete X[p];let x=0;m.forEach(t=>{X[t]={color:U.actorColours[x%U.actorColours.length],position:x},x++}),H(u),K=U.leftMargin+G,Z.insert(0,0,K,50*Object.keys(X).length),et(u,f,0,e);const k=Z.getBounds();g&&u.append("text").text(g).attr("x",K).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",r).attr("font-family",o);const _=k.stopy-k.starty+2*U.diagramMarginY,b=K+k.stopx+2*U.diagramMarginX;d(u,_,b,U.useMaxWidth),u.append("line").attr("x1",K).attr("y1",4*U.height).attr("x2",b-K-4).attr("y2",4*U.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const w=g?70:0;u.attr("viewBox",`${k.startx} -25 ${b} ${_+w}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",_+w+25)},"draw"),Z={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:r(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:r(function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},"updateVal"),updateBounds:r(function(t,e,n,i){const s=p().journey,a=this;let o=0;function l(l){return r(function(r){o++;const c=a.sequenceItems.length-o+1;a.updateVal(r,"starty",e-c*s.boxMargin,Math.min),a.updateVal(r,"stopy",i+c*s.boxMargin,Math.max),a.updateVal(Z.data,"startx",t-c*s.boxMargin,Math.min),a.updateVal(Z.data,"stopx",n+c*s.boxMargin,Math.max),"activation"!==l&&(a.updateVal(r,"startx",t-c*s.boxMargin,Math.min),a.updateVal(r,"stopx",n+c*s.boxMargin,Math.max),a.updateVal(Z.data,"starty",e-c*s.boxMargin,Math.min),a.updateVal(Z.data,"stopy",i+c*s.boxMargin,Math.max))},"updateItemBounds")}r(l,"updateFn"),this.sequenceItems.forEach(l())},"updateBounds"),insert:r(function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(Z.data,"startx",s,Math.min),this.updateVal(Z.data,"starty",a,Math.min),this.updateVal(Z.data,"stopx",r,Math.max),this.updateVal(Z.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)},"insert"),bumpVerticalPos:r(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:r(function(){return this.verticalPos},"getVerticalPos"),getBounds:r(function(){return this.data},"getBounds")},J=U.sectionFills,tt=U.sectionColours,et=r(function(t,e,n,i){const s=p().journey;let r="";const a=n+(2*s.height+s.diagramMarginY);let o=0,l="#CCC",c="black",h=0;for(const[u,p]of e.entries()){if(r!==p.section){l=J[o%J.length],h=o%J.length,c=tt[o%tt.length];let n=0;const i=p.section;for(let t=u;t<e.length&&e[t].section==i;t++)n+=1;const a={x:u*s.taskMargin+u*s.width+K,y:50,text:p.section,fill:l,num:h,colour:c,taskCount:n};Y.drawSection(t,a,s),r=p.section,o++}const n=p.people.reduce((t,e)=>(X[e]&&(t[e]=X[e]),t),{});p.x=u*s.taskMargin+u*s.width+K,p.y=a,p.width=s.diagramMarginX,p.height=s.diagramMarginY,p.colour=c,p.fill=l,p.num=h,p.actors=n,Y.drawTask(t,p,s,i),Z.insert(p.x,p.y,p.x+p.width+s.taskMargin,450)}},"drawTasks"),nt={setConf:W,draw:Q},it={parser:x,db:I,renderer:nt,styles:P,init:r(t=>{nt.setConf(t.journey),I.clear()},"init")};export{it as diagram};
1
+ import{g as t}from"./chunk-5VM5RSS4-D85xFHwk.js";import{a as e,g as n,h as i,d as s}from"./chunk-32BRIVSS-BGCuhDXk.js";import{_ as r,g as a,s as o,a as l,b as c,p as h,o as u,c as p,d as y,e as d,q as f}from"./mermaid.core-CSuHyCbU.js";import"./RemoteLifeOSBlock-Bq3YQBy7.js";import{d as g}from"./arc-DgeTKeM5.js";import"./index-kcB9N5v8.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-Bx92ZYqP.js";import"./square-Dl4fOYPP.js";import"./chevron-up-C3_IR2td.js";import"./__vite-browser-external-2447137e-BMiSckAV.js";var m=function(){var t=r(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],s=[1,11],a=[1,12],o=[1,13],l=[1,14],c={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:r(function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:i,14:s,16:a,17:o,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:s,16:a,17:o,18:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:r(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:r(function(t){var e=this,n=[0],i=[],s=[null],a=[],o=this.table,l="",c=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,r(function(t){n.length=n.length-2*t,s.length=s.length-t,a.length=a.length-t},"popStack"),r(m,"lex");for(var x,k,_,b,w,v,$,M,S={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=o[k]&&o[k][x]),void 0===_||!_.length||!_[0]){var T;for(w in M=[],o[k])this.terminals_[w]&&w>2&&M.push("'"+this.terminals_[w]+"'");T=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:M})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),s.push(p.yytext),a.push(p.yylloc),n.push(_[1]),x=null,h=p.yyleng,l=p.yytext,c=p.yylineno,f=p.yylloc;break;case 2:if(v=this.productions_[_[1]][1],S.$=s[s.length-v],S._$={first_line:a[a.length-(v||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(v||1)].first_column,last_column:a[a.length-1].last_column},g&&(S._$.range=[a[a.length-(v||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(S,[l,h,c,y.yy,_[1],s,a].concat(u))))return b;v&&(n=n.slice(0,-1*v*2),s=s.slice(0,-1*v),a=a.slice(0,-1*v)),n.push(this.productions_[_[1]][0]),s.push(S.$),a.push(S._$),$=o[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0},"parse")},h=function(){return{EOF:1,parseError:r(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:r(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:r(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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:r(function(t){this.unput(this.match.slice(t))},"less"),pastInput:r(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:r(function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r(function(){return this.next()||this.lex()},"lex"),begin:r(function(t){this.conditionStack.push(t)},"begin"),popState:r(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(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:r(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:r(function(t){this.begin(t)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function u(){this.yy={}}return c.lexer=h,r(u,"Parser"),u.prototype=c,c.Parser=u,new u}();m.parser=m;var x=m,k="",_=[],b=[],w=[],v=r(function(){_.length=0,b.length=0,k="",w.length=0,f()},"clear"),$=r(function(t){k=t,_.push(t)},"addSection"),M=r(function(){return _},"getSections"),S=r(function(){let t=E(),e=0;for(;!t&&e<100;)t=E(),e++;return b.push(...w),b},"getTasks"),T=r(function(){const t=[];return b.forEach(e=>{e.people&&t.push(...e.people)}),[...new Set(t)].sort()},"updateActors"),j=r(function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map(t=>t.trim()),a={section:k,type:k,people:r,task:t,score:i};w.push(a)},"addTask"),C=r(function(t){const e={section:k,type:k,description:t,task:t,classes:[]};b.push(e)},"addTaskOrg"),E=r(function(){const t=r(function(t){return w[t].processed},"compileTask");let e=!0;for(const[n,i]of w.entries())t(n),e=e&&i.processed;return e},"compileTasks"),A=r(function(){return T()},"getActors"),I={getConfig:r(()=>p().journey,"getConfig"),clear:v,setDiagramTitle:u,getDiagramTitle:h,setAccTitle:c,getAccTitle:l,setAccDescription:o,getAccDescription:a,addSection:$,getSections:M,getTasks:S,addTask:j,addTaskOrg:C,getActors:A},P=r(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${e.textColor}\n }\n\n .legend {\n fill: ${e.textColor};\n font-family: ${e.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${e.textColor}\n }\n\n .face {\n ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${e.fillType0?`fill: ${e.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${e.fillType0?`fill: ${e.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${e.fillType0?`fill: ${e.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${e.fillType0?`fill: ${e.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${e.fillType0?`fill: ${e.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${e.fillType0?`fill: ${e.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${e.fillType0?`fill: ${e.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${e.fillType0?`fill: ${e.fillType7}`:""};\n }\n\n .actor-0 {\n ${e.actor0?`fill: ${e.actor0}`:""};\n }\n .actor-1 {\n ${e.actor1?`fill: ${e.actor1}`:""};\n }\n .actor-2 {\n ${e.actor2?`fill: ${e.actor2}`:""};\n }\n .actor-3 {\n ${e.actor3?`fill: ${e.actor3}`:""};\n }\n .actor-4 {\n ${e.actor4?`fill: ${e.actor4}`:""};\n }\n .actor-5 {\n ${e.actor5?`fill: ${e.actor5}`:""};\n }\n ${t()}\n`,"getStyles"),V=r(function(t,e){return s(t,e)},"drawRect"),B=r(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function s(t){const n=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function a(t){const n=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function o(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r(s,"smile"),r(a,"sad"),r(o,"ambivalent"),e.score>3?s(i):e.score<3?a(i):o(i),n},"drawFace"),F=r(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),R=r(function(t,e){return i(t,e)},"drawText"),L=r(function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}r(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,R(t,e)},"drawLabel"),O=r(function(t,e,i){const s=t.append("g"),r=n();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,V(s,r),q(i)(e.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),D=-1,N=r(function(t,e,i,s){const r=e.x+i.width/2,a=t.append("g");D++,a.append("line").attr("id",s+"-task"+D).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),B(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const o=n();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=i.width,o.height=i.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,V(a,o);let l=e.x+14;e.people.forEach(t=>{const n=e.actors[t].color,i={cx:l,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};F(a,i),l+=10}),q(i)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},i,e.colour)},"drawTask"),z=r(function(t,n){e(t,n)},"drawBackgroundRect"),q=function(){function t(t,e,n,s,r,a,o,l){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,p=t.split(/<br\s*\/?>/gi);for(let y=0;y<p.length;y++){const t=y*h-h*(p.length-1)/2,l=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);l.append("tspan").attr("x",n+r/2).attr("dy",t).text(p[y]),l.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(l,o)}}function n(t,n,s,r,a,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,l,c),i(u,l)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return r(t,"byText"),r(e,"byTspan"),r(n,"byFo"),r(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Y={drawRect:V,drawCircle:F,drawSection:O,drawText:R,drawLabel:L,drawTask:N,drawBackgroundRect:z,initGraphics:r(function(t,e){D=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics")},W=r(function(t){Object.keys(t).forEach(function(e){U[e]=t[e]})},"setConf"),X={},G=0;function H(t){const e=p().journey,n=e.maxLabelWidth;G=0;let i=60;Object.keys(X).forEach(s=>{const r=X[s].color,a={cx:20,cy:i,r:7,fill:r,stroke:"#000",pos:X[s].position};Y.drawCircle(t,a);let o=t.append("text").attr("visibility","hidden").text(s);const l=o.node().getBoundingClientRect().width;o.remove();let c=[];if(l<=n)c=[s];else{const e=s.split(" ");let i="";o=t.append("text").attr("visibility","hidden"),e.forEach(t=>{const e=i?`${i} ${t}`:t;if(o.text(e),o.node().getBoundingClientRect().width>n){if(i&&c.push(i),i=t,o.text(t),o.node().getBoundingClientRect().width>n){let e="";for(const i of t)e+=i,o.text(e+"-"),o.node().getBoundingClientRect().width>n&&(c.push(e.slice(0,-1)+"-"),e=i);i=e}}else i=e}),i&&c.push(i),o.remove()}c.forEach((n,s)=>{const r={x:40,y:i+7+20*s,fill:"#666",text:n,textMargin:e.boxTextMargin??5},a=Y.drawText(t,r).node().getBoundingClientRect().width;a>G&&a>e.leftMargin-a&&(G=a)}),i+=Math.max(20,20*c.length)})}r(H,"drawActorLegend");var U=p().journey,J=0,Q=r(function(t,e,n,i){const s=p(),r=s.journey.titleColor,a=s.journey.titleFontSize,o=s.journey.titleFontFamily,l=s.securityLevel;let c;"sandbox"===l&&(c=y("#i"+e));const h=y("sandbox"===l?c.nodes()[0].contentDocument.body:"body");Z.init();const u=h.select("#"+e);Y.initGraphics(u,e);const f=i.db.getTasks(),g=i.db.getDiagramTitle(),m=i.db.getActors();for(const p in X)delete X[p];let x=0;m.forEach(t=>{X[t]={color:U.actorColours[x%U.actorColours.length],position:x},x++}),H(u),J=U.leftMargin+G,Z.insert(0,0,J,50*Object.keys(X).length),et(u,f,0,e);const k=Z.getBounds();g&&u.append("text").text(g).attr("x",J).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",r).attr("font-family",o);const _=k.stopy-k.starty+2*U.diagramMarginY,b=J+k.stopx+2*U.diagramMarginX;d(u,_,b,U.useMaxWidth),u.append("line").attr("x1",J).attr("y1",4*U.height).attr("x2",b-J-4).attr("y2",4*U.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const w=g?70:0;u.attr("viewBox",`${k.startx} -25 ${b} ${_+w}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",_+w+25)},"draw"),Z={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:r(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:r(function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},"updateVal"),updateBounds:r(function(t,e,n,i){const s=p().journey,a=this;let o=0;function l(l){return r(function(r){o++;const c=a.sequenceItems.length-o+1;a.updateVal(r,"starty",e-c*s.boxMargin,Math.min),a.updateVal(r,"stopy",i+c*s.boxMargin,Math.max),a.updateVal(Z.data,"startx",t-c*s.boxMargin,Math.min),a.updateVal(Z.data,"stopx",n+c*s.boxMargin,Math.max),"activation"!==l&&(a.updateVal(r,"startx",t-c*s.boxMargin,Math.min),a.updateVal(r,"stopx",n+c*s.boxMargin,Math.max),a.updateVal(Z.data,"starty",e-c*s.boxMargin,Math.min),a.updateVal(Z.data,"stopy",i+c*s.boxMargin,Math.max))},"updateItemBounds")}r(l,"updateFn"),this.sequenceItems.forEach(l())},"updateBounds"),insert:r(function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(Z.data,"startx",s,Math.min),this.updateVal(Z.data,"starty",a,Math.min),this.updateVal(Z.data,"stopx",r,Math.max),this.updateVal(Z.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)},"insert"),bumpVerticalPos:r(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:r(function(){return this.verticalPos},"getVerticalPos"),getBounds:r(function(){return this.data},"getBounds")},K=U.sectionFills,tt=U.sectionColours,et=r(function(t,e,n,i){const s=p().journey;let r="";const a=n+(2*s.height+s.diagramMarginY);let o=0,l="#CCC",c="black",h=0;for(const[u,p]of e.entries()){if(r!==p.section){l=K[o%K.length],h=o%K.length,c=tt[o%tt.length];let n=0;const i=p.section;for(let t=u;t<e.length&&e[t].section==i;t++)n+=1;const a={x:u*s.taskMargin+u*s.width+J,y:50,text:p.section,fill:l,num:h,colour:c,taskCount:n};Y.drawSection(t,a,s),r=p.section,o++}const n=p.people.reduce((t,e)=>(X[e]&&(t[e]=X[e]),t),{});p.x=u*s.taskMargin+u*s.width+J,p.y=a,p.width=s.diagramMarginX,p.height=s.diagramMarginY,p.colour=c,p.fill=l,p.num=h,p.actors=n,Y.drawTask(t,p,s,i),Z.insert(p.x,p.y,p.x+p.width+s.taskMargin,450)}},"drawTasks"),nt={setConf:W,draw:Q},it={parser:x,db:I,renderer:nt,styles:P,init:r(t=>{nt.setConf(t.journey),I.clear()},"init")};export{it as diagram};
@@ -1 +1 @@
1
- import{_ as t,l as e,c as n,F as i,ae as s,af as r,ag as o,ac as a,D as c,i as l,Y as h,Z as g,a9 as u,aa as d,ab as p}from"./mermaid.core-LEKKQwXZ.js";import{g as y}from"./chunk-5VM5RSS4-Uv1D4oA2.js";import"./index-c9Eb0rEZ.js";import"./RemoteLifeOSBlock-CZkQLmE5.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-gwVbOIB1.js";import"./square-K9kFBDil.js";import"./chevron-up-DfL2d5fV.js";import"./__vite-browser-external-2447137e-Dbwxx6PZ.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var f=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],c=[1,19],l=[6,7,8],h=[1,26],g=[1,24],u=[1,25],d=[6,7,11],p=[1,31],y=[6,7,11,24],f=[1,6,13,16,17,20,23],m=[1,35],b=[1,36],_=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:h,7:g,10:23,11:u},e(d,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:c}),e(d,[2,19]),e(d,[2,21],{15:30,24:p}),e(d,[2,22]),e(d,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:g,10:34,11:u},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(f,[2,14],{7:m,11:b}),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(d,[2,16],{15:37,24:p}),e(d,[2,17]),e(d,[2,18]),e(d,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(f,[2,13],{7:m,11:b}),e(_,[2,11]),e(_,[2,12]),e(d,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,c="",l=0,h=0,g=o.slice.call(arguments,1),u=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);u.setInput(e,d.yy),d.yy.lexer=u,d.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var y=u.yylloc;o.push(y);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||u.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),t(m,"lex");for(var b,_,k,E,S,N,x,L,D={};;){if(_=i[i.length-1],this.defaultActions[_]?k=this.defaultActions[_]:(null==b&&(b=m()),k=a[_]&&a[_][b]),void 0===k||!k.length||!k[0]){var I;for(S in L=[],a[_])this.terminals_[S]&&S>2&&L.push("'"+this.terminals_[S]+"'");I=u.showPosition?"Parse error on line "+(l+1)+":\n"+u.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(I,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:y,expected:L})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(k[0]){case 1:i.push(b),r.push(u.yytext),o.push(u.yylloc),i.push(k[1]),b=null,h=u.yyleng,c=u.yytext,l=u.yylineno,y=u.yylloc;break;case 2:if(N=this.productions_[k[1]][1],D.$=r[r.length-N],D._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},f&&(D._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(D,[c,h,l,d.yy,k[1],r,o].concat(g))))return E;N&&(i=i.slice(0,-1*N*2),r=r.slice(0,-1*N),o=o.slice(0,-1*N)),i.push(this.productions_[k[1]][0]),r.push(D.$),o.push(D._$),x=a[i[i.length-2]][i[i.length-1]],i.push(x);break;case 3:return!0}}return!0},"parse")},S=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){return this.next()||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}}();function N(){this.yy={}}return E.lexer=S,t(N,"Parser"),N.prototype=E,E.Parser=N,new N}();f.parser=f;var m=f,b=[],_=[],k=0,E={},S=t(()=>{b=[],_=[],k=0,E={}},"clear"),N=t(t=>{if(0===b.length)return null;const e=b[0].level;let n=null;for(let i=b.length-1;i>=0;i--)if(b[i].level!==e||n||(n=b[i]),b[i].level<e)throw new Error('Items without section detected, found section ("'+b[i].label+'")');return t===n?.level?null:n},"getSection"),x=t(function(){return _},"getSections"),L=t(function(){const t=[],e=x(),i=n();for(const n of e){const e={id:n.id,label:l(n.label??"",i),labelType:"markdown",isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=b.filter(t=>t.parentId===n.id);for(const r of s){const e={id:r.id,parentId:n.id,label:l(r.label??"",i),labelType:"markdown",isGroup:!1,ticket:r?.ticket,priority:r?.priority,assigned:r?.assigned,icon:r?.icon,shape:"kanbanItem",level:r.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:n()}},"getData"),D=t((t,e,i,s,r)=>{const o=n();let a=o.mindmap?.padding??c.mindmap.padding;switch(s){case I.ROUNDED_RECT:case I.RECT:case I.HEXAGON:a*=2}const u={id:l(e,o)||"kbn"+k++,level:t,label:l(i,o),width:o.mindmap?.maxNodeWidth??c.mindmap.maxNodeWidth,padding:a,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:g});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(u.shape=e?.shape),e?.label&&(u.label=e?.label),e?.icon&&(u.icon=e?.icon.toString()),e?.assigned&&(u.assigned=e?.assigned.toString()),e?.ticket&&(u.ticket=e?.ticket.toString()),e?.priority&&(u.priority=e?.priority)}const d=N(t);d?u.parentId=d.id||"kbn"+k++:_.push(u),b.push(u)},"addNode"),I={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:D,getSections:x,getData:L,nodeType:I,getType:t((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return I.RECT;case"(":return")"===n?I.ROUNDED_RECT:I.CLOUD;case"((":return I.CIRCLE;case")":return I.CLOUD;case"))":return I.BANG;case"{{":return I.HEXAGON;default:return I.DEFAULT}},"getType"),setElementForId:t((t,e)=>{E[t]=e},"setElementForId"),decorateNode:t(t=>{if(!t)return;const e=n(),i=b[b.length-1];t.icon&&(i.icon=l(t.icon,e)),t.class&&(i.cssClasses=l(t.class,e))},"decorateNode"),type2Str:t(t=>{switch(t){case I.DEFAULT:return"no-border";case I.RECT:return"rect";case I.ROUNDED_RECT:return"rounded-rect";case I.CIRCLE:return"circle";case I.CLOUD:return"cloud";case I.BANG:return"bang";case I.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),getLogger:t(()=>e,"getLogger"),getElementById:t(t=>E[t],"getElementById")},C={draw:t(async(t,l,h,g)=>{e.debug("Rendering kanban diagram\n"+t);const u=g.db.getData(),d=n();d.htmlLabels=!1;const p=i(l);for(const e of u.nodes)e.domId=`${l}-${e.id}`;const y=p.append("g");y.attr("class","sections");const f=p.append("g");f.attr("class","items");const m=u.nodes.filter(t=>t.isGroup);let b=0;const _=[];let k=25;for(const e of m){const t=d?.kanban?.sectionWidth||200;b+=1,e.x=t*b+10*(b-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+b;const n=await s(y,e);k=Math.max(k,n?.labelBBox?.height),_.push(n)}let E=0;for(const e of m){const t=_[E];E+=1;const n=d?.kanban?.sectionWidth||200,i=3*-n/2+k;let s=i;const a=u.nodes.filter(t=>t.parentId===e.id);for(const h of a){if(h.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");h.x=e.x,h.width=n-15;const t=(await r(f,h,{config:d})).node().getBBox();h.y=s+t.height/2,await o(h),s=h.y+t.height/2+5}const c=t.cluster.select("rect"),l=Math.max(s-i+30,50)+(k-25);c.attr("height",l)}a(void 0,p,d.mindmap?.padding??c.kanban.padding,d.mindmap?.useMaxWidth??c.kanban.useMaxWidth)},"draw")},v=t(e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],u(e["lineColor"+t])?e["lineColor"+t]=d(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t((t,n)=>e.darkMode?p(t,n):d(t,n),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n},"genSections"),w={db:O,renderer:C,parser:m,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${v(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n ${y()}\n`,"getStyles")};export{w as diagram};
1
+ import{_ as t,l as e,c as n,F as i,ae as s,af as r,ag as o,ac as a,D as c,i as l,Y as h,Z as u,a9 as g,aa as d,ab as p}from"./mermaid.core-CSuHyCbU.js";import{g as y}from"./chunk-5VM5RSS4-D85xFHwk.js";import"./index-kcB9N5v8.js";import"./RemoteLifeOSBlock-Bq3YQBy7.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-Bx92ZYqP.js";import"./square-Dl4fOYPP.js";import"./chevron-up-C3_IR2td.js";import"./__vite-browser-external-2447137e-BMiSckAV.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var f=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],c=[1,19],l=[6,7,8],h=[1,26],u=[1,24],g=[1,25],d=[6,7,11],p=[1,31],y=[6,7,11,24],f=[1,6,13,16,17,20,23],m=[1,35],b=[1,36],_=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:h,7:u,10:23,11:g},e(d,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:c}),e(d,[2,19]),e(d,[2,21],{15:30,24:p}),e(d,[2,22]),e(d,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:g},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(f,[2,14],{7:m,11:b}),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(d,[2,16],{15:37,24:p}),e(d,[2,17]),e(d,[2,18]),e(d,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(f,[2,13],{7:m,11:b}),e(_,[2,11]),e(_,[2,12]),e(d,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,c="",l=0,h=0,u=o.slice.call(arguments,1),g=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);g.setInput(e,d.yy),d.yy.lexer=g,d.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;o.push(y);var f=g.options&&g.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||g.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),t(m,"lex");for(var b,_,k,E,S,N,x,L,D={};;){if(_=i[i.length-1],this.defaultActions[_]?k=this.defaultActions[_]:(null==b&&(b=m()),k=a[_]&&a[_][b]),void 0===k||!k.length||!k[0]){var I;for(S in L=[],a[_])this.terminals_[S]&&S>2&&L.push("'"+this.terminals_[S]+"'");I=g.showPosition?"Parse error on line "+(l+1)+":\n"+g.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(I,{text:g.match,token:this.terminals_[b]||b,line:g.yylineno,loc:y,expected:L})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(k[0]){case 1:i.push(b),r.push(g.yytext),o.push(g.yylloc),i.push(k[1]),b=null,h=g.yyleng,c=g.yytext,l=g.yylineno,y=g.yylloc;break;case 2:if(N=this.productions_[k[1]][1],D.$=r[r.length-N],D._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},f&&(D._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(D,[c,h,l,d.yy,k[1],r,o].concat(u))))return E;N&&(i=i.slice(0,-1*N*2),r=r.slice(0,-1*N),o=o.slice(0,-1*N)),i.push(this.productions_[k[1]][0]),r.push(D.$),o.push(D._$),x=a[i[i.length-2]][i[i.length-1]],i.push(x);break;case 3:return!0}}return!0},"parse")},S=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){return this.next()||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}}();function N(){this.yy={}}return E.lexer=S,t(N,"Parser"),N.prototype=E,E.Parser=N,new N}();f.parser=f;var m=f,b=[],_=[],k=0,E={},S=t(()=>{b=[],_=[],k=0,E={}},"clear"),N=t(t=>{if(0===b.length)return null;const e=b[0].level;let n=null;for(let i=b.length-1;i>=0;i--)if(b[i].level!==e||n||(n=b[i]),b[i].level<e)throw new Error('Items without section detected, found section ("'+b[i].label+'")');return t===n?.level?null:n},"getSection"),x=t(function(){return _},"getSections"),L=t(function(){const t=[],e=x(),i=n();for(const n of e){const e={id:n.id,label:l(n.label??"",i),labelType:"markdown",isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=b.filter(t=>t.parentId===n.id);for(const r of s){const e={id:r.id,parentId:n.id,label:l(r.label??"",i),labelType:"markdown",isGroup:!1,ticket:r?.ticket,priority:r?.priority,assigned:r?.assigned,icon:r?.icon,shape:"kanbanItem",level:r.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:n()}},"getData"),D=t((t,e,i,s,r)=>{const o=n();let a=o.mindmap?.padding??c.mindmap.padding;switch(s){case I.ROUNDED_RECT:case I.RECT:case I.HEXAGON:a*=2}const g={id:l(e,o)||"kbn"+k++,level:t,label:l(i,o),width:o.mindmap?.maxNodeWidth??c.mindmap.maxNodeWidth,padding:a,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(g.shape=e?.shape),e?.label&&(g.label=e?.label),e?.icon&&(g.icon=e?.icon.toString()),e?.assigned&&(g.assigned=e?.assigned.toString()),e?.ticket&&(g.ticket=e?.ticket.toString()),e?.priority&&(g.priority=e?.priority)}const d=N(t);d?g.parentId=d.id||"kbn"+k++:_.push(g),b.push(g)},"addNode"),I={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:D,getSections:x,getData:L,nodeType:I,getType:t((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return I.RECT;case"(":return")"===n?I.ROUNDED_RECT:I.CLOUD;case"((":return I.CIRCLE;case")":return I.CLOUD;case"))":return I.BANG;case"{{":return I.HEXAGON;default:return I.DEFAULT}},"getType"),setElementForId:t((t,e)=>{E[t]=e},"setElementForId"),decorateNode:t(t=>{if(!t)return;const e=n(),i=b[b.length-1];t.icon&&(i.icon=l(t.icon,e)),t.class&&(i.cssClasses=l(t.class,e))},"decorateNode"),type2Str:t(t=>{switch(t){case I.DEFAULT:return"no-border";case I.RECT:return"rect";case I.ROUNDED_RECT:return"rounded-rect";case I.CIRCLE:return"circle";case I.CLOUD:return"cloud";case I.BANG:return"bang";case I.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),getLogger:t(()=>e,"getLogger"),getElementById:t(t=>E[t],"getElementById")},C={draw:t(async(t,l,h,u)=>{e.debug("Rendering kanban diagram\n"+t);const g=u.db.getData(),d=n();d.htmlLabels=!1;const p=i(l);for(const e of g.nodes)e.domId=`${l}-${e.id}`;const y=p.append("g");y.attr("class","sections");const f=p.append("g");f.attr("class","items");const m=g.nodes.filter(t=>t.isGroup);let b=0;const _=[];let k=25;for(const e of m){const t=d?.kanban?.sectionWidth||200;b+=1,e.x=t*b+10*(b-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+b;const n=await s(y,e);k=Math.max(k,n?.labelBBox?.height),_.push(n)}let E=0;for(const e of m){const t=_[E];E+=1;const n=d?.kanban?.sectionWidth||200,i=3*-n/2+k;let s=i;const a=g.nodes.filter(t=>t.parentId===e.id);for(const h of a){if(h.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");h.x=e.x,h.width=n-15;const t=(await r(f,h,{config:d})).node().getBBox();h.y=s+t.height/2,await o(h),s=h.y+t.height/2+5}const c=t.cluster.select("rect"),l=Math.max(s-i+30,50)+(k-25);c.attr("height",l)}a(void 0,p,d.mindmap?.padding??c.kanban.padding,d.mindmap?.useMaxWidth??c.kanban.useMaxWidth)},"draw")},v=t(e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],g(e["lineColor"+t])?e["lineColor"+t]=d(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t((t,n)=>e.darkMode?p(t,n):d(t,n),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n},"genSections"),w={db:O,renderer:C,parser:m,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${v(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n ${y()}\n`,"getStyles")};export{w as diagram};
@@ -1 +1 @@
1
- import{c as a}from"./index-c9Eb0rEZ.js";const r=a("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);export{r as K};
1
+ import{c as a}from"./index-kcB9N5v8.js";const r=a("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);export{r as K};
@@ -1 +1 @@
1
- import{l as e,j as n,k as r,m as t,n as o,o as i,p as a,q as u,t as d,r as c,h as s,u as f,v as h,G as g,w as v,i as l,x as p,y as w,z as b}from"./graph-BD-RY4fR.js";import{y as m,z as y,d as x,e as k,b as E,o as O,i as N,A as _,a as I,c as j,k as P,v as M,B as R}from"./isArrayLikeObject-C958pSF-.js";import{b as T,a as L,m as C}from"./map-XtUTTYLw.js";import{t as S,i as G,c as F,b as V}from"./_baseMerge-YHvLFG89.js";import{k as B,b as q,h as Y}from"./_initCloneObject-CgHgrY9n.js";var z=1/0;function A(e){return e?(e=S(e))===z||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function D(n){return null!=n&&n.length?e(n):[]}function J(e){return T(e,5)}var H=Object.prototype,K=H.hasOwnProperty,Q=x(function(e,n){e=Object(e);var r=-1,t=n.length,o=t>2?n[2]:void 0;for(o&&G(n[0],n[1],o)&&(t=1);++r<t;)for(var i=n[r],a=B(i),u=-1,d=a.length;++u<d;){var c=a[u],s=e[c];(void 0===s||k(s,H[c])&&!K.call(e,c))&&(e[c]=i[c])}return e});function U(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}var W=Math.max,X=function(e,o,i){var a=Object(e);if(!E(e)){var u=n(o);e=r(e),o=function(e){return u(a[e],e,a)}}var d=function(e,r,o){var i=null==e?0:e.length;if(!i)return-1;var a=null==o?0:function(e){var n=A(e),r=n%1;return n==n?r?n-r:n:0}(o);return a<0&&(a=W(i+a,0)),t(e,n(r),a)}(e,o,i);return d>-1?a[u?e[d]:d]:void 0};function Z(e,n){return e>n}var $=Object.prototype.hasOwnProperty;function ee(e,n){return null!=e&&$.call(e,n)}function ne(e,n){return null!=e&&a(e,n,ee)}function re(e,n){return e<n}function te(e,r){var t={};return r=n(r),i(e,function(e,n,o){q(t,n,r(e,n,o))}),t}function oe(e,n,r){for(var t=-1,o=e.length;++t<o;){var i=e[t],a=n(i);if(null!=a&&(void 0===u?a==a&&!N(a):r(a,u)))var u=a,d=i}return d}function ie(e){return e&&e.length?oe(e,_,Z):void 0}var ae=F(function(e,n,r){V(e,n,r)});function ue(e){return e&&e.length?oe(e,_,re):void 0}function de(e,r){return e&&e.length?oe(e,n(r),re):void 0}function ce(e,n,r,t){if(!I(e))return e;for(var o=-1,i=(n=u(n,e)).length,a=i-1,c=e;null!=c&&++o<i;){var s=d(n[o]),f=r;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(o!=a){var h=c[s];void 0===(f=void 0)&&(f=I(h)?h:j(n[o+1])?[]:{})}Y(c,s,f),c=c[s]}return e}function se(e,n){if(e!==n){var r=void 0!==e,t=null===e,o=e==e,i=N(e),a=void 0!==n,u=null===n,d=n==n,c=N(n);if(!u&&!c&&!i&&e>n||i&&a&&d&&!u&&!c||t&&a&&d||!r&&d||!o)return 1;if(!t&&!i&&!c&&e<n||c&&r&&o&&!t&&!i||u&&r&&o||!a&&o||!d)return-1}return 0}var fe=function(e){return m(y(e,void 0,D),e+"")}(function(e,n){return null==e?{}:function(e,n){return function(e,n,r){for(var t=-1,o=n.length,i={};++t<o;){var a=n[t],d=c(e,a);r(0,a)&&ce(i,u(a,e),d)}return i}(e,n,function(n,r){return f(e,r)})}(e,n)}),he=Math.ceil,ge=Math.max,ve=function(e,n,r){return r&&"number"!=typeof r&&G(e,n,r)&&(n=r=void 0),e=A(e),void 0===n?(n=e,e=0):n=A(n),function(e,n,r){for(var t=-1,o=ge(he((n-e)/(r||1)),0),i=Array(o);o--;)i[++t]=e,e+=r;return i}(e,n,r=void 0===r?e<n?1:-1:A(r))},le=x(function(r,t){if(null==r)return[];var o=t.length;return o>1&&G(r,t[0],t[1])?t=[]:o>2&&G(t[0],t[1],t[2])&&(t=[t[0]]),function(e,r,t){r=r.length?s(r,function(e){return P(e)?function(n){return c(n,1===e.length?e[0]:e)}:e}):[_];var o=-1;return r=s(r,M(n)),function(e){var n=e.length;for(e.sort(function(e,n){return function(e,n,r){for(var t=-1,o=e.criteria,i=n.criteria,a=o.length,u=r.length;++t<a;){var d=se(o[t],i[t]);if(d)return t>=u?d:d*("desc"==r[t]?-1:1)}return e.index-n.index}(e,n,t)});n--;)e[n]=e[n].value;return e}(L(e,function(e,n,t){return{criteria:s(r,function(n){return n(e)}),index:++o,value:e}}))}(r,e(t),[])}),pe=0;function we(e){var n=++pe;return h(e)+n}class be{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return me(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&me(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,ye)),r=r._prev;return"["+e.join(", ")+"]"}}function me(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ye(e,n){if("_next"!==e&&"_prev"!==e)return n}var xe=R(1);function ke(e,n,r,t,o){var i=o?[]:void 0;return v(e.inEdges(t.v),function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,Ee(n,r,u)}),v(e.outEdges(t.v),function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,Ee(n,r,a)}),e.removeNode(t.v),i}function Ee(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Oe(e,n,r,t){var o;do{o=we(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function Ne(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return v(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),v(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function _e(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,d=e.width/2,c=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*d>Math.abs(a)*c?(u<0&&(c=-c),r=c*a/u,t=c):(a<0&&(d=-d),r=d,t=d*u/a),{x:o+r,y:i+t}}function Ie(e){var n=C(ve(Pe(e)+1),function(){return[]});return v(e.nodes(),function(r){var t=e.node(r),o=t.rank;l(o)||(n[o][t.order]=r)}),n}function je(e,n,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),Oe(e,"border",o,n)}function Pe(e){return ie(C(e.nodes(),function(n){var r=e.node(n).rank;if(!l(r))return r}))}function Me(e,n){return n()}function Re(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],d=Oe(e,"border",a,r);o[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Te(e){v(e.nodes(),function(n){Le(e.node(n))}),v(e.edges(),function(n){Le(e.edge(n))})}function Le(e){var n=e.width;e.width=e.height,e.height=n}function Ce(e){e.y=-e.y}function Se(e){var n=e.x;e.x=e.y,e.y=n}function Ge(e){var n={};v(e.sources(),function r(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return o.rank;n[t]=!0;var i=ue(C(e.outEdges(t),function(n){return r(n.w)-e.edge(n).minlen}));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i})}function Fe(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ve(e){var n,r,t=new g({directed:!1}),o=e.nodes()[0],i=e.nodeCount();for(t.setNode(o,{});Be(t,e)<i;)n=qe(t,e),r=t.hasNode(n.v)?Fe(e,n):-Fe(e,n),Ye(t,e,r);return t}function Be(e,n){return v(e.nodes(),function r(t){v(n.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;e.hasNode(a)||Fe(n,o)||(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}),e.nodeCount()}function qe(e,n){return de(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Fe(n,r)})}function Ye(e,n,r){v(e.nodes(),function(e){n.node(e).rank+=r})}function ze(e,n,r){P(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return v(n,function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);Ae(e,n,"post"===r,i,t,o)}),o}function Ae(e,n,r,t,o,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),v(o(n),function(n){Ae(e,n,r,t,o,i)}),r&&i.push(n))}function De(e){e=function(e){var n=(new g).setGraph(e.graph());return v(e.nodes(),function(r){n.setNode(r,e.node(r))}),v(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),n}(e),Ge(e);var n,r=Ve(e);for(Ke(r),Je(r,e);n=Ue(r);)Xe(r,e,n,We(r,e,n))}function Je(e,n){var r=function(e,n){return ze(e,n,"post")}(e,e.nodes());r=r.slice(0,r.length-1),v(r,function(r){!function(e,n,r){var t=e.node(r).parent;e.edge(r,t).cutvalue=He(e,n,r)}(e,n,r)})}function He(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,v(n.nodeEdges(r),function(i){var u=i.v===r,d=u?i.w:i.v;if(d!==t){var c=u===o,s=n.edge(i).weight;if(a+=c?s:-s,function(e,n,r){return e.hasEdge(n,r)}(e,r,d)){var f=e.edge(r,d).cutvalue;a+=c?-f:f}}}),a}function Ke(e,n){arguments.length<2&&(n=e.nodes()[0]),Qe(e,{},1,n)}function Qe(e,n,r,t,o){var i=r,a=e.node(t);return n[t]=!0,v(e.neighbors(t),function(o){Object.prototype.hasOwnProperty.call(n,o)||(r=Qe(e,n,r,o,t))}),a.low=i,a.lim=r++,o?a.parent=o:delete a.parent,r}function Ue(e){return X(e.edges(),function(n){return e.edge(n).cutvalue<0})}function We(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var i=e.node(t),a=e.node(o),u=i,d=!1;return i.lim>a.lim&&(u=a,d=!0),de(p(n.edges(),function(n){return d===Ze(0,e.node(n.v),u)&&d!==Ze(0,e.node(n.w),u)}),function(e){return Fe(n,e)})}function Xe(e,n,r,t){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(t.v,t.w,{}),Ke(e),Je(e,n),function(e,n){var r=X(e.nodes(),function(e){return!n.node(e).parent}),t=function(e,n){return ze(e,n,"pre")}(e,r);t=t.slice(1),v(t,function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)})}(e,n)}function Ze(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}new Error,De.initLowLimValues=Ke,De.initCutValues=Je,De.calcCutValue=He,De.leaveEdge=Ue,De.enterEdge=We,De.exchangeEdges=Xe;var $e=Ge;function en(e){var n=Oe(e,"root",{},"_root"),r=function(e){var n={};function r(t,o){var i=e.children(t);i&&i.length&&v(i,function(e){r(e,o+1)}),n[t]=o}return v(e.children(),function(e){r(e,1)}),n}(e),t=ie(w(r))-1,o=2*t+1;e.graph().nestingRoot=n,v(e.edges(),function(n){e.edge(n).minlen*=o});var i=function(e){return b(e.edges(),function(n,r){return n+e.edge(r).weight},0)}(e)+1;v(e.children(),function(a){nn(e,n,o,i,t,r,a)}),e.graph().nodeRankFactor=o}function nn(e,n,r,t,o,i,a){var u=e.children(a);if(u.length){var d=je(e,"_bt"),c=je(e,"_bb"),s=e.node(a);e.setParent(d,a),s.borderTop=d,e.setParent(c,a),s.borderBottom=c,v(u,function(u){nn(e,n,r,t,o,i,u);var s=e.node(u),f=s.borderTop?s.borderTop:u,h=s.borderBottom?s.borderBottom:u,g=s.borderTop?t:2*t,v=f!==h?1:o-i[a]+1;e.setEdge(d,f,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(h,c,{weight:g,minlen:v,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:o+i[a]})}else a!==n&&e.setEdge(n,a,{weight:0,minlen:r})}function rn(e,n){for(var r=0,t=1;t<n.length;++t)r+=tn(e,n[t-1],n[t]);return r}function tn(e,n,r){for(var t=function(e,n){return function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(e||[],n||[],Y)}(r,C(r,function(e,n){return n})),o=D(C(n,function(n){return le(C(e.outEdges(n),function(n){return{pos:t[n.w],weight:e.edge(n).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var u=C(new Array(a),function(){return 0}),d=0;return v(o.forEach(function(e){var n=e.pos+i;u[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=u[n+1]),u[n=n-1>>1]+=e.weight;d+=e.weight*r})),d}function on(e,n,r){for(var t;n.length&&(t=U(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function an(e,n,r,t){var o=e.children(n),i=e.node(n),a=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};a&&(o=p(o,function(e){return e!==a&&e!==u}));var c=function(e,n){return C(n,function(n){var r=e.inEdges(n);if(r.length){var t=b(r,function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}},{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}})}(e,o);v(c,function(n){if(e.children(n.v).length){var o=an(e,n.v,r,t);d[n.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&function(e,n){l(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}(n,o)}});var s=function(e,n){var r={};return v(e,function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};l(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)}),v(n.edges(),function(e){var n=r[e.v],t=r[e.w];l(n)||l(t)||(t.indegree++,n.out.push(r[e.w]))}),function(e){var n=[];function r(e){return function(n){n.merged||(l(n.barycenter)||l(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function t(n){return function(r){r.in.push(n),0===--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();n.push(o),v(o.in.reverse(),r(o)),v(o.out,t(o))}return C(p(n,function(e){return!e.merged}),function(e){return fe(e,["vs","i","barycenter","weight"])})}(p(r,function(e){return!e.indegree}))}(c,r);!function(e,n){v(e,function(e){e.vs=D(e.vs.map(function(e){return n[e]?n[e].vs:e}))})}(s,d);var f=function(e,n){var r=function(e){var n={lhs:[],rhs:[]};return v(e,function(e){!function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")}(e)?n.rhs.push(e):n.lhs.push(e)}),n}(e),t=r.lhs,o=le(r.rhs,function(e){return-e.i}),i=[],a=0,u=0,d=0;t.sort(function(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}(!!n)),d=on(i,o,d),v(t,function(e){d+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,d=on(i,o,d)});var c={vs:D(i)};return u&&(c.barycenter=a/u,c.weight=u),c}(s,t);if(a&&(f.vs=D([a,f.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),g=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+g.order)/(f.weight+2),f.weight+=2}return f}function un(e,n,r){return C(n,function(n){return function(e,n,r){var t=function(e){for(var n;e.hasNode(n=we("_root")););return n}(e),o=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(n){return e.node(n)});return v(e.nodes(),function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||t),v(e[r](i),function(n){var r=n.v===i?n.w:n.v,t=o.edge(r,i),a=l(t)?0:t.weight;o.setEdge(r,i,{weight:e.edge(n).weight+a})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),o}(e,n,r)})}function dn(e,n){var r=new g;v(e,function(e){var t=e.graph().root,o=an(e,t,r,n);v(o.vs,function(n,r){e.node(n).order=r}),function(e,n,r){var t,o={};v(r,function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}})}(e,r,o.vs)})}function cn(e,n){v(n,function(n){v(n,function(n,r){e.node(n).order=r})})}function sn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=e[n];Object.defineProperty(o,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function fn(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function hn(e,n){var r=Me;r("layout",()=>{var n=r(" buildLayoutGraph",()=>function(e){var n=new g({multigraph:!0,compound:!0}),r=kn(e.graph());return n.setGraph(ae({},vn,xn(r,gn),fe(r,ln))),v(e.nodes(),function(r){var t=kn(e.node(r));n.setNode(r,Q(xn(t,pn),wn)),n.setParent(r,e.parent(r))}),v(e.edges(),function(r){var t=kn(e.edge(r));n.setEdge(r,ae({},mn,xn(t,bn),fe(t,yn)))}),n}(e));r(" runLayout",()=>function(e,n){n(" makeSpaceForEdgeLabels",()=>function(e){var n=e.graph();n.ranksep/=2,v(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)})}(e)),n(" removeSelfEdges",()=>function(e){v(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}(e)),n(" acyclic",()=>function(e){var n="greedy"===e.graph().acyclicer?function(e,n){if(e.nodeCount()<=1)return[];var r=function(e,n){var r=new g,t=0,o=0;v(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),v(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=n(e),u=i+a;r.setEdge(e.v,e.w,u),o=Math.max(o,r.node(e.v).out+=a),t=Math.max(t,r.node(e.w).in+=a)});var i=ve(o+t+3).map(function(){return new be}),a=t+1;return v(r.nodes(),function(e){Ee(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,n||xe),t=function(e,n,r){for(var t,o=[],i=n[n.length-1],a=n[0];e.nodeCount();){for(;t=a.dequeue();)ke(e,n,r,t);for(;t=i.dequeue();)ke(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(ke(e,n,r,t,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return D(C(t,function(n){return e.outEdges(n.v,n.w)}))}(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],r={},t={};return v(e.nodes(),function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,v(e.outEdges(i),function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):o(e.w)}),delete r[i])}),n}(e);v(n,function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,we("rev"))})}(e)),n(" nestingGraph.run",()=>en(e)),n(" rank",()=>function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){De(e)}(e);break;case"tight-tree":!function(e){Ge(e),Ve(e)}(e);break;case"longest-path":$e(e)}}(Ne(e))),n(" injectEdgeLabelProxies",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o={rank:(e.node(n.w).rank-t.rank)/2+t.rank,e:n};Oe(e,"edge-proxy",o,"_ep")}})}(e)),n(" removeEmptyRanks",()=>function(e){var n=ue(C(e.nodes(),function(n){return e.node(n).rank})),r=[];v(e.nodes(),function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)});var t=0,o=e.graph().nodeRankFactor;v(r,function(n,r){l(n)&&r%o!==0?--t:t&&v(n,function(n){e.node(n).rank+=t})})}(e)),n(" nestingGraph.cleanup",()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,v(e.edges(),function(n){e.edge(n).nestingEdge&&e.removeEdge(n)})}(e)),n(" normalizeRanks",()=>function(e){var n=ue(C(e.nodes(),function(n){return e.node(n).rank}));v(e.nodes(),function(r){var t=e.node(r);ne(t,"rank")&&(t.rank-=n)})}(e)),n(" assignRankMinMax",()=>function(e){var n=0;v(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=ie(n,t.maxRank))}),e.graph().maxRank=n}(e)),n(" removeEdgeLabelProxies",()=>function(e){v(e.nodes(),function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}(e)),n(" normalize.run",()=>function(e){e.graph().dummyChains=[],v(e.edges(),function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var c,s,f=void 0;for(s=0,++t;t<i;++s,++t)u.points=[],c=Oe(e,"edge",f={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_d"),t===d&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),0===s&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}}(e,n)})}(e)),n(" parentDummyChains",()=>function(e){var n=function(e){var n={},r=0;return v(e.children(),function t(o){var i=r;v(e.children(o),t),n[o]={low:i,lim:r++}}),n}(e);v(e.graph().dummyChains,function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],d=Math.min(n[r].low,n[t].low),c=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>d||c>n[o].lim));for(i=o,o=t;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}})}(e)),n(" addBorderSegments",()=>function(e){v(e.children(),function n(r){var t=e.children(r),o=e.node(r);if(t.length&&v(t,n),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)Re(e,"borderLeft","_bl",r,o,i),Re(e,"borderRight","_br",r,o,i)}})}(e)),n(" order",()=>function(e){var n=Pe(e),r=un(e,ve(1,n+1),"inEdges"),t=un(e,ve(n-1,-1,-1),"outEdges"),o=function(e){var n={},r=p(e.nodes(),function(n){return!e.children(n).length}),t=ie(C(r,function(n){return e.node(n).rank})),o=C(ve(t+1),function(){return[]}),i=le(r,function(n){return e.node(n).rank});return v(i,function r(t){if(!ne(n,t)){n[t]=!0;var i=e.node(t);o[i.rank].push(t),v(e.successors(t),r)}}),o}(e);cn(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,d=0;d<4;++u,++d){dn(u%2?r:t,u%4>=2);var c=rn(e,o=Ie(e));c<a&&(d=0,i=J(o),a=c)}cn(e,i)}(e)),n(" insertSelfEdges",()=>function(e){var n=Ie(e);v(n,function(n){var r=0;v(n,function(n,t){var o=e.node(n);o.order=t+r,v(o.selfEdges,function(n){Oe(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")}),delete o.selfEdges})})}(e)),n(" adjustCoordinateSystem",()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||Te(e)}(e)),n(" position",()=>function(e){(function(e){var n=Ie(e),r=e.graph().ranksep,t=0;v(n,function(n){var o=ie(C(n,function(n){return e.node(n).height}));v(n,function(n){e.node(n).y=t+o/2}),t+=o+r})})(e=Ne(e)),function(n){n&&i(n,o(function(n,r){e.node(r).x=n}))}(function(e){var n,r=Ie(e),t=ae(function(e,n){var r={};return b(n,function(n,t){var o=0,i=0,a=n.length,u=U(t);return v(t,function(n,d){var c=function(e,n){if(e.node(n).dummy)return X(e.predecessors(n),function(n){return e.node(n).dummy})}(e,n),s=c?e.node(c).order:a;(c||n===u)&&(v(t.slice(i,d+1),function(n){v(e.predecessors(n),function(t){var i=e.node(t),a=i.order;!(a<o||s<a)||i.dummy&&e.node(n).dummy||sn(r,t,n)})}),i=d+1,o=s)}),t}),r}(e,r),function(e,n){var r={};function t(n,t,o,i,a){var u;v(ve(t,o),function(t){u=n[t],e.node(u).dummy&&v(e.predecessors(u),function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&sn(r,n,u)})})}return b(n,function(n,r){var o,i=-1,a=0;return v(r,function(u,d){if("border"===e.node(u).dummy){var c=e.predecessors(u);c.length&&(o=e.node(c[0]).order,t(r,a,d,i,o),a=d,i=o)}t(r,a,r.length,o,n.length)}),r}),r}(e,r)),i={};v(["u","d"],function(o){n="u"===o?r:w(r).reverse(),v(["l","r"],function(r){"r"===r&&(n=C(n,function(e){return w(e).reverse()}));var a=("u"===o?e.predecessors:e.successors).bind(e),u=function(e,n,r,t){var o={},i={},a={};return v(n,function(e){v(e,function(e,n){o[e]=e,i[e]=e,a[e]=n})}),v(n,function(e){var n=-1;v(e,function(e){var u=t(e);if(u.length)for(var d=((u=le(u,function(e){return a[e]})).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=u[c];i[e]===e&&n<a[f]&&!fn(r,e,f)&&(i[f]=e,i[e]=o[e]=o[f],n=a[f])}})}),{root:o,align:i}}(0,n,t,a),d=function(e,n,r,t,o){var i={},a=function(e,n,r,t){var o=new g,i=e.graph(),a=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i),c=0;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=r?a:-a),a=0,c+=(u.dummy?n:e)/2,c+=(d.dummy?n:e)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(c+=r?a:-a),a=0,c}}(i.nodesep,i.edgesep,t);return v(n,function(n){var t;v(n,function(n){var i=r[n];if(o.setNode(i),t){var u=r[t],d=o.edge(u,i);o.setEdge(u,i,Math.max(a(e,n,t),d||0))}t=n})}),o}(e,n,r,o),u=o?"borderLeft":"borderRight";function d(e,n){for(var r=a.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return d(function(e){i[e]=a.inEdges(e).reduce(function(e,n){return Math.max(e,i[n.v]+a.edge(n))},0)},a.predecessors.bind(a)),d(function(n){var r=a.outEdges(n).reduce(function(e,n){return Math.min(e,i[n.w]-a.edge(n))},Number.POSITIVE_INFINITY),t=e.node(n);r!==Number.POSITIVE_INFINITY&&t.borderType!==u&&(i[n]=Math.max(i[n],r))},a.successors.bind(a)),v(t,function(e){i[e]=i[r[e]]}),i}(e,n,u.root,u.align,"r"===r);"r"===r&&(d=te(d,function(e){return-e})),i[o+r]=d})});var a=function(e,n){return de(w(n),function(n){var r=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return function(n){null==n||O(n,o(function(n,o){var i=function(e,n){return e.node(n).width}(e,o)/2;r=Math.max(n+i,r),t=Math.min(n-i,t)}),B)}(n),r-t})}(e,i);return function(e,n){var r=w(n),t=ue(r),o=ie(r);v(["u","d"],function(r){v(["l","r"],function(i){var a,u=r+i,d=e[u];if(d!==n){var c=w(d);(a="l"===i?t-ue(c):o-ie(c))&&(e[u]=te(d,function(e){return e+a}))}})})}(i,a),function(e,n){return te(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var o=le(C(e,t));return(o[1]+o[2])/2})}(i,e.graph().align)}(e))}(e)),n(" positionSelfEdges",()=>function(e){v(e.nodes(),function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}(e)),n(" removeBorderNodes",()=>function(e){v(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(U(r.borderLeft)),a=e.node(U(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),v(e.nodes(),function(n){"border"===e.node(n).dummy&&e.removeNode(n)})}(e)),n(" normalize.undo",()=>function(e){v(e.graph().dummyChains,function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)})}(e)),n(" fixupEdgeLabelCoords",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)),n(" undoCoordinateSystem",()=>function(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){v(e.nodes(),function(n){Ce(e.node(n))}),v(e.edges(),function(n){var r=e.edge(n);v(r.points,Ce),Object.prototype.hasOwnProperty.call(r,"y")&&Ce(r)})}(e),"lr"!==n&&"rl"!==n||(function(e){v(e.nodes(),function(n){Se(e.node(n))}),v(e.edges(),function(n){var r=e.edge(n);v(r.points,Se),Object.prototype.hasOwnProperty.call(r,"x")&&Se(r)})}(e),Te(e))}(e)),n(" translateGraph",()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function d(e){var i=e.x,a=e.y,u=e.width,d=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-d/2),o=Math.max(o,a+d/2)}v(e.nodes(),function(n){d(e.node(n))}),v(e.edges(),function(n){var r=e.edge(n);Object.prototype.hasOwnProperty.call(r,"x")&&d(r)}),n-=a,t-=u,v(e.nodes(),function(r){var o=e.node(r);o.x-=n,o.y-=t}),v(e.edges(),function(r){var o=e.edge(r);v(o.points,function(e){e.x-=n,e.y-=t}),Object.prototype.hasOwnProperty.call(o,"x")&&(o.x-=n),Object.prototype.hasOwnProperty.call(o,"y")&&(o.y-=t)}),i.width=r-n+a,i.height=o-t+u}(e)),n(" assignNodeIntersects",()=>function(e){v(e.edges(),function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift(_e(i,r)),o.points.push(_e(a,t))})}(e)),n(" reversePoints",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}(e)),n(" acyclic.undo",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}(e))}(n,r)),r(" updateInputGraph",()=>function(e,n){v(e.nodes(),function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))}),v(e.edges(),function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(e,n))})}var gn=["nodesep","edgesep","ranksep","marginx","marginy"],vn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ln=["acyclicer","ranker","rankdir","align"],pn=["width","height"],wn={width:0,height:0},bn=["minlen","weight","width","height","labeloffset"],mn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yn=["labelpos"];function xn(e,n){return te(fe(e,n),Number)}function kn(e){var n={};return v(e,function(e,r){n[r.toLowerCase()]=e}),n}export{hn as l};
1
+ import{l as e,j as n,k as r,m as t,n as o,o as i,p as a,q as u,t as d,r as c,h as s,u as f,v as h,G as g,w as v,i as l,x as p,y as w,z as b}from"./graph-BD-RY4fR.js";import{y as m,z as y,d as x,e as k,b as E,o as O,i as N,A as _,a as I,c as j,k as P,v as M,B as R}from"./isArrayLikeObject-C958pSF-.js";import{b as T,a as L,m as C}from"./map-yP9qyz-l.js";import{t as S,i as G,c as F,b as V}from"./_baseMerge-CwDZKfvJ.js";import{k as B,b as q,h as Y}from"./_initCloneObject-C781OlVa.js";var z=1/0;function A(e){return e?(e=S(e))===z||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function D(n){return null!=n&&n.length?e(n):[]}function J(e){return T(e,5)}var H=Object.prototype,K=H.hasOwnProperty,Q=x(function(e,n){e=Object(e);var r=-1,t=n.length,o=t>2?n[2]:void 0;for(o&&G(n[0],n[1],o)&&(t=1);++r<t;)for(var i=n[r],a=B(i),u=-1,d=a.length;++u<d;){var c=a[u],s=e[c];(void 0===s||k(s,H[c])&&!K.call(e,c))&&(e[c]=i[c])}return e});function U(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}var W=Math.max,X=function(e,o,i){var a=Object(e);if(!E(e)){var u=n(o);e=r(e),o=function(e){return u(a[e],e,a)}}var d=function(e,r,o){var i=null==e?0:e.length;if(!i)return-1;var a=null==o?0:function(e){var n=A(e),r=n%1;return n==n?r?n-r:n:0}(o);return a<0&&(a=W(i+a,0)),t(e,n(r),a)}(e,o,i);return d>-1?a[u?e[d]:d]:void 0};function Z(e,n){return e>n}var $=Object.prototype.hasOwnProperty;function ee(e,n){return null!=e&&$.call(e,n)}function ne(e,n){return null!=e&&a(e,n,ee)}function re(e,n){return e<n}function te(e,r){var t={};return r=n(r),i(e,function(e,n,o){q(t,n,r(e,n,o))}),t}function oe(e,n,r){for(var t=-1,o=e.length;++t<o;){var i=e[t],a=n(i);if(null!=a&&(void 0===u?a==a&&!N(a):r(a,u)))var u=a,d=i}return d}function ie(e){return e&&e.length?oe(e,_,Z):void 0}var ae=F(function(e,n,r){V(e,n,r)});function ue(e){return e&&e.length?oe(e,_,re):void 0}function de(e,r){return e&&e.length?oe(e,n(r),re):void 0}function ce(e,n,r,t){if(!I(e))return e;for(var o=-1,i=(n=u(n,e)).length,a=i-1,c=e;null!=c&&++o<i;){var s=d(n[o]),f=r;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(o!=a){var h=c[s];void 0===(f=void 0)&&(f=I(h)?h:j(n[o+1])?[]:{})}Y(c,s,f),c=c[s]}return e}function se(e,n){if(e!==n){var r=void 0!==e,t=null===e,o=e==e,i=N(e),a=void 0!==n,u=null===n,d=n==n,c=N(n);if(!u&&!c&&!i&&e>n||i&&a&&d&&!u&&!c||t&&a&&d||!r&&d||!o)return 1;if(!t&&!i&&!c&&e<n||c&&r&&o&&!t&&!i||u&&r&&o||!a&&o||!d)return-1}return 0}var fe=function(e){return m(y(e,void 0,D),e+"")}(function(e,n){return null==e?{}:function(e,n){return function(e,n,r){for(var t=-1,o=n.length,i={};++t<o;){var a=n[t],d=c(e,a);r(0,a)&&ce(i,u(a,e),d)}return i}(e,n,function(n,r){return f(e,r)})}(e,n)}),he=Math.ceil,ge=Math.max,ve=function(e,n,r){return r&&"number"!=typeof r&&G(e,n,r)&&(n=r=void 0),e=A(e),void 0===n?(n=e,e=0):n=A(n),function(e,n,r){for(var t=-1,o=ge(he((n-e)/(r||1)),0),i=Array(o);o--;)i[++t]=e,e+=r;return i}(e,n,r=void 0===r?e<n?1:-1:A(r))},le=x(function(r,t){if(null==r)return[];var o=t.length;return o>1&&G(r,t[0],t[1])?t=[]:o>2&&G(t[0],t[1],t[2])&&(t=[t[0]]),function(e,r,t){r=r.length?s(r,function(e){return P(e)?function(n){return c(n,1===e.length?e[0]:e)}:e}):[_];var o=-1;return r=s(r,M(n)),function(e){var n=e.length;for(e.sort(function(e,n){return function(e,n,r){for(var t=-1,o=e.criteria,i=n.criteria,a=o.length,u=r.length;++t<a;){var d=se(o[t],i[t]);if(d)return t>=u?d:d*("desc"==r[t]?-1:1)}return e.index-n.index}(e,n,t)});n--;)e[n]=e[n].value;return e}(L(e,function(e,n,t){return{criteria:s(r,function(n){return n(e)}),index:++o,value:e}}))}(r,e(t),[])}),pe=0;function we(e){var n=++pe;return h(e)+n}class be{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return me(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&me(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,ye)),r=r._prev;return"["+e.join(", ")+"]"}}function me(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ye(e,n){if("_next"!==e&&"_prev"!==e)return n}var xe=R(1);function ke(e,n,r,t,o){var i=o?[]:void 0;return v(e.inEdges(t.v),function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,Ee(n,r,u)}),v(e.outEdges(t.v),function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,Ee(n,r,a)}),e.removeNode(t.v),i}function Ee(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Oe(e,n,r,t){var o;do{o=we(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function Ne(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return v(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),v(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function _e(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,d=e.width/2,c=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*d>Math.abs(a)*c?(u<0&&(c=-c),r=c*a/u,t=c):(a<0&&(d=-d),r=d,t=d*u/a),{x:o+r,y:i+t}}function Ie(e){var n=C(ve(Pe(e)+1),function(){return[]});return v(e.nodes(),function(r){var t=e.node(r),o=t.rank;l(o)||(n[o][t.order]=r)}),n}function je(e,n,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),Oe(e,"border",o,n)}function Pe(e){return ie(C(e.nodes(),function(n){var r=e.node(n).rank;if(!l(r))return r}))}function Me(e,n){return n()}function Re(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],d=Oe(e,"border",a,r);o[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Te(e){v(e.nodes(),function(n){Le(e.node(n))}),v(e.edges(),function(n){Le(e.edge(n))})}function Le(e){var n=e.width;e.width=e.height,e.height=n}function Ce(e){e.y=-e.y}function Se(e){var n=e.x;e.x=e.y,e.y=n}function Ge(e){var n={};v(e.sources(),function r(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return o.rank;n[t]=!0;var i=ue(C(e.outEdges(t),function(n){return r(n.w)-e.edge(n).minlen}));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i})}function Fe(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ve(e){var n,r,t=new g({directed:!1}),o=e.nodes()[0],i=e.nodeCount();for(t.setNode(o,{});Be(t,e)<i;)n=qe(t,e),r=t.hasNode(n.v)?Fe(e,n):-Fe(e,n),Ye(t,e,r);return t}function Be(e,n){return v(e.nodes(),function r(t){v(n.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;e.hasNode(a)||Fe(n,o)||(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}),e.nodeCount()}function qe(e,n){return de(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Fe(n,r)})}function Ye(e,n,r){v(e.nodes(),function(e){n.node(e).rank+=r})}function ze(e,n,r){P(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return v(n,function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);Ae(e,n,"post"===r,i,t,o)}),o}function Ae(e,n,r,t,o,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),v(o(n),function(n){Ae(e,n,r,t,o,i)}),r&&i.push(n))}function De(e){e=function(e){var n=(new g).setGraph(e.graph());return v(e.nodes(),function(r){n.setNode(r,e.node(r))}),v(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),n}(e),Ge(e);var n,r=Ve(e);for(Ke(r),Je(r,e);n=Ue(r);)Xe(r,e,n,We(r,e,n))}function Je(e,n){var r=function(e,n){return ze(e,n,"post")}(e,e.nodes());r=r.slice(0,r.length-1),v(r,function(r){!function(e,n,r){var t=e.node(r).parent;e.edge(r,t).cutvalue=He(e,n,r)}(e,n,r)})}function He(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,v(n.nodeEdges(r),function(i){var u=i.v===r,d=u?i.w:i.v;if(d!==t){var c=u===o,s=n.edge(i).weight;if(a+=c?s:-s,function(e,n,r){return e.hasEdge(n,r)}(e,r,d)){var f=e.edge(r,d).cutvalue;a+=c?-f:f}}}),a}function Ke(e,n){arguments.length<2&&(n=e.nodes()[0]),Qe(e,{},1,n)}function Qe(e,n,r,t,o){var i=r,a=e.node(t);return n[t]=!0,v(e.neighbors(t),function(o){Object.prototype.hasOwnProperty.call(n,o)||(r=Qe(e,n,r,o,t))}),a.low=i,a.lim=r++,o?a.parent=o:delete a.parent,r}function Ue(e){return X(e.edges(),function(n){return e.edge(n).cutvalue<0})}function We(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var i=e.node(t),a=e.node(o),u=i,d=!1;return i.lim>a.lim&&(u=a,d=!0),de(p(n.edges(),function(n){return d===Ze(0,e.node(n.v),u)&&d!==Ze(0,e.node(n.w),u)}),function(e){return Fe(n,e)})}function Xe(e,n,r,t){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(t.v,t.w,{}),Ke(e),Je(e,n),function(e,n){var r=X(e.nodes(),function(e){return!n.node(e).parent}),t=function(e,n){return ze(e,n,"pre")}(e,r);t=t.slice(1),v(t,function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)})}(e,n)}function Ze(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}new Error,De.initLowLimValues=Ke,De.initCutValues=Je,De.calcCutValue=He,De.leaveEdge=Ue,De.enterEdge=We,De.exchangeEdges=Xe;var $e=Ge;function en(e){var n=Oe(e,"root",{},"_root"),r=function(e){var n={};function r(t,o){var i=e.children(t);i&&i.length&&v(i,function(e){r(e,o+1)}),n[t]=o}return v(e.children(),function(e){r(e,1)}),n}(e),t=ie(w(r))-1,o=2*t+1;e.graph().nestingRoot=n,v(e.edges(),function(n){e.edge(n).minlen*=o});var i=function(e){return b(e.edges(),function(n,r){return n+e.edge(r).weight},0)}(e)+1;v(e.children(),function(a){nn(e,n,o,i,t,r,a)}),e.graph().nodeRankFactor=o}function nn(e,n,r,t,o,i,a){var u=e.children(a);if(u.length){var d=je(e,"_bt"),c=je(e,"_bb"),s=e.node(a);e.setParent(d,a),s.borderTop=d,e.setParent(c,a),s.borderBottom=c,v(u,function(u){nn(e,n,r,t,o,i,u);var s=e.node(u),f=s.borderTop?s.borderTop:u,h=s.borderBottom?s.borderBottom:u,g=s.borderTop?t:2*t,v=f!==h?1:o-i[a]+1;e.setEdge(d,f,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(h,c,{weight:g,minlen:v,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:o+i[a]})}else a!==n&&e.setEdge(n,a,{weight:0,minlen:r})}function rn(e,n){for(var r=0,t=1;t<n.length;++t)r+=tn(e,n[t-1],n[t]);return r}function tn(e,n,r){for(var t=function(e,n){return function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(e||[],n||[],Y)}(r,C(r,function(e,n){return n})),o=D(C(n,function(n){return le(C(e.outEdges(n),function(n){return{pos:t[n.w],weight:e.edge(n).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var u=C(new Array(a),function(){return 0}),d=0;return v(o.forEach(function(e){var n=e.pos+i;u[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=u[n+1]),u[n=n-1>>1]+=e.weight;d+=e.weight*r})),d}function on(e,n,r){for(var t;n.length&&(t=U(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function an(e,n,r,t){var o=e.children(n),i=e.node(n),a=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};a&&(o=p(o,function(e){return e!==a&&e!==u}));var c=function(e,n){return C(n,function(n){var r=e.inEdges(n);if(r.length){var t=b(r,function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}},{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}})}(e,o);v(c,function(n){if(e.children(n.v).length){var o=an(e,n.v,r,t);d[n.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&function(e,n){l(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}(n,o)}});var s=function(e,n){var r={};return v(e,function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};l(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)}),v(n.edges(),function(e){var n=r[e.v],t=r[e.w];l(n)||l(t)||(t.indegree++,n.out.push(r[e.w]))}),function(e){var n=[];function r(e){return function(n){n.merged||(l(n.barycenter)||l(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function t(n){return function(r){r.in.push(n),0===--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();n.push(o),v(o.in.reverse(),r(o)),v(o.out,t(o))}return C(p(n,function(e){return!e.merged}),function(e){return fe(e,["vs","i","barycenter","weight"])})}(p(r,function(e){return!e.indegree}))}(c,r);!function(e,n){v(e,function(e){e.vs=D(e.vs.map(function(e){return n[e]?n[e].vs:e}))})}(s,d);var f=function(e,n){var r=function(e){var n={lhs:[],rhs:[]};return v(e,function(e){!function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")}(e)?n.rhs.push(e):n.lhs.push(e)}),n}(e),t=r.lhs,o=le(r.rhs,function(e){return-e.i}),i=[],a=0,u=0,d=0;t.sort(function(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}(!!n)),d=on(i,o,d),v(t,function(e){d+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,d=on(i,o,d)});var c={vs:D(i)};return u&&(c.barycenter=a/u,c.weight=u),c}(s,t);if(a&&(f.vs=D([a,f.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),g=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+g.order)/(f.weight+2),f.weight+=2}return f}function un(e,n,r){return C(n,function(n){return function(e,n,r){var t=function(e){for(var n;e.hasNode(n=we("_root")););return n}(e),o=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(n){return e.node(n)});return v(e.nodes(),function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||t),v(e[r](i),function(n){var r=n.v===i?n.w:n.v,t=o.edge(r,i),a=l(t)?0:t.weight;o.setEdge(r,i,{weight:e.edge(n).weight+a})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),o}(e,n,r)})}function dn(e,n){var r=new g;v(e,function(e){var t=e.graph().root,o=an(e,t,r,n);v(o.vs,function(n,r){e.node(n).order=r}),function(e,n,r){var t,o={};v(r,function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}})}(e,r,o.vs)})}function cn(e,n){v(n,function(n){v(n,function(n,r){e.node(n).order=r})})}function sn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=e[n];Object.defineProperty(o,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function fn(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function hn(e,n){var r=Me;r("layout",()=>{var n=r(" buildLayoutGraph",()=>function(e){var n=new g({multigraph:!0,compound:!0}),r=kn(e.graph());return n.setGraph(ae({},vn,xn(r,gn),fe(r,ln))),v(e.nodes(),function(r){var t=kn(e.node(r));n.setNode(r,Q(xn(t,pn),wn)),n.setParent(r,e.parent(r))}),v(e.edges(),function(r){var t=kn(e.edge(r));n.setEdge(r,ae({},mn,xn(t,bn),fe(t,yn)))}),n}(e));r(" runLayout",()=>function(e,n){n(" makeSpaceForEdgeLabels",()=>function(e){var n=e.graph();n.ranksep/=2,v(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)})}(e)),n(" removeSelfEdges",()=>function(e){v(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}(e)),n(" acyclic",()=>function(e){var n="greedy"===e.graph().acyclicer?function(e,n){if(e.nodeCount()<=1)return[];var r=function(e,n){var r=new g,t=0,o=0;v(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),v(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=n(e),u=i+a;r.setEdge(e.v,e.w,u),o=Math.max(o,r.node(e.v).out+=a),t=Math.max(t,r.node(e.w).in+=a)});var i=ve(o+t+3).map(function(){return new be}),a=t+1;return v(r.nodes(),function(e){Ee(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,n||xe),t=function(e,n,r){for(var t,o=[],i=n[n.length-1],a=n[0];e.nodeCount();){for(;t=a.dequeue();)ke(e,n,r,t);for(;t=i.dequeue();)ke(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(ke(e,n,r,t,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return D(C(t,function(n){return e.outEdges(n.v,n.w)}))}(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],r={},t={};return v(e.nodes(),function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,v(e.outEdges(i),function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):o(e.w)}),delete r[i])}),n}(e);v(n,function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,we("rev"))})}(e)),n(" nestingGraph.run",()=>en(e)),n(" rank",()=>function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){De(e)}(e);break;case"tight-tree":!function(e){Ge(e),Ve(e)}(e);break;case"longest-path":$e(e)}}(Ne(e))),n(" injectEdgeLabelProxies",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o={rank:(e.node(n.w).rank-t.rank)/2+t.rank,e:n};Oe(e,"edge-proxy",o,"_ep")}})}(e)),n(" removeEmptyRanks",()=>function(e){var n=ue(C(e.nodes(),function(n){return e.node(n).rank})),r=[];v(e.nodes(),function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)});var t=0,o=e.graph().nodeRankFactor;v(r,function(n,r){l(n)&&r%o!==0?--t:t&&v(n,function(n){e.node(n).rank+=t})})}(e)),n(" nestingGraph.cleanup",()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,v(e.edges(),function(n){e.edge(n).nestingEdge&&e.removeEdge(n)})}(e)),n(" normalizeRanks",()=>function(e){var n=ue(C(e.nodes(),function(n){return e.node(n).rank}));v(e.nodes(),function(r){var t=e.node(r);ne(t,"rank")&&(t.rank-=n)})}(e)),n(" assignRankMinMax",()=>function(e){var n=0;v(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=ie(n,t.maxRank))}),e.graph().maxRank=n}(e)),n(" removeEdgeLabelProxies",()=>function(e){v(e.nodes(),function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}(e)),n(" normalize.run",()=>function(e){e.graph().dummyChains=[],v(e.edges(),function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var c,s,f=void 0;for(s=0,++t;t<i;++s,++t)u.points=[],c=Oe(e,"edge",f={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_d"),t===d&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),0===s&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}}(e,n)})}(e)),n(" parentDummyChains",()=>function(e){var n=function(e){var n={},r=0;return v(e.children(),function t(o){var i=r;v(e.children(o),t),n[o]={low:i,lim:r++}}),n}(e);v(e.graph().dummyChains,function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],d=Math.min(n[r].low,n[t].low),c=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>d||c>n[o].lim));for(i=o,o=t;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}})}(e)),n(" addBorderSegments",()=>function(e){v(e.children(),function n(r){var t=e.children(r),o=e.node(r);if(t.length&&v(t,n),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)Re(e,"borderLeft","_bl",r,o,i),Re(e,"borderRight","_br",r,o,i)}})}(e)),n(" order",()=>function(e){var n=Pe(e),r=un(e,ve(1,n+1),"inEdges"),t=un(e,ve(n-1,-1,-1),"outEdges"),o=function(e){var n={},r=p(e.nodes(),function(n){return!e.children(n).length}),t=ie(C(r,function(n){return e.node(n).rank})),o=C(ve(t+1),function(){return[]}),i=le(r,function(n){return e.node(n).rank});return v(i,function r(t){if(!ne(n,t)){n[t]=!0;var i=e.node(t);o[i.rank].push(t),v(e.successors(t),r)}}),o}(e);cn(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,d=0;d<4;++u,++d){dn(u%2?r:t,u%4>=2);var c=rn(e,o=Ie(e));c<a&&(d=0,i=J(o),a=c)}cn(e,i)}(e)),n(" insertSelfEdges",()=>function(e){var n=Ie(e);v(n,function(n){var r=0;v(n,function(n,t){var o=e.node(n);o.order=t+r,v(o.selfEdges,function(n){Oe(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")}),delete o.selfEdges})})}(e)),n(" adjustCoordinateSystem",()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||Te(e)}(e)),n(" position",()=>function(e){(function(e){var n=Ie(e),r=e.graph().ranksep,t=0;v(n,function(n){var o=ie(C(n,function(n){return e.node(n).height}));v(n,function(n){e.node(n).y=t+o/2}),t+=o+r})})(e=Ne(e)),function(n){n&&i(n,o(function(n,r){e.node(r).x=n}))}(function(e){var n,r=Ie(e),t=ae(function(e,n){var r={};return b(n,function(n,t){var o=0,i=0,a=n.length,u=U(t);return v(t,function(n,d){var c=function(e,n){if(e.node(n).dummy)return X(e.predecessors(n),function(n){return e.node(n).dummy})}(e,n),s=c?e.node(c).order:a;(c||n===u)&&(v(t.slice(i,d+1),function(n){v(e.predecessors(n),function(t){var i=e.node(t),a=i.order;!(a<o||s<a)||i.dummy&&e.node(n).dummy||sn(r,t,n)})}),i=d+1,o=s)}),t}),r}(e,r),function(e,n){var r={};function t(n,t,o,i,a){var u;v(ve(t,o),function(t){u=n[t],e.node(u).dummy&&v(e.predecessors(u),function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&sn(r,n,u)})})}return b(n,function(n,r){var o,i=-1,a=0;return v(r,function(u,d){if("border"===e.node(u).dummy){var c=e.predecessors(u);c.length&&(o=e.node(c[0]).order,t(r,a,d,i,o),a=d,i=o)}t(r,a,r.length,o,n.length)}),r}),r}(e,r)),i={};v(["u","d"],function(o){n="u"===o?r:w(r).reverse(),v(["l","r"],function(r){"r"===r&&(n=C(n,function(e){return w(e).reverse()}));var a=("u"===o?e.predecessors:e.successors).bind(e),u=function(e,n,r,t){var o={},i={},a={};return v(n,function(e){v(e,function(e,n){o[e]=e,i[e]=e,a[e]=n})}),v(n,function(e){var n=-1;v(e,function(e){var u=t(e);if(u.length)for(var d=((u=le(u,function(e){return a[e]})).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=u[c];i[e]===e&&n<a[f]&&!fn(r,e,f)&&(i[f]=e,i[e]=o[e]=o[f],n=a[f])}})}),{root:o,align:i}}(0,n,t,a),d=function(e,n,r,t,o){var i={},a=function(e,n,r,t){var o=new g,i=e.graph(),a=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i),c=0;if(c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=r?a:-a),a=0,c+=(u.dummy?n:e)/2,c+=(d.dummy?n:e)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(c+=r?a:-a),a=0,c}}(i.nodesep,i.edgesep,t);return v(n,function(n){var t;v(n,function(n){var i=r[n];if(o.setNode(i),t){var u=r[t],d=o.edge(u,i);o.setEdge(u,i,Math.max(a(e,n,t),d||0))}t=n})}),o}(e,n,r,o),u=o?"borderLeft":"borderRight";function d(e,n){for(var r=a.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return d(function(e){i[e]=a.inEdges(e).reduce(function(e,n){return Math.max(e,i[n.v]+a.edge(n))},0)},a.predecessors.bind(a)),d(function(n){var r=a.outEdges(n).reduce(function(e,n){return Math.min(e,i[n.w]-a.edge(n))},Number.POSITIVE_INFINITY),t=e.node(n);r!==Number.POSITIVE_INFINITY&&t.borderType!==u&&(i[n]=Math.max(i[n],r))},a.successors.bind(a)),v(t,function(e){i[e]=i[r[e]]}),i}(e,n,u.root,u.align,"r"===r);"r"===r&&(d=te(d,function(e){return-e})),i[o+r]=d})});var a=function(e,n){return de(w(n),function(n){var r=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return function(n){null==n||O(n,o(function(n,o){var i=function(e,n){return e.node(n).width}(e,o)/2;r=Math.max(n+i,r),t=Math.min(n-i,t)}),B)}(n),r-t})}(e,i);return function(e,n){var r=w(n),t=ue(r),o=ie(r);v(["u","d"],function(r){v(["l","r"],function(i){var a,u=r+i,d=e[u];if(d!==n){var c=w(d);(a="l"===i?t-ue(c):o-ie(c))&&(e[u]=te(d,function(e){return e+a}))}})})}(i,a),function(e,n){return te(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var o=le(C(e,t));return(o[1]+o[2])/2})}(i,e.graph().align)}(e))}(e)),n(" positionSelfEdges",()=>function(e){v(e.nodes(),function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}(e)),n(" removeBorderNodes",()=>function(e){v(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(U(r.borderLeft)),a=e.node(U(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),v(e.nodes(),function(n){"border"===e.node(n).dummy&&e.removeNode(n)})}(e)),n(" normalize.undo",()=>function(e){v(e.graph().dummyChains,function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)})}(e)),n(" fixupEdgeLabelCoords",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)),n(" undoCoordinateSystem",()=>function(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){v(e.nodes(),function(n){Ce(e.node(n))}),v(e.edges(),function(n){var r=e.edge(n);v(r.points,Ce),Object.prototype.hasOwnProperty.call(r,"y")&&Ce(r)})}(e),"lr"!==n&&"rl"!==n||(function(e){v(e.nodes(),function(n){Se(e.node(n))}),v(e.edges(),function(n){var r=e.edge(n);v(r.points,Se),Object.prototype.hasOwnProperty.call(r,"x")&&Se(r)})}(e),Te(e))}(e)),n(" translateGraph",()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function d(e){var i=e.x,a=e.y,u=e.width,d=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-d/2),o=Math.max(o,a+d/2)}v(e.nodes(),function(n){d(e.node(n))}),v(e.edges(),function(n){var r=e.edge(n);Object.prototype.hasOwnProperty.call(r,"x")&&d(r)}),n-=a,t-=u,v(e.nodes(),function(r){var o=e.node(r);o.x-=n,o.y-=t}),v(e.edges(),function(r){var o=e.edge(r);v(o.points,function(e){e.x-=n,e.y-=t}),Object.prototype.hasOwnProperty.call(o,"x")&&(o.x-=n),Object.prototype.hasOwnProperty.call(o,"y")&&(o.y-=t)}),i.width=r-n+a,i.height=o-t+u}(e)),n(" assignNodeIntersects",()=>function(e){v(e.edges(),function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift(_e(i,r)),o.points.push(_e(a,t))})}(e)),n(" reversePoints",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}(e)),n(" acyclic.undo",()=>function(e){v(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}(e))}(n,r)),r(" updateInputGraph",()=>function(e,n){v(e.nodes(),function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))}),v(e.edges(),function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(e,n))})}var gn=["nodesep","edgesep","ranksep","marginx","marginy"],vn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ln=["acyclicer","ranker","rankdir","align"],pn=["width","height"],wn={width:0,height:0},bn=["minlen","weight","width","height","labeloffset"],mn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yn=["labelpos"];function xn(e,n){return te(fe(e,n),Number)}function kn(e){var n={};return v(e,function(e,r){n[r.toLowerCase()]=e}),n}export{hn as l};
@@ -1 +1 @@
1
- import{b8 as n,b9 as t,ba as r,bb as e,bc as a}from"./mermaid.core-LEKKQwXZ.js";import{i as u}from"./init-C0SZ43gy.js";import{e as o,f as i,a as f,b as c}from"./defaultLocale-Z7o9ZNZF.js";function l(n,t){return null==n||null==t?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function s(n,t){return null==n||null==t?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function h(n){let t,r,e;function a(n,e,a=0,u=n.length){if(a<u){if(0!==t(e,e))return u;do{const t=a+u>>>1;r(n[t],e)<0?a=t+1:u=t}while(a<u)}return a}return 2!==n.length?(t=l,r=(t,r)=>l(n(t),r),e=(t,r)=>n(t)-r):(t=n===l||n===s?n:M,r=n,e=n),{left:a,center:function(n,t,r=0,u=n.length){const o=a(n,t,r,u-1);return o>r&&e(n[o-1],t)>-e(n[o],t)?o-1:o},right:function(n,e,a=0,u=n.length){if(a<u){if(0!==t(e,e))return u;do{const t=a+u>>>1;r(n[t],e)<=0?a=t+1:u=t}while(a<u)}return a}}}function M(){return 0}const m=h(l).right;h(function(n){return null===n?NaN:+n}).center;const p=Math.sqrt(50),g=Math.sqrt(10),N=Math.sqrt(2);function v(n,t,r){const e=(t-n)/Math.max(0,r),a=Math.floor(Math.log10(e)),u=e/Math.pow(10,a),o=u>=p?10:u>=g?5:u>=N?2:1;let i,f,c;return a<0?(c=Math.pow(10,-a)/o,i=Math.round(n*c),f=Math.round(t*c),i/c<n&&++i,f/c>t&&--f,c=-c):(c=Math.pow(10,a)*o,i=Math.round(n/c),f=Math.round(t/c),i*c<n&&++i,f*c>t&&--f),f<i&&.5<=r&&r<2?v(n,t,2*r):[i,f,c]}function b(n,t,r){return v(n=+n,t=+t,r=+r)[2]}function y(n,t,r){r=+r;const e=(t=+t)<(n=+n),a=e?b(t,n,r):b(n,t,r);return(e?-1:1)*(a<0?1/-a:a)}function w(n,t){t||(t=[]);var r,e=n?Math.min(t.length,n.length):0,a=t.slice();return function(u){for(r=0;r<e;++r)a[r]=n[r]*(1-u)+t[r]*u;return a}}function d(n,t){var r,e=t?t.length:0,a=n?Math.min(e,n.length):0,u=new Array(a),o=new Array(e);for(r=0;r<a;++r)u[r]=k(n[r],t[r]);for(;r<e;++r)o[r]=t[r];return function(n){for(r=0;r<a;++r)o[r]=u[r](n);return o}}function A(n,t){var r=new Date;return n=+n,t=+t,function(e){return r.setTime(n*(1-e)+t*e),r}}function x(n,t){var r,e={},a={};for(r in null!==n&&"object"==typeof n||(n={}),null!==t&&"object"==typeof t||(t={}),t)r in n?e[r]=k(n[r],t[r]):a[r]=t[r];return function(n){for(r in e)a[r]=e[r](n);return a}}function k(u,o){var i,f=typeof o;return null==o||"boolean"===f?n(o):("number"===f?t:"string"===f?(i=a(o))?(o=i,r):e:o instanceof a?r:o instanceof Date?A:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}(o)?w:Array.isArray(o)?d:"function"!=typeof o.valueOf&&"function"!=typeof o.toString||isNaN(o)?x:t)(u,o)}function j(n,t){return n=+n,t=+t,function(r){return Math.round(n*(1-r)+t*r)}}function q(n){return+n}var D=[0,1];function V(n){return n}function B(n,t){return(t-=n=+n)?function(r){return(r-n)/t}:function(n){return function(){return n}}(isNaN(t)?NaN:.5)}function F(n,t,r){var e=n[0],a=n[1],u=t[0],o=t[1];return a<e?(e=B(a,e),u=r(o,u)):(e=B(e,a),u=r(u,o)),function(n){return u(e(n))}}function L(n,t,r){var e=Math.min(n.length,t.length)-1,a=new Array(e),u=new Array(e),o=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<e;)a[o]=B(n[o],n[o+1]),u[o]=r(t[o],t[o+1]);return function(t){var r=m(n,t,1,e)-1;return u[r](a[r](t))}}function O(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function P(){return function(){var n,r,e,a,u,o,i=D,f=D,c=k,l=V;function s(){var n=Math.min(i.length,f.length);return l!==V&&(l=function(n,t){var r;return n>t&&(r=n,n=t,t=r),function(r){return Math.max(n,Math.min(t,r))}}(i[0],i[n-1])),a=n>2?L:F,u=o=null,h}function h(t){return null==t||isNaN(t=+t)?e:(u||(u=a(i.map(n),f,c)))(n(l(t)))}return h.invert=function(e){return l(r((o||(o=a(f,i.map(n),t)))(e)))},h.domain=function(n){return arguments.length?(i=Array.from(n,q),s()):i.slice()},h.range=function(n){return arguments.length?(f=Array.from(n),s()):f.slice()},h.rangeRound=function(n){return f=Array.from(n),c=j,s()},h.clamp=function(n){return arguments.length?(l=!!n||V,s()):l!==V},h.interpolate=function(n){return arguments.length?(c=n,s()):c},h.unknown=function(n){return arguments.length?(e=n,h):e},function(t,e){return n=t,r=e,s()}}()(V,V)}function R(){var n=P();return n.copy=function(){return O(n,R())},u.apply(n,arguments),function(n){var t=n.domain;return n.ticks=function(n){var r=t();return function(n,t,r){if(!((r=+r)>0))return[];if((n=+n)===(t=+t))return[n];const e=t<n,[a,u,o]=e?v(t,n,r):v(n,t,r);if(!(u>=a))return[];const i=u-a+1,f=new Array(i);if(e)if(o<0)for(let c=0;c<i;++c)f[c]=(u-c)/-o;else for(let c=0;c<i;++c)f[c]=(u-c)*o;else if(o<0)for(let c=0;c<i;++c)f[c]=(a+c)/-o;else for(let c=0;c<i;++c)f[c]=(a+c)*o;return f}(r[0],r[r.length-1],n??10)},n.tickFormat=function(n,r){var e=t();return function(n,t,r,e){var a,u=y(n,t,r);switch((e=i(e??",f")).type){case"s":var l=Math.max(Math.abs(n),Math.abs(t));return null!=e.precision||isNaN(a=function(n,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(o(t)/3)))-o(Math.abs(n)))}(u,l))||(e.precision=a),f(e,l);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=function(n,t){return n=Math.abs(n),t=Math.abs(t)-n,Math.max(0,o(t)-o(n))+1}(u,Math.max(Math.abs(n),Math.abs(t))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=function(n){return Math.max(0,-o(Math.abs(n)))}(u))||(e.precision=a-2*("%"===e.type))}return c(e)}(e[0],e[e.length-1],n??10,r)},n.nice=function(r){null==r&&(r=10);var e,a,u=t(),o=0,i=u.length-1,f=u[o],c=u[i],l=10;for(c<f&&(a=f,f=c,c=a,a=o,o=i,i=a);l-- >0;){if((a=b(f,c,r))===e)return u[o]=f,u[i]=c,t(u);if(a>0)f=Math.floor(f/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;f=Math.ceil(f*a)/a,c=Math.floor(c*a)/a}e=a}return n},n}(n)}export{O as a,h as b,P as c,R as l,y as t};
1
+ import{b8 as n,b9 as t,ba as r,bb as e,bc as a}from"./mermaid.core-CSuHyCbU.js";import{i as u}from"./init-C0SZ43gy.js";import{e as o,f as i,a as f,b as c}from"./defaultLocale-Z7o9ZNZF.js";function l(n,t){return null==n||null==t?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function s(n,t){return null==n||null==t?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function h(n){let t,r,e;function a(n,e,a=0,u=n.length){if(a<u){if(0!==t(e,e))return u;do{const t=a+u>>>1;r(n[t],e)<0?a=t+1:u=t}while(a<u)}return a}return 2!==n.length?(t=l,r=(t,r)=>l(n(t),r),e=(t,r)=>n(t)-r):(t=n===l||n===s?n:M,r=n,e=n),{left:a,center:function(n,t,r=0,u=n.length){const o=a(n,t,r,u-1);return o>r&&e(n[o-1],t)>-e(n[o],t)?o-1:o},right:function(n,e,a=0,u=n.length){if(a<u){if(0!==t(e,e))return u;do{const t=a+u>>>1;r(n[t],e)<=0?a=t+1:u=t}while(a<u)}return a}}}function M(){return 0}const m=h(l).right;h(function(n){return null===n?NaN:+n}).center;const p=Math.sqrt(50),g=Math.sqrt(10),N=Math.sqrt(2);function v(n,t,r){const e=(t-n)/Math.max(0,r),a=Math.floor(Math.log10(e)),u=e/Math.pow(10,a),o=u>=p?10:u>=g?5:u>=N?2:1;let i,f,c;return a<0?(c=Math.pow(10,-a)/o,i=Math.round(n*c),f=Math.round(t*c),i/c<n&&++i,f/c>t&&--f,c=-c):(c=Math.pow(10,a)*o,i=Math.round(n/c),f=Math.round(t/c),i*c<n&&++i,f*c>t&&--f),f<i&&.5<=r&&r<2?v(n,t,2*r):[i,f,c]}function b(n,t,r){return v(n=+n,t=+t,r=+r)[2]}function y(n,t,r){r=+r;const e=(t=+t)<(n=+n),a=e?b(t,n,r):b(n,t,r);return(e?-1:1)*(a<0?1/-a:a)}function w(n,t){t||(t=[]);var r,e=n?Math.min(t.length,n.length):0,a=t.slice();return function(u){for(r=0;r<e;++r)a[r]=n[r]*(1-u)+t[r]*u;return a}}function d(n,t){var r,e=t?t.length:0,a=n?Math.min(e,n.length):0,u=new Array(a),o=new Array(e);for(r=0;r<a;++r)u[r]=k(n[r],t[r]);for(;r<e;++r)o[r]=t[r];return function(n){for(r=0;r<a;++r)o[r]=u[r](n);return o}}function A(n,t){var r=new Date;return n=+n,t=+t,function(e){return r.setTime(n*(1-e)+t*e),r}}function x(n,t){var r,e={},a={};for(r in null!==n&&"object"==typeof n||(n={}),null!==t&&"object"==typeof t||(t={}),t)r in n?e[r]=k(n[r],t[r]):a[r]=t[r];return function(n){for(r in e)a[r]=e[r](n);return a}}function k(u,o){var i,f=typeof o;return null==o||"boolean"===f?n(o):("number"===f?t:"string"===f?(i=a(o))?(o=i,r):e:o instanceof a?r:o instanceof Date?A:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}(o)?w:Array.isArray(o)?d:"function"!=typeof o.valueOf&&"function"!=typeof o.toString||isNaN(o)?x:t)(u,o)}function j(n,t){return n=+n,t=+t,function(r){return Math.round(n*(1-r)+t*r)}}function q(n){return+n}var D=[0,1];function O(n){return n}function V(n,t){return(t-=n=+n)?function(r){return(r-n)/t}:function(n){return function(){return n}}(isNaN(t)?NaN:.5)}function B(n,t,r){var e=n[0],a=n[1],u=t[0],o=t[1];return a<e?(e=V(a,e),u=r(o,u)):(e=V(e,a),u=r(u,o)),function(n){return u(e(n))}}function F(n,t,r){var e=Math.min(n.length,t.length)-1,a=new Array(e),u=new Array(e),o=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<e;)a[o]=V(n[o],n[o+1]),u[o]=r(t[o],t[o+1]);return function(t){var r=m(n,t,1,e)-1;return u[r](a[r](t))}}function L(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function R(){return function(){var n,r,e,a,u,o,i=D,f=D,c=k,l=O;function s(){var n=Math.min(i.length,f.length);return l!==O&&(l=function(n,t){var r;return n>t&&(r=n,n=t,t=r),function(r){return Math.max(n,Math.min(t,r))}}(i[0],i[n-1])),a=n>2?F:B,u=o=null,h}function h(t){return null==t||isNaN(t=+t)?e:(u||(u=a(i.map(n),f,c)))(n(l(t)))}return h.invert=function(e){return l(r((o||(o=a(f,i.map(n),t)))(e)))},h.domain=function(n){return arguments.length?(i=Array.from(n,q),s()):i.slice()},h.range=function(n){return arguments.length?(f=Array.from(n),s()):f.slice()},h.rangeRound=function(n){return f=Array.from(n),c=j,s()},h.clamp=function(n){return arguments.length?(l=!!n||O,s()):l!==O},h.interpolate=function(n){return arguments.length?(c=n,s()):c},h.unknown=function(n){return arguments.length?(e=n,h):e},function(t,e){return n=t,r=e,s()}}()(O,O)}function S(){var n=R();return n.copy=function(){return L(n,S())},u.apply(n,arguments),function(n){var t=n.domain;return n.ticks=function(n){var r=t();return function(n,t,r){if(!((r=+r)>0))return[];if((n=+n)===(t=+t))return[n];const e=t<n,[a,u,o]=e?v(t,n,r):v(n,t,r);if(!(u>=a))return[];const i=u-a+1,f=new Array(i);if(e)if(o<0)for(let c=0;c<i;++c)f[c]=(u-c)/-o;else for(let c=0;c<i;++c)f[c]=(u-c)*o;else if(o<0)for(let c=0;c<i;++c)f[c]=(a+c)/-o;else for(let c=0;c<i;++c)f[c]=(a+c)*o;return f}(r[0],r[r.length-1],n??10)},n.tickFormat=function(n,r){var e=t();return function(n,t,r,e){var a,u=y(n,t,r);switch((e=i(e??",f")).type){case"s":var l=Math.max(Math.abs(n),Math.abs(t));return null!=e.precision||isNaN(a=function(n,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(o(t)/3)))-o(Math.abs(n)))}(u,l))||(e.precision=a),f(e,l);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=function(n,t){return n=Math.abs(n),t=Math.abs(t)-n,Math.max(0,o(t)-o(n))+1}(u,Math.max(Math.abs(n),Math.abs(t))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=function(n){return Math.max(0,-o(Math.abs(n)))}(u))||(e.precision=a-2*("%"===e.type))}return c(e)}(e[0],e[e.length-1],n??10,r)},n.nice=function(r){null==r&&(r=10);var e,a,u=t(),o=0,i=u.length-1,f=u[o],c=u[i],l=10;for(c<f&&(a=f,f=c,c=a,a=o,o=i,i=a);l-- >0;){if((a=b(f,c,r))===e)return u[o]=f,u[i]=c,t(u);if(a>0)f=Math.floor(f/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;f=Math.ceil(f*a)/a,c=Math.floor(c*a)/a}e=a}return n},n}(n)}export{L as a,h as b,R as c,S as l,y as t};
@@ -1 +1 @@
1
- import{u as t,f as e,v as r,w as a,a as n,h as o,S as c,k as s,b as u}from"./isArrayLikeObject-C958pSF-.js";import{k as b,g as i,s as j,a as f,b as y,c as A,d as l,e as p,f as v,h as d,j as g}from"./graph-BD-RY4fR.js";import{c as m,k as w,g as h,f as O,e as S,a as x,d as I,i as U,h as F}from"./_initCloneObject-CgHgrY9n.js";var k=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)f(e,i(t)),t=h(t);return e}:j;function E(t){return y(t,w,k)}var M=Object.prototype.hasOwnProperty,B=/\w*$/,D=t?t.prototype:void 0,C=D?D.valueOf:void 0,L=a&&a.isMap,N=L?r(L):function(t){return e(t)&&"[object Map]"==A(t)},P=a&&a.isSet,R=P?r(P):function(t){return e(t)&&"[object Set]"==A(t)},V="[object Arguments]",G="[object Function]",W="[object Object]",$={};function _(t,e,r,a,u,j){var f,y=1&e,v=2&e,d=4&e;if(void 0!==f)return f;if(!n(t))return t;var g=s(t);if(g){if(f=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&M.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!y)return x(t,f)}else{var h=A(t),D=h==G||"[object GeneratorFunction]"==h;if(o(t))return I(t,y);if(h==W||h==V||D&&!u){if(f=v||D?{}:U(t),!y)return v?function(t,e){return m(t,k(t),e)}(t,function(t,e){return t&&m(e,w(e),t)}(f,t)):function(t,e){return m(t,i(t),e)}(t,function(t,e){return t&&m(e,b(e),t)}(f,t))}else{if(!$[h])return u?t:{};f=function(t,e,r){var a=t.constructor;switch(e){case"[object ArrayBuffer]":return O(t);case"[object Boolean]":case"[object Date]":return new a(+t);case"[object DataView]":return function(t,e){var r=e?O(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return S(t,r);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,B.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return C?Object(C.call(t)):{}}(t)}}(t,h,y)}}j||(j=new c);var L=j.get(t);if(L)return L;j.set(t,f),R(t)?t.forEach(function(a){f.add(_(a,e,r,0,t,j))}):N(t)&&t.forEach(function(a,n){f.set(n,_(a,e,r,0,t,j))});var P=g?void 0:(d?v?E:l:v?w:b)(t);return p(P||t,function(a,n){P&&(a=t[n=a]),F(f,n,_(a,e,r,0,t,j))}),f}function q(t,e){var r=-1,a=u(t)?Array(t.length):[];return v(t,function(t,n,o){a[++r]=e(t,n,o)}),a}function z(t,e){return(s(t)?d:q)(t,g(e))}$[V]=$["[object Array]"]=$["[object ArrayBuffer]"]=$["[object DataView]"]=$["[object Boolean]"]=$["[object Date]"]=$["[object Float32Array]"]=$["[object Float64Array]"]=$["[object Int8Array]"]=$["[object Int16Array]"]=$["[object Int32Array]"]=$["[object Map]"]=$["[object Number]"]=$[W]=$["[object RegExp]"]=$["[object Set]"]=$["[object String]"]=$["[object Symbol]"]=$["[object Uint8Array]"]=$["[object Uint8ClampedArray]"]=$["[object Uint16Array]"]=$["[object Uint32Array]"]=!0,$["[object Error]"]=$[G]=$["[object WeakMap]"]=!1;export{q as a,_ as b,z as m};
1
+ import{u as t,f as e,v as r,w as a,a as n,h as o,S as c,k as s,b as u}from"./isArrayLikeObject-C958pSF-.js";import{k as b,g as i,s as j,a as f,b as y,c as A,d as l,e as p,f as v,h as d,j as m}from"./graph-BD-RY4fR.js";import{c as g,k as w,g as h,f as O,e as S,a as x,d as I,i as U,h as F}from"./_initCloneObject-C781OlVa.js";var k=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)f(e,i(t)),t=h(t);return e}:j;function E(t){return y(t,w,k)}var M=Object.prototype.hasOwnProperty,B=/\w*$/,D=t?t.prototype:void 0,C=D?D.valueOf:void 0,L=a&&a.isMap,N=L?r(L):function(t){return e(t)&&"[object Map]"==A(t)},P=a&&a.isSet,R=P?r(P):function(t){return e(t)&&"[object Set]"==A(t)},V="[object Arguments]",G="[object Function]",W="[object Object]",$={};function _(t,e,r,a,u,j){var f,y=1&e,v=2&e,d=4&e;if(void 0!==f)return f;if(!n(t))return t;var m=s(t);if(m){if(f=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&M.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!y)return x(t,f)}else{var h=A(t),D=h==G||"[object GeneratorFunction]"==h;if(o(t))return I(t,y);if(h==W||h==V||D&&!u){if(f=v||D?{}:U(t),!y)return v?function(t,e){return g(t,k(t),e)}(t,function(t,e){return t&&g(e,w(e),t)}(f,t)):function(t,e){return g(t,i(t),e)}(t,function(t,e){return t&&g(e,b(e),t)}(f,t))}else{if(!$[h])return u?t:{};f=function(t,e,r){var a=t.constructor;switch(e){case"[object ArrayBuffer]":return O(t);case"[object Boolean]":case"[object Date]":return new a(+t);case"[object DataView]":return function(t,e){var r=e?O(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return S(t,r);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,B.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return C?Object(C.call(t)):{}}(t)}}(t,h,y)}}j||(j=new c);var L=j.get(t);if(L)return L;j.set(t,f),R(t)?t.forEach(function(a){f.add(_(a,e,r,0,t,j))}):N(t)&&t.forEach(function(a,n){f.set(n,_(a,e,r,0,t,j))});var P=m?void 0:(d?v?E:l:v?w:b)(t);return p(P||t,function(a,n){P&&(a=t[n=a]),F(f,n,_(a,e,r,0,t,j))}),f}function q(t,e){var r=-1,a=u(t)?Array(t.length):[];return v(t,function(t,n,o){a[++r]=e(t,n,o)}),a}function z(t,e){return(s(t)?d:q)(t,m(e))}$[V]=$["[object Array]"]=$["[object ArrayBuffer]"]=$["[object DataView]"]=$["[object Boolean]"]=$["[object Date]"]=$["[object Float32Array]"]=$["[object Float64Array]"]=$["[object Int8Array]"]=$["[object Int16Array]"]=$["[object Int32Array]"]=$["[object Map]"]=$["[object Number]"]=$[W]=$["[object RegExp]"]=$["[object Set]"]=$["[object String]"]=$["[object Symbol]"]=$["[object Uint8Array]"]=$["[object Uint8ClampedArray]"]=$["[object Uint16Array]"]=$["[object Uint32Array]"]=!0,$["[object Error]"]=$[G]=$["[object WeakMap]"]=!1;export{q as a,_ as b,z as m};