@kabmo-labs/kabmo 0.42.0 → 0.42.1

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 (181) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +592 -593
  3. package/dist/client/static/js/{CsvGrid-20k047ht.js → CsvGrid-8gdp5b49.js} +1 -1
  4. package/dist/client/static/js/{DocxView-qpvhfcmg.js → DocxView-j9sphgra.js} +2 -2
  5. package/dist/client/static/js/{DrawioView-178skky8.js → DrawioView-xsgjc7d8.js} +1 -1
  6. package/dist/client/static/js/{ImageView-460th5qa.js → ImageView-ve9hc519.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-5cv0dty8.js → LayoutWrapper-5mqffvkc.js} +2 -2
  8. package/dist/client/static/js/{Modal-wks6p4r5.js → Modal-50whypff.js} +10 -10
  9. package/dist/client/static/js/{PdfView-y51g03nr.js → PdfView-afd5cg54.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-rsmvn7ks.js → SessionsView-7719nvy0.js} +1 -1
  11. package/dist/client/static/js/{SheetView-z7yvb05v.js → SheetView-gfzgxb4r.js} +1 -1
  12. package/dist/client/static/js/{SvgPreview-yehgzhem.js → SvgPreview-225pkb99.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-6zxpcy8b.js → abnfDiagram-O67JEVCF-z70sk69m.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-m98sgh3c.js → architectureDiagram-NJMV4G6O-pf1gpkje.js} +3 -3
  16. package/dist/client/static/js/{blockDiagram-BEXU5L5S-cp7rervg.js → blockDiagram-BEXU5L5S-sr25kbn6.js} +2 -2
  17. package/dist/client/static/js/{c4Diagram-YGBWAQC7-t31recqm.js → c4Diagram-YGBWAQC7-znstpg86.js} +1 -1
  18. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fy8x3dkx.js → classDiagram-v2-NBCMYWYE-7n0pdcd8.js} +3 -3
  19. package/dist/client/static/js/{cose-bilkent-JH36ORCC-va7ybm9e.js → cose-bilkent-JH36ORCC-zn3qw4c4.js} +1 -1
  20. package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +1 -0
  21. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4k0k429c.js → cynefinDiagram-VND7K2PF-3z41vtzs.js} +1 -1
  22. package/dist/client/static/js/{dagre-6A5THRUB-ykdhxq6t.js → dagre-6A5THRUB-5j3zn883.js} +2 -2
  23. package/dist/client/static/js/{diagram-22UHCM2B-5nvwx7b6.js → diagram-22UHCM2B-ryw1w2kh.js} +4 -4
  24. package/dist/client/static/js/{diagram-3UASUU5V-hc7zsjgw.js → diagram-3UASUU5V-p91q4gkh.js} +1 -1
  25. package/dist/client/static/js/{diagram-ATOU4E4O-97ae07y7.js → diagram-ATOU4E4O-22dn73g4.js} +1 -1
  26. package/dist/client/static/js/{diagram-CDSNMT55-b56nnbbs.js → diagram-CDSNMT55-589p9n53.js} +3 -3
  27. package/dist/client/static/js/{diagram-MLGK6HIB-37rygr9k.js → diagram-MLGK6HIB-ezw06wbx.js} +1 -1
  28. package/dist/client/static/js/{diagram-MPIPVDR6-wv3vhhfk.js → diagram-MPIPVDR6-cfwrsvk1.js} +1 -1
  29. package/dist/client/static/js/{dockerfile-0efb1z6e.js → dockerfile-r4k7q34y.js} +1 -1
  30. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-13fv7vxg.js → ebnfDiagram-ZINNZB2B-3rv2wvbf.js} +1 -1
  31. package/dist/client/static/js/{elixir-mabagxwa.js → elixir-szk51ehr.js} +1 -1
  32. package/dist/client/static/js/{elk-276RUBZZ-xam60ktz.js → elk-276RUBZZ-ma40kneq.js} +1 -1
  33. package/dist/client/static/js/{erDiagram-OPXOYQCR-24ctv2ee.js → erDiagram-OPXOYQCR-xwstsfqa.js} +2 -2
  34. package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +1 -0
  35. package/dist/client/static/js/flowDiagram-KWPJA3E3-evp84v09.js +1 -0
  36. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-766a8fqw.js → ganttDiagram-FUAMR5RP-qxyx9tr9.js} +2 -2
  37. package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +1 -0
  38. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-fmwjkgh6.js → gitGraphDiagram-X574FWY7-v6sg7bkh.js} +1 -1
  39. package/dist/client/static/js/html-tbz83eke.js +1 -0
  40. package/dist/client/static/js/{index-xxe52zrm.js → index-001vebsp.js} +1 -1
  41. package/dist/client/static/js/{index-4j8rgr4p.js → index-0nca2nhp.js} +1 -1
  42. package/dist/client/static/js/{index-nbexks3x.js → index-0p43qr4k.js} +1 -1
  43. package/dist/client/static/js/{index-yvxa7hd8.js → index-2w9j2nj4.js} +1 -1
  44. package/dist/client/static/js/{index-2x9eqztp.js → index-313ctswm.js} +1 -1
  45. package/dist/client/static/js/{index-ka2rc2cr.js → index-3d40c0a7.js} +3 -3
  46. package/dist/client/static/js/{index-sq3r1xhf.js → index-4y0ayjfx.js} +1 -1
  47. package/dist/client/static/js/{index-qj34r6d0.js → index-5599dngt.js} +1 -1
  48. package/dist/client/static/js/{index-hzwr5fm9.js → index-5asf5625.js} +3 -3
  49. package/dist/client/static/js/{index-dydwcp3n.js → index-6dxs0tvg.js} +1 -1
  50. package/dist/client/static/js/{index-a9t9gdew.js → index-6eq445nn.js} +4 -4
  51. package/dist/client/static/js/{index-4z4ax55k.js → index-869bpqcs.js} +6 -6
  52. package/dist/client/static/js/{index-97qst4k9.js → index-8fvmyv7t.js} +1 -1
  53. package/dist/client/static/js/{index-vcn1kcpy.js → index-8pdz41yh.js} +3 -3
  54. package/dist/client/static/js/{index-zvazj4va.js → index-9hzfvjrb.js} +1 -1
  55. package/dist/client/static/js/{index-9vdbnvmk.js → index-9ss64g4g.js} +1 -1
  56. package/dist/client/static/js/{index-zjydzxhm.js → index-b0v6gwym.js} +2 -2
  57. package/dist/client/static/js/{index-ejdnjh5c.js → index-b37ewyvk.js} +1 -1
  58. package/dist/client/static/js/{index-z6kpc98a.js → index-b3d2k7ec.js} +1 -1
  59. package/dist/client/static/js/{index-grczkttn.js → index-b42t14wk.js} +7 -7
  60. package/dist/client/static/js/{index-1c0pnsjd.js → index-cqaz1281.js} +1 -1
  61. package/dist/client/static/js/{index-sx809d6d.js → index-df4yxfzd.js} +1 -1
  62. package/dist/client/static/js/{index-2hpy58d0.js → index-gsxebrq9.js} +2 -2
  63. package/dist/client/static/js/{index-sz3mxjvy.js → index-kh6vp5w5.js} +1 -1
  64. package/dist/client/static/js/{index-x7f5ysch.js → index-mphhvgm9.js} +1 -1
  65. package/dist/client/static/js/{index-13xbwcbz.js → index-mq6s2faf.js} +1 -1
  66. package/dist/client/static/js/{index-xe5cqwnf.js → index-mvykbyhe.js} +1 -1
  67. package/dist/client/static/js/{index-czagykbq.js → index-pxtff3ez.js} +2 -2
  68. package/dist/client/static/js/{index-tqycj126.js → index-q3qpm7jn.js} +1 -1
  69. package/dist/client/static/js/{index-6ge6gk9w.js → index-qh753ynv.js} +1 -1
  70. package/dist/client/static/js/{index-8hgm0abr.js → index-rt6ac0kk.js} +175 -171
  71. package/dist/client/static/js/{index-b4y5g48d.js → index-sr7sdm2t.js} +1 -1
  72. package/dist/client/static/js/{index-8jqawh3r.js → index-v5dbrq83.js} +1 -1
  73. package/dist/client/static/js/{index-1rxa9zxp.js → index-w5q9ymf4.js} +1 -1
  74. package/dist/client/static/js/{index-4mstdh41.js → index-x7a5jpvq.js} +1 -1
  75. package/dist/client/static/js/{index-7t63akyt.js → index-x7m6dmt4.js} +1 -1
  76. package/dist/client/static/js/{index-13dr1t1r.js → index-xsts4pqm.js} +23 -23
  77. package/dist/client/static/js/{index-95en3p3g.js → index-y1p3bdsw.js} +4 -4
  78. package/dist/client/static/js/info-A6RAGUB7-n495k952.js +1 -0
  79. package/dist/client/static/js/{infoDiagram-VRGFBTTK-tqytmzp1.js → infoDiagram-VRGFBTTK-0anekyhb.js} +2 -2
  80. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rp77ff6m.js → ishikawaDiagram-OU5B5YK6-zxpmfkjb.js} +2 -2
  81. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-c7bxrhf1.js → journeyDiagram-ZHPQQLJL-1e86fzra.js} +2 -2
  82. package/dist/client/static/js/{kanban-definition-PNTS6WVX-j2pxewqq.js → kanban-definition-PNTS6WVX-e85hhmr1.js} +4 -4
  83. package/dist/client/static/js/{mermaid.core-cqqe1krg.js → mermaid.core-jpcrnzyw.js} +2 -2
  84. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-s03k32p9.js → mindmap-definition-NLK3R4M7-xwy5928e.js} +1 -1
  85. package/dist/client/static/js/one-dark-pro-r0tswz8r.js +1 -0
  86. package/dist/client/static/js/one-light-xzcfrptf.js +1 -0
  87. package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +1 -0
  88. package/dist/client/static/js/{pegDiagram-GJSIUBJH-dfg2j0zc.js → pegDiagram-GJSIUBJH-7dy6pw26.js} +1 -1
  89. package/dist/client/static/js/{perl-5vxax0nr.js → perl-dtn1fccw.js} +1 -1
  90. package/dist/client/static/js/{php-hgrgdq63.js → php-7av78hch.js} +1 -1
  91. package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +1 -0
  92. package/dist/client/static/js/{pieDiagram-5QR66LMP-pshd1j79.js → pieDiagram-5QR66LMP-nrv2t5yn.js} +2 -2
  93. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-cvvvmtk2.js → quadrantDiagram-O4NWA36T-3nt63xr8.js} +1 -1
  94. package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +1 -0
  95. package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +1 -0
  96. package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +1 -0
  97. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +1 -0
  98. package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +1 -0
  99. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-h53p3sha.js → railroadDiagram-XR7U4H2S-evm05hzp.js} +1 -1
  100. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-bdv2fkxd.js → requirementDiagram-PLB6GJNP-tzrcmktj.js} +1 -1
  101. package/dist/client/static/js/{ruby-8pxcn21w.js → ruby-s2bqr910.js} +1 -1
  102. package/dist/client/static/js/{rust-j80dxgjg.js → rust-pcvgybk3.js} +1 -1
  103. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-xqnnvmhy.js → sankeyDiagram-IPEJSGJF-jvjd5rz8.js} +1 -1
  104. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3p67305f.js → sequenceDiagram-PO4LG4MO-0zvjwx29.js} +3 -3
  105. package/dist/client/static/js/{sizeCapture-INFHLROL-f87525h7.js → sizeCapture-INFHLROL-6t6g0edv.js} +1 -1
  106. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-e5st1fy3.js → stateDiagram-v2-GCMORJYK-nb13b23a.js} +1 -1
  107. package/dist/client/static/js/{swimlanes-2SLR337P-ceghkbez.js → swimlanes-2SLR337P-ef8vmg6f.js} +1 -1
  108. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-vc8hvfya.js → swimlanesDiagram-TC7HE7FX-f4sx355z.js} +1 -1
  109. package/dist/client/static/js/{timeline-definition-EJHVYXUP-f7evs443.js → timeline-definition-EJHVYXUP-3bfph698.js} +3 -3
  110. package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +1 -0
  111. package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +1 -0
  112. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-0gpn21p7.js → usecaseDiagram-POWQR4AR-vj6yj6tc.js} +7 -7
  113. package/dist/client/static/js/{vennDiagram-UO4OBE2U-4spzy428.js → vennDiagram-UO4OBE2U-9xyyabaq.js} +2 -2
  114. package/dist/client/static/js/{vue-xm1dxpmy.js → vue-cbqm4bed.js} +1 -1
  115. package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +1 -0
  116. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-745xr2pa.js → wardleyDiagram-VNRHLVJA-zpcwgv9d.js} +2 -2
  117. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-7dr9qwx5.js → xychartDiagram-PMCCYNJV-pdr2rms2.js} +3 -3
  118. package/package.json +1 -1
  119. package/src/cli/lib/commands/session.js +12 -1
  120. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +14 -123
  121. package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +214 -0
  122. package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +126 -0
  123. package/src/client/components/workspace/chat-timeline/UserTurn.tsx +183 -0
  124. package/src/client/hooks/chat/timeline/composer-modes.ts +10 -7
  125. package/src/client/hooks/chat/timeline/plan-review-republish.test.ts +121 -0
  126. package/src/client/hooks/chat/timeline/plan-review.ts +12 -3
  127. package/src/server/lib/harness/acp/acp-audit.server.ts +1 -1
  128. package/src/server/lib/harness/acp/session-exit.ts +39 -5
  129. package/src/server/lib/harness/acp/session-turns.ts +67 -12
  130. package/src/server/lib/harness/acp/session.test.ts +61 -0
  131. package/src/server/lib/harness/acp/session.ts +15 -25
  132. package/src/server/lib/harness/acp/turn-outcome.server.test.ts +97 -0
  133. package/src/server/lib/harness/acp/turn-outcome.server.ts +71 -0
  134. package/src/server/lib/harness/acp/turn-silence.ts +52 -0
  135. package/src/server/lib/harness/acp/turn.test.ts +85 -3
  136. package/src/server/lib/harness/acp/turn.ts +62 -4
  137. package/src/server/lib/lifecycle/after-listen.ts +10 -0
  138. package/src/server/lib/omp/rpc/frame-fold-contract.ts +21 -0
  139. package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +4 -0
  140. package/src/server/lib/omp/rpc/frame-fold.ts +25 -2
  141. package/src/server/lib/omp/rpc/manager.ts +9 -8
  142. package/src/server/lib/omp/rpc/retry-saga.ts +54 -0
  143. package/src/server/lib/omp/rpc/run-settle.server.ts +38 -5
  144. package/src/server/lib/omp/rpc/run-settle.test.ts +5 -2
  145. package/src/server/lib/omp/rpc/session-commands-dialog.test.ts +6 -20
  146. package/src/server/lib/omp/rpc/session-commands-mapping.test.ts +131 -0
  147. package/src/server/lib/omp/rpc/session-commands.test.ts +95 -116
  148. package/src/server/lib/omp/rpc/session-commands.ts +38 -17
  149. package/src/server/lib/omp/rpc/terminal-settle.test.ts +223 -0
  150. package/src/server/lib/omp/rpc/terminal-settle.ts +127 -29
  151. package/src/server/lib/sessions/notify.server.test.ts +11 -3
  152. package/src/server/lib/sessions/notify.server.ts +67 -42
  153. package/src/server/lib/sessions/spawn.server.test.ts +5 -1
  154. package/src/server/lib/sessions/spawn.server.ts +8 -3
  155. package/src/server/routes/sessions/answer.test.ts +62 -0
  156. package/src/server/routes/sessions/answer.ts +13 -2
  157. package/src/shared/lib/chat/composer/delegation.ts +11 -7
  158. package/src/shared/lib/chat/export-markdown.ts +19 -0
  159. package/src/shared/lib/chat/orchestration/notice.test.ts +118 -0
  160. package/src/shared/lib/chat/orchestration/notice.ts +183 -0
  161. package/src/shared/lib/chat/timeline/omp-callbacks.ts +6 -1
  162. package/src/shared/lib/icons/tint-hues.generated.ts +36 -36
  163. package/dist/client/static/js/architecture-7GRP2DOG-9q06651f.js +0 -1
  164. package/dist/client/static/js/cynefin-OW5HDTMX-w7a38g4g.js +0 -1
  165. package/dist/client/static/js/eventmodeling-NTZA5JFV-6wrjccyw.js +0 -1
  166. package/dist/client/static/js/flowDiagram-KWPJA3E3-19vjkg84.js +0 -1
  167. package/dist/client/static/js/gitGraph-4MIJSDKK-4je2p50v.js +0 -1
  168. package/dist/client/static/js/html-bwyt0ayy.js +0 -1
  169. package/dist/client/static/js/info-A6RAGUB7-k0z5qdew.js +0 -1
  170. package/dist/client/static/js/one-dark-pro-9tt0a020.js +0 -1
  171. package/dist/client/static/js/one-light-5fg4r0ra.js +0 -1
  172. package/dist/client/static/js/packet-AYTQ26CC-6cnvmb2z.js +0 -1
  173. package/dist/client/static/js/pie-WAS4IAKB-m9z1mztn.js +0 -1
  174. package/dist/client/static/js/radar-RG4KPBEZ-8m9rkex6.js +0 -1
  175. package/dist/client/static/js/railroad-74A4TZTK-wc55emj8.js +0 -1
  176. package/dist/client/static/js/railroad-abnf-HS5TGJTU-2y2rnrzq.js +0 -1
  177. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-zzcc9x0v.js +0 -1
  178. package/dist/client/static/js/railroad-peg-WCYAUIDC-z82na5nb.js +0 -1
  179. package/dist/client/static/js/treeView-Q6P3EWNA-kzh6cm3f.js +0 -1
  180. package/dist/client/static/js/treemap-WGGIJYW6-wz5ed560.js +0 -1
  181. package/dist/client/static/js/wardley-WFR3VGLG-zewbfccz.js +0 -1
