@staticbolt/docs 0.0.1-beta.3 → 0.0.1-beta.5

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 (117) hide show
  1. package/README.md +16 -19
  2. package/lib/index.d.mts +62 -35
  3. package/lib/mermaid/abnfDiagram-PAR5IXJI-Ibbj5eGO.js +1 -0
  4. package/lib/mermaid/architecture-7GRP2DOG-M7G3SWCO-BJAoKIRD.js +1 -0
  5. package/lib/mermaid/architectureDiagram-2PNWDENW-CI3fLWIN.js +36 -0
  6. package/lib/mermaid/blockDiagram-PUWGUBOA-DAfWpjz7.js +129 -0
  7. package/lib/mermaid/c4Diagram-3NLNHZP5-at-f4FDi.js +38 -0
  8. package/lib/mermaid/chunk-2NMSUPJH-DuxvnX1p.js +1 -0
  9. package/lib/mermaid/chunk-32MCUW2P-D8U-Oy6M.js +206 -0
  10. package/lib/mermaid/chunk-3NPNU5GP-8WYybYAh.js +1 -0
  11. package/lib/mermaid/chunk-3SMGFRGC-C0WC5bhP.js +1 -0
  12. package/lib/mermaid/chunk-4CAJECRU-C_QnaDal.js +15 -0
  13. package/lib/mermaid/chunk-4OADUZ5Q-DHE3k_pb.js +10 -0
  14. package/lib/mermaid/chunk-5IMINLNL-Cl3N81sR.js +1 -0
  15. package/lib/mermaid/chunk-5IQCK5RY-Df5Ppxew.js +3 -0
  16. package/lib/mermaid/chunk-5MVFYWFU-DgXg5u6h.js +1 -0
  17. package/lib/mermaid/chunk-AQ6EADP3-CZhslHi-.js +1 -0
  18. package/lib/mermaid/chunk-AZZRMDJM-y-xJBuMz.js +15 -0
  19. package/lib/mermaid/chunk-CLS4B6BI-BRLlisnG.js +168 -0
  20. package/lib/mermaid/chunk-DZP67EKU-9RpG5Rdc.js +70 -0
  21. package/lib/mermaid/chunk-EICP7K5X-8YS1Gtlr.js +1 -0
  22. package/lib/mermaid/chunk-GDY2UAB4-QtXfmDIW.js +1 -0
  23. package/lib/mermaid/chunk-H7VHZCWX-CwFRFlEn.js +1 -0
  24. package/lib/mermaid/chunk-IJBDOHL6-CgcssvZb.js +1 -0
  25. package/lib/mermaid/chunk-JFFVMJIA-Cx1_ZSMR.js +1 -0
  26. package/lib/mermaid/chunk-JQRUD6KW-Dbva2Z17.js +1 -0
  27. package/lib/mermaid/chunk-JZGDI5JK-BspJQ1vQ.js +1 -0
  28. package/lib/mermaid/chunk-KD6SPIPN-4bKl37hM.js +2 -0
  29. package/lib/mermaid/chunk-NF366YI6-D1lnbapv.js +231 -0
  30. package/lib/mermaid/chunk-NUDPKBEF-CL0e9XiQ.js +34 -0
  31. package/lib/mermaid/chunk-OJINMHTS-rKnCIFV0.js +1 -0
  32. package/lib/mermaid/chunk-Q6NGPIAH-CM9NYxWM.js +2 -0
  33. package/lib/mermaid/chunk-QJSWEUOL-kvKBktmc.js +133 -0
  34. package/lib/mermaid/chunk-R7JDMUKV-CSyCOfYj.js +1 -0
  35. package/lib/mermaid/chunk-RCXAM2GK-BeKcutEV.js +1 -0
  36. package/lib/mermaid/chunk-RT4MAWR3-Cv_8LyN5.js +1 -0
  37. package/lib/mermaid/chunk-SFMINX4W-BW2NSwFJ.js +1 -0
  38. package/lib/mermaid/chunk-SLDQ463B-D15xTdNW.js +88 -0
  39. package/lib/mermaid/chunk-STOV2HOB-GnExfzIX.js +1 -0
  40. package/lib/mermaid/chunk-T5OCTHI4-DdZvN-9i.js +1 -0
  41. package/lib/mermaid/chunk-TCEHX7R3-BXjgPiQF.js +1 -0
  42. package/lib/mermaid/chunk-VQC2EELJ-sGo2yn97.js +1 -0
  43. package/lib/mermaid/chunk-VRZKL3EH-BzaZ6KlD.js +1 -0
  44. package/lib/mermaid/chunk-VTHDQ7BV-BqUEu5Ml.js +1 -0
  45. package/lib/mermaid/chunk-VY2OSTJR-BYk2nUI_.js +2 -0
  46. package/lib/mermaid/chunk-WUBWJARI-Z8MI6quX.js +1 -0
  47. package/lib/mermaid/chunk-YBMQ5JGJ-DlZ1nCKo.js +2 -0
  48. package/lib/mermaid/chunk-YDMLL4PJ-BHgx6nXf.js +1 -0
  49. package/lib/mermaid/chunk-Z6V44ARX-CWGOZvke.js +62 -0
  50. package/lib/mermaid/chunk-ZJJ7VQJP-CZ7qJzqZ.js +340 -0
  51. package/lib/mermaid/chunk-ZNLK7HRR-B-wIfXTw.js +1 -0
  52. package/lib/mermaid/chunk-ZQN7UHIL-CNp35E78.js +1 -0
  53. package/lib/mermaid/chunk-ZS6VBONO-D-IFTJgn.js +175 -0
  54. package/lib/mermaid/chunk-ZUNWM646-DRKPDcQl.js +1 -0
  55. package/lib/mermaid/classDiagram-FGAMPOII-D1sf64vv.js +1 -0
  56. package/lib/mermaid/classDiagram-v2-AI5RJEK4-D1sf64vv.js +1 -0
  57. package/lib/mermaid/cose-bilkent-Q72C2OJ3-iX90typn.js +1 -0
  58. package/lib/mermaid/cynefin-OW5HDTMX-6OCTWOGG-6jDAiaRu.js +1 -0
  59. package/lib/mermaid/cynefinDiagram-2OOWUY4M-5ACKe62t.js +62 -0
  60. package/lib/mermaid/dagre-MPVFI544-BUrJjGwd.js +4 -0
  61. package/lib/mermaid/diagram-AE4NWXFW-B3Lkw8MS.js +24 -0
  62. package/lib/mermaid/diagram-BUJID5UG-p2ajLLgr.js +41 -0
  63. package/lib/mermaid/diagram-C44CZ5NI-CO0U1GX-.js +24 -0
  64. package/lib/mermaid/diagram-EYOLEXXS-DDoUndBV.js +30 -0
  65. package/lib/mermaid/diagram-P7B6PWOJ-C_dSNQyG.js +3 -0
  66. package/lib/mermaid/ebnfDiagram-FTPZ3PV6-DIwB5te0.js +1 -0
  67. package/lib/mermaid/erDiagram-H3ERR26V-CN4pCzIq.js +99 -0
  68. package/lib/mermaid/eventmodeling-NTZA5JFV-WKSWQHFS-Ruta89_N.js +1 -0
  69. package/lib/mermaid/flowDiagram-YHGXBVSY-CrSHzFwR.js +1 -0
  70. package/lib/mermaid/ganttDiagram-RWFTB7ED-C-rfEOn5.js +292 -0
  71. package/lib/mermaid/gitGraph-4MIJSDKK-JH2HKYUO-B76vihW5.js +1 -0
  72. package/lib/mermaid/gitGraphDiagram-MAR6GKOP-peAd7EYO.js +106 -0
  73. package/lib/mermaid/index.js +15 -0
  74. package/lib/mermaid/info-A6RAGUB7-3TX3OFWW-DykwOJ0Z.js +1 -0
  75. package/lib/mermaid/infoDiagram-LV547AFH-C46dOKDG.js +2 -0
  76. package/lib/mermaid/ishikawaDiagram-PUJQGNDS-DUmHXvO9.js +70 -0
  77. package/lib/mermaid/journeyDiagram-EW5QJT4W-CNAhUHsQ.js +139 -0
  78. package/lib/mermaid/kanban-definition-JSQERAZB-uOEoksHt.js +89 -0
  79. package/lib/mermaid/katex-CZ4GXH2S-CaEE-8Xf.js +257 -0
  80. package/lib/mermaid/mindmap-definition-VBJCLQLM-DZceCWFq.js +96 -0
  81. package/lib/mermaid/packet-AYTQ26CC-MKII6P3Y-XqJQX7OO.js +1 -0
  82. package/lib/mermaid/pegDiagram-7WILOQTJ-DMKA8PUf.js +1 -0
  83. package/lib/mermaid/pie-WAS4IAKB-6B4OPMJ5-DpoRuAye.js +1 -0
  84. package/lib/mermaid/pieDiagram-EFA7CBSB-BzO4xw8C.js +39 -0
  85. package/lib/mermaid/quadrantDiagram-WARVYA7P-DMQd2xKZ.js +7 -0
  86. package/lib/mermaid/radar-RG4KPBEZ-UPTR3XUL-BcwE6tO1.js +1 -0
  87. package/lib/mermaid/railroad-74A4TZTK-MEFUPFMS-B2Kwx3Uk.js +1 -0
  88. package/lib/mermaid/railroad-abnf-HS5TGJTU-R5YG2S5D-uBY3fYzG.js +1 -0
  89. package/lib/mermaid/railroad-ebnf-LZEXJU2U-G5QEX2L6-AhpzdU_3.js +1 -0
  90. package/lib/mermaid/railroad-peg-WCYAUIDC-H5I2ZRY2-CrsmP7-8.js +1 -0
  91. package/lib/mermaid/railroadDiagram-5NIQVNLQ-BGyZ628g.js +1 -0
  92. package/lib/mermaid/requirementDiagram-SXREGOKZ-CtCO7u9U.js +84 -0
  93. package/lib/mermaid/sankeyDiagram-VV74M2VP-CPXqmSKK.js +40 -0
  94. package/lib/mermaid/sequenceDiagram-52ZFIFDL-B1rSqWZp.js +162 -0
  95. package/lib/mermaid/sizeCapture-FGA5AGYP-BEqQzsxs.js +1 -0
  96. package/lib/mermaid/stateDiagram-3QAKPIVI-3KzWPUq3.js +1 -0
  97. package/lib/mermaid/stateDiagram-v2-HN2P4RDZ-dXASbYMy.js +1 -0
  98. package/lib/mermaid/swimlanes-QLVP42QD-CLpR90IY.js +1 -0
  99. package/lib/mermaid/swimlanesDiagram-JKPDBFCN-C2sgVGQE.js +8 -0
  100. package/lib/mermaid/timeline-definition-GS45XAXW-DLn0_RV5.js +120 -0
  101. package/lib/mermaid/treeView-Q6P3EWNA-ZRJGANNQ-u1bD1sZ1.js +1 -0
  102. package/lib/mermaid/treemap-WGGIJYW6-K64VN5AS-DrIaTBlj.js +1 -0
  103. package/lib/mermaid/vennDiagram-QIQU2ZRJ-FxbUp7-Z.js +34 -0
  104. package/lib/mermaid/wardley-WFR3VGLG-D67OWCCH-Br9hyuFK.js +1 -0
  105. package/lib/mermaid/wardleyDiagram-U6YNM66N-l-Kvr0Az.js +78 -0
  106. package/lib/mermaid/xychartDiagram-XJAZEDNM-O9bztWNh.js +7 -0
  107. package/lib/plugins.mjs +213 -162
  108. package/package.json +3 -10
  109. package/sources/parts/document/document.part.html +7 -7
  110. package/sources/parts/header/header.part.html +2 -2
  111. package/sources/parts/header/header.style.css +4 -2
  112. package/sources/parts/mermaid/mermaid.part.html +1 -1
  113. package/sources/parts/pagefind/pagefind.part.html +5 -3
  114. package/sources/parts/sidebar/sidebar.part.html +1 -1
  115. package/sources/parts/sidebar/sidebar.style.css +10 -0
  116. package/sources/parts/table-of-content/table-of-content-desktop.part.html +2 -2
  117. package/sources/scripts/mermaid.ts +3 -1