@@ -1,2 +1,2 @@
1
- import{d,n,o,a,e,s,E,D,st,ut}from"./index-8hgm0abr.js";var q={name:"ticket",size:24,node:[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]},S=s(q);function P({providerName:t,providerSlug:r,iconUrl:i,credentialSources:l,error:p,note:c,children:m}){return e("section",{className:"bg-paper border border-ink/15 rounded-lg shadow-xs",children:[e("header",{className:"flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-ink/10",children:[e("span",{className:"flex min-w-0 items-center gap-2",children:[r&&e(ut,{provider:{slug:r,name:t,...i?{iconUrl:i}:{}},size:20}),e("span",{className:"truncate text-xs font-semibold text-ink",children:t})]}),e("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50 truncate",title:`Credentials from ${l.join(", ")}`,children:l.join(" · ")})]}),e("div",{className:"p-3.5 space-y-4",children:[p&&e("p",{className:"flex items-start gap-2 text-error text-xs leading-relaxed",children:[e(E,{size:14,className:"shrink-0 mt-0.5"}),e("span",{className:"break-words",children:p})]}),m,c&&e("p",{className:"text-[10px] text-ink/50 leading-relaxed border-t border-ink/10 pt-2.5",children:c})]})]})}var B=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}),j=new Intl.NumberFormat("id-ID"),y=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!1}),G=new Intl.DateTimeFormat("id-ID",{dateStyle:"medium",timeStyle:"short"});function x(t){return B.format(t)}function b(t){return j.format(t)}function oa(t){let r=new Date(t);if(Number.isNaN(r.getTime()))return t;return G.format(r)}function L(t,r){if(r<=0)return 0;return Math.min(100,Math.max(0,t/r*100))}function T(t,r){if(r<=0)return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(t/r*100)}%`}function k(t){if(!Number.isFinite(t))return"0";let r=Math.abs(t);if(r>=1e9)return`${y.format(t/1e9)}B`;if(r>=1e6)return`${y.format(t/1e6)}M`;if(r>=1000)return`${y.format(t/1000)}K`;return b(t)}function N(t){let r=Number(t);if(t.trim()===""||!Number.isFinite(r))return t;return b(r)}var O=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2});function U(t){if(!Number.isFinite(t))return"$0,00";return`$${O.format(t)}`}function w(t,r){if(!Number.isFinite(t))return"—";switch(r){case"percent":return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(t)}%`;case"usd":return U(t);case"tokens":case"bytes":return k(t);default:return b(t)}}function C(t){if(!Number.isFinite(t))return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(t*100)}%`}function z({window:t}){let r=t.usedRp+t.remainingRp,i=L(t.usedRp,r);return e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("span",{className:"text-[11px] font-semibold text-ink",children:t.label}),e("span",{className:"text-[10px] text-ink/50",children:["Resets ",oa(t.resetsAt)]})]}),e("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:e("div",{className:"h-full bg-ink/80 rounded-full",style:{width:`${i}%`}})}),e("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[e("span",{children:["Used ",e("span",{className:"font-semibold text-ink",children:x(t.usedRp)})," ·"," ",T(t.usedRp,r)]}),e("span",{children:["Remaining ",e("span",{className:"font-semibold text-ink",children:x(t.remainingRp)})]})]})]})}function H({coupon:t}){return e("div",{className:"bg-ink/5 border border-ink/10 rounded-lg p-3 shadow-xs",children:[e("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e(S,{size:12,className:"text-ink/60"}),e("span",{className:"text-[11px] font-semibold text-ink",children:["Active coupon · ",t.name]})]}),e("div",{className:"text-[10px] text-ink/60 space-y-0.5",children:[e("div",{children:["Remaining"," ",e("span",{className:"font-semibold text-ink",children:t.remainingRp===null?"Unlimited":x(t.remainingRp)})," ","· Used ",e("span",{className:"font-semibold text-ink",children:x(t.usedRp)})]}),e("div",{children:["Expires ",oa(t.expiresAt)]}),t.scopeModels.length>0&&e("div",{children:["Models: ",t.scopeModels.join(", ")]})]})]})}function I({quota:t}){if(!t)return e("p",{className:"text-[11px] text-ink/50",children:"Quota data is not available for this account."});return e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),t.planName&&e("span",{className:"text-[10px] text-ink/60",children:["Plan ",e("span",{className:"font-semibold text-ink",children:t.planName})]})]}),t.windows.length===0?e("p",{className:"text-[11px] text-ink/50",children:"No quota windows reported."}):e("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:t.windows.map((r)=>e(z,{window:r},r.key))}),t.coupon&&e(H,{coupon:t.coupon})]})}function A({usage:t}){if(!t)return e("p",{className:"text-[11px] text-ink/50",children:"The 30-day usage report is not available."});let r=t.rows.reduce((l,p)=>l+p.inputTokens,0),i=t.rows.reduce((l,p)=>l+p.outputTokens,0);return e("div",{className:"space-y-2",children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"30-day usage by model"}),e("div",{className:"overflow-x-auto border border-ink/15 rounded-lg shadow-xs",children:e("table",{className:"w-full text-[11px]",children:[e("thead",{className:"bg-ink/5 text-ink/60",children:e("tr",{children:[e("th",{className:"text-left font-semibold px-3 py-2 whitespace-nowrap",children:"Model"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Requests"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Input tokens"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Output tokens"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Cost"})]})}),e("tbody",{className:"divide-y divide-ink/10",children:t.rows.length===0?e("tr",{children:e("td",{colSpan:5,className:"px-3 py-3 text-center text-ink/50",children:"No usage recorded in the last 30 days."})}):t.rows.map((l)=>e("tr",{children:[e("td",{className:"px-3 py-1.5 font-mono text-ink whitespace-nowrap",children:l.model}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:b(l.requests)}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:k(l.inputTokens)}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:k(l.outputTokens)}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:x(l.costRp)})]},l.model))}),e("tfoot",{className:"bg-ink/5 border-t border-ink/15 font-semibold text-ink",children:e("tr",{children:[e("td",{className:"px-3 py-2",children:"Total"}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:b(t.totalRequests)}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:k(r)}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:k(i)}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:x(t.totalCostRp)})]})})]})})]})}function F({report:t}){let{balance:r,usage:i,quota:l}=t;if(!r&&!i&&!l)return e("p",{className:"text-[11px] text-ink/50",children:"No kenari data was returned for this account."});let p=r?r.amountRp!==null?x(r.amountRp):r.raw:"–",c=r?r.amountRp!==null?r.raw:"Amount could not be parsed":"Balance unavailable",m=i?i.rows.reduce((g,u)=>g+u.inputTokens+u.outputTokens,0):0;return e(d,{children:[e("div",{className:"@container",children:e("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[e(st,{value:p,label:"Wallet balance",hint:c}),e(st,{value:l?.planName??"–",label:"Active plan",hint:l?"kenari quota plan":"Quota unavailable"}),e(st,{value:i?b(i.totalRequests):"–",label:"Requests (30 days)",hint:i?"Across all models":"Usage report unavailable"}),e(st,{value:i?x(i.totalCostRp):"–",label:"Cost (30 days)",hint:i?"Billed in Rupiah":"Usage report unavailable"}),e(st,{value:i?k(m):"–",label:"Tokens processed (30 days)",hint:i?"Input + output":"Usage report unavailable",tone:"muted",className:"col-span-2 @[540px]:col-span-1"})]})}),e(I,{quota:l}),e(A,{usage:i})]})}function W({report:t}){let r=t.balance;if(!r)return e("p",{className:"text-[11px] text-ink/50",children:"DeepSeek balance data is not available."});return e(d,{children:[e("div",{className:"@container",children:e("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[e(st,{value:r.isAvailable?"Available":"Unavailable",label:"Prepaid balance",hint:r.isAvailable?"Account can spend":"Top up required",tone:r.isAvailable?"default":"muted"}),e(st,{value:b(r.entries.length),label:"Currency buckets",hint:r.entries.length>0?"From the balance endpoint":"No entries returned",tone:"muted"})]})}),r.entries.length===0?e("p",{className:"text-[11px] text-ink/50",children:"The balance endpoint returned no currency entries."}):e("div",{className:"grid grid-cols-1 gap-2.5",children:r.entries.map((i)=>e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs",children:[e("div",{className:"flex items-center justify-between gap-2 mb-2",children:[e("span",{className:"text-[11px] font-semibold text-ink",children:i.currency}),e("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/40",children:"Balance"})]}),e("dl",{className:"grid grid-cols-3 gap-2 text-[10px]",children:[e("div",{children:[e("dt",{className:"text-ink/50",children:"Total"}),e("dd",{className:"font-semibold text-ink tabular-nums break-words",children:N(i.totalBalance)})]}),e("div",{children:[e("dt",{className:"text-ink/50",children:"Granted"}),e("dd",{className:"font-semibold text-ink tabular-nums break-words",children:N(i.grantedBalance)})]}),e("div",{children:[e("dt",{className:"text-ink/50",children:"Topped up"}),e("dd",{className:"font-semibold text-ink tabular-nums break-words",children:N(i.toppedUpBalance)})]})]})]},i.currency))})]})}function R(t,r,i,l){let p=t.find((c)=>c.id===r);if(p){p.limits.push(l);return}t.push({id:r,title:i,limits:[l]})}function V(t){let r=(t.split(":")[1]??"").toLowerCase();if(r==="google")return{id:"google",title:"Google"};if(r==="anthropic"||r==="openai")return{id:"third-party",title:"Claude & GPT (shared)"};if(r==="default"||r==="")return{id:"default",title:"Usage"};return{id:r,title:r}}function X(t){let r=[];for(let i of t)if(i.id==="anthropic:extra")R(r,"balance","Balance",i);else R(r,"windows","Quota windows",i);return r}function J(t){let r=[];for(let i of t){let l=V(i.id);if(l.id==="third-party"){if(r.find((c)=>c.id==="third-party")?.limits.some((c)=>Z(c,i)))continue}R(r,l.id,l.title,i)}return r}function Z(t,r){return t.unit===r.unit&&t.label===r.label&&t.usedFraction===r.usedFraction&&t.remaining===r.remaining&&t.resetsAt===r.resetsAt}function _(t,r){if(r.length===0)return[];let i=t.trim().toLowerCase();if(i==="anthropic")return X(r);if(i==="google-antigravity")return J(r);return[{id:"all",title:"Quota windows",limits:[...r]}]}function Y({limit:t}){let r=Math.min(100,Math.max(0,(t.usedFraction??0)*100)),i=t.modelId??t.accountId,l=t.used!==void 0?w(t.used,t.unit):void 0,p=t.limit!==void 0?w(t.limit,t.unit):void 0,c=t.remaining!==void 0?w(t.remaining,t.unit):void 0;return e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[e("div",{className:"flex items-start justify-between gap-2",children:[e("div",{className:"min-w-0",children:[e("div",{className:"text-[11px] font-semibold text-ink truncate",children:[t.label,t.windowLabel&&e("span",{className:"ml-1.5 rounded border border-ink/15 px-1 py-px font-mono text-[9px] font-normal text-ink/50",children:t.windowLabel})]}),i&&e("div",{className:"text-[10px] text-ink/50 truncate",children:i})]}),e("span",{className:"text-[10px] text-ink/50 flex-shrink-0 whitespace-nowrap",children:t.resetsAt!==void 0?`Resets ${oa(new Date(t.resetsAt).toISOString())}`:""})]}),e("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:e("div",{className:`h-full rounded-full ${t.status==="exhausted"?"bg-error/70":"bg-ink/80"}`,style:{width:`${r}%`}})}),e("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[e("span",{children:["Used"," ",e("span",{className:"font-semibold text-ink",children:t.unit==="percent"||!l?C(t.usedFraction??0):l}),t.unit!=="percent"&&l&&p?` of ${p}`:""]}),e("span",{className:"flex items-center gap-2",children:[t.status!=="ok"&&t.status!=="unknown"&&e("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70",children:t.status}),c&&e("span",{children:["Remaining ",e("span",{className:"font-semibold text-ink",children:c})]})]})]}),t.notes&&t.notes.length>0&&e("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:t.notes.map((m)=>e("li",{children:m},m))})]})}function Q({providerId:t,limits:r,tracked:i,unavailable:l,notes:p}){let c=_(t,r);return e("div",{className:"space-y-2",children:[p&&p.length>0&&e("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:p.map((m)=>e("li",{children:m},m))}),c.length===0?e(d,{children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),e("p",{className:"text-[11px] text-ink/50",children:!i?"No quota source for this provider: omp ships no usage adapter for it and it exposes no balance endpoint Kabmo knows.":l?"omp tracks this provider but its usage endpoint returned no data — an invalid or expired credential, an unreachable endpoint, or a plan without quota windows.":"No quota windows were reported for this provider."})]}):c.map((m)=>e("div",{className:"@container space-y-2",children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:m.title}),e("div",{className:"grid grid-cols-1 @[520px]:grid-cols-2 gap-2.5",children:m.limits.map((g)=>e(Y,{limit:g},g.id))})]},m.id))]})}var ee="DeepSeek exposes no usage or quota API — only the prepaid balance (and the web console at platform.deepseek.com) is available.";function ku({summary:t}){let r=Boolean(t.kenari||t.deepseek);return e(P,{providerName:t.name,providerSlug:t.id,iconUrl:t.iconUrl,credentialSources:t.credentialSources,error:t.error,note:t.deepseek?ee:void 0,children:[t.kenari&&e(F,{report:t.kenari}),t.deepseek&&e(W,{report:t.deepseek}),!r&&(t.limits.length>0||!t.error)&&e(Q,{providerId:t.id,limits:t.limits,tracked:t.tracked,unavailable:t.limitsUnavailable,notes:t.notes})]})}function te(t){let r=t.filter((p)=>p.usedFraction!==void 0);if(r.length===0){let p=t.find((c)=>c.unit==="usd"&&c.remaining!==void 0);if(p)return`${U(p.remaining??0)} left`;return t[0]?.label}let i=r.reduce((p,c)=>(c.usedFraction??0)>(p.usedFraction??0)?c:p),l=Math.round((i.usedFraction??0)*100);return i.windowLabel?`${l}% · ${i.windowLabel}`:`${l}% used`}function Ds(t){return t.providers.map((r)=>({id:r.id,name:r.name,...r.iconUrl?{iconUrl:r.iconUrl}:{},error:r.error,hint:ne(r),limits:r.limits,tracked:r.tracked,limitsUnavailable:r.limitsUnavailable,summary:r}))}function ne(t){let r=t.kenari?.quota?.planName;if(r)return r;let i=t.deepseek?.balance?.entries[0];if(i)return`${i.currency} ${N(i.totalBalance)}`;return te(t.limits)??"No quota reported"}function Qg(t){return t.error?"Error":"Connected"}function K(){let[t,r]=n([]),[i,l]=n(null),[p,c]=n(!0),m=a(()=>{c(!0),fetch("/api/settings/usage/reset").then((u)=>u.json()).then((u)=>{r(Array.isArray(u.accounts)?u.accounts:[]),l(typeof u.error==="string"?u.error:null)}).catch((u)=>{r([]),l(u instanceof Error?u.message:"Failed to load saved resets")}).finally(()=>c(!1))},[]);o(()=>{m()},[m]);let g=a(async(u)=>{try{let h=await(await fetch("/api/settings/usage/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:u})})).json();if(h.ok)m();return{ok:Boolean(h.ok),message:h.message||"No result reported."}}catch(f){return{ok:!1,message:f instanceof Error?f.message:"Failed to spend the saved reset"}}},[m]);return{accounts:t,error:i,isLoading:p,reload:m,spend:g}}function ae({account:t,onSpend:r,spending:i}){let l=`${t.provider}/${t.credentialId}`,p=t.email??t.accountId??t.credentialId,c=t.orgName??t.orgId,m=t.availableCount??t.credits.length,g=t.redeemableCount??0,u=t.error??t.unavailableReason;return e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[e("div",{className:"flex items-start justify-between gap-2",children:[e("div",{className:"min-w-0",children:[e("div",{className:"text-[11px] font-semibold text-ink truncate",children:[p,c?e("span",{className:"text-ink/50 font-normal",children:[" · ",c]}):null]}),e("div",{className:"text-[10px] text-ink/50 font-mono truncate",children:l})]}),e("span",{className:"text-[10px] text-ink/60 flex-shrink-0 whitespace-nowrap",children:g>0?`${g} of ${m} usable`:`${m} saved`})]}),t.soonestExpiry!==void 0&&e("div",{className:"text-[10px] text-ink/60",children:["Soonest expires ",oa(new Date(t.soonestExpiry).toISOString())]}),t.credits.length>0&&e("div",{className:"space-y-1",children:t.credits.map((f)=>e("div",{className:"flex items-center justify-between gap-2 text-[10px] text-ink/70",children:[e("span",{className:"truncate",children:f.title??f.program??f.id}),e("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[f.clears&&f.clears.length>0&&e("span",{className:"font-mono text-ink/50",children:f.clears.join(", ")}),f.usable===!1&&e("span",{className:"font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/60",children:"blocked"})]})]},f.id))}),u&&e("div",{className:"text-[10px] text-ink/60 leading-snug",children:u}),e("button",{type:"button",onClick:()=>r(l),disabled:i||g===0,title:g===0?u??"Nothing to spend on this account right now.":`Spend a saved reset on ${l}`,className:"w-full rounded-md border border-ink/15 px-2 py-1 text-[11px] font-medium text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:i?"Spending…":"Spend saved reset"})]})}function xu(){let{accounts:t,error:r,isLoading:i,reload:l,spend:p}=K(),[c,m]=n(null),[g,u]=n(null),f=(v)=>{m(v),u(null),p(v).then((M)=>{u(M),m(null)})},h=!i&&!r&&t.length===0;return e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"min-w-0",children:[e("div",{className:"text-[11px] font-semibold text-ink",children:"Saved rate-limit resets"}),e("div",{className:"text-[10px] text-ink/50 leading-snug",children:"Provider-issued resets for Codex and Claude accounts. Spending one clears the window it covers."})]}),e("button",{type:"button",onClick:l,disabled:i,title:"Re-read saved resets",className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",children:e(D,{size:12,className:i?"animate-spin text-ink":""})})]}),r&&e("div",{className:"flex items-start gap-1.5 text-[10px] text-error leading-snug",children:[e(E,{size:12,className:"flex-shrink-0 mt-px"}),e("span",{children:r})]}),t.map((v)=>e(ae,{account:v,onSpend:f,spending:c===`${v.provider}/${v.credentialId}`},`${v.provider}/${v.credentialId}`)),h&&e("p",{className:"text-[10px] text-ink/50 leading-snug",children:"No saved resets on any account."}),g&&e("div",{className:`text-[10px] leading-snug ${g.ok?"text-ink/70":"text-error"}`,children:g.message})]})}function wu(){let[t,r]=n(null),[i,l]=n(!0),[p,c]=n(null),m=a(async(g)=>{if(!g?.silent)l(!0);c(null);try{let u=g?.force?"/api/settings/usage?refresh=1":"/api/settings/usage",f=await fetch(u);if(!f.ok)throw Error(`Usage request failed (${f.status})`);let h=await f.json();r(h)}catch(u){c(u instanceof Error?u.message:"Failed to load provider usage")}finally{if(!g?.silent)l(!1)}},[]);return o(()=>{m()},[m]),{report:t,isLoading:i,error:p,reload:m}}
1
+ import{d,n,o,a,e,s,E,D,st,ut}from"./index-rt6ac0kk.js";var q={name:"ticket",size:24,node:[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]},S=s(q);function P({providerName:t,providerSlug:r,iconUrl:i,credentialSources:l,error:p,note:c,children:m}){return e("section",{className:"bg-paper border border-ink/15 rounded-lg shadow-xs",children:[e("header",{className:"flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-ink/10",children:[e("span",{className:"flex min-w-0 items-center gap-2",children:[r&&e(ut,{provider:{slug:r,name:t,...i?{iconUrl:i}:{}},size:20}),e("span",{className:"truncate text-xs font-semibold text-ink",children:t})]}),e("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50 truncate",title:`Credentials from ${l.join(", ")}`,children:l.join(" · ")})]}),e("div",{className:"p-3.5 space-y-4",children:[p&&e("p",{className:"flex items-start gap-2 text-error text-xs leading-relaxed",children:[e(E,{size:14,className:"shrink-0 mt-0.5"}),e("span",{className:"break-words",children:p})]}),m,c&&e("p",{className:"text-[10px] text-ink/50 leading-relaxed border-t border-ink/10 pt-2.5",children:c})]})]})}var B=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}),j=new Intl.NumberFormat("id-ID"),y=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!1}),G=new Intl.DateTimeFormat("id-ID",{dateStyle:"medium",timeStyle:"short"});function x(t){return B.format(t)}function b(t){return j.format(t)}function oa(t){let r=new Date(t);if(Number.isNaN(r.getTime()))return t;return G.format(r)}function L(t,r){if(r<=0)return 0;return Math.min(100,Math.max(0,t/r*100))}function T(t,r){if(r<=0)return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(t/r*100)}%`}function k(t){if(!Number.isFinite(t))return"0";let r=Math.abs(t);if(r>=1e9)return`${y.format(t/1e9)}B`;if(r>=1e6)return`${y.format(t/1e6)}M`;if(r>=1000)return`${y.format(t/1000)}K`;return b(t)}function N(t){let r=Number(t);if(t.trim()===""||!Number.isFinite(r))return t;return b(r)}var O=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2});function U(t){if(!Number.isFinite(t))return"$0,00";return`$${O.format(t)}`}function w(t,r){if(!Number.isFinite(t))return"—";switch(r){case"percent":return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(t)}%`;case"usd":return U(t);case"tokens":case"bytes":return k(t);default:return b(t)}}function C(t){if(!Number.isFinite(t))return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(t*100)}%`}function z({window:t}){let r=t.usedRp+t.remainingRp,i=L(t.usedRp,r);return e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("span",{className:"text-[11px] font-semibold text-ink",children:t.label}),e("span",{className:"text-[10px] text-ink/50",children:["Resets ",oa(t.resetsAt)]})]}),e("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:e("div",{className:"h-full bg-ink/80 rounded-full",style:{width:`${i}%`}})}),e("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[e("span",{children:["Used ",e("span",{className:"font-semibold text-ink",children:x(t.usedRp)})," ·"," ",T(t.usedRp,r)]}),e("span",{children:["Remaining ",e("span",{className:"font-semibold text-ink",children:x(t.remainingRp)})]})]})]})}function H({coupon:t}){return e("div",{className:"bg-ink/5 border border-ink/10 rounded-lg p-3 shadow-xs",children:[e("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e(S,{size:12,className:"text-ink/60"}),e("span",{className:"text-[11px] font-semibold text-ink",children:["Active coupon · ",t.name]})]}),e("div",{className:"text-[10px] text-ink/60 space-y-0.5",children:[e("div",{children:["Remaining"," ",e("span",{className:"font-semibold text-ink",children:t.remainingRp===null?"Unlimited":x(t.remainingRp)})," ","· Used ",e("span",{className:"font-semibold text-ink",children:x(t.usedRp)})]}),e("div",{children:["Expires ",oa(t.expiresAt)]}),t.scopeModels.length>0&&e("div",{children:["Models: ",t.scopeModels.join(", ")]})]})]})}function I({quota:t}){if(!t)return e("p",{className:"text-[11px] text-ink/50",children:"Quota data is not available for this account."});return e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),t.planName&&e("span",{className:"text-[10px] text-ink/60",children:["Plan ",e("span",{className:"font-semibold text-ink",children:t.planName})]})]}),t.windows.length===0?e("p",{className:"text-[11px] text-ink/50",children:"No quota windows reported."}):e("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:t.windows.map((r)=>e(z,{window:r},r.key))}),t.coupon&&e(H,{coupon:t.coupon})]})}function A({usage:t}){if(!t)return e("p",{className:"text-[11px] text-ink/50",children:"The 30-day usage report is not available."});let r=t.rows.reduce((l,p)=>l+p.inputTokens,0),i=t.rows.reduce((l,p)=>l+p.outputTokens,0);return e("div",{className:"space-y-2",children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"30-day usage by model"}),e("div",{className:"overflow-x-auto border border-ink/15 rounded-lg shadow-xs",children:e("table",{className:"w-full text-[11px]",children:[e("thead",{className:"bg-ink/5 text-ink/60",children:e("tr",{children:[e("th",{className:"text-left font-semibold px-3 py-2 whitespace-nowrap",children:"Model"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Requests"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Input tokens"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Output tokens"}),e("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Cost"})]})}),e("tbody",{className:"divide-y divide-ink/10",children:t.rows.length===0?e("tr",{children:e("td",{colSpan:5,className:"px-3 py-3 text-center text-ink/50",children:"No usage recorded in the last 30 days."})}):t.rows.map((l)=>e("tr",{children:[e("td",{className:"px-3 py-1.5 font-mono text-ink whitespace-nowrap",children:l.model}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:b(l.requests)}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:k(l.inputTokens)}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:k(l.outputTokens)}),e("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:x(l.costRp)})]},l.model))}),e("tfoot",{className:"bg-ink/5 border-t border-ink/15 font-semibold text-ink",children:e("tr",{children:[e("td",{className:"px-3 py-2",children:"Total"}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:b(t.totalRequests)}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:k(r)}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:k(i)}),e("td",{className:"px-3 py-2 text-right tabular-nums",children:x(t.totalCostRp)})]})})]})})]})}function F({report:t}){let{balance:r,usage:i,quota:l}=t;if(!r&&!i&&!l)return e("p",{className:"text-[11px] text-ink/50",children:"No kenari data was returned for this account."});let p=r?r.amountRp!==null?x(r.amountRp):r.raw:"–",c=r?r.amountRp!==null?r.raw:"Amount could not be parsed":"Balance unavailable",m=i?i.rows.reduce((g,u)=>g+u.inputTokens+u.outputTokens,0):0;return e(d,{children:[e("div",{className:"@container",children:e("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[e(st,{value:p,label:"Wallet balance",hint:c}),e(st,{value:l?.planName??"–",label:"Active plan",hint:l?"kenari quota plan":"Quota unavailable"}),e(st,{value:i?b(i.totalRequests):"–",label:"Requests (30 days)",hint:i?"Across all models":"Usage report unavailable"}),e(st,{value:i?x(i.totalCostRp):"–",label:"Cost (30 days)",hint:i?"Billed in Rupiah":"Usage report unavailable"}),e(st,{value:i?k(m):"–",label:"Tokens processed (30 days)",hint:i?"Input + output":"Usage report unavailable",tone:"muted",className:"col-span-2 @[540px]:col-span-1"})]})}),e(I,{quota:l}),e(A,{usage:i})]})}function W({report:t}){let r=t.balance;if(!r)return e("p",{className:"text-[11px] text-ink/50",children:"DeepSeek balance data is not available."});return e(d,{children:[e("div",{className:"@container",children:e("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[e(st,{value:r.isAvailable?"Available":"Unavailable",label:"Prepaid balance",hint:r.isAvailable?"Account can spend":"Top up required",tone:r.isAvailable?"default":"muted"}),e(st,{value:b(r.entries.length),label:"Currency buckets",hint:r.entries.length>0?"From the balance endpoint":"No entries returned",tone:"muted"})]})}),r.entries.length===0?e("p",{className:"text-[11px] text-ink/50",children:"The balance endpoint returned no currency entries."}):e("div",{className:"grid grid-cols-1 gap-2.5",children:r.entries.map((i)=>e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs",children:[e("div",{className:"flex items-center justify-between gap-2 mb-2",children:[e("span",{className:"text-[11px] font-semibold text-ink",children:i.currency}),e("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/40",children:"Balance"})]}),e("dl",{className:"grid grid-cols-3 gap-2 text-[10px]",children:[e("div",{children:[e("dt",{className:"text-ink/50",children:"Total"}),e("dd",{className:"font-semibold text-ink tabular-nums break-words",children:N(i.totalBalance)})]}),e("div",{children:[e("dt",{className:"text-ink/50",children:"Granted"}),e("dd",{className:"font-semibold text-ink tabular-nums break-words",children:N(i.grantedBalance)})]}),e("div",{children:[e("dt",{className:"text-ink/50",children:"Topped up"}),e("dd",{className:"font-semibold text-ink tabular-nums break-words",children:N(i.toppedUpBalance)})]})]})]},i.currency))})]})}function R(t,r,i,l){let p=t.find((c)=>c.id===r);if(p){p.limits.push(l);return}t.push({id:r,title:i,limits:[l]})}function V(t){let r=(t.split(":")[1]??"").toLowerCase();if(r==="google")return{id:"google",title:"Google"};if(r==="anthropic"||r==="openai")return{id:"third-party",title:"Claude & GPT (shared)"};if(r==="default"||r==="")return{id:"default",title:"Usage"};return{id:r,title:r}}function X(t){let r=[];for(let i of t)if(i.id==="anthropic:extra")R(r,"balance","Balance",i);else R(r,"windows","Quota windows",i);return r}function J(t){let r=[];for(let i of t){let l=V(i.id);if(l.id==="third-party"){if(r.find((c)=>c.id==="third-party")?.limits.some((c)=>Z(c,i)))continue}R(r,l.id,l.title,i)}return r}function Z(t,r){return t.unit===r.unit&&t.label===r.label&&t.usedFraction===r.usedFraction&&t.remaining===r.remaining&&t.resetsAt===r.resetsAt}function _(t,r){if(r.length===0)return[];let i=t.trim().toLowerCase();if(i==="anthropic")return X(r);if(i==="google-antigravity")return J(r);return[{id:"all",title:"Quota windows",limits:[...r]}]}function Y({limit:t}){let r=Math.min(100,Math.max(0,(t.usedFraction??0)*100)),i=t.modelId??t.accountId,l=t.used!==void 0?w(t.used,t.unit):void 0,p=t.limit!==void 0?w(t.limit,t.unit):void 0,c=t.remaining!==void 0?w(t.remaining,t.unit):void 0;return e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[e("div",{className:"flex items-start justify-between gap-2",children:[e("div",{className:"min-w-0",children:[e("div",{className:"text-[11px] font-semibold text-ink truncate",children:[t.label,t.windowLabel&&e("span",{className:"ml-1.5 rounded border border-ink/15 px-1 py-px font-mono text-[9px] font-normal text-ink/50",children:t.windowLabel})]}),i&&e("div",{className:"text-[10px] text-ink/50 truncate",children:i})]}),e("span",{className:"text-[10px] text-ink/50 flex-shrink-0 whitespace-nowrap",children:t.resetsAt!==void 0?`Resets ${oa(new Date(t.resetsAt).toISOString())}`:""})]}),e("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:e("div",{className:`h-full rounded-full ${t.status==="exhausted"?"bg-error/70":"bg-ink/80"}`,style:{width:`${r}%`}})}),e("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[e("span",{children:["Used"," ",e("span",{className:"font-semibold text-ink",children:t.unit==="percent"||!l?C(t.usedFraction??0):l}),t.unit!=="percent"&&l&&p?` of ${p}`:""]}),e("span",{className:"flex items-center gap-2",children:[t.status!=="ok"&&t.status!=="unknown"&&e("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70",children:t.status}),c&&e("span",{children:["Remaining ",e("span",{className:"font-semibold text-ink",children:c})]})]})]}),t.notes&&t.notes.length>0&&e("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:t.notes.map((m)=>e("li",{children:m},m))})]})}function Q({providerId:t,limits:r,tracked:i,unavailable:l,notes:p}){let c=_(t,r);return e("div",{className:"space-y-2",children:[p&&p.length>0&&e("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:p.map((m)=>e("li",{children:m},m))}),c.length===0?e(d,{children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),e("p",{className:"text-[11px] text-ink/50",children:!i?"No quota source for this provider: omp ships no usage adapter for it and it exposes no balance endpoint Kabmo knows.":l?"omp tracks this provider but its usage endpoint returned no data — an invalid or expired credential, an unreachable endpoint, or a plan without quota windows.":"No quota windows were reported for this provider."})]}):c.map((m)=>e("div",{className:"@container space-y-2",children:[e("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:m.title}),e("div",{className:"grid grid-cols-1 @[520px]:grid-cols-2 gap-2.5",children:m.limits.map((g)=>e(Y,{limit:g},g.id))})]},m.id))]})}var ee="DeepSeek exposes no usage or quota API — only the prepaid balance (and the web console at platform.deepseek.com) is available.";function ku({summary:t}){let r=Boolean(t.kenari||t.deepseek);return e(P,{providerName:t.name,providerSlug:t.id,iconUrl:t.iconUrl,credentialSources:t.credentialSources,error:t.error,note:t.deepseek?ee:void 0,children:[t.kenari&&e(F,{report:t.kenari}),t.deepseek&&e(W,{report:t.deepseek}),!r&&(t.limits.length>0||!t.error)&&e(Q,{providerId:t.id,limits:t.limits,tracked:t.tracked,unavailable:t.limitsUnavailable,notes:t.notes})]})}function te(t){let r=t.filter((p)=>p.usedFraction!==void 0);if(r.length===0){let p=t.find((c)=>c.unit==="usd"&&c.remaining!==void 0);if(p)return`${U(p.remaining??0)} left`;return t[0]?.label}let i=r.reduce((p,c)=>(c.usedFraction??0)>(p.usedFraction??0)?c:p),l=Math.round((i.usedFraction??0)*100);return i.windowLabel?`${l}% · ${i.windowLabel}`:`${l}% used`}function Ds(t){return t.providers.map((r)=>({id:r.id,name:r.name,...r.iconUrl?{iconUrl:r.iconUrl}:{},error:r.error,hint:ne(r),limits:r.limits,tracked:r.tracked,limitsUnavailable:r.limitsUnavailable,summary:r}))}function ne(t){let r=t.kenari?.quota?.planName;if(r)return r;let i=t.deepseek?.balance?.entries[0];if(i)return`${i.currency} ${N(i.totalBalance)}`;return te(t.limits)??"No quota reported"}function Qg(t){return t.error?"Error":"Connected"}function K(){let[t,r]=n([]),[i,l]=n(null),[p,c]=n(!0),m=a(()=>{c(!0),fetch("/api/settings/usage/reset").then((u)=>u.json()).then((u)=>{r(Array.isArray(u.accounts)?u.accounts:[]),l(typeof u.error==="string"?u.error:null)}).catch((u)=>{r([]),l(u instanceof Error?u.message:"Failed to load saved resets")}).finally(()=>c(!1))},[]);o(()=>{m()},[m]);let g=a(async(u)=>{try{let h=await(await fetch("/api/settings/usage/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:u})})).json();if(h.ok)m();return{ok:Boolean(h.ok),message:h.message||"No result reported."}}catch(f){return{ok:!1,message:f instanceof Error?f.message:"Failed to spend the saved reset"}}},[m]);return{accounts:t,error:i,isLoading:p,reload:m,spend:g}}function ae({account:t,onSpend:r,spending:i}){let l=`${t.provider}/${t.credentialId}`,p=t.email??t.accountId??t.credentialId,c=t.orgName??t.orgId,m=t.availableCount??t.credits.length,g=t.redeemableCount??0,u=t.error??t.unavailableReason;return e("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[e("div",{className:"flex items-start justify-between gap-2",children:[e("div",{className:"min-w-0",children:[e("div",{className:"text-[11px] font-semibold text-ink truncate",children:[p,c?e("span",{className:"text-ink/50 font-normal",children:[" · ",c]}):null]}),e("div",{className:"text-[10px] text-ink/50 font-mono truncate",children:l})]}),e("span",{className:"text-[10px] text-ink/60 flex-shrink-0 whitespace-nowrap",children:g>0?`${g} of ${m} usable`:`${m} saved`})]}),t.soonestExpiry!==void 0&&e("div",{className:"text-[10px] text-ink/60",children:["Soonest expires ",oa(new Date(t.soonestExpiry).toISOString())]}),t.credits.length>0&&e("div",{className:"space-y-1",children:t.credits.map((f)=>e("div",{className:"flex items-center justify-between gap-2 text-[10px] text-ink/70",children:[e("span",{className:"truncate",children:f.title??f.program??f.id}),e("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[f.clears&&f.clears.length>0&&e("span",{className:"font-mono text-ink/50",children:f.clears.join(", ")}),f.usable===!1&&e("span",{className:"font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/60",children:"blocked"})]})]},f.id))}),u&&e("div",{className:"text-[10px] text-ink/60 leading-snug",children:u}),e("button",{type:"button",onClick:()=>r(l),disabled:i||g===0,title:g===0?u??"Nothing to spend on this account right now.":`Spend a saved reset on ${l}`,className:"w-full rounded-md border border-ink/15 px-2 py-1 text-[11px] font-medium text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:i?"Spending…":"Spend saved reset"})]})}function xu(){let{accounts:t,error:r,isLoading:i,reload:l,spend:p}=K(),[c,m]=n(null),[g,u]=n(null),f=(v)=>{m(v),u(null),p(v).then((M)=>{u(M),m(null)})},h=!i&&!r&&t.length===0;return e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"min-w-0",children:[e("div",{className:"text-[11px] font-semibold text-ink",children:"Saved rate-limit resets"}),e("div",{className:"text-[10px] text-ink/50 leading-snug",children:"Provider-issued resets for Codex and Claude accounts. Spending one clears the window it covers."})]}),e("button",{type:"button",onClick:l,disabled:i,title:"Re-read saved resets",className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",children:e(D,{size:12,className:i?"animate-spin text-ink":""})})]}),r&&e("div",{className:"flex items-start gap-1.5 text-[10px] text-error leading-snug",children:[e(E,{size:12,className:"flex-shrink-0 mt-px"}),e("span",{children:r})]}),t.map((v)=>e(ae,{account:v,onSpend:f,spending:c===`${v.provider}/${v.credentialId}`},`${v.provider}/${v.credentialId}`)),h&&e("p",{className:"text-[10px] text-ink/50 leading-snug",children:"No saved resets on any account."}),g&&e("div",{className:`text-[10px] leading-snug ${g.ok?"text-ink/70":"text-error"}`,children:g.message})]})}function wu(){let[t,r]=n(null),[i,l]=n(!0),[p,c]=n(null),m=a(async(g)=>{if(!g?.silent)l(!0);c(null);try{let u=g?.force?"/api/settings/usage?refresh=1":"/api/settings/usage",f=await fetch(u);if(!f.ok)throw Error(`Usage request failed (${f.status})`);let h=await f.json();r(h)}catch(u){c(u instanceof Error?u.message:"Failed to load provider usage")}finally{if(!g?.silent)l(!1)}},[]);return o(()=>{m()},[m]),{report:t,isLoading:i,error:p,reload:m}}
2
2
  export{oa,ku,Ds,Qg,xu,wu};
@@ -1,12 +1,12 @@
1
- import{t,l,mt,ua,x,R,F,z,P,U,q,j,p,da,Ni,h,ir,sr,K,wn,ft,Ze,Xe,Hn,Jl,Rt,Ft,Sn,Lt,gt}from"./index-13dr1t1r.js";import{$t}from"./index-8hgm0abr.js";import{Pa}from"./index-tqycj126.js";var h1="flowchart-",d1=class{constructor(){this.vertexCounter=0,this.config=p(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=F,this.setAccDescription=P,this.setDiagramTitle=q,this.getAccTitle=z,this.getAccDescription=U,this.getDiagramTitle=j,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{t(this,"FlowDB")}sanitizeText(e){return x.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,a,n,o,k,c={},A){if(!e||e.trim().length===0)return;let f;if(A!==void 0){let T;if(!A.includes(`
1
+ import{t,l,mt,ua,x,R,F,z,P,U,q,j,p,da,Ni,h,ir,sr,K,Cn,ft,Ze,Xe,Hn,Jl,Rt,Ft,Tn,Lt,gt}from"./index-xsts4pqm.js";import{$t}from"./index-rt6ac0kk.js";import{Pa}from"./index-q3qpm7jn.js";var h1="flowchart-",d1=class{constructor(){this.vertexCounter=0,this.config=p(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=F,this.setAccDescription=P,this.setDiagramTitle=q,this.getAccTitle=z,this.getAccDescription=U,this.getDiagramTitle=j,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{t(this,"FlowDB")}sanitizeText(e){return x.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,a,n,o,k,c={},A){if(!e||e.trim().length===0)return;let f;if(A!==void 0){let T;if(!A.includes(`
2
2
  `))T=`{
3
3
  `+A+`
4
4
  }`;else T=A+`
5
- `;f=sr(T,{schema:ir})}let N=this.subGraphLookup.get(e);if(N&&f){N.metadata={...N.metadata,...f};return}let B=this.edges.find((T)=>T.id===e);if(B){let T=f;if(T?.animate!==void 0)B.animate=T.animate;if(T?.animation!==void 0)B.animation=T.animation;if(T?.curve!==void 0)B.interpolate=T.curve;return}let V,D=this.vertices.get(e);if(D===void 0){if(r===void 0&&a===void 0&&n!==void 0&&n!==null)l.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`);D={id:e,labelType:"text",domId:h1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,D)}if(this.vertexCounter++,r!==void 0){if(this.config=p(),V=this.sanitizeText(r.text.trim()),D.labelType=r.type,V.startsWith('"')&&V.endsWith('"'))V=V.substring(1,V.length-1);D.text=V}else if(D.text===void 0)D.text=e;if(a!==void 0)D.type=a;if(n!==void 0&&n!==null)n.forEach((T)=>{D.styles.push(T)});if(o!==void 0&&o!==null)o.forEach((T)=>{D.classes.push(T)});if(k!==void 0)D.dir=k;if(D.props===void 0)D.props=c;else if(c!==void 0)Object.assign(D.props,c);if(f!==void 0){if(f.shape){if(f.shape!==f.shape.toLowerCase()||f.shape.includes("_"))throw Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);else if(!Jl(f.shape))throw Error(`No such shape: ${f.shape}.`);D.type=f?.shape}if(f?.label)D.text=f?.label,D.labelType=this.sanitizeNodeLabelType(f?.labelType);if(f?.icon){if(D.icon=f?.icon,!f.label?.trim()&&D.text===e)D.text=""}if(f?.form)D.form=f?.form;if(f?.pos)D.pos=f?.pos;if(f?.img){if(D.img=f?.img,!f.label?.trim()&&D.text===e)D.text=""}if(f?.constraint)D.constraint=f.constraint;if(f.w)D.assetWidth=Number(f.w);if(f.h)D.assetHeight=Number(f.h)}}addSingleLink(e,r,a,n){let c={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};l.info("abc78 Got edge...",c);let A=a.text;if(A!==void 0){if(c.text=this.sanitizeText(A.text.trim()),c.text.startsWith('"')&&c.text.endsWith('"'))c.text=c.text.substring(1,c.text.length-1);c.labelType=this.sanitizeNodeLabelType(A.type)}if(a!==void 0)c.type=a.type,c.stroke=a.stroke,c.length=a.length>10?10:a.length;if(n&&!this.edges.some((f)=>f.id===n))c.id=n,c.isUserDefinedId=!0;else{let f=this.edges.filter((N)=>N.start===c.start&&N.end===c.end);if(f.length===0)c.id=wn(c.start,c.end,{counter:0,prefix:"L"});else c.id=wn(c.start,c.end,{counter:f.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))l.info("Pushing edge..."),this.edges.push(c);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
5
+ `;f=sr(T,{schema:ir})}let N=this.subGraphLookup.get(e);if(N&&f){N.metadata={...N.metadata,...f};return}let B=this.edges.find((T)=>T.id===e);if(B){let T=f;if(T?.animate!==void 0)B.animate=T.animate;if(T?.animation!==void 0)B.animation=T.animation;if(T?.curve!==void 0)B.interpolate=T.curve;return}let V,D=this.vertices.get(e);if(D===void 0){if(r===void 0&&a===void 0&&n!==void 0&&n!==null)l.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`);D={id:e,labelType:"text",domId:h1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,D)}if(this.vertexCounter++,r!==void 0){if(this.config=p(),V=this.sanitizeText(r.text.trim()),D.labelType=r.type,V.startsWith('"')&&V.endsWith('"'))V=V.substring(1,V.length-1);D.text=V}else if(D.text===void 0)D.text=e;if(a!==void 0)D.type=a;if(n!==void 0&&n!==null)n.forEach((T)=>{D.styles.push(T)});if(o!==void 0&&o!==null)o.forEach((T)=>{D.classes.push(T)});if(k!==void 0)D.dir=k;if(D.props===void 0)D.props=c;else if(c!==void 0)Object.assign(D.props,c);if(f!==void 0){if(f.shape){if(f.shape!==f.shape.toLowerCase()||f.shape.includes("_"))throw Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);else if(!Jl(f.shape))throw Error(`No such shape: ${f.shape}.`);D.type=f?.shape}if(f?.label)D.text=f?.label,D.labelType=this.sanitizeNodeLabelType(f?.labelType);if(f?.icon){if(D.icon=f?.icon,!f.label?.trim()&&D.text===e)D.text=""}if(f?.form)D.form=f?.form;if(f?.pos)D.pos=f?.pos;if(f?.img){if(D.img=f?.img,!f.label?.trim()&&D.text===e)D.text=""}if(f?.constraint)D.constraint=f.constraint;if(f.w)D.assetWidth=Number(f.w);if(f.h)D.assetHeight=Number(f.h)}}addSingleLink(e,r,a,n){let c={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};l.info("abc78 Got edge...",c);let A=a.text;if(A!==void 0){if(c.text=this.sanitizeText(A.text.trim()),c.text.startsWith('"')&&c.text.endsWith('"'))c.text=c.text.substring(1,c.text.length-1);c.labelType=this.sanitizeNodeLabelType(A.type)}if(a!==void 0)c.type=a.type,c.stroke=a.stroke,c.length=a.length>10?10:a.length;if(n&&!this.edges.some((f)=>f.id===n))c.id=n,c.isUserDefinedId=!0;else{let f=this.edges.filter((N)=>N.start===c.start&&N.end===c.end);if(f.length===0)c.id=Cn(c.start,c.end,{counter:0,prefix:"L"});else c.id=Cn(c.start,c.end,{counter:f.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))l.info("Pushing edge..."),this.edges.push(c);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
6
6
 
7
7
  Initialize mermaid with maxEdges set to a higher number to allow more edges.
8
8
  You cannot set this config via configuration inside the diagram as it is a secure config.
9
- You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,a){let n=this.isLinkData(a)?a.id.replace("@",""):void 0;l.info("addLink",e,r,n);for(let o of e)for(let k of r){let c=o===e[e.length-1],A=k===r[0];if(c&&A)this.addSingleLink(o,k,a,n);else this.addSingleLink(o,k,a,void 0)}}updateLinkInterpolate(e,r){e.forEach((a)=>{if(a==="default")this.edges.defaultInterpolate=r;else this.edges[a].interpolate=r})}updateLink(e,r){e.forEach((a)=>{if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(a==="default")this.edges.defaultStyle=r;else if(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some((n)=>n?.startsWith("fill")))this.edges[a]?.style?.push("fill:none")})}addClass(e,r){let a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((n)=>{let o=this.classes.get(n);if(o===void 0)o={id:n,styles:[],textStyles:[]},this.classes.set(n,o);if(a!==void 0&&a!==null)a.forEach((k)=>{if(/color/.exec(k)){let c=k.replace("fill","bgFill");o.textStyles.push(c)}o.styles.push(k)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let a of e.split(",")){let n=this.vertices.get(a);if(n)n.classes.push(r);let o=this.edges.find((c)=>c.id===a);if(o)o.classes.push(r);let k=this.subGraphLookup.get(a);if(k)k.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let a of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}setClickFun(e,r,a){if(p().securityLevel!=="loose")return;if(r===void 0)return;let n=[];if(typeof a==="string"){n=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let k=0;k<n.length;k++){let c=n[k].trim();if(c.startsWith('"')&&c.endsWith('"'))c=c.substr(1,c.length-2);n[k]=c}}if(n.length===0)n.push(e);let o=this.vertices.get(e);if(o)o.haveCallback=!0,this.funs.push(()=>{let k=this.lookUpDomId(e),c=document.querySelector(`[id="${k}"]`);if(c!==null)c.addEventListener("click",()=>{K.runFunc(r,...n)},!1)})}setLink(e,r,a){e.split(",").forEach((n)=>{let o=this.vertices.get(n);if(o!==void 0)o.link=K.formatUrl(r,this.config),o.linkTarget=a}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,a){e.split(",").forEach((n)=>{this.setClickFun(n,r,a)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=Pa();h(e).select("svg").selectAll("g.node").on("mouseover",(o)=>{let k=h(o.currentTarget),c=k.attr("title");if(c===null)return;let A=o.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(k.attr("title")).style("left",window.scrollX+A.left+(A.right-A.left)/2+"px").style("top",window.scrollY+A.bottom+"px"),r.html($t.sanitize(c)),k.classed("hover",!0)}).on("mouseout",(o)=>{r.transition().duration(500).style("opacity",0),h(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=p(),R()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,a){let n=e.text.trim(),o=a.text;if(e===a&&/\s/.exec(a.text))n=void 0;let c=t((V)=>{let D={boolean:{},number:{},string:{}},T=[],v;return{nodeList:V.filter(function(ie){let d=typeof ie;if(ie.stmt&&ie.stmt==="dir")return v=ie.value,!1;if(ie.trim()==="")return!1;if(d in D)return D[d].hasOwnProperty(ie)?!1:D[d][ie]=!0;else return T.includes(ie)?!1:T.push(ie)}),dir:v}},"uniq")(r.flat()),{nodeList:A,dir:f}=c,N=p().flowchart??{};if(f=f??(N.inheritDir?this.getDirection()??p().direction??void 0:void 0),this.version==="gen-1")for(let V=0;V<A.length;V++)A[V]=this.lookUpDomId(A[V]);n=n??"subGraph"+this.subCount,o=o||"",o=this.sanitizeText(o),this.subCount=this.subCount+1;let B={id:n,nodes:A,title:o.trim(),classes:[],dir:f,labelType:this.sanitizeNodeLabelType(a?.type)};return l.info("Adding",B.id,B.nodes,B.dir),B.nodes=this.makeUniq(B,this.subGraphs).nodes,this.subGraphs.push(B),this.subGraphLookup.set(n,B),n}getPosForId(e){for(let[r,a]of this.subGraphs.entries())if(a.id===e)return r;return-1}indexNodes2(e,r){let a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let n=0,o=1;while(n<a.length){let k=this.getPosForId(a[n]);if(k>=0){let c=this.indexNodes2(e,k);if(c.result)return{result:!0,count:o+c.count};else o=o+c.count}n=n+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(e){let r=e.trim(),a="arrow_open";switch(r[0]){case"<":a="arrow_point",r=r.slice(1);break;case"x":a="arrow_cross",r=r.slice(1);break;case"o":a="arrow_circle",r=r.slice(1);break}let n="normal";if(r.includes("="))n="thick";if(r.includes("."))n="dotted";return{type:a,stroke:n}}countChar(e,r){let a=r.length,n=0;for(let o=0;o<a;++o)if(r[o]===e)++n;return n}destructEndLink(e){let r=e.trim(),a=r.slice(0,-1),n="arrow_open";switch(r.slice(-1)){case"x":if(n="arrow_cross",r.startsWith("x"))n="double_"+n,a=a.slice(1);break;case">":if(n="arrow_point",r.startsWith("<"))n="double_"+n,a=a.slice(1);break;case"o":if(n="arrow_circle",r.startsWith("o"))n="double_"+n,a=a.slice(1);break}let o="normal",k=a.length-1;if(a.startsWith("="))o="thick";if(a.startsWith("~"))o="invisible";let c=this.countChar(".",a);if(c)o="dotted",k=c;return{type:n,stroke:o,length:k}}destructLink(e,r){let a=this.destructEndLink(e),n;if(r){if(n=this.destructStartLink(r),n.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=a.type;else{if(n.type!==a.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}if(n.type==="double_arrow")n.type="double_arrow_point";return n.length=a.length,n}return a}exists(e,r){for(let a of e)if(a.nodes.includes(r))return!0;return!1}makeUniq(e,r){let a=[];return e.nodes.forEach((n,o)=>{if(!this.exists(r,n))a.push(e.nodes[o])}),{nodes:a}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon){if(e.form==="circle")return"iconCircle";if(e.form==="square")return"iconSquare";if(e.form==="rounded")return"iconRounded";return"icon"}switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find((a)=>a.id===r)}destructEdgeType(e){let r="none",a="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":a=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(e,r,a,n,o,k){let c=a.get(e.id),A=n.get(e.id)??!1,f=this.findNode(r,e.id);if(f)f.cssStyles=e.styles,f.cssCompiledStyles=this.getCompiledStyles(e.classes),f.cssClasses=e.classes.join(" ");else{let N={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:c,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:k,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};if(A)r.push({...N,isGroup:!0,shape:"rect"});else r.push({...N,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:o.flowchart?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let a of e){let n=this.classes.get(a);if(n?.styles)r=[...r,...n.styles??[]].map((o)=>o.trim());if(n?.textStyles)r=[...r,...n.textStyles??[]].map((o)=>o.trim())}return r}getData(){let e=p(),r=[],a=[],n=this.getSubGraphs(),o=new Map,k=new Map,c=new Map;for(let d of n)for(let m of d.nodes)if(this.subGraphLookup.has(m))c.set(m,d.id);let A=new Map,f=new Map;for(let d of n){let m=c.get(d.id);if(m!==void 0)f.set(m,[...f.get(m)??[],d.id])}let N=0,B=t((d)=>{A.set(d,N++);for(let m of f.get(d)??[])B(m)},"walk");for(let d of n)if(!c.has(d.id))B(d.id);let V=t((d)=>this.subGraphLookup.get(d)?.metadata?.view==="collapsed","isCollapsed"),D=t((d)=>{let m,ue=new Set,le=d;while(le!==void 0&&!ue.has(le)){if(ue.add(le),V(le))m=le;le=c.get(le)}return m},"outermostCollapsed"),T=new Set,v=new Map;for(let d of n){let m=D(d.id);if(m===void 0)continue;if(d.id!==m)T.add(d.id),v.set(d.id,m);for(let ue of d.nodes){if(ue===m)continue;T.add(ue),v.set(ue,m)}}for(let d=n.length-1;d>=0;d--){let m=n[d];if(T.has(m.id))continue;if(m.nodes.length>0)k.set(m.id,!0);for(let ue of m.nodes)o.set(ue,m.id)}for(let d=n.length-1;d>=0;d--){let m=n[d];if(T.has(m.id))continue;if(m.metadata?.view==="collapsed")r.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:o.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:"collapsedGroup",dir:m.dir,isGroup:!1,look:e.look,colorIndex:A.get(m.id)});else r.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:o.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:"rect",dir:m.dir,isGroup:!0,look:e.look,colorIndex:A.get(m.id),metadata:m.metadata})}this.getVertices().forEach((d)=>{if(T.has(d.id))return;this.addNodeFromVertex(d,r,o,k,e,e.look||"classic")});let ie=this.getEdges();return ie.forEach((d,m)=>{let{arrowTypeStart:ue,arrowTypeEnd:le}=this.destructEdgeType(d.type),O=[...ie.defaultStyle??[]],M=v.get(d.start)??d.start,W=v.get(d.end)??d.end;if(M===W&&(v.has(d.start)||v.has(d.end)))return;if(d.style)O.push(...d.style);let H={id:wn(M,W,{counter:m,prefix:"L"},d.id),isUserDefinedId:d.isUserDefinedId,start:M,end:W,type:d.type??"normal",label:d.text,labelType:d.labelType,labelpos:"c",thickness:d.stroke,minlen:d.length,classes:d?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":ue,arrowTypeEnd:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":le,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(d.classes),labelStyle:O,style:O,pattern:d.stroke,look:e.look,animate:d.animate,animation:d.animation,curve:d.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};a.push(H)}),{nodes:r,edges:a,other:{},config:e}}defaultConfig(){return Ni.flowchart}},p1=t(function(e,r){return r.db.getClasses()},"getClasses"),f1=t(async function(e,r,a,n){l.info("REF0:"),l.info("Drawing state diagram (v2)",r);let{securityLevel:o,flowchart:k,layout:c}=p();n.db.setDiagramId(r),l.debug("Before getData: ");let A=n.db.getData();l.debug("Data: ",A);let f=Lt(r,o),N=n.db.getDirection();A.type=n.type,A.layoutAlgorithm=Ft(c),A.direction=N,A.nodeSpacing=k?.nodeSpacing||50,A.rankSpacing=k?.rankSpacing||50,A.markers=["point","circle","cross"],A.diagramId=r,l.debug("REF1:",A),await Rt(A,f);let B=A.config.flowchart?.diagramPadding??8;K.insertTitle(f,"flowchartTitleText",k?.titleTopMargin||0,n.db.getDiagramTitle()),gt(f,B,"flowchart",k?.useMaxWidth||!1)},"draw"),b1={getClasses:p1,draw:f1},kt=function(){var e=t(function(Be,b,g,C){for(g=g||{},C=Be.length;C--;g[Be[C]]=b);return g},"o"),r=[1,4],a=[1,3],n=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],k=[2,2],c=[1,13],A=[1,14],f=[1,15],N=[1,16],B=[1,23],V=[1,25],D=[1,26],T=[1,27],v=[1,50],Y=[1,49],ie=[1,29],d=[1,30],m=[1,31],ue=[1,32],le=[1,33],O=[1,45],M=[1,47],W=[1,43],H=[1,48],Q=[1,44],J=[1,51],Z=[1,46],ee=[1,52],te=[1,53],Je=[1,34],$e=[1,35],et=[1,36],tt=[1,37],st=[1,38],Fe=[1,58],L=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],be=[1,62],ke=[1,61],ge=[1,63],Ie=[8,9,11,75,77,78],At=[1,79],Re=[1,92],Ne=[1,97],Ge=[1,96],Pe=[1,93],Oe=[1,89],Me=[1,95],Ue=[1,91],We=[1,98],ze=[1,94],je=[1,99],Ke=[1,90],ve=[8,9,10,11,40,75,77,78],re=[8,9,10,11,40,46,75,77,78],ce=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Ct=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Ye=[44,60,89,102,105,106,109,111,114,115,116],Dt=[1,122],Tt=[1,123],it=[1,125],rt=[1,124],Et=[44,60,62,74,89,102,105,106,109,111,114,115,116],St=[1,134],yt=[1,148],xt=[1,149],_t=[1,150],Bt=[1,151],vt=[1,136],Vt=[1,138],wt=[1,142],It=[1,143],Nt=[1,144],Gt=[1,145],Pt=[1,146],Ot=[1,147],Mt=[1,152],Ut=[1,153],Wt=[1,132],zt=[1,133],jt=[1,140],Kt=[1,135],Yt=[1,139],Ht=[1,137],ot=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],qt=[1,155],Xt=[1,157],G=[8,9,11],he=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],E=[1,177],ae=[1,173],ne=[1,174],S=[1,178],y=[1,175],_=[1,176],He=[77,116,119],w=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Qt=[10,106],_e=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ae=[1,248],me=[1,246],Ce=[1,250],De=[1,244],Te=[1,245],Ee=[1,247],Se=[1,249],ye=[1,251],qe=[1,269],Jt=[8,9,11,106],fe=[8,9,10,11,60,84,105,106,109,110,111,112],lt={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(b,g,C,u,I,s,Le){var i=s.length-1;switch(I){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 183:this.$=s[i];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(s[i-1]),this.$=s[i-1];break;case 27:this.$=s[i-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4]);break;case 34:this.$=u.addSubGraph(s[i-3],s[i-1],s[i-3]);break;case 35:this.$=u.addSubGraph(void 0,s[i-1],void 0);break;case 37:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 43:this.$=s[i-1]+s[i];break;case 44:this.$=s[i];break;case 45:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 46:u.addLink(s[i-2].stmt,s[i],s[i-1]),this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 47:u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 48:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 49:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 50:this.$={stmt:s[i],nodes:s[i]};break;case 51:this.$=[s[i]];break;case 52:u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4]),this.$=s[i-5].concat(s[i]);break;case 53:this.$=s[i-4].concat(s[i]);break;case 54:this.$=s[i];break;case 55:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 56:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square");break;case 57:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle");break;case 58:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle");break;case 59:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse");break;case 60:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium");break;case 61:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine");break;case 62:this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]]));break;case 63:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder");break;case 64:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round");break;case 65:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond");break;case 66:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon");break;case 67:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd");break;case 68:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid");break;case 69:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid");break;case 70:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right");break;case 71:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left");break;case 72:this.$=s[i],u.addVertex(s[i]);break;case 73:s[i-1].text=s[i],this.$=s[i-1];break;case 74:case 75:s[i-2].text=s[i-1],this.$=s[i-2];break;case 76:this.$=s[i];break;case 77:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1]};break;case 78:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1],id:s[i-3]};break;case 79:this.$={text:s[i],type:"text"};break;case 80:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 81:this.$={text:s[i],type:"string"};break;case 82:this.$={text:s[i],type:"markdown"};break;case 83:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length};break;case 84:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length,id:s[i-1]};break;case 85:this.$=s[i-1];break;case 86:this.$={text:s[i],type:"text"};break;case 87:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 88:this.$={text:s[i],type:"string"};break;case 89:case 104:this.$={text:s[i],type:"markdown"};break;case 101:this.$={text:s[i],type:"text"};break;case 102:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 103:this.$={text:s[i],type:"text"};break;case 105:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 106:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 107:case 115:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 108:case 116:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 109:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 110:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 111:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 112:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 113:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 114:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 117:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 118:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 119:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 120:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 121:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 122:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 123:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 124:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 125:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 126:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 127:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 128:case 130:this.$=[s[i]];break;case 129:case 131:s[i-2].push(s[i]),this.$=s[i-2];break;case 133:this.$=s[i-1]+s[i];break;case 181:this.$=s[i];break;case 182:this.$=s[i-1]+""+s[i];break;case 184:this.$=s[i-1]+""+s[i];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:r,10:a,12:n},{1:[3]},e(o,k,{5:6}),{4:7,9:r,10:a,12:n},{4:8,9:r,10:a,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:Fe,15:54,18:57},e(L,[2,3]),e(L,[2,4]),e(L,[2,5]),e(L,[2,6]),e(L,[2,7]),e(L,[2,8]),{8:be,9:ke,11:ge,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:be,9:ke,11:ge,21:68},{8:be,9:ke,11:ge,21:69},{8:be,9:ke,11:ge,21:70},{8:be,9:ke,11:ge,21:71},{8:be,9:ke,11:ge,21:72},{8:be,9:ke,10:[1,73],11:ge,21:74},e(L,[2,36]),{35:[1,75]},{37:[1,76]},e(L,[2,39]),e(Ie,[2,50],{18:77,39:78,10:Fe,40:At}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Re,44:Ne,60:Ge,80:[1,87],89:Pe,95:[1,84],97:[1,85],101:86,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},e(L,[2,185]),e(L,[2,186]),e(L,[2,187]),e(L,[2,188]),e(L,[2,189]),e(ve,[2,51]),e(ve,[2,54],{46:[1,100]}),e(re,[2,72],{113:113,29:[1,101],44:v,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:Y,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:O,102:M,105:W,106:H,109:Q,111:J,114:Z,115:ee,116:te}),e(ce,[2,181]),e(ce,[2,142]),e(ce,[2,143]),e(ce,[2,144]),e(ce,[2,145]),e(ce,[2,146]),e(ce,[2,147]),e(ce,[2,148]),e(ce,[2,149]),e(ce,[2,150]),e(ce,[2,151]),e(ce,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(Ct,[2,26],{18:115,10:Fe}),e(L,[2,27]),{42:116,43:39,44:v,45:40,47:41,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(L,[2,40]),e(L,[2,41]),e(L,[2,42]),e(Ye,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Dt,81:Tt,116:it,119:rt},{75:[1,126],77:[1,127]},e(Et,[2,83]),e(L,[2,28]),e(L,[2,29]),e(L,[2,30]),e(L,[2,31]),e(L,[2,32]),{10:St,12:yt,14:xt,27:_t,28:128,32:Bt,44:vt,60:Vt,75:wt,80:[1,130],81:[1,131],83:141,84:It,85:Nt,86:Gt,87:Pt,88:Ot,89:Mt,90:Ut,91:129,105:Wt,109:zt,111:jt,114:Kt,115:Yt,116:Ht},e(ot,k,{5:154}),e(L,[2,37]),e(L,[2,38]),e(Ie,[2,48],{44:qt}),e(Ie,[2,49],{18:156,10:Fe,40:Xt}),e(ve,[2,44]),{44:v,47:158,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{102:[1,159],103:160,105:[1,161]},{44:v,47:162,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{44:v,47:163,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(G,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(G,[2,115],{120:168,10:[1,167],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(G,[2,117],{10:[1,169]}),e(he,[2,183]),e(he,[2,170]),e(he,[2,171]),e(he,[2,172]),e(he,[2,173]),e(he,[2,174]),e(he,[2,175]),e(he,[2,176]),e(he,[2,177]),e(he,[2,178]),e(he,[2,179]),e(he,[2,180]),{44:v,47:170,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{30:171,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:179,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:181,50:[1,180],67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:182,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:183,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:184,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{109:[1,185]},{30:186,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:187,65:[1,188],67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:189,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:190,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:191,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},e(ce,[2,182]),e(o,[2,20]),e(Ct,[2,25]),e(Ie,[2,46],{39:192,18:193,10:Fe,40:At}),e(Ye,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{77:[1,197],79:198,116:it,119:rt},e(He,[2,79]),e(He,[2,81]),e(He,[2,82]),e(He,[2,168]),e(He,[2,169]),{76:199,79:121,80:Dt,81:Tt,116:it,119:rt},e(Et,[2,84]),{8:be,9:ke,10:St,11:ge,12:yt,14:xt,21:201,27:_t,29:[1,200],32:Bt,44:vt,60:Vt,75:wt,83:141,84:It,85:Nt,86:Gt,87:Pt,88:Ot,89:Mt,90:Ut,91:202,105:Wt,109:zt,111:jt,114:Kt,115:Yt,116:Ht},e(w,[2,101]),e(w,[2,103]),e(w,[2,104]),e(w,[2,157]),e(w,[2,158]),e(w,[2,159]),e(w,[2,160]),e(w,[2,161]),e(w,[2,162]),e(w,[2,163]),e(w,[2,164]),e(w,[2,165]),e(w,[2,166]),e(w,[2,167]),e(w,[2,90]),e(w,[2,91]),e(w,[2,92]),e(w,[2,93]),e(w,[2,94]),e(w,[2,95]),e(w,[2,96]),e(w,[2,97]),e(w,[2,98]),e(w,[2,99]),e(w,[2,100]),{6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,203],33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},{10:Fe,18:204},{44:[1,205]},e(ve,[2,43]),{10:[1,206],44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,207]},{10:[1,208],106:[1,209]},e(Qt,[2,128]),{10:[1,210],44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,211],44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:113,114:Z,115:ee,116:te},{80:[1,212]},e(G,[2,109],{10:[1,213]}),e(G,[2,111],{10:[1,214]}),{80:[1,215]},e(he,[2,184]),{80:[1,216],98:[1,217]},e(ve,[2,55],{113:113,44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,114:Z,115:ee,116:te}),{31:[1,218],67:E,82:219,116:S,117:y,118:_},e(_e,[2,86]),e(_e,[2,88]),e(_e,[2,89]),e(_e,[2,153]),e(_e,[2,154]),e(_e,[2,155]),e(_e,[2,156]),{49:[1,220],67:E,82:219,116:S,117:y,118:_},{30:221,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{51:[1,222],67:E,82:219,116:S,117:y,118:_},{53:[1,223],67:E,82:219,116:S,117:y,118:_},{55:[1,224],67:E,82:219,116:S,117:y,118:_},{57:[1,225],67:E,82:219,116:S,117:y,118:_},{60:[1,226]},{64:[1,227],67:E,82:219,116:S,117:y,118:_},{66:[1,228],67:E,82:219,116:S,117:y,118:_},{30:229,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{31:[1,230],67:E,82:219,116:S,117:y,118:_},{67:E,69:[1,231],71:[1,232],82:219,116:S,117:y,118:_},{67:E,69:[1,234],71:[1,233],82:219,116:S,117:y,118:_},e(Ie,[2,45],{18:156,10:Fe,40:Xt}),e(Ie,[2,47],{44:qt}),e(Ye,[2,75]),e(Ye,[2,74]),{62:[1,235],67:E,82:219,116:S,117:y,118:_},e(Ye,[2,77]),e(He,[2,80]),{77:[1,236],79:198,116:it,119:rt},{30:237,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},e(ot,k,{5:238}),e(w,[2,102]),e(L,[2,35]),{43:239,44:v,45:40,47:41,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{10:Fe,18:240},{10:Ae,60:me,84:Ce,92:241,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:252,104:[1,253],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:254,104:[1,255],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{105:[1,256]},{10:Ae,60:me,84:Ce,92:257,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{44:v,47:258,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(G,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(G,[2,116]),e(G,[2,118],{10:[1,262]}),e(G,[2,119]),e(re,[2,56]),e(_e,[2,87]),e(re,[2,57]),{51:[1,263],67:E,82:219,116:S,117:y,118:_},e(re,[2,64]),e(re,[2,59]),e(re,[2,60]),e(re,[2,61]),{109:[1,264]},e(re,[2,63]),e(re,[2,65]),{66:[1,265],67:E,82:219,116:S,117:y,118:_},e(re,[2,67]),e(re,[2,68]),e(re,[2,70]),e(re,[2,69]),e(re,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Ye,[2,78]),{31:[1,266],67:E,82:219,116:S,117:y,118:_},{6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,267],33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},e(ve,[2,53]),{43:268,44:v,45:40,47:41,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(G,[2,121],{106:qe}),e(Jt,[2,130],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(fe,[2,132]),e(fe,[2,134]),e(fe,[2,135]),e(fe,[2,136]),e(fe,[2,137]),e(fe,[2,138]),e(fe,[2,139]),e(fe,[2,140]),e(fe,[2,141]),e(G,[2,122],{106:qe}),{10:[1,271]},e(G,[2,123],{106:qe}),{10:[1,272]},e(Qt,[2,129]),e(G,[2,105],{106:qe}),e(G,[2,106],{113:113,44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,114:Z,115:ee,116:te}),e(G,[2,110]),e(G,[2,112],{10:[1,273]}),e(G,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:be,9:ke,11:ge,21:278},e(L,[2,34]),e(ve,[2,52]),{10:Ae,60:me,84:Ce,105:De,107:279,108:243,109:Te,110:Ee,111:Se,112:ye},e(fe,[2,133]),{14:Re,44:Ne,60:Ge,89:Pe,101:280,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{14:Re,44:Ne,60:Ge,89:Pe,101:281,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{98:[1,282]},e(G,[2,120]),e(re,[2,58]),{30:283,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},e(re,[2,66]),e(ot,k,{5:284}),e(Jt,[2,131],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(G,[2,126],{120:168,10:[1,285],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(G,[2,127],{120:168,10:[1,286],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(G,[2,114]),{31:[1,287],67:E,82:219,116:S,117:y,118:_},{6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,288],33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},{10:Ae,60:me,84:Ce,92:289,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:290,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},e(re,[2,62]),e(L,[2,33]),e(G,[2,124],{106:qe}),e(G,[2,125],{106:qe})],defaultActions:{},parseError:t(function(b,g){if(g.recoverable)this.trace(b);else{var C=Error(b);throw C.hash=g,C}},"parseError"),parse:t(function(b){var g=this,C=[0],u=[],I=[null],s=[],Le=this.table,i="",X=0,Zt=0,e1=0,u1=2,t1=1,o1=s.slice.call(arguments,1),se=Object.create(this.lexer),Ve={yy:{}};for(var ct in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ct))Ve.yy[ct]=this.yy[ct];if(se.setInput(b,Ve.yy),Ve.yy.lexer=se,Ve.yy.parser=this,typeof se.yylloc>"u")se.yylloc={};var ht=se.yylloc;s.push(ht);var l1=se.options&&se.options.ranges;if(typeof Ve.yy.parseError==="function")this.parseError=Ve.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function c1(pe){C.length=C.length-2*pe,I.length=I.length-pe,s.length=s.length-pe}t(c1,"popStack");function s1(){var pe=u.pop()||se.lex()||t1;if(typeof pe!=="number"){if(pe instanceof Array)u=pe,pe=u.pop();pe=g.symbols_[pe]||pe}return pe}t(s1,"lex");var oe,dt,we,de,C1,pt,Qe={},nt,xe,i1,ut;while(!0){if(we=C[C.length-1],this.defaultActions[we])de=this.defaultActions[we];else{if(oe===null||typeof oe>"u")oe=s1();de=Le[we]&&Le[we][oe]}if(typeof de>"u"||!de.length||!de[0]){var bt="";ut=[];for(nt in Le[we])if(this.terminals_[nt]&&nt>u1)ut.push("'"+this.terminals_[nt]+"'");if(se.showPosition)bt="Parse error on line "+(X+1)+`:
9
+ You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,a){let n=this.isLinkData(a)?a.id.replace("@",""):void 0;l.info("addLink",e,r,n);for(let o of e)for(let k of r){let c=o===e[e.length-1],A=k===r[0];if(c&&A)this.addSingleLink(o,k,a,n);else this.addSingleLink(o,k,a,void 0)}}updateLinkInterpolate(e,r){e.forEach((a)=>{if(a==="default")this.edges.defaultInterpolate=r;else this.edges[a].interpolate=r})}updateLink(e,r){e.forEach((a)=>{if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(a==="default")this.edges.defaultStyle=r;else if(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some((n)=>n?.startsWith("fill")))this.edges[a]?.style?.push("fill:none")})}addClass(e,r){let a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((n)=>{let o=this.classes.get(n);if(o===void 0)o={id:n,styles:[],textStyles:[]},this.classes.set(n,o);if(a!==void 0&&a!==null)a.forEach((k)=>{if(/color/.exec(k)){let c=k.replace("fill","bgFill");o.textStyles.push(c)}o.styles.push(k)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let a of e.split(",")){let n=this.vertices.get(a);if(n)n.classes.push(r);let o=this.edges.find((c)=>c.id===a);if(o)o.classes.push(r);let k=this.subGraphLookup.get(a);if(k)k.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let a of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}setClickFun(e,r,a){if(p().securityLevel!=="loose")return;if(r===void 0)return;let n=[];if(typeof a==="string"){n=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let k=0;k<n.length;k++){let c=n[k].trim();if(c.startsWith('"')&&c.endsWith('"'))c=c.substr(1,c.length-2);n[k]=c}}if(n.length===0)n.push(e);let o=this.vertices.get(e);if(o)o.haveCallback=!0,this.funs.push(()=>{let k=this.lookUpDomId(e),c=document.querySelector(`[id="${k}"]`);if(c!==null)c.addEventListener("click",()=>{K.runFunc(r,...n)},!1)})}setLink(e,r,a){e.split(",").forEach((n)=>{let o=this.vertices.get(n);if(o!==void 0)o.link=K.formatUrl(r,this.config),o.linkTarget=a}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,a){e.split(",").forEach((n)=>{this.setClickFun(n,r,a)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=Pa();h(e).select("svg").selectAll("g.node").on("mouseover",(o)=>{let k=h(o.currentTarget),c=k.attr("title");if(c===null)return;let A=o.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(k.attr("title")).style("left",window.scrollX+A.left+(A.right-A.left)/2+"px").style("top",window.scrollY+A.bottom+"px"),r.html($t.sanitize(c)),k.classed("hover",!0)}).on("mouseout",(o)=>{r.transition().duration(500).style("opacity",0),h(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=p(),R()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,a){let n=e.text.trim(),o=a.text;if(e===a&&/\s/.exec(a.text))n=void 0;let c=t((V)=>{let D={boolean:{},number:{},string:{}},T=[],v;return{nodeList:V.filter(function(ie){let d=typeof ie;if(ie.stmt&&ie.stmt==="dir")return v=ie.value,!1;if(ie.trim()==="")return!1;if(d in D)return D[d].hasOwnProperty(ie)?!1:D[d][ie]=!0;else return T.includes(ie)?!1:T.push(ie)}),dir:v}},"uniq")(r.flat()),{nodeList:A,dir:f}=c,N=p().flowchart??{};if(f=f??(N.inheritDir?this.getDirection()??p().direction??void 0:void 0),this.version==="gen-1")for(let V=0;V<A.length;V++)A[V]=this.lookUpDomId(A[V]);n=n??"subGraph"+this.subCount,o=o||"",o=this.sanitizeText(o),this.subCount=this.subCount+1;let B={id:n,nodes:A,title:o.trim(),classes:[],dir:f,labelType:this.sanitizeNodeLabelType(a?.type)};return l.info("Adding",B.id,B.nodes,B.dir),B.nodes=this.makeUniq(B,this.subGraphs).nodes,this.subGraphs.push(B),this.subGraphLookup.set(n,B),n}getPosForId(e){for(let[r,a]of this.subGraphs.entries())if(a.id===e)return r;return-1}indexNodes2(e,r){let a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let n=0,o=1;while(n<a.length){let k=this.getPosForId(a[n]);if(k>=0){let c=this.indexNodes2(e,k);if(c.result)return{result:!0,count:o+c.count};else o=o+c.count}n=n+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(e){let r=e.trim(),a="arrow_open";switch(r[0]){case"<":a="arrow_point",r=r.slice(1);break;case"x":a="arrow_cross",r=r.slice(1);break;case"o":a="arrow_circle",r=r.slice(1);break}let n="normal";if(r.includes("="))n="thick";if(r.includes("."))n="dotted";return{type:a,stroke:n}}countChar(e,r){let a=r.length,n=0;for(let o=0;o<a;++o)if(r[o]===e)++n;return n}destructEndLink(e){let r=e.trim(),a=r.slice(0,-1),n="arrow_open";switch(r.slice(-1)){case"x":if(n="arrow_cross",r.startsWith("x"))n="double_"+n,a=a.slice(1);break;case">":if(n="arrow_point",r.startsWith("<"))n="double_"+n,a=a.slice(1);break;case"o":if(n="arrow_circle",r.startsWith("o"))n="double_"+n,a=a.slice(1);break}let o="normal",k=a.length-1;if(a.startsWith("="))o="thick";if(a.startsWith("~"))o="invisible";let c=this.countChar(".",a);if(c)o="dotted",k=c;return{type:n,stroke:o,length:k}}destructLink(e,r){let a=this.destructEndLink(e),n;if(r){if(n=this.destructStartLink(r),n.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=a.type;else{if(n.type!==a.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}if(n.type==="double_arrow")n.type="double_arrow_point";return n.length=a.length,n}return a}exists(e,r){for(let a of e)if(a.nodes.includes(r))return!0;return!1}makeUniq(e,r){let a=[];return e.nodes.forEach((n,o)=>{if(!this.exists(r,n))a.push(e.nodes[o])}),{nodes:a}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon){if(e.form==="circle")return"iconCircle";if(e.form==="square")return"iconSquare";if(e.form==="rounded")return"iconRounded";return"icon"}switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find((a)=>a.id===r)}destructEdgeType(e){let r="none",a="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":a=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(e,r,a,n,o,k){let c=a.get(e.id),A=n.get(e.id)??!1,f=this.findNode(r,e.id);if(f)f.cssStyles=e.styles,f.cssCompiledStyles=this.getCompiledStyles(e.classes),f.cssClasses=e.classes.join(" ");else{let N={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:c,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:k,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};if(A)r.push({...N,isGroup:!0,shape:"rect"});else r.push({...N,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:o.flowchart?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let a of e){let n=this.classes.get(a);if(n?.styles)r=[...r,...n.styles??[]].map((o)=>o.trim());if(n?.textStyles)r=[...r,...n.textStyles??[]].map((o)=>o.trim())}return r}getData(){let e=p(),r=[],a=[],n=this.getSubGraphs(),o=new Map,k=new Map,c=new Map;for(let d of n)for(let m of d.nodes)if(this.subGraphLookup.has(m))c.set(m,d.id);let A=new Map,f=new Map;for(let d of n){let m=c.get(d.id);if(m!==void 0)f.set(m,[...f.get(m)??[],d.id])}let N=0,B=t((d)=>{A.set(d,N++);for(let m of f.get(d)??[])B(m)},"walk");for(let d of n)if(!c.has(d.id))B(d.id);let V=t((d)=>this.subGraphLookup.get(d)?.metadata?.view==="collapsed","isCollapsed"),D=t((d)=>{let m,ue=new Set,le=d;while(le!==void 0&&!ue.has(le)){if(ue.add(le),V(le))m=le;le=c.get(le)}return m},"outermostCollapsed"),T=new Set,v=new Map;for(let d of n){let m=D(d.id);if(m===void 0)continue;if(d.id!==m)T.add(d.id),v.set(d.id,m);for(let ue of d.nodes){if(ue===m)continue;T.add(ue),v.set(ue,m)}}for(let d=n.length-1;d>=0;d--){let m=n[d];if(T.has(m.id))continue;if(m.nodes.length>0)k.set(m.id,!0);for(let ue of m.nodes)o.set(ue,m.id)}for(let d=n.length-1;d>=0;d--){let m=n[d];if(T.has(m.id))continue;if(m.metadata?.view==="collapsed")r.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:o.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:"collapsedGroup",dir:m.dir,isGroup:!1,look:e.look,colorIndex:A.get(m.id)});else r.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:o.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:"rect",dir:m.dir,isGroup:!0,look:e.look,colorIndex:A.get(m.id),metadata:m.metadata})}this.getVertices().forEach((d)=>{if(T.has(d.id))return;this.addNodeFromVertex(d,r,o,k,e,e.look||"classic")});let ie=this.getEdges();return ie.forEach((d,m)=>{let{arrowTypeStart:ue,arrowTypeEnd:le}=this.destructEdgeType(d.type),O=[...ie.defaultStyle??[]],M=v.get(d.start)??d.start,W=v.get(d.end)??d.end;if(M===W&&(v.has(d.start)||v.has(d.end)))return;if(d.style)O.push(...d.style);let H={id:Cn(M,W,{counter:m,prefix:"L"},d.id),isUserDefinedId:d.isUserDefinedId,start:M,end:W,type:d.type??"normal",label:d.text,labelType:d.labelType,labelpos:"c",thickness:d.stroke,minlen:d.length,classes:d?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":ue,arrowTypeEnd:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":le,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(d.classes),labelStyle:O,style:O,pattern:d.stroke,look:e.look,animate:d.animate,animation:d.animation,curve:d.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};a.push(H)}),{nodes:r,edges:a,other:{},config:e}}defaultConfig(){return Ni.flowchart}},p1=t(function(e,r){return r.db.getClasses()},"getClasses"),f1=t(async function(e,r,a,n){l.info("REF0:"),l.info("Drawing state diagram (v2)",r);let{securityLevel:o,flowchart:k,layout:c}=p();n.db.setDiagramId(r),l.debug("Before getData: ");let A=n.db.getData();l.debug("Data: ",A);let f=Lt(r,o),N=n.db.getDirection();A.type=n.type,A.layoutAlgorithm=Ft(c),A.direction=N,A.nodeSpacing=k?.nodeSpacing||50,A.rankSpacing=k?.rankSpacing||50,A.markers=["point","circle","cross"],A.diagramId=r,l.debug("REF1:",A),await Rt(A,f);let B=A.config.flowchart?.diagramPadding??8;K.insertTitle(f,"flowchartTitleText",k?.titleTopMargin||0,n.db.getDiagramTitle()),gt(f,B,"flowchart",k?.useMaxWidth||!1)},"draw"),b1={getClasses:p1,draw:f1},kt=function(){var e=t(function(Be,b,g,C){for(g=g||{},C=Be.length;C--;g[Be[C]]=b);return g},"o"),r=[1,4],a=[1,3],n=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],k=[2,2],c=[1,13],A=[1,14],f=[1,15],N=[1,16],B=[1,23],V=[1,25],D=[1,26],T=[1,27],v=[1,50],Y=[1,49],ie=[1,29],d=[1,30],m=[1,31],ue=[1,32],le=[1,33],O=[1,45],M=[1,47],W=[1,43],H=[1,48],Q=[1,44],J=[1,51],Z=[1,46],ee=[1,52],te=[1,53],Je=[1,34],$e=[1,35],et=[1,36],tt=[1,37],st=[1,38],Fe=[1,58],L=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],be=[1,62],ke=[1,61],ge=[1,63],Ie=[8,9,11,75,77,78],At=[1,79],Re=[1,92],Ne=[1,97],Ge=[1,96],Pe=[1,93],Oe=[1,89],Me=[1,95],Ue=[1,91],We=[1,98],ze=[1,94],je=[1,99],Ke=[1,90],ve=[8,9,10,11,40,75,77,78],re=[8,9,10,11,40,46,75,77,78],ce=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Ct=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Ye=[44,60,89,102,105,106,109,111,114,115,116],Dt=[1,122],Tt=[1,123],it=[1,125],rt=[1,124],Et=[44,60,62,74,89,102,105,106,109,111,114,115,116],St=[1,134],yt=[1,148],xt=[1,149],_t=[1,150],Bt=[1,151],vt=[1,136],Vt=[1,138],wt=[1,142],It=[1,143],Nt=[1,144],Gt=[1,145],Pt=[1,146],Ot=[1,147],Mt=[1,152],Ut=[1,153],Wt=[1,132],zt=[1,133],jt=[1,140],Kt=[1,135],Yt=[1,139],Ht=[1,137],ot=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],qt=[1,155],Xt=[1,157],G=[8,9,11],he=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],E=[1,177],ae=[1,173],ne=[1,174],S=[1,178],y=[1,175],_=[1,176],He=[77,116,119],w=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Qt=[10,106],_e=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ae=[1,248],me=[1,246],Ce=[1,250],De=[1,244],Te=[1,245],Ee=[1,247],Se=[1,249],ye=[1,251],qe=[1,269],Jt=[8,9,11,106],fe=[8,9,10,11,60,84,105,106,109,110,111,112],lt={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(b,g,C,u,I,s,Le){var i=s.length-1;switch(I){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 183:this.$=s[i];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(s[i-1]),this.$=s[i-1];break;case 27:this.$=s[i-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4]);break;case 34:this.$=u.addSubGraph(s[i-3],s[i-1],s[i-3]);break;case 35:this.$=u.addSubGraph(void 0,s[i-1],void 0);break;case 37:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 43:this.$=s[i-1]+s[i];break;case 44:this.$=s[i];break;case 45:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 46:u.addLink(s[i-2].stmt,s[i],s[i-1]),this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 47:u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 48:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 49:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 50:this.$={stmt:s[i],nodes:s[i]};break;case 51:this.$=[s[i]];break;case 52:u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4]),this.$=s[i-5].concat(s[i]);break;case 53:this.$=s[i-4].concat(s[i]);break;case 54:this.$=s[i];break;case 55:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 56:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square");break;case 57:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle");break;case 58:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle");break;case 59:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse");break;case 60:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium");break;case 61:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine");break;case 62:this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]]));break;case 63:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder");break;case 64:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round");break;case 65:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond");break;case 66:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon");break;case 67:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd");break;case 68:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid");break;case 69:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid");break;case 70:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right");break;case 71:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left");break;case 72:this.$=s[i],u.addVertex(s[i]);break;case 73:s[i-1].text=s[i],this.$=s[i-1];break;case 74:case 75:s[i-2].text=s[i-1],this.$=s[i-2];break;case 76:this.$=s[i];break;case 77:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1]};break;case 78:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1],id:s[i-3]};break;case 79:this.$={text:s[i],type:"text"};break;case 80:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 81:this.$={text:s[i],type:"string"};break;case 82:this.$={text:s[i],type:"markdown"};break;case 83:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length};break;case 84:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length,id:s[i-1]};break;case 85:this.$=s[i-1];break;case 86:this.$={text:s[i],type:"text"};break;case 87:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 88:this.$={text:s[i],type:"string"};break;case 89:case 104:this.$={text:s[i],type:"markdown"};break;case 101:this.$={text:s[i],type:"text"};break;case 102:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 103:this.$={text:s[i],type:"text"};break;case 105:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 106:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 107:case 115:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 108:case 116:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 109:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 110:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 111:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 112:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 113:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 114:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 117:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 118:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 119:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 120:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 121:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 122:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 123:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 124:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 125:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 126:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 127:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 128:case 130:this.$=[s[i]];break;case 129:case 131:s[i-2].push(s[i]),this.$=s[i-2];break;case 133:this.$=s[i-1]+s[i];break;case 181:this.$=s[i];break;case 182:this.$=s[i-1]+""+s[i];break;case 184:this.$=s[i-1]+""+s[i];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:r,10:a,12:n},{1:[3]},e(o,k,{5:6}),{4:7,9:r,10:a,12:n},{4:8,9:r,10:a,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:Fe,15:54,18:57},e(L,[2,3]),e(L,[2,4]),e(L,[2,5]),e(L,[2,6]),e(L,[2,7]),e(L,[2,8]),{8:be,9:ke,11:ge,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:be,9:ke,11:ge,21:68},{8:be,9:ke,11:ge,21:69},{8:be,9:ke,11:ge,21:70},{8:be,9:ke,11:ge,21:71},{8:be,9:ke,11:ge,21:72},{8:be,9:ke,10:[1,73],11:ge,21:74},e(L,[2,36]),{35:[1,75]},{37:[1,76]},e(L,[2,39]),e(Ie,[2,50],{18:77,39:78,10:Fe,40:At}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Re,44:Ne,60:Ge,80:[1,87],89:Pe,95:[1,84],97:[1,85],101:86,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},e(L,[2,185]),e(L,[2,186]),e(L,[2,187]),e(L,[2,188]),e(L,[2,189]),e(ve,[2,51]),e(ve,[2,54],{46:[1,100]}),e(re,[2,72],{113:113,29:[1,101],44:v,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:Y,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:O,102:M,105:W,106:H,109:Q,111:J,114:Z,115:ee,116:te}),e(ce,[2,181]),e(ce,[2,142]),e(ce,[2,143]),e(ce,[2,144]),e(ce,[2,145]),e(ce,[2,146]),e(ce,[2,147]),e(ce,[2,148]),e(ce,[2,149]),e(ce,[2,150]),e(ce,[2,151]),e(ce,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(Ct,[2,26],{18:115,10:Fe}),e(L,[2,27]),{42:116,43:39,44:v,45:40,47:41,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(L,[2,40]),e(L,[2,41]),e(L,[2,42]),e(Ye,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Dt,81:Tt,116:it,119:rt},{75:[1,126],77:[1,127]},e(Et,[2,83]),e(L,[2,28]),e(L,[2,29]),e(L,[2,30]),e(L,[2,31]),e(L,[2,32]),{10:St,12:yt,14:xt,27:_t,28:128,32:Bt,44:vt,60:Vt,75:wt,80:[1,130],81:[1,131],83:141,84:It,85:Nt,86:Gt,87:Pt,88:Ot,89:Mt,90:Ut,91:129,105:Wt,109:zt,111:jt,114:Kt,115:Yt,116:Ht},e(ot,k,{5:154}),e(L,[2,37]),e(L,[2,38]),e(Ie,[2,48],{44:qt}),e(Ie,[2,49],{18:156,10:Fe,40:Xt}),e(ve,[2,44]),{44:v,47:158,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{102:[1,159],103:160,105:[1,161]},{44:v,47:162,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{44:v,47:163,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(G,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(G,[2,115],{120:168,10:[1,167],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(G,[2,117],{10:[1,169]}),e(he,[2,183]),e(he,[2,170]),e(he,[2,171]),e(he,[2,172]),e(he,[2,173]),e(he,[2,174]),e(he,[2,175]),e(he,[2,176]),e(he,[2,177]),e(he,[2,178]),e(he,[2,179]),e(he,[2,180]),{44:v,47:170,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{30:171,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:179,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:181,50:[1,180],67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:182,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:183,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:184,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{109:[1,185]},{30:186,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:187,65:[1,188],67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:189,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:190,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{30:191,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},e(ce,[2,182]),e(o,[2,20]),e(Ct,[2,25]),e(Ie,[2,46],{39:192,18:193,10:Fe,40:At}),e(Ye,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{77:[1,197],79:198,116:it,119:rt},e(He,[2,79]),e(He,[2,81]),e(He,[2,82]),e(He,[2,168]),e(He,[2,169]),{76:199,79:121,80:Dt,81:Tt,116:it,119:rt},e(Et,[2,84]),{8:be,9:ke,10:St,11:ge,12:yt,14:xt,21:201,27:_t,29:[1,200],32:Bt,44:vt,60:Vt,75:wt,83:141,84:It,85:Nt,86:Gt,87:Pt,88:Ot,89:Mt,90:Ut,91:202,105:Wt,109:zt,111:jt,114:Kt,115:Yt,116:Ht},e(w,[2,101]),e(w,[2,103]),e(w,[2,104]),e(w,[2,157]),e(w,[2,158]),e(w,[2,159]),e(w,[2,160]),e(w,[2,161]),e(w,[2,162]),e(w,[2,163]),e(w,[2,164]),e(w,[2,165]),e(w,[2,166]),e(w,[2,167]),e(w,[2,90]),e(w,[2,91]),e(w,[2,92]),e(w,[2,93]),e(w,[2,94]),e(w,[2,95]),e(w,[2,96]),e(w,[2,97]),e(w,[2,98]),e(w,[2,99]),e(w,[2,100]),{6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,203],33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},{10:Fe,18:204},{44:[1,205]},e(ve,[2,43]),{10:[1,206],44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,207]},{10:[1,208],106:[1,209]},e(Qt,[2,128]),{10:[1,210],44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,211],44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:113,114:Z,115:ee,116:te},{80:[1,212]},e(G,[2,109],{10:[1,213]}),e(G,[2,111],{10:[1,214]}),{80:[1,215]},e(he,[2,184]),{80:[1,216],98:[1,217]},e(ve,[2,55],{113:113,44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,114:Z,115:ee,116:te}),{31:[1,218],67:E,82:219,116:S,117:y,118:_},e(_e,[2,86]),e(_e,[2,88]),e(_e,[2,89]),e(_e,[2,153]),e(_e,[2,154]),e(_e,[2,155]),e(_e,[2,156]),{49:[1,220],67:E,82:219,116:S,117:y,118:_},{30:221,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{51:[1,222],67:E,82:219,116:S,117:y,118:_},{53:[1,223],67:E,82:219,116:S,117:y,118:_},{55:[1,224],67:E,82:219,116:S,117:y,118:_},{57:[1,225],67:E,82:219,116:S,117:y,118:_},{60:[1,226]},{64:[1,227],67:E,82:219,116:S,117:y,118:_},{66:[1,228],67:E,82:219,116:S,117:y,118:_},{30:229,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},{31:[1,230],67:E,82:219,116:S,117:y,118:_},{67:E,69:[1,231],71:[1,232],82:219,116:S,117:y,118:_},{67:E,69:[1,234],71:[1,233],82:219,116:S,117:y,118:_},e(Ie,[2,45],{18:156,10:Fe,40:Xt}),e(Ie,[2,47],{44:qt}),e(Ye,[2,75]),e(Ye,[2,74]),{62:[1,235],67:E,82:219,116:S,117:y,118:_},e(Ye,[2,77]),e(He,[2,80]),{77:[1,236],79:198,116:it,119:rt},{30:237,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},e(ot,k,{5:238}),e(w,[2,102]),e(L,[2,35]),{43:239,44:v,45:40,47:41,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},{10:Fe,18:240},{10:Ae,60:me,84:Ce,92:241,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:252,104:[1,253],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:254,104:[1,255],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{105:[1,256]},{10:Ae,60:me,84:Ce,92:257,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{44:v,47:258,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(G,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(G,[2,116]),e(G,[2,118],{10:[1,262]}),e(G,[2,119]),e(re,[2,56]),e(_e,[2,87]),e(re,[2,57]),{51:[1,263],67:E,82:219,116:S,117:y,118:_},e(re,[2,64]),e(re,[2,59]),e(re,[2,60]),e(re,[2,61]),{109:[1,264]},e(re,[2,63]),e(re,[2,65]),{66:[1,265],67:E,82:219,116:S,117:y,118:_},e(re,[2,67]),e(re,[2,68]),e(re,[2,70]),e(re,[2,69]),e(re,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Ye,[2,78]),{31:[1,266],67:E,82:219,116:S,117:y,118:_},{6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,267],33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},e(ve,[2,53]),{43:268,44:v,45:40,47:41,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(G,[2,121],{106:qe}),e(Jt,[2,130],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(fe,[2,132]),e(fe,[2,134]),e(fe,[2,135]),e(fe,[2,136]),e(fe,[2,137]),e(fe,[2,138]),e(fe,[2,139]),e(fe,[2,140]),e(fe,[2,141]),e(G,[2,122],{106:qe}),{10:[1,271]},e(G,[2,123],{106:qe}),{10:[1,272]},e(Qt,[2,129]),e(G,[2,105],{106:qe}),e(G,[2,106],{113:113,44:v,60:Y,89:O,102:M,105:W,106:H,109:Q,111:J,114:Z,115:ee,116:te}),e(G,[2,110]),e(G,[2,112],{10:[1,273]}),e(G,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:be,9:ke,11:ge,21:278},e(L,[2,34]),e(ve,[2,52]),{10:Ae,60:me,84:Ce,105:De,107:279,108:243,109:Te,110:Ee,111:Se,112:ye},e(fe,[2,133]),{14:Re,44:Ne,60:Ge,89:Pe,101:280,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{14:Re,44:Ne,60:Ge,89:Pe,101:281,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{98:[1,282]},e(G,[2,120]),e(re,[2,58]),{30:283,67:E,80:ae,81:ne,82:172,116:S,117:y,118:_},e(re,[2,66]),e(ot,k,{5:284}),e(Jt,[2,131],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(G,[2,126],{120:168,10:[1,285],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(G,[2,127],{120:168,10:[1,286],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(G,[2,114]),{31:[1,287],67:E,82:219,116:S,117:y,118:_},{6:11,7:12,8:c,9:A,10:f,11:N,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,288],33:24,34:V,36:D,38:T,42:28,43:39,44:v,45:40,47:41,60:Y,84:ie,85:d,86:m,87:ue,88:le,89:O,102:M,105:W,106:H,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Je,122:$e,123:et,124:tt,125:st},{10:Ae,60:me,84:Ce,92:289,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:290,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},e(re,[2,62]),e(L,[2,33]),e(G,[2,124],{106:qe}),e(G,[2,125],{106:qe})],defaultActions:{},parseError:t(function(b,g){if(g.recoverable)this.trace(b);else{var C=Error(b);throw C.hash=g,C}},"parseError"),parse:t(function(b){var g=this,C=[0],u=[],I=[null],s=[],Le=this.table,i="",X=0,Zt=0,e1=0,u1=2,t1=1,o1=s.slice.call(arguments,1),se=Object.create(this.lexer),Ve={yy:{}};for(var ct in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ct))Ve.yy[ct]=this.yy[ct];if(se.setInput(b,Ve.yy),Ve.yy.lexer=se,Ve.yy.parser=this,typeof se.yylloc>"u")se.yylloc={};var ht=se.yylloc;s.push(ht);var l1=se.options&&se.options.ranges;if(typeof Ve.yy.parseError==="function")this.parseError=Ve.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function c1(pe){C.length=C.length-2*pe,I.length=I.length-pe,s.length=s.length-pe}t(c1,"popStack");function s1(){var pe=u.pop()||se.lex()||t1;if(typeof pe!=="number"){if(pe instanceof Array)u=pe,pe=u.pop();pe=g.symbols_[pe]||pe}return pe}t(s1,"lex");var oe,dt,we,de,C1,pt,Qe={},nt,xe,i1,ut;while(!0){if(we=C[C.length-1],this.defaultActions[we])de=this.defaultActions[we];else{if(oe===null||typeof oe>"u")oe=s1();de=Le[we]&&Le[we][oe]}if(typeof de>"u"||!de.length||!de[0]){var bt="";ut=[];for(nt in Le[we])if(this.terminals_[nt]&&nt>u1)ut.push("'"+this.terminals_[nt]+"'");if(se.showPosition)bt="Parse error on line "+(X+1)+`:
10
10
  `+se.showPosition()+`
11
11
  Expecting `+ut.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'";else bt="Parse error on line "+(X+1)+": Unexpected "+(oe==t1?"end of input":"'"+(this.terminals_[oe]||oe)+"'");this.parseError(bt,{text:se.match,token:this.terminals_[oe]||oe,line:se.yylineno,loc:ht,expected:ut})}if(de[0]instanceof Array&&de.length>1)throw Error("Parse Error: multiple actions possible at state: "+we+", token: "+oe);switch(de[0]){case 1:if(C.push(oe),I.push(se.yytext),s.push(se.yylloc),C.push(de[1]),oe=null,!dt){if(Zt=se.yyleng,i=se.yytext,X=se.yylineno,ht=se.yylloc,e1>0)e1--}else oe=dt,dt=null;break;case 2:if(xe=this.productions_[de[1]][1],Qe.$=I[I.length-xe],Qe._$={first_line:s[s.length-(xe||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(xe||1)].first_column,last_column:s[s.length-1].last_column},l1)Qe._$.range=[s[s.length-(xe||1)].range[0],s[s.length-1].range[1]];if(pt=this.performAction.apply(Qe,[i,Zt,X,Ve.yy,de[1],I,s].concat(o1)),typeof pt<"u")return pt;if(xe)C=C.slice(0,-1*xe*2),I=I.slice(0,-1*xe),s=s.slice(0,-1*xe);C.push(this.productions_[de[1]][0]),I.push(Qe.$),s.push(Qe._$),i1=Le[C[C.length-2]][C[C.length-1]],C.push(i1);break;case 3:return!0}}return!0},"parse")},n1=function(){var Be={EOF:1,parseError:t(function(g,C){if(this.yy.parser)this.yy.parser.parseError(g,C);else throw Error(g)},"parseError"),setInput:t(function(b,g){if(this.yy=g||this.yy||{},this._input=b,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];return this.offset=0,this},"setInput"),input:t(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var g=b.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),b},"input"),unput:t(function(b){var g=b.length,C=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1)this.yylineno-=C.length-1;var I=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===u.length?this.yylloc.first_column:0)+u[u.length-C.length].length-C[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[I[0],I[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(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).
12
12
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(b){this.unput(this.match.slice(b))},"less"),pastInput:t(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var b=this.match;if(b.length<20)b+=this._input.substr(0,20-b.length);return(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var b=this.pastInput(),g=Array(b.length+1).join("-");return b+this.upcomingInput()+`
@@ -209,6 +209,6 @@ ${k?`
209
209
  }
210
210
  text-align: center;
211
211
  }
212
- ${Sn()}
212
+ ${Tn()}
213
213
  `,"getStyles"),Nf=m1,Qf=t(({styles:e=Nf}={})=>({parser:k1,get db(){return new d1},renderer:b1,styles:e,init:t((r)=>{if(!r.flowchart)r.flowchart={};r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,da({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),Sh=Qf();
214
214
  export{Nf,Qf,Sh};