@@ -0,0 +1,106 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{V as t,q as n}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as r,F as i,Q as a,R as o,V as s,X as c,Y as l,h as u,l as d,q as f,v as p,z as m}from"./chunk-QJSWEUOL-kvKBktmc.js";import"./chunk-STOV2HOB-GnExfzIX.js";import{a as h,o as g,s as _}from"./chunk-VY2OSTJR-BYk2nUI_.js";import{t as v}from"./chunk-JQRUD6KW-Dbva2Z17.js";import"./chunk-ZS6VBONO-D-IFTJgn.js";import{t as y}from"./chunk-5IQCK5RY-Df5Ppxew.js";import"./chunk-JZGDI5JK-BspJQ1vQ.js";import"./chunk-OJINMHTS-rKnCIFV0.js";import"./chunk-VQC2EELJ-sGo2yn97.js";import"./chunk-KD6SPIPN-4bKl37hM.js";import"./chunk-Q6NGPIAH-CM9NYxWM.js";import"./chunk-RT4MAWR3-Cv_8LyN5.js";import"./chunk-YBMQ5JGJ-DlZ1nCKo.js";import"./chunk-GDY2UAB4-QtXfmDIW.js";import"./chunk-3SMGFRGC-C0WC5bhP.js";import"./chunk-3NPNU5GP-8WYybYAh.js";import"./chunk-TCEHX7R3-BXjgPiQF.js";import"./chunk-5MVFYWFU-DgXg5u6h.js";import"./chunk-SFMINX4W-BW2NSwFJ.js";import"./chunk-JFFVMJIA-Cx1_ZSMR.js";import"./chunk-ZUNWM646-DRKPDcQl.js";import{t as b}from"./chunk-T5OCTHI4-DdZvN-9i.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},ee=p.gitGraph,S=e(()=>h({...ee,...d().gitGraph}),`getConfig`),C=new b(()=>{let e=S(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function w(){return _({length:7})}e(w,`getID`);function T(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}e(T,`uniqBy`);var te=e(function(e){C.records.direction=e},`setDirection`),ne=e(function(e){n.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{C.records.options=JSON.parse(e)}catch(e){n.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),re=e(function(){return C.records.options},`getOptions`),ie=e(function(e){let t=e.msg,r=e.id,i=e.type,a=e.tags;n.info(`commit`,t,r,i,a),n.debug(`Entering commit:`,t,r,i,a);let s=S();r=o.sanitizeText(r,s),t=o.sanitizeText(t,s),a=a?.map(e=>o.sanitizeText(e,s));let c={id:r||C.records.seq+`-`+w(),message:t,seq:C.records.seq++,type:i??x.NORMAL,tags:a??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};C.records.head=c,n.info(`main branch`,s.mainBranchName),C.records.commits.has(c.id)&&n.warn(`Commit ID ${c.id} already exists`),C.records.commits.set(c.id,c),C.records.branches.set(C.records.currBranch,c.id),n.debug(`in pushCommit `+c.id)},`commit`),ae=e(function(e){let t=e.name,r=e.order;if(t=o.sanitizeText(t,S()),C.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);C.records.branches.set(t,C.records.head==null?null:C.records.head.id),C.records.branchConfig.set(t,{name:t,order:r}),E(t),n.debug(`in createBranch`)},`branch`),oe=e(e=>{let t=e.branch,r=e.id,i=e.type,a=e.tags,s=S();t=o.sanitizeText(t,s),r&&=o.sanitizeText(r,s);let c=C.records.branches.get(C.records.currBranch),l=C.records.branches.get(t),u=c?C.records.commits.get(c):void 0,d=l?C.records.commits.get(l):void 0;if(u&&d&&u.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(C.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!C.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(d===void 0||!d){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(u===d){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(r&&C.records.commits.has(r)){let e=Error(`Incorrect usage of "merge". Commit with id:`+r+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${r} ${i} ${a?.join(` `)}`,token:`merge ${t} ${r} ${i} ${a?.join(` `)}`,expected:[`merge ${t} ${r}_UNIQUE ${i} ${a?.join(` `)}`]},e}let f=l||``,p={id:r||`${C.records.seq}-${w()}`,message:`merged branch ${t} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,f],branch:C.records.currBranch,type:x.MERGE,customType:i,customId:!!r,tags:a??[]};C.records.head=p,C.records.commits.set(p.id,p),C.records.branches.set(C.records.currBranch,p.id),n.debug(C.records.branches),n.debug(`in mergeBranch`)},`merge`),se=e(function(e){let t=e.id,r=e.targetId,i=e.tags,a=e.parent;n.debug(`Entering cherryPick:`,t,r,i);let s=S();if(t=o.sanitizeText(t,s),r=o.sanitizeText(r,s),i=i?.map(e=>o.sanitizeText(e,s)),a=o.sanitizeText(a,s),!t||!C.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let c=C.records.commits.get(t);if(c===void 0||!c)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(a&&!(Array.isArray(c.parents)&&c.parents.includes(a)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let l=c.branch;if(c.type===x.MERGE&&!a)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!r||!C.records.commits.has(r)){if(l===C.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let e=C.records.branches.get(C.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let o=C.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let s={id:C.records.seq+`-`+w(),message:`cherry-picked ${c?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,c.id],branch:C.records.currBranch,type:x.CHERRY_PICK,tags:i?i.filter(Boolean):[`cherry-pick:${c.id}${c.type===x.MERGE?`|parent:${a}`:``}`]};C.records.head=s,C.records.commits.set(s.id,s),C.records.branches.set(C.records.currBranch,s.id),n.debug(C.records.branches),n.debug(`in cherryPick`)}},`cherryPick`),E=e(function(e){if(e=o.sanitizeText(e,S()),C.records.branches.has(e)){C.records.currBranch=e;let t=C.records.branches.get(C.records.currBranch);t===void 0||!t?C.records.head=null:C.records.head=C.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function D(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}e(D,`upsert`);function O(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),r=``;e.forEach(function(e){r+=e===t?` *`:` |`});let i=[r,t.id,t.seq];for(let e in C.records.branches)C.records.branches.get(e)===t.id&&i.push(e);if(n.debug(i.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=C.records.commits.get(t.parents[0]);D(e,t,n),t.parents[1]&&e.push(C.records.commits.get(t.parents[1]))}else{if(t.parents.length==0)return;if(t.parents[0]){let n=C.records.commits.get(t.parents[0]);D(e,t,n)}}e=T(e,e=>e.id),O(e)}e(O,`prettyPrintCommitHistory`);var ce=e(function(){n.debug(C.records.commits);let e=k()[0];O([e])},`prettyPrint`),le=e(function(){C.reset(),u()},`clear`),ue=e(function(){return[...C.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),de=e(function(){return C.records.branches},`getBranches`),fe=e(function(){return C.records.commits},`getCommits`),k=e(function(){let e=[...C.records.commits.values()];return e.forEach(function(e){n.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),A={commitType:x,getConfig:S,setDirection:te,setOptions:ne,getOptions:re,commit:ie,branch:ae,merge:oe,cherryPick:se,checkout:E,prettyPrint:ce,clear:le,getBranchesAsObjArray:ue,getBranches:de,getCommits:fe,getCommitsArray:k,getCurrentBranch:e(function(){return C.records.currBranch},`getCurrentBranch`),getDirection:e(function(){return C.records.direction},`getDirection`),getHead:e(function(){return C.records.head},`getHead`),setAccTitle:a,getAccTitle:s,getAccDescription:f,setAccDescription:l,setDiagramTitle:i,getDiagramTitle:c},pe=e((e,t)=>{v(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)me(n,t)},`populate`),me=e((t,r)=>{let i={Commit:e(e=>r.commit(he(e)),`Commit`),Branch:e(e=>r.branch(ge(e)),`Branch`),Merge:e(e=>r.merge(_e(e)),`Merge`),Checkout:e(e=>r.checkout(ve(e)),`Checkout`),CherryPicking:e(e=>r.cherryPick(ye(e)),`CherryPicking`)}[t.$type];i?i(t):n.error(`Unknown statement type: ${t.$type}`)},`parseStatement`),he=e(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?x.NORMAL:x[e.type],tags:e.tags??void 0}),`parseCommit`),ge=e(e=>({name:e.name,order:e.order??0}),`parseBranch`),_e=e(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:x[e.type],tags:e.tags??void 0}),`parseMerge`),ve=e(e=>e.branch,`parseCheckout`),ye=e(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),be={parse:e(async e=>{let t=await y(`gitGraph`,e);n.debug(t),pe(t,A)},`parse`)},j=10,M=40,N=4,P=2,F=8,I=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),L=12,R=new Set([`redux-color`,`redux-dark-color`]),xe=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),z=e((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),B=new Map,V=new Map,H=30,U=new Map,W=[],G=0,K=`LR`,Se=e(()=>{B.clear(),V.clear(),U.clear(),G=0,W=[],K=`LR`},`clear`),q=e(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),J=e(t=>{let n,r,i;return K===`BT`?(r=e((e,t)=>e<=t,`comparisonFunc`),i=1/0):(r=e((e,t)=>e>=t,`comparisonFunc`),i=0),t.forEach(e=>{let t=K===`TB`||K==`BT`?V.get(e)?.y:V.get(e)?.x;t!==void 0&&r(t,i)&&(n=e,i=t)}),n},`findClosestParent`),Ce=e(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=V.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),we=e((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Ee(n),i=Math.max(r,i)):a.push(n),De(n,r)}),r=i,a.forEach(e=>{Oe(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Ce(n.parents);r=V.get(e).y-M,r<=i&&(i=r);let t=B.get(n.branch).pos,a=r-j;V.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),Te=e(e=>{let t=J(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=V.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Ee=e(e=>Te(e)+M,`calculateCommitPosition`),De=e((e,t)=>{let n=B.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+j;return V.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),Oe=e((e,t,n)=>{let r=B.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;V.set(e.id,{x:a,y:i})},`setRootPosition`),ke=e((e,t,n,i,a,o)=>{let{theme:s}=r(),c=I.has(s??``),l=R.has(s??``),u=xe.has(s??``);if(o===x.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(c?3:0)).attr(`y`,n.y-10+(c?3:0)).attr(`width`,c?14:20).attr(`height`,c?14:20).attr(`class`,`commit ${t.id} commit-highlight${z(a,F,l)} ${i}-outer`),e.append(`rect`).attr(`x`,n.x-6+(c?2:0)).attr(`y`,n.y-6+(c?2:0)).attr(`width`,c?8:12).attr(`height`,c?8:12).attr(`class`,`commit ${t.id} commit${z(a,F,l)} ${i}-inner`);else if(o===x.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,c?7:10).attr(`class`,`commit ${t.id} ${i}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,c?2.5:2.75).attr(`fill`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${i}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,c?2.5:2.75).attr(`fill`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${i}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${i}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${i}`);else{let r=e.append(`circle`);if(r.attr(`cx`,n.x),r.attr(`cy`,n.y),r.attr(`r`,c?7:10),r.attr(`class`,`commit ${t.id} commit${z(a,F,l)}`),o===x.MERGE){let r=e.append(`circle`);r.attr(`cx`,n.x),r.attr(`cy`,n.y),r.attr(`r`,c?5:6),r.attr(`class`,`commit ${i} ${t.id} commit${z(a,F,l)}`)}if(o===x.REVERSE){let r=e.append(`path`),o=c?4:5;r.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${i} ${t.id} commit${z(a,F,l)}`)}}},`drawCommitBullet`),Ae=e((e,t,n,r,i)=>{if(t.type!==x.CHERRY_PICK&&(t.customId&&t.type===x.MERGE||t.type!==x.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-P).attr(`y`,n.y+13.5).attr(`width`,c.width+2*P).attr(`height`,c.height+2*P),K===`TB`||K===`BT`?(o.attr(`x`,n.x-(c.width+4*N+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*N)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel)){if(K===`TB`||K===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}}},`drawCommitLabel`),je=e((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
2
+ ${r-a/2-N/2},${l+P}
3
+ ${r-a/2-N/2},${l-P}
4
+ ${n.posWithOffset-a/2-N},${l-s-P}
5
+ ${n.posWithOffset+a/2+N},${l-s-P}
6
+ ${n.posWithOffset+a/2+N},${l+s+P}
7
+ ${n.posWithOffset-a/2-N},${l+s+P}`),t.attr(`cy`,l).attr(`cx`,r-a/2+N/2).attr(`r`,1.5).attr(`class`,`tag-hole`),K===`TB`||K===`BT`){let o=r+c;i.attr(`class`,`tag-label-bkg`).attr(`points`,`
8
+ ${n.x},${o+2}
9
+ ${n.x},${o-2}
10
+ ${n.x+j},${o-s-2}
11
+ ${n.x+j+a+4},${o-s-2}
12
+ ${n.x+j+a+4},${o+s+2}
13
+ ${n.x+j},${o+s+2}`).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),t.attr(`cx`,n.x+N/2).attr(`cy`,o).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),e.attr(`x`,n.x+5).attr(`y`,o+3).attr(`transform`,`translate(14,14) rotate(45, `+n.x+`,`+r+`)`)}}}},`drawCommitTags`),Me=e(e=>{switch(e.customType??e.type){case x.NORMAL:return`commit-normal`;case x.REVERSE:return`commit-reverse`;case x.HIGHLIGHT:return`commit-highlight`;case x.MERGE:return`commit-merge`;case x.CHERRY_PICK:return`commit-cherry-pick`;default:return`commit-normal`}},`getCommitClassType`),Ne=e((e,t,n,r)=>{let i={x:0,y:0};if(e.parents.length>0){let n=J(e.parents);if(n){let a=r.get(n)??i;return t===`TB`?a.y+M:t===`BT`?(r.get(e.id)??i).y-M:a.x+M}}else return t===`TB`?H:t===`BT`?(r.get(e.id)??i).y-M:0;return 0},`calculatePosition`),Pe=e((e,t,n)=>{let i=K===`BT`&&n?t:t+j,a=B.get(e.branch)?.pos,o=K===`TB`||K===`BT`?B.get(e.branch)?.pos:i;if(o===void 0||a===void 0)throw Error(`Position were undefined for commit ${e.id}`);let s=I.has(r().theme??``);return{x:o,y:K===`TB`||K===`BT`?i:a+(s?L/2+1:-2),posWithOffset:i}},`getCommitPosition`),Y=e((t,n,r,i)=>{let a=t.append(`g`).attr(`class`,`commit-bullets`),o=t.append(`g`).attr(`class`,`commit-labels`),s=K===`TB`||K===`BT`?H:0,c=[...n.keys()],l=i.parallelCommits??!1,u=e((e,t)=>{let r=n.get(e)?.seq,i=n.get(t)?.seq;return r!==void 0&&i!==void 0?r-i:0},`sortKeys`),d=c.sort(u);K===`BT`&&(l&&we(d,n,s),d=d.reverse()),d.forEach(e=>{let t=n.get(e);if(!t)throw Error(`Commit not found for key ${e}`);l&&(s=Ne(t,K,s,V));let c=Pe(t,s,l);if(r){let e=Me(t),n=t.customType??t.type,r=B.get(t.branch)?.index??0;ke(a,t,c,e,r,n),Ae(o,t,c,s,i),je(o,t,c,s)}K===`TB`||K===`BT`?V.set(t.id,{x:c.x,y:c.posWithOffset}):V.set(t.id,{x:c.posWithOffset,y:c.y}),s=K===`BT`&&l?s+M:s+M+j,s>G&&(G=s)})},`drawCommits`),Fe=e((t,n,r,i,a)=>{let o=(K===`TB`||K===`BT`?r.x<i.x:r.y<i.y)?n.branch:t.branch,s=e(e=>e.branch===o,`isOnBranchToGetCurve`),c=e(e=>e.seq>t.seq&&e.seq<n.seq,`isBetweenCommits`);return[...a.values()].some(e=>c(e)&&s(e))},`shouldRerouteArrow`),X=e((e,t,n=0)=>{let r=e+Math.abs(e-t)/2;return n>5?r:W.every(e=>Math.abs(e-r)>=10)?(W.push(r),r):X(e,t-Math.abs(e-t)/5,n+1)},`findLane`),Ie=e((e,t,n,i)=>{let{theme:a}=r(),o=R.has(a??``),s=V.get(t.id),c=V.get(n.id);if(s===void 0||c===void 0)throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);let l=Fe(t,n,s,c,i),u=``,d=``,f=0,p=0,m=B.get(n.branch)?.index;n.type===x.MERGE&&t.id!==n.parents[0]&&(m=B.get(t.branch)?.index);let h;if(l){u=`A 10 10, 0, 0, 0,`,d=`A 10 10, 0, 0, 1,`,f=10,p=10;let e=s.y<c.y?X(s.y,c.y):X(c.y,s.y),n=s.x<c.x?X(s.x,c.x):X(c.x,s.x);K===`TB`?s.x<c.x?h=`M ${s.x} ${s.y} L ${n-f} ${s.y} ${d} ${n} ${s.y+p} L ${n} ${c.y-f} ${u} ${n+p} ${c.y} L ${c.x} ${c.y}`:(m=B.get(t.branch)?.index,h=`M ${s.x} ${s.y} L ${n+f} ${s.y} ${u} ${n} ${s.y+p} L ${n} ${c.y-f} ${d} ${n-p} ${c.y} L ${c.x} ${c.y}`):K===`BT`?s.x<c.x?h=`M ${s.x} ${s.y} L ${n-f} ${s.y} ${u} ${n} ${s.y-p} L ${n} ${c.y+f} ${d} ${n+p} ${c.y} L ${c.x} ${c.y}`:(m=B.get(t.branch)?.index,h=`M ${s.x} ${s.y} L ${n+f} ${s.y} ${d} ${n} ${s.y-p} L ${n} ${c.y+f} ${u} ${n-p} ${c.y} L ${c.x} ${c.y}`):s.y<c.y?h=`M ${s.x} ${s.y} L ${s.x} ${e-f} ${u} ${s.x+p} ${e} L ${c.x-f} ${e} ${d} ${c.x} ${e+p} L ${c.x} ${c.y}`:(m=B.get(t.branch)?.index,h=`M ${s.x} ${s.y} L ${s.x} ${e+f} ${d} ${s.x+p} ${e} L ${c.x-f} ${e} ${u} ${c.x} ${e-p} L ${c.x} ${c.y}`)}else u=`A 20 20, 0, 0, 0,`,d=`A 20 20, 0, 0, 1,`,f=20,p=20,K===`TB`?(s.x<c.x&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-f} ${u} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-f} ${s.y} ${d} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x>c.x&&(u=`A 20 20, 0, 0, 0,`,d=`A 20 20, 0, 0, 1,`,f=20,p=20,h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-f} ${d} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+f} ${s.y} ${u} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):K===`BT`?(s.x<c.x&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+f} ${d} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-f} ${s.y} ${u} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x>c.x&&(u=`A 20 20, 0, 0, 0,`,d=`A 20 20, 0, 0, 1,`,f=20,p=20,h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+f} ${u} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+f} ${s.y} ${d} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):(s.y<c.y&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${s.x} ${s.y} L ${c.x-f} ${s.y} ${d} ${c.x} ${s.y+p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y-f} ${u} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y>c.y&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${s.x} ${s.y} L ${c.x-f} ${s.y} ${u} ${c.x} ${s.y-p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y+f} ${d} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y===c.y&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`));if(h===void 0)throw Error(`Line definition not found`);e.append(`path`).attr(`d`,h).attr(`class`,`arrow arrow`+z(m,F,o))},`drawArrow`),Le=e((e,t)=>{let n=e.append(`g`).attr(`class`,`commit-arrows`);[...t.keys()].forEach(e=>{let r=t.get(e);r.parents&&r.parents.length>0&&r.parents.forEach(e=>{Ie(n,t.get(e),r,t)})})},`drawArrows`),Re=e((e,t,n,i)=>{let{look:a,theme:o,themeVariables:s}=r(),{dropShadow:c,THEME_COLOR_LIMIT:l}=s,u=I.has(o??``),d=R.has(o??``),f=e.append(`g`);t.forEach((e,t)=>{let r=z(t,u?l:F,d),o=B.get(e.name)?.pos;if(o===void 0)throw Error(`Position not found for branch ${e.name}`);let s=K===`TB`||K===`BT`?o:u?o+L/2+1:o-2,p=f.append(`line`);p.attr(`x1`,0),p.attr(`y1`,s),p.attr(`x2`,G),p.attr(`y2`,s),p.attr(`class`,`branch branch`+r),K===`TB`?(p.attr(`y1`,H),p.attr(`x1`,o),p.attr(`y2`,G),p.attr(`x2`,o)):K===`BT`&&(p.attr(`y1`,G),p.attr(`x1`,o),p.attr(`y2`,H),p.attr(`x2`,o)),W.push(s);let m=e.name,h=q(m),g=f.insert(`rect`),_=f.insert(`g`).attr(`class`,`branchLabel`).insert(`g`).attr(`class`,`label branch-label`+r);_.node().appendChild(h);let v=h.getBBox(),y=u?0:4,b=u?16:0,x=u?L:0;a===`neo`&&g.attr(`data-look`,`neo`),g.attr(`class`,`branchLabelBkg label`+r).attr(`style`,a===`neo`?`filter:${u?`url(#${i}-drop-shadow)`:c}`:``).attr(`rx`,y).attr(`ry`,y).attr(`x`,-v.width-4-(n.rotateCommitLabel===!0?30:0)).attr(`y`,-v.height/2+10).attr(`width`,v.width+18+b).attr(`height`,v.height+4+x),_.attr(`transform`,`translate(`+(-v.width-14-(n.rotateCommitLabel===!0?30:0)+b/2)+`, `+(s-v.height/2-2)+`)`),K===`TB`?(g.attr(`x`,o-v.width/2-10).attr(`y`,0),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, 0)`),u&&(g.attr(`transform`,`translate(${-b/2-3}, ${-x-10})`),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+(-x*2+7)+`)`))):K===`BT`?(g.attr(`x`,o-v.width/2-10).attr(`y`,G),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+G+`)`),u&&(g.attr(`transform`,`translate(${-b/2-3}, ${x+10})`),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+(G+x*2+4)+`)`))):g.attr(`transform`,`translate(-19, `+(s-12-x/2)+`)`)})},`drawBranches`),ze=e(function(e,t,n,r,i){return B.set(e,{pos:t,index:n}),t+=50+(i?40:0)+(K===`TB`||K===`BT`?r.width/2:0),t},`setBranchPosition`),Be={draw:e(function(e,i,a,o){Se(),n.debug(`in gitgraph renderer`,e+`
14
+ `,`id:`,i,a);let s=o.db;if(!s.getConfig){n.error(`getConfig method is not available on db`);return}let c=s.getConfig(),l=c.rotateCommitLabel??!1;U=s.getCommits();let u=s.getBranchesAsObjArray();K=s.getDirection();let d=t(`[id="${i}"]`),{look:f,theme:p,themeVariables:h}=r(),{useGradient:_,gradientStart:v,gradientStop:y,filterColor:b}=h;if(_){let e=d.append(`defs`).append(`linearGradient`).attr(`id`,i+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,v).attr(`stop-opacity`,1),e.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,y).attr(`stop-opacity`,1)}f===`neo`&&I.has(p??``)&&d.append(`defs`).append(`filter`).attr(`id`,i+`-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,b);let x=0;u.forEach((e,t)=>{let n=q(e.name),r=d.append(`g`),i=r.insert(`g`).attr(`class`,`branchLabel`),a=i.insert(`g`).attr(`class`,`label branch-label`);a.node()?.appendChild(n);let o=n.getBBox();x=ze(e.name,x,t,o,l),a.remove(),i.remove(),r.remove()}),Y(d,U,!1,c),c.showBranches&&Re(d,u,c,i),Le(d,U),Y(d,U,!0,c),g.insertTitle(d,`gitTitleText`,c.titleTopMargin??0,s.getDiagramTitle()),m(void 0,d,c.diagramPadding,c.useMaxWidth)},`draw`)},Z=8,Q=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),Ve=new Set([`redux-color`,`redux-dark-color`]),$=new Set([`neo`,`neo-dark`]),He=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),Ue=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`,`neo`,`neo-dark`]),We=e(e=>{let{svgId:t}=e,n=``;if(e.useGradient&&t)for(let r=0;r<e.THEME_COLOR_LIMIT;r++)n+=`
15
+ .label${r} { fill: ${e.mainBkg}; stroke: url(${t}-gradient); stroke-width: ${e.strokeWidth};}
16
+ `;return n},`genGitGraphGradient`),Ge=e(e=>{let{theme:t,themeVariables:n}=d(),{borderColorArray:r}=n,i=Q.has(t);if($.has(t)){let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)if(n===0)t+=`
17
+ .branch-label${n} { fill: ${e.nodeBorder};}
18
+ .commit${n} { stroke: ${e.nodeBorder}; }
19
+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
20
+ .arrow${n} { stroke: ${e.nodeBorder}; }
21
+ .commit-bullets { fill: ${e.nodeBorder}; }
22
+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
23
+ ${We(e)}`;else{let r=n%Z;t+=`
24
+ .branch-label${n} { fill: ${e[`gitBranchLabel`+r]}; }
25
+ .commit${n} { stroke: ${e[`git`+r]}; fill: ${e[`git`+r]}; }
26
+ .commit-highlight${n} { stroke: ${e[`gitInv`+r]}; fill: ${e[`gitInv`+r]}; }
27
+ .arrow${n} { stroke: ${e[`git`+r]}; }
28
+ `}return t}if(Ve.has(t)){let n=``;for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
29
+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
30
+ .commit${a} { stroke: ${e.nodeBorder}; }
31
+ .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
32
+ .label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``} }
33
+ .arrow${a} { stroke: ${e.nodeBorder}; }
34
+ .commit-bullets { fill: ${e.nodeBorder}; }
35
+ `;else{let o=a%r.length;n+=`
36
+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
37
+ .commit${a} { stroke: ${r[o]}; fill: ${r[o]}; }
38
+ .commit-highlight${a} { stroke: ${r[o]}; fill: ${r[o]}; }
39
+ .label${a} { fill: ${He.has(t)?e.mainBkg:r[o]}; stroke: ${r[o]}; stroke-width: ${e.strokeWidth}; }
40
+ .arrow${a} { stroke: ${r[o]}; }
41
+ `}return n}{let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)t+=`
42
+ .branch-label${n} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
43
+ .commit${n} { stroke: ${e.nodeBorder}; }
44
+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
45
+ .label${n} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``}}
46
+ .arrow${n} { stroke: ${e.nodeBorder}; }
47
+ .commit-bullets { fill: ${e.nodeBorder}; }
48
+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
49
+ `;return t}},`genColor`),Ke=e(e=>`${Array.from({length:e.THEME_COLOR_LIMIT},(e,t)=>t).map(t=>{let n=t%Z;return`
50
+ .branch-label${t} { fill: ${e[`gitBranchLabel`+n]}; }
51
+ .commit${t} { stroke: ${e[`git`+n]}; fill: ${e[`git`+n]}; }
52
+ .commit-highlight${t} { stroke: ${e[`gitInv`+n]}; fill: ${e[`gitInv`+n]}; }
53
+ .label${t} { fill: ${e[`git`+n]}; }
54
+ .arrow${t} { stroke: ${e[`git`+n]}; }
55
+ `}).join(`
56
+ `)}`,`normalTheme`),qe={parser:be,db:A,renderer:Be,styles:e(e=>{let{theme:t}=d(),n=Ue.has(t);return`
57
+ .commit-id,
58
+ .commit-msg,
59
+ .branch-label {
60
+ fill: lightgrey;
61
+ color: lightgrey;
62
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
63
+ font-family: var(--mermaid-font-family);
64
+ }
65
+
66
+ ${n?Ge(e):Ke(e)}
67
+
68
+ .branch {
69
+ stroke-width: ${e.strokeWidth};
70
+ stroke: ${e.commitLineColor??e.lineColor};
71
+ stroke-dasharray: ${n?`4 2`:`2`};
72
+ }
73
+ .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n?e.nodeBorder:e.commitLabelColor}; ${n?`font-weight:${e.noteFontWeight};`:``}}
74
+ .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n?`transparent`:e.commitLabelBackground}; opacity: ${n?``:.5}; }
75
+ .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
76
+ .tag-label-bkg { fill: ${n?e.mainBkg:e.tagLabelBackground}; stroke: ${n?e.nodeBorder:e.tagLabelBorder}; ${n?`filter:${e.dropShadow}`:``} }
77
+ .tag-hole { fill: ${e.textColor}; }
78
+
79
+ .commit-merge {
80
+ stroke: ${n?e.mainBkg:e.primaryColor};
81
+ fill: ${n?e.mainBkg:e.primaryColor};
82
+ }
83
+ .commit-reverse {
84
+ stroke: ${n?e.mainBkg:e.primaryColor};
85
+ fill: ${n?e.mainBkg:e.primaryColor};
86
+ stroke-width: ${n?e.strokeWidth:3};
87
+ }
88
+ .commit-highlight-outer {
89
+ }
90
+ .commit-highlight-inner {
91
+ stroke: ${n?e.mainBkg:e.primaryColor};
92
+ fill: ${n?e.mainBkg:e.primaryColor};
93
+ }
94
+
95
+ .arrow {
96
+ /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
97
+ stroke-width: ${Q.has(t)?e.strokeWidth:8};
98
+ stroke-linecap: round;
99
+ fill: none
100
+ }
101
+ .gitTitleText {
102
+ text-anchor: middle;
103
+ font-size: 18px;
104
+ fill: ${e.textColor};
105
+ }
106
+ `},`getStyles`)};export{qe as diagram};
@@ -0,0 +1,15 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{M as t,V as n,q as r}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{$ as i,C as a,D as o,E as s,H as c,I as l,J as u,L as d,N as f,O as p,W as m,_ as h,at as g,d as _,et as v,f as y,g as b,i as x,l as S,m as C,nt as w,p as ee,rt as te,s as T,tt as E,u as ne}from"./chunk-QJSWEUOL-kvKBktmc.js";import{t as re}from"./chunk-IJBDOHL6-CgcssvZb.js";import"./chunk-4CAJECRU-C_QnaDal.js";import"./chunk-5IMINLNL-Cl3N81sR.js";import"./chunk-ZNLK7HRR-B-wIfXTw.js";import{r as ie}from"./chunk-2NMSUPJH-DuxvnX1p.js";import"./chunk-STOV2HOB-GnExfzIX.js";import{a as ae,c as oe,h as se,o as D,r as ce,t as le,u as ue}from"./chunk-VY2OSTJR-BYk2nUI_.js";import{i as de}from"./chunk-DZP67EKU-9RpG5Rdc.js";import"./chunk-Z6V44ARX-CWGOZvke.js";import"./chunk-VRZKL3EH-BzaZ6KlD.js";import"./chunk-ZQN7UHIL-CNp35E78.js";import"./chunk-4OADUZ5Q-DHE3k_pb.js";import"./chunk-WUBWJARI-Z8MI6quX.js";import{n as fe,t as pe}from"./chunk-NUDPKBEF-CL0e9XiQ.js";import{t as me}from"./chunk-YDMLL4PJ-BHgx6nXf.js";var he={id:`c4`,detector:e(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./c4Diagram-3NLNHZP5-at-f4FDi.js`);return{id:`c4`,diagram:e}},`loader`)},ge=`flowchart`,_e={id:ge,detector:e((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./flowDiagram-YHGXBVSY-CrSHzFwR.js`);return{id:ge,diagram:e}},`loader`)},ve=`flowchart-v2`,ye={id:ve,detector:e((e,t)=>t?.flowchart?.defaultRenderer!==`dagre-d3`&&(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./flowDiagram-YHGXBVSY-CrSHzFwR.js`);return{id:ve,diagram:e}},`loader`)},be=`swimlane`,xe={id:be,detector:e(e=>/^\s*swimlane-beta\b/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./swimlanesDiagram-JKPDBFCN-C2sgVGQE.js`);return{id:be,diagram:e}},`loader`)},Se={id:`er`,detector:e(e=>/^\s*erDiagram/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./erDiagram-H3ERR26V-CN4pCzIq.js`);return{id:`er`,diagram:e}},`loader`)},Ce=`gitGraph`,we={id:Ce,detector:e(e=>/^\s*gitGraph/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-MAR6GKOP-peAd7EYO.js`);return{id:Ce,diagram:e}},`loader`)},Te=`gantt`,Ee={id:Te,detector:e(e=>/^\s*gantt/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./ganttDiagram-RWFTB7ED-C-rfEOn5.js`);return{id:Te,diagram:e}},`loader`)},De=`info`,Oe={id:De,detector:e(e=>/^\s*info/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./infoDiagram-LV547AFH-C46dOKDG.js`);return{id:De,diagram:e}},`loader`)},ke={id:`pie`,detector:e(e=>/^\s*pie/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./pieDiagram-EFA7CBSB-BzO4xw8C.js`);return{id:`pie`,diagram:e}},`loader`)},Ae=`quadrantChart`,je={id:Ae,detector:e(e=>/^\s*quadrantChart/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./quadrantDiagram-WARVYA7P-DMQd2xKZ.js`);return{id:Ae,diagram:e}},`loader`)},Me=`xychart`,Ne={id:Me,detector:e(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./xychartDiagram-XJAZEDNM-O9bztWNh.js`);return{id:Me,diagram:e}},`loader`)},Pe=`requirement`,Fe={id:Pe,detector:e(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./requirementDiagram-SXREGOKZ-CtCO7u9U.js`);return{id:Pe,diagram:e}},`loader`)},Ie=`sequence`,Le={id:Ie,detector:e(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./sequenceDiagram-52ZFIFDL-B1rSqWZp.js`);return{id:Ie,diagram:e}},`loader`)},Re=`class`,ze={id:Re,detector:e((e,t)=>t?.class?.defaultRenderer!==`dagre-wrapper`&&/^\s*classDiagram/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./classDiagram-FGAMPOII-D1sf64vv.js`);return{id:Re,diagram:e}},`loader`)},Be=`classDiagram`,Ve={id:Be,detector:e((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./classDiagram-v2-AI5RJEK4-D1sf64vv.js`);return{id:Be,diagram:e}},`loader`)},He=`state`,Ue={id:He,detector:e((e,t)=>t?.state?.defaultRenderer!==`dagre-wrapper`&&/^\s*stateDiagram/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./stateDiagram-3QAKPIVI-3KzWPUq3.js`);return{id:He,diagram:e}},`loader`)},We=`stateDiagram`,Ge={id:We,detector:e((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-HN2P4RDZ-dXASbYMy.js`);return{id:We,diagram:e}},`loader`)},Ke=`journey`,qe={id:Ke,detector:e(e=>/^\s*journey/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./journeyDiagram-EW5QJT4W-CNAhUHsQ.js`);return{id:Ke,diagram:e}},`loader`)},Je={draw:e((e,t,n)=>{r.debug(`rendering svg for syntax error
2
+ `);let i=re(t),a=i.append(`g`);i.attr(`viewBox`,`0 0 2412 512`),p(i,100,512,!0),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Ye=Je,Xe={db:{},renderer:Je,parser:{parse:e(()=>{},`parse`)}},Ze=`flowchart-elk`,Qe={id:Ze,detector:e((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:e(async()=>{let{diagram:e}=await import(`./flowDiagram-YHGXBVSY-CrSHzFwR.js`);return{id:Ze,diagram:e}},`loader`)},$e=`timeline`,et={id:$e,detector:e(e=>/^\s*timeline/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./timeline-definition-GS45XAXW-DLn0_RV5.js`);return{id:$e,diagram:e}},`loader`)},tt=`mindmap`,nt={id:tt,detector:e(e=>/^\s*mindmap/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./mindmap-definition-VBJCLQLM-DZceCWFq.js`);return{id:tt,diagram:e}},`loader`)},rt=`kanban`,it={id:rt,detector:e(e=>/^\s*kanban/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./kanban-definition-JSQERAZB-uOEoksHt.js`);return{id:rt,diagram:e}},`loader`)},at=`sankey`,ot={id:at,detector:e(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./sankeyDiagram-VV74M2VP-CPXqmSKK.js`);return{id:at,diagram:e}},`loader`)},st=`packet`,ct={id:st,detector:e(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./diagram-AE4NWXFW-B3Lkw8MS.js`);return{id:st,diagram:e}},`loader`)},lt=`radar`,ut={id:lt,detector:e(e=>/^\s*radar-beta/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./diagram-BUJID5UG-p2ajLLgr.js`);return{id:lt,diagram:e}},`loader`)},dt=`block`,ft={id:dt,detector:e(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./blockDiagram-PUWGUBOA-DAfWpjz7.js`);return{id:dt,diagram:e}},`loader`)},pt=`treeView`,mt={id:pt,detector:e(e=>/^\s*treeView-beta/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./diagram-EYOLEXXS-DDoUndBV.js`);return{id:pt,diagram:e}},`loader`)},ht=`architecture`,gt={id:ht,detector:e(e=>/^\s*architecture/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./architectureDiagram-2PNWDENW-CI3fLWIN.js`);return{id:ht,diagram:e}},`loader`)},_t=`eventmodeling`,vt={id:_t,detector:e(e=>/^\s*eventmodeling/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./diagram-P7B6PWOJ-C_dSNQyG.js`);return{id:_t,diagram:e}},`loader`)},yt=`ishikawa`,bt={id:yt,detector:e(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-PUJQGNDS-DUmHXvO9.js`);return{id:yt,diagram:e}},`loader`)},xt=`venn`,St={id:xt,detector:e(e=>/^\s*venn-beta/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./vennDiagram-QIQU2ZRJ-FxbUp7-Z.js`);return{id:xt,diagram:e}},`loader`)},Ct=`treemap`,wt={id:Ct,detector:e(e=>/^\s*treemap/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./diagram-C44CZ5NI-CO0U1GX-.js`);return{id:Ct,diagram:e}},`loader`)},Tt=`wardley`,Et={id:Tt,detector:e(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./wardleyDiagram-U6YNM66N-l-Kvr0Az.js`);return{id:Tt,diagram:e}},`loader`)},Dt=`cynefin`,Ot={id:Dt,detector:e(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./cynefinDiagram-2OOWUY4M-5ACKe62t.js`);return{id:Dt,diagram:e}},`loader`)},kt=`railroad`,At={id:kt,detector:e(e=>/^\s*railroad-beta/i.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./railroadDiagram-5NIQVNLQ-BGyZ628g.js`);return{id:kt,diagram:e}},`loader`)},jt=`railroadEbnf`,Mt={id:jt,detector:e(e=>/^\s*railroad-ebnf-beta/i.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./ebnfDiagram-FTPZ3PV6-DIwB5te0.js`);return{id:jt,diagram:e}},`loader`)},Nt=`railroadAbnf`,Pt={id:Nt,detector:e(e=>/^\s*railroad-abnf-beta/i.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./abnfDiagram-PAR5IXJI-Ibbj5eGO.js`);return{id:Nt,diagram:e}},`loader`)},Ft=`railroadPeg`,It={id:Ft,detector:e(e=>/^\s*railroad-peg-beta/i.test(e),`detector`),loader:e(async()=>{let{diagram:e}=await import(`./pegDiagram-7WILOQTJ-DMKA8PUf.js`);return{id:Ft,diagram:e}},`loader`)},Lt=!1,O=e(()=>{Lt||(Lt=!0,v(`error`,Xe,e=>e.toLowerCase().trim()===`error`),v(`---`,{db:{clear:e(()=>{},`clear`)},styles:{},renderer:{draw:e(()=>{},`draw`)},parser:{parse:e(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:e(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),T(Qe,nt,gt),T(he,it,Ve,ze,Se,Ee,Oe,ke,Fe,Le,xe,ye,_e,et,we,Ge,Ue,qe,je,ot,ct,Ne,ft,vt,mt,ut,bt,wt,At,Mt,Pt,It,St,Et,Ot))},`addDiagrams`),Rt=e(async()=>{r.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(w).map(async([e,{detector:t,loader:n}])=>{if(n)try{E(e)}catch{try{let{diagram:e,id:r}=await n();v(r,e,t)}catch(t){throw r.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete w[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){r.error(`Failed to load ${e.length} external diagrams`);for(let t of e)r.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),k=`comm`,zt=`rule`,Bt=`decl`,Vt=`@media`,Ht=`@import`,Ut=`@supports`,Wt=`@namespace`,Gt=`@keyframes`,Kt=`@layer`,qt=`@scope`,Jt=Math.abs,Yt=String.fromCharCode;function Xt(e){return e.trim()}e(Xt,`trim`);function A(e,t,n){return e.replace(t,n)}e(A,`replace`);function Zt(e,t,n){return e.indexOf(t,n)}e(Zt,`indexof`);function j(e,t){return e.charCodeAt(t)|0}e(j,`charat`);function M(e,t,n){return e.slice(t,n)}e(M,`substr`);function N(e){return e.length}e(N,`strlen`);function Qt(e){return e.length}e(Qt,`sizeof`);function P(e,t){return t.push(e),e}e(P,`append`);var F=1,I=1,$t=0,L=0,R=0,z=``;function B(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:F,column:I,length:o,return:``,siblings:s}}e(B,`node`);function en(){return R}e(en,`char`);function tn(){return R=L>0?j(z,--L):0,I--,R===10&&(I=1,F--),R}e(tn,`prev`);function V(){return R=L<$t?j(z,L++):0,I++,R===10&&(I=1,F++),R}e(V,`next`);function H(){return j(z,L)}e(H,`peek`);function U(){return L}e(U,`caret`);function W(e,t){return M(z,e,t)}e(W,`slice`);function G(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}e(G,`token`);function nn(e){return F=I=1,$t=N(z=e),L=0,[]}e(nn,`alloc`);function rn(e){return z=``,e}e(rn,`dealloc`);function K(e){return Xt(W(L-1,q(e===91?e+2:e===40?e+1:e)))}e(K,`delimit`);function an(e){for(;(R=H())&&R<33;)V();return G(e)>2||G(R)>3?``:` `}e(an,`whitespace`);function on(e,t){for(;--t&&V()&&!(R<48||R>102||R>57&&R<65||R>70&&R<97););return W(e,U()+(t<6&&H()==32&&V()==32))}e(on,`escaping`);function q(e){for(;V();)switch(R){case e:return L;case 34:case 39:e!==34&&e!==39&&q(R);break;case 40:e===41&&q(e);break;case 92:V()}return L}e(q,`delimiter`);function sn(e,t){for(;V()&&e+R!==57&&(e+R!==84||H()!==47););return`/*`+W(t,L-1)+`*`+Yt(e===47?e:V())}e(sn,`commenter`);function cn(e){for(;!G(H());)V();return W(e,L)}e(cn,`identifier`);function ln(e){return rn(J(``,null,null,null,[``],e=nn(e),0,[0],e))}e(ln,`compile`);function J(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=V()){case 40:if(m!=108&&j(C,d-1)==58){Zt(C+=A(K(v),`&`,`&\f`),`&\f`,Jt(l?s[l-1]:0))!=-1&&(_=-1);break}case 34:case 39:case 91:C+=K(v);break;case 9:case 10:case 13:case 32:C+=an(m);break;case 92:C+=on(U()-1,7);continue;case 47:switch(H()){case 42:case 47:P(dn(sn(V(),U()),t,n,c),c),(G(m||1)==5||G(H()||1)==5)&&N(C)&&M(C,-1,void 0)!==` `&&(C+=` `);break;default:C+=`/`}break;case 123*h:s[l++]=N(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=A(C,/\f/g,``)),p>0&&(N(C)-d||h===0&&m===47)&&P(p>32?fn(C+`;`,r,n,d-1,c):fn(A(C,` `,``)+`;`,r,n,d-2,c),c);break;case 59:C+=`;`;default:if(P(S=un(C,t,n,l,u,i,s,y,b=[],x=[],d,a),a),v===123){if(u===0)J(C,t,S,S,b,a,d,s,x);else{switch(f){case 99:if(j(C,3)===110)break;case 108:if(j(C,2)===97)break;default:u=0;case 100:case 109:case 115:}u?J(e,S,S,r&&P(un(e,S,S,0,0,i,s,y,i,b=[],d,x),x),i,x,d,s,r?b:x):J(C,S,S,S,[``],x,0,s,x)}}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+N(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&tn()==125)continue}switch(C+=Yt(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(N(C)-1)*_,_=1;break;case 64:H()===45&&(C+=K(V())),f=H(),u=d=N(y=C+=cn(U())),v++;break;case 45:m===45&&N(C)==2&&(h=0)}}return a}e(J,`parse`);function un(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Qt(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=M(e,f+1,f=Jt(g=o[h])),b=e;v<m;++v)(b=Xt(g>0?p[v]+` `+y:A(y,/&\f/g,p[v])))&&(c[_++]=b);return B(e,t,n,i===0?zt:s,c,l,u,d)}e(un,`ruleset`);function dn(e,t,n,r){return B(e,t,n,k,Yt(en()),M(e,2,-2),0,r)}e(dn,`comment`);function fn(e,t,n,r,i){return B(e,t,n,Bt,M(e,0,r),M(e,r+1,-1),r,i)}e(fn,`declaration`);function Y(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}e(Y,`serialize`);function pn(e,t,n,r){switch(e.type){case Kt:if(e.children.length)break;case Ht:case Wt:case Bt:return e.return=e.return||e.value;case k:return``;case Gt:return e.return=e.value+`{`+Y(e.children,r)+`}`;case zt:if(!N(e.value=e.props.join(`,`)))return``}return N(n=Y(e.children,r))?e.return=e.value+`{`+n+`}`:``}e(pn,`stringify`);function mn(e){var t=Qt(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}e(mn,`middleware`);var hn=`graphics-document document`;function gn(e,t){e.attr(`role`,hn),t!==``&&e.attr(`aria-roledescription`,t)}e(gn,`setA11yDiagramInfo`);function _n(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}e(_n,`addSVGa11yTitleDescription`);var vn=class t{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{e(this,`Diagram`)}static async fromText(e,n={}){let r=S(),i=o(e,r);e=ue(e)+`
3
+ `;try{E(i)}catch{let e=C(i);if(!e)throw new te(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();v(t,n)}let{db:a,parser:s,renderer:c,init:l}=E(i);return s.parser&&(s.parser.yy=a),a.clear?.(),l?.(r),n.title&&a.setDiagramTitle?.(n.title),await s.parse(e),new t(i,e,a,s,c)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},yn=[],bn=e(()=>{yn.forEach(e=>{e()}),yn=[]},`attachFunctions`),xn=e(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function Sn(e){let t=e.match(ne);if(!t)return{text:e,metadata:{}};let n=t[1],r=n?t[2].split(`
4
+ `).map(e=>e.startsWith(n)?e.slice(n.length):e).join(`
5
+ `):t[2],i=fe(r,{schema:pe})??{};i=typeof i==`object`&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}e(Sn,`extractFrontMatter`);var Cn=e(e=>e.replace(/\r\n?/g,`
6
+ `).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),wn=e(e=>{let{text:t,metadata:n}=Sn(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),Tn=e(e=>{let t=D.detectInit(e)??{},n=D.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:le(e),directive:t}},`processDirectives`);function En(e){let t=wn(Cn(e)),n=Tn(t.text),r=ae(t.config,n.directive);return e=xn(n.text),{code:e,title:t.title,config:r}}e(En,`preprocessDiagram`);function Dn(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}e(Dn,`toBase64`);var On=5e4,kn=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,An=`sandbox`,jn=`loose`,Mn=`http://www.w3.org/2000/svg`,Nn=`http://www.w3.org/1999/xlink`,Pn=`http://www.w3.org/1999/xhtml`,Fn=`100%`,In=`100%`,Ln=`border:0;margin:0;`,Rn=`margin:0`,zn=`allow-top-navigation-by-user-activation allow-popups`,Bn=`The "iframe" tag is not supported by your browser.`,Vn=[`foreignobject`],Hn=[`dominant-baseline`];function Un(e){let t=En(e);return _(),y(t.config??{}),t}e(Un,`processAndSetConfigs`);async function Wn(e,t){O();try{let{code:t,config:n}=Un(e);return{diagramType:(await nr(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}e(Wn,`parse`);var Gn=e((e,t,n=[])=>`.${e} ${t} ${ee(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),Kn=e((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=x(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{se(e.styles)||r.forEach(t=>{n.insertRule(Gn(e.id,t,e.styles),n.cssRules.length)}),se(e.textStyles)||n.insertRule(Gn(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0){if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=u(t)+`
7
+ `}else r+=`${e.themeCSS}
8
+ `}return r+u(n)},`createCssStyles`),qn=e((t,n)=>Y(ln(`${t}{${n}}`),mn([e(function(e,n,i,a){if(e.type===`rule`&&Array.isArray(e.props)){if(e.parent&&e.parent.type===Gt)return;e.props=e.props.map(n=>n===t&&Array.isArray(e.children)&&e.children.every(e=>e.type===`decl`&&new Set([`font-family`,`font-size`,`fill`]).has(e.props))||(n.startsWith(`${t} `)||n.startsWith(`${t}>`))&&!n.startsWith(`${t} ||`)?n:`${t} ${n}`)}else e.type.startsWith(`@`)&&([Vt,Ut,Kt,qt,`@container`,`@starting-style`,Gt].includes(e.type)||(r.warn(`Removing unsupported at-rule ${e.type} from CSS`),e.type=k))},`addNamespace`),pn])),`compileCSS`),Jn=e((e,t,n,r)=>{let i=Kn(e,n);return qn(r,m(t,i,{...e.themeVariables,theme:e.theme,look:e.look},r))},`createUserStyles`),Yn=e((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=ce(r),r=r.replace(/<br>/g,`<br/>`),r},`cleanUpSvgCode`),Xn=e((e=``,t)=>`<iframe style="width:${Fn};height:${t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+`px`:In};${Ln}" src="data:text/html;charset=UTF-8;base64,${Dn(`<body style="${Rn}">${e}</body>`)}" sandbox="${zn}">
9
+ ${Bn}
10
+ </iframe>`,`putIntoIFrame`),Zn=e((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,Mn);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function Qn(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}e(Qn,`sandboxedIframe`);var $n=e((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),er=e(async function(t,i,a){O();let o=Un(i);i=o.code;let s=S();r.debug(s),i.length>(s?.maxTextSize??On)&&(i=kn);let c=`#${t}`,u=`i`+t,d=`#`+u,f=`d`+t,p=`#`+f,m=e(()=>{let e=n(_?d:p).node();e&&`remove`in e&&e.remove()},`removeTempElements`),g=n(document.body),_=s.securityLevel===An,v=s.securityLevel===jn,y=s.fontFamily;if(a!==void 0){if(a&&(a.innerHTML=``),_){let e=Qn(n(a),u);g=n(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=n(a);Zn(g,t,f,`font-family: ${y}`,Nn)}else{if($n(document,t,f,u),_){let e=Qn(n(document.body),u);g=n(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=n(`body`);Zn(g,t,f)}let b,x;try{b=await vn.fromText(i,{title:o.title})}catch(e){if(s.suppressErrorRendering)throw m(),e;b=await vn.fromText(`error`),x=e}let C=g.select(p).node(),w=b.type,ee=C.firstChild,te=ee.firstChild,T=b.renderer.getClasses?.(i,b),E=Jn(s,w,T,c),ne=document.createElement(`style`);ne.innerHTML=E,ee.insertBefore(ne,te);try{await b.renderer.draw(i,t,`11.17.2`,b)}catch(e){throw s.suppressErrorRendering?m():Ye.draw(i,t,`11.17.2`),e}let re=g.select(`${p} svg`),ie=b.db.getAccTitle?.(),ae=b.db.getAccDescription?.();rr(w,re,ie,ae);let oe=e(()=>{g.select(`[id="${t}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,Pn);let e=g.select(p).node().innerHTML;if(r.debug(`config.arrowMarkerAbsolute`,s.arrowMarkerAbsolute),e=Yn(e,_,l(s.arrowMarkerAbsolute)),_){let t=g.select(p+` svg`).node();e=Xn(e,t)}else v||(e=h.sanitize(e,{ADD_TAGS:Vn,ADD_ATTR:Hn,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return bn(),e},`serializeSvg`)();if(x)throw x;return m(),{diagramType:w,svg:oe,bindFunctions:b.db.bindFunctions}},`render`);function tr(e={}){let n=c({},e);n?.fontFamily&&!n.themeVariables?.fontFamily&&(n.themeVariables||={},n.themeVariables.fontFamily=n.fontFamily),g(n),n?.theme&&n.theme in d?n.themeVariables=d[n.theme].getThemeVariables(n.themeVariables):n&&(n.themeVariables=d.default.getThemeVariables(n.themeVariables));let r=typeof n==`object`?i(n):a();t(r.logLevel),O()}e(tr,`initialize`);var nr=e((e,t={})=>{let{code:n}=En(e);return vn.fromText(n,t)},`getDiagramFromText`);function rr(e,t,n,r){gn(t,e),_n(t,n,r,t.attr(`id`))}e(rr,`addA11yInfo`);var X=Object.freeze({render:er,parse:Wn,getDiagramFromText:nr,initialize:tr,getConfig:S,setConfig:f,getSiteConfig:a,updateSiteConfig:b,reset:e(()=>{_()},`reset`),globalReset:e(()=>{_(s)},`globalReset`),defaultConfig:s});t(S().logLevel),_(S());var ir=e((e,t,n)=>{r.warn(e),oe(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),ar=e(async function(e={querySelector:`.mermaid`}){try{await or(e)}catch(t){if(oe(t)&&r.error(t.str),Q.parseError&&Q.parseError(t),!e.suppressErrors)throw r.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),or=e(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let i=X.getConfig();r.debug(`${e?``:`No `}Callback function found`);let a;if(n)a=n;else if(t)a=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);r.debug(`Found ${a.length} diagrams`),i?.startOnLoad!==void 0&&(r.debug(`Start On Load: `+i?.startOnLoad),X.updateSiteConfig({startOnLoad:i?.startOnLoad}));let o=new D.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed),s,c=[];for(let t of Array.from(a)){if(r.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${o.next()}`;s=t.innerHTML,s=de(D.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let i=D.detectInit(s);i&&r.debug(`Detected early reinit: `,i);try{let{svg:r,bindFunctions:i}=await hr(n,s,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){ir(e,c,Q.parseError)}}if(c.length>0)throw c[0]},`runThrowsErrors`),sr=e(function(e){X.initialize(e)},`initialize`),cr=e(async function(e,t,n){r.warn(`mermaid.init is deprecated. Please use run instead.`),e&&sr(e);let i={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?i.querySelector=t:t&&(i.nodes=t instanceof HTMLElement?[t]:t),await ar(i)},`init`),lr=e(async(e,{lazyLoad:t=!0}={})=>{O(),T(...e),t===!1&&await Rt()},`registerExternalDiagrams`),ur=e(function(){if(Q.startOnLoad){let{startOnLoad:e}=X.getConfig();e&&Q.run().catch(e=>r.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,ur,!1);var dr=e(function(e){Q.parseError=e},`setParseErrorHandler`),Z=[],fr=!1,pr=e(async()=>{if(!fr){for(fr=!0;Z.length>0;){let e=Z.shift();if(e)try{await e()}catch(e){r.error(`Error executing queue`,e)}}fr=!1}},`executeQueue`),mr=e(async(t,n)=>new Promise((i,a)=>{let o=e(()=>new Promise((e,o)=>{X.parse(t,n).then(t=>{e(t),i(t)},e=>{r.error(`Error parsing`,e),Q.parseError?.(e),o(e),a(e)})}),`performCall`);Z.push(o),pr().catch(a)}),`parse`),hr=e((t,n,i)=>new Promise((a,o)=>{let s=e(()=>new Promise((e,s)=>{X.render(t,n,i).then(t=>{e(t),a(t)},e=>{r.error(`Error parsing`,e),Q.parseError?.(e),s(e),o(e)})}),`performCall`);Z.push(s),pr().catch(o)}),`render`),gr=e(()=>Object.keys(w).map(e=>({id:e})),`getRegisteredDiagramsMetadata`),Q={startOnLoad:!0,mermaidAPI:X,parse:mr,render:hr,init:cr,run:ar,registerExternalDiagrams:lr,registerLayoutLoaders:me,initialize:sr,parseError:void 0,contentLoaded:ur,setParseErrorHandler:dr,detectType:o,registerIconPacks:ie,getRegisteredDiagramsMetadata:gr};
11
+ /*! Check if previously processed */
12
+ /*!
13
+ * Wait for document loaded before starting the execution
14
+ */
15
+ const _r=Q;function vr(e){let t=document.createElement(`div`);t.style.cssText=`display:none; color: var(${e})`,document.body.append(t);let n=getComputedStyle(t).color;t.remove();let r=document.createElement(`canvas`);r.width=r.height=1;let i=r.getContext(`2d`);i.fillStyle=n,i.fillRect(0,0,1,1);let[a,o,s]=i.getImageData(0,0,1,1).data;return`#${[a,o,s].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function yr(){let e=e=>vr(e);return{theme:`base`,themeVariables:{background:e(`--sb-color-black`),mainBkg:e(`--sb-color-gray-7`),secondaryColor:e(`--sb-color-gray-6`),tertiaryColor:e(`--sb-color-gray-5`),clusterBkg:e(`--sb-color-gray-7`),primaryBorderColor:e(`--sb-color-accent`),secondaryBorderColor:e(`--sb-color-gray-4`),tertiaryBorderColor:e(`--sb-color-gray-5`),primaryTextColor:e(`--sb-color-gray-0`),secondaryTextColor:e(`--sb-color-gray-1`),tertiaryTextColor:e(`--sb-color-gray-2`),titleColor:e(`--sb-color-gray-1`),edgeLabelBackground:e(`--sb-color-gray-6`),primaryColor:e(`--sb-color-accent`),lineColor:e(`--sb-color-gray-3`),fontFamily:`ui-sans-serif, system-ui, sans-serif`,fontSize:`14px`}}}for(let e of document.querySelectorAll(`.mermaid`))e.dataset.src=e.textContent.trim();async function $(){for(let e of document.querySelectorAll(`.mermaid`))e.textContent=e.dataset.src??``,delete e.dataset.processed;_r.initialize({startOnLoad:!1,...yr()}),await _r.run()}await $(),document.addEventListener(`color-scheme-changed`,$);export{$ as renderDiagrams};
@@ -0,0 +1 @@
1
+ import"./chunk-ZS6VBONO-D-IFTJgn.js";import{t as e}from"./chunk-3NPNU5GP-8WYybYAh.js";export{e as createInfoServices};
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{q as t}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{O as n}from"./chunk-QJSWEUOL-kvKBktmc.js";import{t as r}from"./chunk-IJBDOHL6-CgcssvZb.js";import"./chunk-ZS6VBONO-D-IFTJgn.js";import{t as i}from"./chunk-5IQCK5RY-Df5Ppxew.js";import"./chunk-JZGDI5JK-BspJQ1vQ.js";import"./chunk-OJINMHTS-rKnCIFV0.js";import"./chunk-VQC2EELJ-sGo2yn97.js";import"./chunk-KD6SPIPN-4bKl37hM.js";import"./chunk-Q6NGPIAH-CM9NYxWM.js";import"./chunk-RT4MAWR3-Cv_8LyN5.js";import"./chunk-YBMQ5JGJ-DlZ1nCKo.js";import"./chunk-GDY2UAB4-QtXfmDIW.js";import"./chunk-3SMGFRGC-C0WC5bhP.js";import"./chunk-3NPNU5GP-8WYybYAh.js";import"./chunk-TCEHX7R3-BXjgPiQF.js";import"./chunk-5MVFYWFU-DgXg5u6h.js";import"./chunk-SFMINX4W-BW2NSwFJ.js";import"./chunk-JFFVMJIA-Cx1_ZSMR.js";import"./chunk-ZUNWM646-DRKPDcQl.js";var a={parse:e(async e=>{let n=await i(`info`,e);t.debug(n)},`parse`)},o={version:`11.17.2`},s={parser:a,db:{getVersion:e(()=>o.version,`getVersion`)},renderer:{draw:e((e,i,a)=>{t.debug(`rendering info diagram
2
+ `+e);let o=r(i);n(o,100,400,!0),o.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${a}`)},`draw`)}};export{s as diagram};
@@ -0,0 +1,70 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as t,F as n,O as r,Q as i,R as a,V as o,X as s,Y as c,h as l,q as u}from"./chunk-QJSWEUOL-kvKBktmc.js";import{t as d}from"./chunk-IJBDOHL6-CgcssvZb.js";import{t as f}from"./chunk-5IMINLNL-Cl3N81sR.js";import"./chunk-STOV2HOB-GnExfzIX.js";import{p}from"./chunk-VY2OSTJR-BYk2nUI_.js";var m=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,14],i=[1,12],a=[1,13],o=[6,7,8],s=[1,20],c=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={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(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim())}},`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:r,7:[1,10],9:9,12:11,13:i,14:a},t(o,[2,3]),{1:[2,2]},t(o,[2,4]),t(o,[2,5]),{1:[2,6],6:r,12:15,13:i,14:a},{6:r,9:16,12:11,13:i,14:a},{6:s,7:c,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:c,10:22,11:l},{1:[2,7],6:r,12:15,13:i,14:a},t(d,[2,14],{7:f,11:p}),t(m,[2,8]),t(m,[2,9]),t(m,[2,10]),t(u,[2,15]),t(d,[2,13],{7:f,11:p}),t(m,[2,11]),t(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,typeof h.yylloc>`u`&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e;return e=i.pop()||h.lex()||p,typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:((S===null||typeof S>`u`)&&(S=x()),T=s[w]&&s[w][S]),typeof T>`u`||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),typeof E<`u`)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};h.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}})();function g(){this.yy={}}return e(g,`Parser`),g.prototype=h,h.Parser=g,new g})();m.parser=m;var h=m,g=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,`IshikawaDB`)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,l()}getRoot(){return this.root}addNode(e,r){let i=a.sanitizeText(r,t());if(!this.root){this.root={text:i,children:[]},this.stack=[{level:0,node:this.root}],n(i);return}this.baseLevel??=e;let o=e-this.baseLevel+1;for(o<=0&&(o=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=o;)this.stack.pop();let s=this.stack[this.stack.length-1].node,c={text:i,children:[]};s.children.push(c),this.stack.push({level:o,node:c})}getAccTitle(){return o()}setAccTitle(e){i(e)}getAccDescription(){return u()}setAccDescription(e){c(e)}getDiagramTitle(){return s()}setDiagramTitle(e){n(e)}},_=14,v=250,y=30,b=60,x=5,S=82*Math.PI/180,C=Math.cos(S),w=Math.sin(S),T=e((e,t,n)=>{let i=e.node().getBBox(),a=i.width+t*2,o=i.height+t*2;r(e,o,a,n),e.attr(`viewBox`,`${i.x-t} ${i.y-t} ${a} ${o}`)},`applyPaddedViewBox`),E=e((e,n,r,i)=>{let a=i.db.getRoot();if(!a)return;let o=t(),{look:s,handDrawnSeed:c,themeVariables:l}=o,u=p(o.fontSize)[0]??_,m=s===`handDrawn`,h=a.children??[],g=o.ishikawa?.diagramPadding??20,y=o.ishikawa?.useMaxWidth??!1,b=d(n),x=b.append(`g`).attr(`class`,`ishikawa`),S=m?f.svg(b.node()):void 0,C=S?{roughSvg:S,seed:c??0,lineColor:l?.lineColor??`#333`,fillColor:l?.mainBkg??`#fff`}:void 0,w=`ishikawa-arrow-${n}`;m||x.append(`defs`).append(`marker`).attr(`id`,w).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 E=0,k=v,A=m?void 0:L(x,E,k,E,k,`ishikawa-spine`);if(O(x,E,k,a.text,u,C),!h.length){m&&L(x,E,k,E,k,`ishikawa-spine`,C),T(b,g,y);return}E-=20;let j=h.filter((e,t)=>t%2==0),N=h.filter((e,t)=>t%2==1),P=D(j),F=D(N),I=P.total+F.total,R=v,z=v;if(I>0){let e=v*2,t=v*.3;R=Math.max(t,e*(P.total/I)),z=Math.max(t,e*(F.total/I))}let B=u*2;R=Math.max(R,P.max*B),z=Math.max(z,F.max*B),k=Math.max(R,v),A&&A.attr(`y1`,k).attr(`y2`,k),x.select(`.ishikawa-head-group`).attr(`transform`,`translate(0,${k})`);let V=Math.ceil(h.length/2);for(let e=0;e<V;e++){let t=x.append(`g`).attr(`class`,`ishikawa-pair`);for(let[n,r,i]of[[h[e*2],-1,R],[h[e*2+1],1,z]])n&&M(t,n,E,k,r,i,u,C);E=t.selectAll(`text`).nodes().reduce((e,t)=>Math.min(e,t.getBBox().x),1/0)}if(m)L(x,E,k,0,k,`ishikawa-spine`,C);else{A.attr(`x1`,E);let e=`url(#${w})`;x.selectAll(`line.ishikawa-branch, line.ishikawa-sub-branch`).attr(`marker-start`,e)}T(b,g,y)},`draw`),D=e(t=>{let n=e(e=>e.children.reduce((e,t)=>e+1+n(t),0),`countDescendants`);return t.reduce((e,t)=>{let r=n(t);return e.total+=r,e.max=Math.max(e.max,r),e},{total:0,max:0})},`sideStats`),O=e((e,t,n,r,i,a)=>{let o=Math.max(6,Math.floor(110/(i*.6))),s=e.append(`g`).attr(`class`,`ishikawa-head-group`).attr(`transform`,`translate(${t},${n})`),c=F(s,P(r,o),0,0,`ishikawa-head-label`,`start`,i),l=c.node().getBBox(),u=Math.max(60,l.width+6),d=Math.max(40,l.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${u*2.4} 0 0 ${-d/2} Z`;if(a){let e=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-head`)}else s.insert(`path`,`:first-child`).attr(`class`,`ishikawa-head`).attr(`d`,f);c.attr(`transform`,`translate(${(u-l.width)/2-l.x+3},${-l.y-l.height/2})`)},`drawHead`),k=e((t,n)=>{let r=[],i=[],a=e((e,t,o)=>{let s=n===-1?[...e].reverse():e;for(let e of s){let n=r.length,s=e.children??[];r.push({depth:o,text:P(e.text,15),parentIndex:t,childCount:s.length}),o%2==0?(i.push(n),s.length&&a(s,n,o+1)):(s.length&&a(s,n,o+1),i.push(n))}},`walk`);return a(t,-1,2),{entries:r,yOrder:i}},`flattenTree`),A=e((e,t,n,r,i,a,o)=>{let s=e.append(`g`).attr(`class`,`ishikawa-label-group`),c=F(s,t,n,r+11*i,`ishikawa-label cause`,`middle`,a).node().getBBox();if(o){let e=o.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-label-box`)}else s.insert(`rect`,`:first-child`).attr(`class`,`ishikawa-label-box`).attr(`x`,c.x-20).attr(`y`,c.y-2).attr(`width`,c.width+40).attr(`height`,c.height+4)},`drawCauseLabel`),j=e((e,t,n,r,i,a)=>{let o=Math.sqrt(r*r+i*i);if(o===0)return;let s=r/o,c=i/o,l=-c*6,u=s*6,d=t,f=n,p=`M ${d} ${f} L ${d-s*6*2+l} ${f-c*6*2+u} L ${d-s*6*2-l} ${f-c*6*2-u} Z`,m=a.roughSvg.path(p,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:`solid`,stroke:a.lineColor,strokeWidth:1});e.append(()=>m)},`drawArrowMarker`),M=e((e,t,n,r,i,a,o,s)=>{let c=t.children??[],l=a*(c.length?1:.2),u=-C*l,d=w*l*i,f=n+u,p=r+d;if(L(e,n,r,f,p,`ishikawa-branch`,s),s&&j(e,n,r,n-f,r-p,s),A(e,t.text,f,p,i,o,s),!c.length)return;let{entries:m,yOrder:h}=k(c,i),g=m.length,_=Array(g);for(let[e,t]of h.entries())_[t]=r+d*((e+1)/(g+1));let v=new Map;v.set(-1,{x0:n,y0:r,x1:f,y1:p,childCount:c.length,childrenDrawn:0});let S=-C,T=w*i,E=i<0?`ishikawa-label up`:`ishikawa-label down`;for(let[t,n]of m.entries()){let r=_[t],i=v.get(n.parentIndex),a=e.append(`g`).attr(`class`,`ishikawa-sub-group`),c=0,l=0,u=0;if(n.depth%2==0){let e=i.y1-i.y0;c=I(i.x0,i.x1,e?(r-i.y0)/e:.5),l=r,u=c-(n.childCount>0?b+n.childCount*x:y),L(a,c,r,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,r,1,0,s),F(a,n.text,u,r,`ishikawa-label align`,`end`,o)}else{let e=i.childrenDrawn++;c=I(i.x0,i.x1,(i.childCount-e)/(i.childCount+1)),l=i.y0,u=c+S*((r-l)/T),L(a,c,l,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,l,c-u,l-r,s),F(a,n.text,u,r,E,`end`,o)}n.childCount>0&&v.set(t,{x0:c,y0:l,x1:u,y1:r,childCount:n.childCount,childrenDrawn:0})}},`drawBranch`),N=e(e=>e.split(/<br\s*\/?>|\n/),`splitLines`),P=e((e,t)=>{if(e.length<=t)return e;let n=[];for(let r of e.split(/\s+/)){let e=n.length-1;e>=0&&n[e].length+1+r.length<=t?n[e]+=` `+r:n.push(r)}return n.join(`
7
+ `)},`wrapText`),F=e((e,t,n,r,i,a,o)=>{let s=N(t),c=o*1.05,l=e.append(`text`).attr(`class`,i).attr(`text-anchor`,a).attr(`x`,n).attr(`y`,r-(s.length-1)*c/2);for(let[e,t]of s.entries())l.append(`tspan`).attr(`x`,n).attr(`dy`,e===0?0:c).text(t);return l},`drawMultilineText`),I=e((e,t,n)=>e+(t-e)*n,`lerp`),L=e((e,t,n,r,i,a,o)=>{if(o){let s=o.roughSvg.line(t,n,r,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});e.append(()=>s).attr(`class`,a);return}return e.append(`line`).attr(`class`,a).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i)},`drawLine`),R={parser:h,get db(){return new g},renderer:{draw:E},styles:e(e=>`
8
+ .ishikawa .ishikawa-spine,
9
+ .ishikawa .ishikawa-branch,
10
+ .ishikawa .ishikawa-sub-branch {
11
+ stroke: ${e.lineColor};
12
+ stroke-width: 2;
13
+ fill: none;
14
+ }
15
+
16
+ .ishikawa .ishikawa-sub-branch {
17
+ stroke-width: 1;
18
+ }
19
+
20
+ .ishikawa .ishikawa-arrow {
21
+ fill: ${e.lineColor};
22
+ }
23
+
24
+ .ishikawa .ishikawa-head {
25
+ fill: ${e.mainBkg};
26
+ stroke: ${e.lineColor};
27
+ stroke-width: 2;
28
+ }
29
+
30
+ .ishikawa .ishikawa-label-box {
31
+ fill: ${e.mainBkg};
32
+ stroke: ${e.lineColor};
33
+ stroke-width: 2;
34
+ }
35
+
36
+ .ishikawa text {
37
+ font-family: ${e.fontFamily};
38
+ font-size: ${e.fontSize};
39
+ fill: ${e.textColor};
40
+ }
41
+
42
+ .ishikawa .ishikawa-head-label {
43
+ font-weight: 600;
44
+ text-anchor: middle;
45
+ dominant-baseline: middle;
46
+ font-size: 14px;
47
+ }
48
+
49
+ .ishikawa .ishikawa-label {
50
+ text-anchor: end;
51
+ }
52
+
53
+ .ishikawa .ishikawa-label.cause {
54
+ text-anchor: middle;
55
+ dominant-baseline: middle;
56
+ }
57
+
58
+ .ishikawa .ishikawa-label.align {
59
+ text-anchor: end;
60
+ dominant-baseline: middle;
61
+ }
62
+
63
+ .ishikawa .ishikawa-label.up {
64
+ dominant-baseline: baseline;
65
+ }
66
+
67
+ .ishikawa .ishikawa-label.down {
68
+ dominant-baseline: hanging;
69
+ }
70
+ `,`getStyles`)};export{R as diagram};
@@ -0,0 +1,139 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{V as t,W as n}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as r,F as i,O as a,Q as o,V as s,X as c,Y as l,h as u,q as d}from"./chunk-QJSWEUOL-kvKBktmc.js";import"./chunk-STOV2HOB-GnExfzIX.js";import{t as f}from"./chunk-AZZRMDJM-y-xJBuMz.js";import{a as p,c as m,i as h,s as g}from"./chunk-EICP7K5X-8YS1Gtlr.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,11,12,14,16,17,18],r=[1,9],i=[1,10],a=[1,11],o=[1,12],s=[1,13],c=[1,14],l={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:15,11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,5]),t(n,[2,6]),t(n,[2,8]),{13:[1,16]},{15:[1,17]},t(n,[2,11]),t(n,[2,12]),{19:[1,18]},t(n,[2,4]),t(n,[2,9]),t(n,[2,10]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,typeof h.yylloc>`u`&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e;return e=i.pop()||h.lex()||p,typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:((S===null||typeof S>`u`)&&(S=x()),T=s[w]&&s[w][S]),typeof T>`u`||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),typeof E<`u`)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};l.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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 i=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin(`acc_title`),12;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 e(u,`Parser`),u.prototype=l,l.Parser=u,new u})();_.parser=_;var v=_,y=``,b=[],x=[],S=[],C=e(function(){b.length=0,x.length=0,y=``,S.length=0,u()},`clear`),w=e(function(e){y=e,b.push(e)},`addSection`),T=e(function(){return b},`getSections`),E=e(function(){let e=A(),t=0;for(;!e&&t<100;)e=A(),t++;return x.push(...S),x},`getTasks`),D=e(function(){let e=[];return x.forEach(t=>{t.people&&e.push(...t.people)}),[...new Set(e)].sort()},`updateActors`),O=e(function(e,t){let n=t.substr(1).split(`:`),r=0,i=[];n.length===1?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(`,`));let a=i.map(e=>e.trim()),o={section:y,type:y,people:a,task:e,score:r};S.push(o)},`addTask`),k=e(function(e){let t={section:y,type:y,description:e,task:e,classes:[]};x.push(t)},`addTaskOrg`),A=e(function(){let t=e(function(e){return S[e].processed},`compileTask`),n=!0;for(let[e,r]of S.entries())t(e),n&&=r.processed;return n},`compileTasks`),j=e(function(){return D()},`getActors`),M={getConfig:e(()=>r().journey,`getConfig`),clear:C,setDiagramTitle:i,getDiagramTitle:c,setAccTitle:o,getAccTitle:s,setAccDescription:l,getAccDescription:d,addSection:w,getSections:T,getTasks:E,addTask:O,addTaskOrg:k,getActors:j},N=e(e=>`.label {
7
+ font-family: ${e.fontFamily};
8
+ color: ${e.textColor};
9
+ }
10
+ .mouth {
11
+ stroke: #666;
12
+ }
13
+
14
+ line {
15
+ stroke: ${e.textColor}
16
+ }
17
+
18
+ .legend {
19
+ fill: ${e.textColor};
20
+ font-family: ${e.fontFamily};
21
+ }
22
+
23
+ .label text {
24
+ fill: #333;
25
+ }
26
+ .label {
27
+ color: ${e.textColor}
28
+ }
29
+
30
+ .face {
31
+ ${e.faceColor?`fill: ${e.faceColor}`:`fill: #FFF8DC`};
32
+ stroke: #999;
33
+ }
34
+
35
+ .node rect,
36
+ .node circle,
37
+ .node ellipse,
38
+ .node polygon,
39
+ .node path {
40
+ fill: ${e.mainBkg};
41
+ stroke: ${e.nodeBorder};
42
+ stroke-width: 1px;
43
+ }
44
+
45
+ .node .label {
46
+ text-align: center;
47
+ }
48
+ .node.clickable {
49
+ cursor: pointer;
50
+ }
51
+
52
+ .arrowheadPath {
53
+ fill: ${e.arrowheadColor};
54
+ }
55
+
56
+ .edgePaths .path {
57
+ stroke: ${e.lineColor};
58
+ stroke-width: 1.5px;
59
+ }
60
+
61
+ .flowchart-link {
62
+ stroke: ${e.lineColor};
63
+ fill: none;
64
+ }
65
+
66
+ .edgeLabel {
67
+ background-color: ${e.edgeLabelBackground};
68
+ rect {
69
+ opacity: 0.5;
70
+ }
71
+ text-align: center;
72
+ }
73
+
74
+ .cluster rect {
75
+ }
76
+
77
+ .cluster text {
78
+ fill: ${e.titleColor};
79
+ }
80
+
81
+ div.mermaidTooltip {
82
+ position: absolute;
83
+ text-align: center;
84
+ max-width: 200px;
85
+ padding: 2px;
86
+ font-family: ${e.fontFamily};
87
+ font-size: 12px;
88
+ background: ${e.tertiaryColor};
89
+ border: 1px solid ${e.border2};
90
+ border-radius: 2px;
91
+ pointer-events: none;
92
+ z-index: 100;
93
+ }
94
+
95
+ .task-type-0, .section-type-0 {
96
+ ${e.fillType0?`fill: ${e.fillType0}`:``};
97
+ }
98
+ .task-type-1, .section-type-1 {
99
+ ${e.fillType0?`fill: ${e.fillType1}`:``};
100
+ }
101
+ .task-type-2, .section-type-2 {
102
+ ${e.fillType0?`fill: ${e.fillType2}`:``};
103
+ }
104
+ .task-type-3, .section-type-3 {
105
+ ${e.fillType0?`fill: ${e.fillType3}`:``};
106
+ }
107
+ .task-type-4, .section-type-4 {
108
+ ${e.fillType0?`fill: ${e.fillType4}`:``};
109
+ }
110
+ .task-type-5, .section-type-5 {
111
+ ${e.fillType0?`fill: ${e.fillType5}`:``};
112
+ }
113
+ .task-type-6, .section-type-6 {
114
+ ${e.fillType0?`fill: ${e.fillType6}`:``};
115
+ }
116
+ .task-type-7, .section-type-7 {
117
+ ${e.fillType0?`fill: ${e.fillType7}`:``};
118
+ }
119
+
120
+ .actor-0 {
121
+ ${e.actor0?`fill: ${e.actor0}`:``};
122
+ }
123
+ .actor-1 {
124
+ ${e.actor1?`fill: ${e.actor1}`:``};
125
+ }
126
+ .actor-2 {
127
+ ${e.actor2?`fill: ${e.actor2}`:``};
128
+ }
129
+ .actor-3 {
130
+ ${e.actor3?`fill: ${e.actor3}`:``};
131
+ }
132
+ .actor-4 {
133
+ ${e.actor4?`fill: ${e.actor4}`:``};
134
+ }
135
+ .actor-5 {
136
+ ${e.actor5?`fill: ${e.actor5}`:``};
137
+ }
138
+ ${f()}
139
+ `,`getStyles`),P=e(function(e,t){return m(e,t)},`drawRect`),F=e(function(t,r){let i=t.append(`circle`).attr(`cx`,r.cx).attr(`cy`,r.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),a=t.append(`g`);a.append(`circle`).attr(`cx`,r.cx-5).attr(`cy`,r.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),a.append(`circle`).attr(`cx`,r.cx+5).attr(`cy`,r.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function o(e){let t=n().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(6.8181818181818175);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+r.cx+`,`+(r.cy+2)+`)`)}e(o,`smile`);function s(e){let t=n().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(6.8181818181818175);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+r.cx+`,`+(r.cy+7)+`)`)}e(s,`sad`);function c(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,r.cx-5).attr(`y1`,r.cy+7).attr(`x2`,r.cx+5).attr(`y2`,r.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return e(c,`ambivalent`),r.score>3?o(a):r.score<3?s(a):c(a),i},`drawFace`),I=e(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),L=e(function(e,t){return h(e,t)},`drawText`),R=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,L(t,n)},`drawLabel`),z=e(function(e,t,n){let r=e.append(`g`),i=g();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,P(r,i),U(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),B=-1,V=e(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);B++,a.append(`line`).attr(`id`,r+`-task`+B).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),F(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=g();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,P(a,o);let s=t.x+14;t.people.forEach(e=>{let n=t.actors[e].color,r={cx:s,cy:t.y,r:7,fill:n,stroke:`#000`,title:e,pos:t.actors[e].position};I(a,r),s+=10}),U(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),H=e(function(e,t){p(e,t)},`drawBackgroundRect`),U=(function(){function t(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}e(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}e(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return e(i,`_setTextAttrs`),function(e){return e.textPlacement===`fo`?r:e.textPlacement===`old`?t:n}})(),W={drawRect:P,drawCircle:I,drawSection:z,drawText:L,drawLabel:R,drawTask:V,drawBackgroundRect:H,initGraphics:e(function(e,t){B=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-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`)},ee=e(function(e){Object.keys(e).forEach(function(t){J[t]=e[t]})},`setConf`),G={},K=0;function q(e){let t=r().journey,n=t.maxLabelWidth;K=0;let i=60;Object.keys(G).forEach(r=>{let a=G[r].color,o={cx:20,cy:i,r:7,fill:a,stroke:`#000`,pos:G[r].position};W.drawCircle(e,o);let s=e.append(`text`).attr(`visibility`,`hidden`).text(r),c=s.node().getBoundingClientRect().width;s.remove();let l=[];if(c<=n)l=[r];else{let t=r.split(` `),i=``;s=e.append(`text`).attr(`visibility`,`hidden`),t.forEach(e=>{let t=i?`${i} ${e}`:e;if(s.text(t),s.node().getBoundingClientRect().width>n){if(i&&l.push(i),i=e,s.text(e),s.node().getBoundingClientRect().width>n){let t=``;for(let r of e)t+=r,s.text(t+`-`),s.node().getBoundingClientRect().width>n&&(l.push(t.slice(0,-1)+`-`),t=r);i=t}}else i=t}),i&&l.push(i),s.remove()}l.forEach((n,r)=>{let a={x:40,y:i+7+r*20,fill:`#666`,text:n,textMargin:t.boxTextMargin??5},o=W.drawText(e,a).node().getBoundingClientRect().width;o>K&&o>t.leftMargin-o&&(K=o)}),i+=Math.max(20,l.length*20)})}e(q,`drawActorLegend`);var J=r().journey,Y=0,te=e(function(e,n,i,o){let s=r(),c=s.journey.titleColor,l=s.journey.titleFontSize,u=s.journey.titleFontFamily,d=s.securityLevel,f;d===`sandbox`&&(f=t(`#i`+n));let p=t(d===`sandbox`?f.nodes()[0].contentDocument.body:`body`);X.init();let m=p.select(`#`+n);W.initGraphics(m,n);let h=o.db.getTasks(),g=o.db.getDiagramTitle(),_=o.db.getActors();for(let e in G)delete G[e];let v=0;_.forEach(e=>{G[e]={color:J.actorColours[v%J.actorColours.length],position:v},v++}),q(m),Y=J.leftMargin+K,X.insert(0,0,Y,Object.keys(G).length*50),ne(m,h,0,n);let y=X.getBounds();g&&m.append(`text`).text(g).attr(`x`,Y).attr(`font-size`,l).attr(`font-weight`,`bold`).attr(`y`,25).attr(`fill`,c).attr(`font-family`,u);let b=y.stopy-y.starty+2*J.diagramMarginY,x=Y+y.stopx+2*J.diagramMarginX;a(m,b,x,J.useMaxWidth),m.append(`line`).attr(`x1`,Y).attr(`y1`,J.height*4).attr(`x2`,x-Y-4).attr(`y2`,J.height*4).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#`+n+`-arrowhead)`);let S=g?70:0;m.attr(`viewBox`,`${y.startx} -25 ${x} ${b+S}`),m.attr(`preserveAspectRatio`,`xMinYMin meet`),m.attr(`height`,b+S+25)},`draw`),X={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:e(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},`init`),updateVal:e(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,i,a){let o=r().journey,s=this,c=0;function l(r){return e(function(e){c++;let l=s.sequenceItems.length-c+1;s.updateVal(e,`starty`,n-l*o.boxMargin,Math.min),s.updateVal(e,`stopy`,a+l*o.boxMargin,Math.max),s.updateVal(X.data,`startx`,t-l*o.boxMargin,Math.min),s.updateVal(X.data,`stopx`,i+l*o.boxMargin,Math.max),r!==`activation`&&(s.updateVal(e,`startx`,t-l*o.boxMargin,Math.min),s.updateVal(e,`stopx`,i+l*o.boxMargin,Math.max),s.updateVal(X.data,`starty`,n-l*o.boxMargin,Math.min),s.updateVal(X.data,`stopy`,a+l*o.boxMargin,Math.max))},`updateItemBounds`)}e(l,`updateFn`),this.sequenceItems.forEach(l())},`updateBounds`),insert:e(function(e,t,n,r){let i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(X.data,`startx`,i,Math.min),this.updateVal(X.data,`starty`,o,Math.min),this.updateVal(X.data,`stopx`,a,Math.max),this.updateVal(X.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=this.verticalPos},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return this.data},`getBounds`)},Z=J.sectionFills,Q=J.sectionColours,ne=e(function(e,t,n,i){let a=r().journey,o=``,s=n+(a.height*2+a.diagramMarginY),c=0,l=`#CCC`,u=`black`,d=0;for(let[n,r]of t.entries()){if(o!==r.section){l=Z[c%Z.length],d=c%Z.length,u=Q[c%Q.length];let i=0,s=r.section;for(let e=n;e<t.length&&t[e].section==s;e++)i+=1;let f={x:n*a.taskMargin+n*a.width+Y,y:50,text:r.section,fill:l,num:d,colour:u,taskCount:i};W.drawSection(e,f,a),o=r.section,c++}let f=r.people.reduce((e,t)=>(G[t]&&(e[t]=G[t]),e),{});r.x=n*a.taskMargin+n*a.width+Y,r.y=s,r.width=a.diagramMarginX,r.height=a.diagramMarginY,r.colour=u,r.fill=l,r.num=d,r.actors=f,W.drawTask(e,r,a,i),X.insert(r.x,r.y,r.x+r.width+a.taskMargin,450)}},`drawTasks`),$={setConf:ee,draw:te},re={parser:v,db:M,renderer:$,styles:N,init:e(e=>{$.setConf(e.journey),M.clear()},`init`)};export{re as diagram};