pi-outpost 0.32.4 → 0.34.0

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 (188) hide show
  1. package/dist/contract/README.md +120 -1
  2. package/dist/contract/conformance/README.md +29 -5
  3. package/dist/contract/conformance/index.json +115 -0
  4. package/dist/contract/conformance/invalid/unknown-version.json +1 -1
  5. package/dist/contract/conformance/invalid/v3-timeline-comparison-without-reference.json +123 -0
  6. package/dist/contract/conformance/invalid/v3-timeline-contradictory-change.json +128 -0
  7. package/dist/contract/conformance/invalid/v3-timeline-dependency-cycle.json +124 -0
  8. package/dist/contract/conformance/invalid/v3-timeline-dependency-on-removed.json +125 -0
  9. package/dist/contract/conformance/invalid/v3-timeline-duplicate-dependency.json +125 -0
  10. package/dist/contract/conformance/invalid/v3-timeline-duplicate-identifier.json +120 -0
  11. package/dist/contract/conformance/invalid/v3-timeline-empty-task-endpoint.json +124 -0
  12. package/dist/contract/conformance/invalid/v3-timeline-impossible-date.json +101 -0
  13. package/dist/contract/conformance/invalid/v3-timeline-inverted-activity.json +120 -0
  14. package/dist/contract/conformance/invalid/v3-timeline-inverted-range.json +120 -0
  15. package/dist/contract/conformance/invalid/v3-timeline-milestone-outside-range.json +120 -0
  16. package/dist/contract/conformance/invalid/v3-timeline-period-outside-range.json +139 -0
  17. package/dist/contract/conformance/invalid/v3-timeline-presentation-property.json +121 -0
  18. package/dist/contract/conformance/invalid/v3-timeline-previous-outside-range.json +128 -0
  19. package/dist/contract/conformance/invalid/v3-timeline-previous-wrong-shape.json +128 -0
  20. package/dist/contract/conformance/invalid/v3-timeline-reference-outside-range.json +140 -0
  21. package/dist/contract/conformance/invalid/v3-timeline-self-dependency.json +124 -0
  22. package/dist/contract/conformance/invalid/v3-timeline-under-version-2.json +120 -0
  23. package/dist/contract/conformance/invalid/v3-timeline-unknown-dependency-type.json +121 -0
  24. package/dist/contract/conformance/invalid/v3-timeline-unresolved-dependency-endpoint.json +120 -0
  25. package/dist/contract/conformance/invalid/v3-timeline-unsupported-scale.json +120 -0
  26. package/dist/contract/conformance/invalid/v3-timeline-with-target.json +123 -0
  27. package/dist/contract/conformance/valid/v3-timeline-calendar.json +140 -0
  28. package/dist/contract/conformance/valid/v3-timeline-compared.json +142 -0
  29. package/dist/contract/conformance/valid/v3-timeline-empty-task-and-anonymous-separator.json +35 -0
  30. package/dist/contract/conformance/valid/v3-timeline-four-dependency-types.json +61 -0
  31. package/dist/contract/conformance/valid/v3-timeline-programme.json +44 -0
  32. package/dist/contract/conformance/valid/v3-timeline-quarter-scale.json +42 -0
  33. package/dist/contract/conformance/valid/v3-timeline-single-day-activity.json +27 -0
  34. package/dist/contract/conformance/valid/v3-timeline-unsatisfied-dependency.json +45 -0
  35. package/dist/contract/conformance/valid/v3-timeline-week-scale.json +35 -0
  36. package/dist/contract/conformance/version-1.lock.json +2 -2
  37. package/dist/contract/schemas/structured-exchange-3.json +1263 -0
  38. package/dist/contract/schemas/structured-exchange-profile-registry-2.json +94 -0
  39. package/dist/contract/structured-exchange-project-setup.md +36 -0
  40. package/dist/contract/validate-structured-exchange.mjs +1981 -174
  41. package/dist/pi-outpost-tools.mjs +4556 -1130
  42. package/dist/pi-outpost.mjs +5733 -1898
  43. package/dist/pi-outpost.sea.mjs +2 -2
  44. package/dist/sea-prep.blob +2 -2
  45. package/dist/skills/structured-exchange/SKILL.md +90 -378
  46. package/dist/skills/structured-exchange/references/enriched-contract.md +158 -0
  47. package/dist/skills/structured-exchange/references/figures.md +52 -0
  48. package/dist/skills/structured-exchange/references/graphs-and-tables.md +115 -0
  49. package/dist/skills/structured-exchange/references/proposals.md +86 -0
  50. package/dist/skills/structured-exchange/references/timelines.md +87 -0
  51. package/dist/skills/structured-exchange/structured-exchange-3.json +1263 -0
  52. package/dist/skills/structured-exchange/structured-exchange-profile-registry-2.json +94 -0
  53. package/dist/skills/structured-exchange-project/SKILL.md +22 -0
  54. package/dist/web/assets/{PdfViewer-DHIy06i5.js → PdfViewer-9kadnb9W.js} +2 -2
  55. package/dist/web/assets/{abnfDiagram-VCTEODGH-0IqI620v.js → abnfDiagram-YUKMZFIV-BUZ7jF1I.js} +1 -1
  56. package/dist/web/assets/architecture-WOLXFQ4H-CxBmyj2Z.js +1 -0
  57. package/dist/web/assets/architectureDiagram-47P4ROYG-BAvert-J.js +36 -0
  58. package/dist/web/assets/{blockDiagram-OSKFZWR5-sw0nzjYC.js → blockDiagram-E7TT5TSB-CXQT_J2x.js} +16 -5
  59. package/dist/web/assets/c4Diagram-CRA5TL53-Byqo5aDs.js +38 -0
  60. package/dist/web/assets/channel-D3nE3SyW.js +1 -0
  61. package/dist/web/assets/chunk-2BW5OAIV-D9dSVCv2.js +10 -0
  62. package/dist/web/assets/chunk-3YJQHVM4-D6IQcIQB.js +2 -0
  63. package/dist/web/assets/chunk-4EA7E6EY-BxZ_5HMn.js +1 -0
  64. package/dist/web/assets/{chunk-F27PBJKO-C6rqX2gT.js → chunk-7TKQ45FW-G9TsFldk.js} +1 -1
  65. package/dist/web/assets/{chunk-SVP7TREG-CYXVRfc0.js → chunk-AW2ZBBNX-nmg5rsd5.js} +3 -3
  66. package/dist/web/assets/{chunk-GVQU2GXP-BtSmWzHA.js → chunk-DBDB3WZW-BwVIGLtu.js} +1 -1
  67. package/dist/web/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
  68. package/dist/web/assets/chunk-E2ZNV5FY-VD95O25Z.js +72 -0
  69. package/dist/web/assets/chunk-EU5HNXII-CSnybkPb.js +213 -0
  70. package/dist/web/assets/chunk-FVRAUYC3-TBqluQ8N.js +2 -0
  71. package/dist/web/assets/{chunk-PWAF6VOD-Dup_NAkl.js → chunk-HJ2JQQFS-BiLMpVsO.js} +1 -1
  72. package/dist/web/assets/chunk-HTAEGDNF-QDOAuhR5.js +1 -0
  73. package/dist/web/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
  74. package/dist/web/assets/{chunk-POPQ4Y6H-BrnPOTT-.js → chunk-KQW6MTUR-_WxFaX97.js} +1 -1
  75. package/dist/web/assets/chunk-NGNAAXSQ-BW1P8EP7.js +136 -0
  76. package/dist/web/assets/chunk-NTY3LDVX-BI0Pj8F6.js +1 -0
  77. package/dist/web/assets/chunk-VPRB5NB3-BBDlNNll.js +129 -0
  78. package/dist/web/assets/chunk-XC4XBNZT-Ba1ra4Jd.js +62 -0
  79. package/dist/web/assets/classDiagram-v2-K4WV4PDN-CksBjG_q.js +217 -0
  80. package/dist/web/assets/{conversationExport-CfUybHMU.js → conversationExport-q-9NUHuj.js} +1 -1
  81. package/dist/web/assets/cynefin-EF2NZ3EQ-ucJDz_S5.js +1 -0
  82. package/dist/web/assets/{cynefinDiagram-5FMLGOSQ-BKvXEDID.js → cynefinDiagram-3GCD6N5R-qPxcNdaa.js} +1 -1
  83. package/dist/web/assets/dagre-W4DXFKR2-ChflYJGj.js +4 -0
  84. package/dist/web/assets/diagram-2UJZ2QOL-Bi9ngdu2.js +200 -0
  85. package/dist/web/assets/{diagram-VX7I27RA-D5POkb-9.js → diagram-OVF4WLC6-iSSbF5Cd.js} +10 -10
  86. package/dist/web/assets/{diagram-S7CK7UJ4-DTvEAe9r.js → diagram-PFPMY2P6-BeEOD8rR.js} +2 -2
  87. package/dist/web/assets/{diagram-Z3DM3KII-CC2Mxm4H.js → diagram-UMYRVEAY-BckO6iZI.js} +1 -1
  88. package/dist/web/assets/{diagram-UQ7AKVKN-CVGEkml-.js → diagram-YEKJPTXX-BzzDIAmO.js} +2 -2
  89. package/dist/web/assets/diagram-ZIFT7M5P-ByjWOPbN.js +3 -0
  90. package/dist/web/assets/{docxExport-ErgwApAZ.js → docxExport-BO7j3Xnv.js} +1 -1
  91. package/dist/web/assets/{ebnfDiagram-PWID7BFC-CbDy2vxX.js → ebnfDiagram-VR2GEFS7-DRp-A5JC.js} +1 -1
  92. package/dist/web/assets/elk-IJKZMXRS-QzeiQ3l1.js +27 -0
  93. package/dist/web/assets/{erDiagram-2YWLMYGG-DUdStx-7.js → erDiagram-O2IAPWRE-BewZvI56.js} +15 -15
  94. package/dist/web/assets/eventmodeling-K75KTNOO-CX7X0bsf.js +1 -0
  95. package/dist/web/assets/flowDiagram-OXPTDLAJ-CSIHFoeR.js +1 -0
  96. package/dist/web/assets/ganttDiagram-R7TSEDQI-BT8Lcdwc.js +292 -0
  97. package/dist/web/assets/gitGraph-VSP46ZUC-BxYbaxeg.js +1 -0
  98. package/dist/web/assets/gitGraphDiagram-XJZIOB7I-B0fqVCqP.js +106 -0
  99. package/dist/web/assets/index-DcqvxkHN.css +2 -0
  100. package/dist/web/assets/index-eTp_lQUc.js +350 -0
  101. package/dist/web/assets/info-OHQRW6UA-DV3PDKXA.js +1 -0
  102. package/dist/web/assets/infoDiagram-5W2HQ5XZ-DfHpZ9RG.js +2 -0
  103. package/dist/web/assets/{ishikawaDiagram-5VMMS53U-D-gYpOUM.js → ishikawaDiagram-K3B6WC7H-DuwLwL9k.js} +2 -2
  104. package/dist/web/assets/{journeyDiagram-EYS64GPL-B0WqOtZ4.js → journeyDiagram-COXZFDF6-CMOfweZO.js} +4 -4
  105. package/dist/web/assets/{kanban-definition-UXKFOSKX-DIrVFtP3.js → kanban-definition-P3RFRI5V-DjHhlDbk.js} +9 -9
  106. package/dist/web/assets/{line-CuEhAU65.js → line-CGIAMPkR.js} +1 -1
  107. package/dist/web/assets/loadReferencedImage-DZ5eApE4.js +2 -0
  108. package/dist/web/assets/{mermaid-parser.core-CzCh9EE1.js → mermaid-parser.core-C18KmsD9.js} +6 -6
  109. package/dist/web/assets/mermaid.core-C9srNL3b.js +44 -0
  110. package/dist/web/assets/{mindmap-definition-THT77NOG-CBH0Z9AJ.js → mindmap-definition-LZFPQGKD-C38HXkG2.js} +24 -24
  111. package/dist/web/assets/packet-JDAUHWVQ-Br-8ADK6.js +1 -0
  112. package/dist/web/assets/{pdf-6mG9havR.js → pdf-C3f6Vjz7.js} +1 -1
  113. package/dist/web/assets/{pegDiagram-XKGWAZYB-BNpTWHo8.js → pegDiagram-BGZESJAR-Be49dM_b.js} +1 -1
  114. package/dist/web/assets/pie-XZMESJXO-68ykK6i1.js +1 -0
  115. package/dist/web/assets/{pieDiagram-E7YTZNPT-CZ34Q1W-.js → pieDiagram-CAPJLFHJ-DVOWjXQ_.js} +2 -2
  116. package/dist/web/assets/{quadrantDiagram-AXDQQJYC-C5aFQsIe.js → quadrantDiagram-GDMTTRAM-8la_R53U.js} +3 -3
  117. package/dist/web/assets/radar-ABXABTNO-K00ZGu13.js +1 -0
  118. package/dist/web/assets/railroad-I3PHUGI6-W7QuDysT.js +1 -0
  119. package/dist/web/assets/railroad-abnf-LNEFI6M7-DR6CNkaK.js +1 -0
  120. package/dist/web/assets/railroad-ebnf-DWYD2UWJ-dAhaGv5L.js +1 -0
  121. package/dist/web/assets/railroad-peg-JR7BVNR7-DwoiiDdE.js +1 -0
  122. package/dist/web/assets/{railroadDiagram-O6MQD6OU-B0ctRtRT.js → railroadDiagram-SM67HX2B-BuSjCs02.js} +1 -1
  123. package/dist/web/assets/{requirementDiagram-IS5BZ75X-BuOtNPGm.js → requirementDiagram-X7JNWC4A-3uq8m_5E.js} +11 -11
  124. package/dist/web/assets/{sankeyDiagram-P5KCCOFB-CybICPpQ.js → sankeyDiagram-UM26HJRW-BB9_G8bN.js} +3 -3
  125. package/dist/web/assets/sequenceDiagram-ZO4K6R2Y-CGehVq9k.js +169 -0
  126. package/dist/web/assets/stateDiagram-v2-TBUQTH76-CwMywh5s.js +291 -0
  127. package/dist/web/assets/swimlanes-N4OXWK64-CqjihurI.js +1 -0
  128. package/dist/web/assets/swimlanesDiagram-K3J5GTZL-Blk5ohUI.js +8 -0
  129. package/dist/web/assets/timeline-definition-YOQAKGHF-BtKnuY5Y.js +120 -0
  130. package/dist/web/assets/treeView-D4JQ5SDB-Dy4jC4wa.js +1 -0
  131. package/dist/web/assets/treemap-SAJKECNS-CHtGJD8P.js +1 -0
  132. package/dist/web/assets/usecaseDiagram-VIAY4XPW-BjnstWbR.js +328 -0
  133. package/dist/web/assets/vennDiagram-BLWOH2XV-o_EtJWVA.js +34 -0
  134. package/dist/web/assets/wardley-7MLQ67FV-BTheL3FW.js +1 -0
  135. package/dist/web/assets/{wardleyDiagram-VM6X3IG4-CzB2tR_t.js → wardleyDiagram-YMQ3BMBF-Bp_sv2v4.js} +3 -3
  136. package/dist/web/assets/xychartDiagram-TAQBALBS-C0IpEfij.js +7 -0
  137. package/dist/web/index.html +2 -2
  138. package/package.json +3 -3
  139. package/dist/web/assets/architecture-7GRP2DOG-BqTZwqCY.js +0 -1
  140. package/dist/web/assets/architectureDiagram-5GKGNRK7-BEGSAGSn.js +0 -36
  141. package/dist/web/assets/c4Diagram-7LVT6UL2-C6wQYxBC.js +0 -38
  142. package/dist/web/assets/channel-CbMG5PZq.js +0 -1
  143. package/dist/web/assets/chunk-3NF5O7KM-Dni31-nE.js +0 -168
  144. package/dist/web/assets/chunk-4HAMMTFA-hiqoLVtf.js +0 -62
  145. package/dist/web/assets/chunk-75Z2AOVW-1k7HRGrm.js +0 -2
  146. package/dist/web/assets/chunk-DU6HZSFF-Dy05V--k.js +0 -127
  147. package/dist/web/assets/chunk-FOHPRMQF-DHwB1DNv.js +0 -161
  148. package/dist/web/assets/chunk-GMAD6QVW-Bi5Ne8OE.js +0 -72
  149. package/dist/web/assets/chunk-HLEWEB6X-yamDqy1M.js +0 -206
  150. package/dist/web/assets/chunk-L3NEJ4N5-CQSamtuJ.js +0 -1
  151. package/dist/web/assets/chunk-OSK3NFVY-S95igUko.js +0 -10
  152. package/dist/web/assets/chunk-P2QGCYS3-BPor-azX.js +0 -1
  153. package/dist/web/assets/chunk-ZLD2IHE6-D0uZMMWb.js +0 -231
  154. package/dist/web/assets/classDiagram-CYGNFDIV-2Yl201cv.js +0 -1
  155. package/dist/web/assets/classDiagram-v2-TLXNO2FR-2Yl201cv.js +0 -1
  156. package/dist/web/assets/cynefin-OW5HDTMX-ua6bZIWp.js +0 -1
  157. package/dist/web/assets/dagre-OS7QT2EB-BRxaZdm2.js +0 -4
  158. package/dist/web/assets/dagre-PrKaheQc.js +0 -1
  159. package/dist/web/assets/diagram-VSXAHHWV-Dkh-RvzE.js +0 -3
  160. package/dist/web/assets/eventmodeling-NTZA5JFV-Bw8wULv_.js +0 -1
  161. package/dist/web/assets/flowDiagram-T62WH6J4-Dp4v9IDN.js +0 -1
  162. package/dist/web/assets/ganttDiagram-EL5Y4UJY-6dI1H52q.js +0 -292
  163. package/dist/web/assets/gitGraph-4MIJSDKK-UXnB0IFr.js +0 -1
  164. package/dist/web/assets/gitGraphDiagram-WWUBYQGX-B_wXPpx0.js +0 -106
  165. package/dist/web/assets/index-9y9n2Dul.css +0 -2
  166. package/dist/web/assets/index-COu8CnNa.js +0 -350
  167. package/dist/web/assets/info-A6RAGUB7-C2WWyNzF.js +0 -1
  168. package/dist/web/assets/infoDiagram-FKFFQAWI-DY65_ndC.js +0 -2
  169. package/dist/web/assets/loadReferencedImage-DgHMXQNZ.js +0 -2
  170. package/dist/web/assets/mermaid.core-BmGW_v8T.js +0 -44
  171. package/dist/web/assets/packet-AYTQ26CC-BYG_KViO.js +0 -1
  172. package/dist/web/assets/pie-WAS4IAKB-wBoUHr8R.js +0 -1
  173. package/dist/web/assets/radar-RG4KPBEZ-D4K5XP7X.js +0 -1
  174. package/dist/web/assets/railroad-74A4TZTK-Haum25Us.js +0 -1
  175. package/dist/web/assets/railroad-abnf-HS5TGJTU-D-kbOsoZ.js +0 -1
  176. package/dist/web/assets/railroad-ebnf-LZEXJU2U-CWtixpZf.js +0 -1
  177. package/dist/web/assets/railroad-peg-WCYAUIDC-BeY7arxf.js +0 -1
  178. package/dist/web/assets/sequenceDiagram-WJ2MYXX4-Dvo8sl8e.js +0 -162
  179. package/dist/web/assets/stateDiagram-XQSTLZYL-BcM-hGJa.js +0 -1
  180. package/dist/web/assets/stateDiagram-v2-IH3M54BS-hYgwFLzv.js +0 -1
  181. package/dist/web/assets/swimlanes-V6O3JKXN-mOOjKnlm.js +0 -1
  182. package/dist/web/assets/swimlanesDiagram-JKAHXJPX-C_yinM3f.js +0 -8
  183. package/dist/web/assets/timeline-definition-24CTP7MA-DuwMztTy.js +0 -120
  184. package/dist/web/assets/treeView-Q6P3EWNA-BT4vRttT.js +0 -1
  185. package/dist/web/assets/treemap-WGGIJYW6-Df6GHCE2.js +0 -1
  186. package/dist/web/assets/vennDiagram-4TSXK5OY-BbcbGn7o.js +0 -34
  187. package/dist/web/assets/wardley-WFR3VGLG-L_G3ydHA.js +0 -1
  188. package/dist/web/assets/xychartDiagram-S5SC5T6Z-CKHwJboP.js +0 -7
@@ -1,231 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{$ as r,H as i,K as a,U as o,a as s,s as c,v as l,w as u,x as d,y as f}from"./chunk-DU6HZSFF-Dy05V--k.js";import{g as p,s as m}from"./chunk-75Z2AOVW-1k7HRGrm.js";import{t as h}from"./chunk-F27PBJKO-C6rqX2gT.js";import{t as g}from"./chunk-XXDRQBXY-BvKO0v-W.js";import{t as _}from"./chunk-POPQ4Y6H-BrnPOTT-.js";import{d as v}from"./mermaid.core-BmGW_v8T.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``}}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,7]),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(A,[2,11]),t(A,[2,12],{14:[1,40],15:[1,41]}),t(A,[2,16]),{18:[1,42]},t(A,[2,18],{20:[1,43]}),{23:[1,44]},t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(A,[2,28]),{34:[1,49]},{36:[1,50]},t(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(j,[2,44],{58:[1,56]}),t(j,[2,45],{58:[1,57]}),t(A,[2,38]),t(A,[2,39]),t(A,[2,40]),t(A,[2,41]),t(A,[2,6]),t(A,[2,13]),{13:58,24:f,57:k},t(A,[2,17]),t(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(A,[2,29]),t(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(A,[2,34]),t(A,[2,35]),t(A,[2,36]),t(A,[2,37]),t(j,[2,46]),t(j,[2,47]),t(A,[2,15]),t(A,[2,19]),t(M,a,{7:78}),t(A,[2,26]),t(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},t(A,[2,32]),t(A,[2,33]),t(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
- `+h.showPosition()+`
3
- Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};N.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
- `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
- `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(t,n,r,i){function a(){let e=n.yytext.indexOf(`%%`);if(e===0)return!1;if(e>0){let r=n.yytext.slice(0,e),i=n.yytext.slice(e);i&&t.lexer.unput(i),n.yytext=r}return!0}switch(e(a,`processId`),r){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return a()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+n.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return a()?(this.popState(),`ID`):void 0;case 66:return a()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return a()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function P(){this.yy={}}return e(P,`Parser`),P.prototype=N,N.Parser=P,new P})();y.parser=y;var b=y,x=`TB`,S=`TB`,C=`dir`,w=`state`,T=`root`,E=`relation`,D=`classDef`,O=`style`,k=`applyClass`,A=`default`,j=`divider`,M=`fill:none`,N=`fill: #333`,P=`c`,ee=`markdown`,F=`normal`,I=`rect`,L=`rectWithTitle`,te=`stateStart`,ne=`stateEnd`,R=`divider`,re=`roundedWithTitle`,ie=`note`,ae=`noteGroup`,z=`statediagram`,oe=`${z}-state`,B=`transition`,se=`note`,ce=`${B} note-edge`,le=`${z}-${se}`,ue=`${z}-cluster`,de=`${z}-cluster-alt`,V=`parent`,H=`note`,fe=`state`,U=`----`,pe=`${U}${H}`,W=`${U}${V}`,G=e((e,t=S)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),me={getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`),draw:e(async function(e,n,r,i){t.info(`REF0:`),t.info(`Drawing state diagram (v2)`,n);let{securityLevel:a,state:o,layout:s}=d();i.db.extract(i.db.getRootDocV2());let c=i.db.getData(),l=g(n,a);c.type=i.type,c.layoutAlgorithm=s,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=d().look===`neo`?[`barbNeo`]:[`barb`],c.diagramId=n,await v(c,l);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,n)=>{let r=typeof n==`string`?n:typeof n?.id==`string`?n.id:``,i=c.nodes.find(e=>e.id===r);if(!r){t.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(n));return}let a=l.node()?.querySelectorAll(`g.node, g.rough-node`),o;if(a?.forEach(e=>{let t=e.textContent?.trim();(e.id===i?.domId||t===r)&&(o=e)}),!o){t.warn(`⚠️ Could not find node matching text:`,r);return}let s=o.parentNode;if(!s){t.warn(`⚠️ Node has no parent, cannot wrap:`,r);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),o.setAttribute(`title`,t)}s.replaceChild(u,o),u.appendChild(o),t.info(`🔗 Wrapped node in <a> tag for:`,r,e.url)})}catch(e){t.error(`❌ Error injecting clickable links:`,e)}p.insertTitle(l,`statediagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),_(l,8,z,o?.useMaxWidth??!0)},`draw`),getDir:G},K=new Map,q=0;function J(e=``,t=0,n=``,r=U){return`${fe}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}e(J,`stateDomId`);var he=e((e,n,r,i,a,o,s,l)=>{t.trace(`items`,n),n.forEach(t=>{switch(t.stmt){case w:Z(e,t,r,i,a,o,s,l);break;case A:Z(e,t,r,i,a,o,s,l);break;case E:{Z(e,t.state1,r,i,a,o,s,l),Z(e,t.state2,r,i,a,o,s,l);let n=s===`neo`,u={id:`edge`+q,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:n?`arrow_barb_neo`:`arrow_barb`,style:M,labelStyle:``,label:c.sanitizeText(t.description??``,d()),arrowheadStyle:N,labelpos:P,labelType:ee,thickness:F,classes:B,look:s};a.push(u),q++}}})},`setupDoc`),ge=e((e,t=S)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function Y(e,t,n){if(!t.id||t.id===`</join></fork>`||t.id===`</choice>`)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}e(Y,`insertOrUpdateNode`);function X(e){return e?.classes?.join(` `)??``}e(X,`getClassesFromDbInfo`);function _e(e){return e?.styles??[]}e(_e,`getStylesFromDbInfo`);var Z=e((e,n,r,i,a,o,s,l)=>{let u=n.id,f=r.get(u),p=X(f),m=_e(f),h=d();if(t.info(`dataFetcher parsedItem`,n,f,m),u!==`root`){let r=I;n.start===!0?r=te:n.start===!1&&(r=ne),n.type!==A&&(r=n.type),K.get(u)||K.set(u,{id:u,shape:r,description:c.sanitizeText(u,h),cssClasses:`${p} ${oe}`,cssStyles:m});let d=K.get(u);n.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(n.description)):d.description?.length&&d.description.length>0?(d.shape=L,d.description=d.description===u?[n.description]:[d.description,n.description]):(d.shape=I,d.description=n.description),d.description=c.sanitizeTextOrArray(d.description,h)),d.description?.length===1&&d.shape===L&&(d.shape=d.type===`group`?re:I),!d.type&&n.doc&&(t.info(`Setting cluster for XCX`,u,ge(n)),d.type=`group`,d.isGroup=!0,d.dir=ge(n),d.shape=n.type===j?R:re,d.cssClasses=`${d.cssClasses} ${ue} ${o?de:``}`);let f={labelStyle:``,shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:u,dir:d.dir,domId:J(u,q),type:d.type,isGroup:d.type===`group`,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(f.shape===R&&(f.label=``),e&&e.id!==`root`&&(t.trace(`Setting node `,u,` to be child of its parent `,e.id),f.parentId=e.id),f.centerLabel=!0,n.note){let e={labelStyle:``,shape:ie,label:n.note.text,labelType:`markdown`,cssClasses:le,cssStyles:[],cssCompiledStyles:[],id:u+pe+`-`+q,domId:J(u,q,H),type:d.type,isGroup:d.type===`group`,padding:h.flowchart?.padding,look:s,position:n.note.position},t=u+W,r={labelStyle:``,shape:ae,label:n.note.text,cssClasses:d.cssClasses,cssStyles:[],id:u+W,domId:J(u,q,V),type:`group`,isGroup:!0,padding:16,look:s,position:n.note.position};q++,r.id=t,e.parentId=t,Y(i,r,l),Y(i,e,l),Y(i,f,l);let o=u,c=e.id;n.note.position===`left of`&&(o=e.id,c=u),a.push({id:o+`-`+c,start:o,end:c,arrowhead:`none`,arrowTypeEnd:``,style:M,labelStyle:``,classes:ce,arrowheadStyle:N,labelpos:P,labelType:ee,thickness:F,look:s})}else Y(i,f,l)}n.doc&&(t.trace(`Adding nodes children `),he(n,n.doc,r,i,a,!o,s,l))},`dataFetcher`),ve=e(()=>{K.clear(),q=0},`reset`),Q={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},ye=e(()=>new Map,`newClassesList`),be=e(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=e(e=>JSON.parse(JSON.stringify(e)),`clone`),xe=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=ye(),this.documents={root:be()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=f,this.setAccTitle=o,this.getAccDescription=l,this.setAccDescription=i,this.setDiagramTitle=a,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{e(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case w:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case E:this.addRelation(t.state1,t.state2,t.description);break;case D:this.addStyleClass(t.id.trim(),t.classes);break;case O:this.handleStyleDef(t);break;case k:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip)}let t=this.getStates(),n=d();ve(),Z(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){t.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===E){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===w&&(t.id===Q.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==T&&t.stmt!==w||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===j){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:w,id:m(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:T,stmt:T},{id:T,stmt:T,doc:this.rootDoc},!0),{id:T,doc:this.rootDoc}}addState(e,n=A,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){let u=e?.trim();if(!this.currentDocument.states.has(u))t.info(`Adding state `,u,i),this.currentDocument.states.set(u,{stmt:w,id:u,descriptions:[],type:n,doc:r,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.doc||=r,e.type||=n}if(i&&(t.info(`Setting state description`,u,i),(Array.isArray(i)?i:[i]).forEach(e=>this.addDescription(u,e.trim()))),a){let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.note=a,e.note.text=c.sanitizeText(e.note.text,d())}o&&(t.info(`Setting state classes`,u,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(u,e.trim()))),s&&(t.info(`Setting state styles`,u,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(u,e.trim()))),l&&(t.info(`Setting state styles`,u,s),(Array.isArray(l)?l:[l]).forEach(e=>this.setTextStyle(u,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:be()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=ye(),e||(this.links=new Map,s())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){t.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,n,r){this.links.set(e,{url:n,tooltip:r}),t.warn(`Adding link`,e,n,r)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Q.START_NODE?(this.startEndCount++,`${Q.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=A){return e===Q.START_NODE?Q.START_TYPE:t}endIdIfNeeded(e=``){return e===Q.END_NODE?(this.startEndCount++,`${Q.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=A){return e===Q.END_NODE?Q.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:c.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?c.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(c.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Q.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Q.COLOR_KEYWORD).exec(e)){let e=t.replace(Q.FILL_KEYWORD,Q.BG_FILL).replace(Q.COLOR_KEYWORD,Q.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(e){let t=h();n(e).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,e=>{let i=n(e.currentTarget),a=i.attr(`title`);if(a===null)return;let o=e.currentTarget?.getBoundingClientRect();t.transition().duration(200).style(`opacity`,`.9`),t.style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),t.html(r.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{t.transition().duration(500).style(`opacity`,0),n(e.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===C)}getDirection(){return this.getDirectionStatement()?.value??x}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:C,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:G(this.getRootDocV2())}}getConfig(){return d().state}},Se=e(e=>`
7
- defs [id$="-barbEnd"] {
8
- fill: ${e.transitionColor};
9
- stroke: ${e.transitionColor};
10
- }
11
- g.stateGroup text {
12
- fill: ${e.nodeBorder};
13
- stroke: none;
14
- font-size: 10px;
15
- }
16
- g.stateGroup text {
17
- fill: ${e.textColor};
18
- stroke: none;
19
- font-size: 10px;
20
-
21
- }
22
- g.stateGroup .state-title {
23
- font-weight: bolder;
24
- fill: ${e.stateLabelColor};
25
- }
26
-
27
- g.stateGroup rect {
28
- fill: ${e.mainBkg};
29
- stroke: ${e.nodeBorder};
30
- }
31
-
32
- g.stateGroup line {
33
- stroke: ${e.lineColor};
34
- stroke-width: ${e.strokeWidth||1};
35
- }
36
-
37
- .transition {
38
- stroke: ${e.transitionColor};
39
- stroke-width: ${e.strokeWidth||1};
40
- fill: none;
41
- }
42
-
43
- .stateGroup .composit {
44
- fill: ${e.background};
45
- border-bottom: 1px
46
- }
47
-
48
- .stateGroup .alt-composit {
49
- fill: #e0e0e0;
50
- border-bottom: 1px
51
- }
52
-
53
- .state-note {
54
- stroke: ${e.noteBorderColor};
55
- fill: ${e.noteBkgColor};
56
-
57
- text {
58
- fill: ${e.noteTextColor};
59
- stroke: none;
60
- font-size: 10px;
61
- }
62
- }
63
-
64
- .stateLabel .box {
65
- stroke: none;
66
- stroke-width: 0;
67
- fill: ${e.mainBkg};
68
- opacity: 0.5;
69
- }
70
-
71
- .edgeLabel .label rect {
72
- fill: ${e.labelBackgroundColor};
73
- opacity: 0.5;
74
- }
75
- .edgeLabel {
76
- background-color: ${e.edgeLabelBackground};
77
- p {
78
- background-color: ${e.edgeLabelBackground};
79
- }
80
- rect {
81
- opacity: 0.5;
82
- background-color: ${e.edgeLabelBackground};
83
- fill: ${e.edgeLabelBackground};
84
- }
85
- text-align: center;
86
- }
87
- .edgeLabel .label text {
88
- fill: ${e.transitionLabelColor||e.tertiaryTextColor};
89
- }
90
- .label div .edgeLabel {
91
- color: ${e.transitionLabelColor||e.tertiaryTextColor};
92
- }
93
-
94
- .stateLabel text {
95
- fill: ${e.stateLabelColor};
96
- font-size: 10px;
97
- font-weight: bold;
98
- }
99
-
100
- .node circle.state-start {
101
- fill: ${e.specialStateColor};
102
- stroke: ${e.specialStateColor};
103
- }
104
-
105
- .node .fork-join {
106
- fill: ${e.specialStateColor};
107
- stroke: ${e.specialStateColor};
108
- }
109
-
110
- .node circle.state-end {
111
- fill: ${e.innerEndBackground};
112
- stroke: ${e.background};
113
- stroke-width: 1.5
114
- }
115
- .end-state-inner {
116
- fill: ${e.compositeBackground||e.background};
117
- // stroke: ${e.background};
118
- stroke-width: 1.5
119
- }
120
-
121
- .node rect {
122
- fill: ${e.stateBkg||e.mainBkg};
123
- stroke: ${e.stateBorder||e.nodeBorder};
124
- stroke-width: ${e.strokeWidth||1}px;
125
- }
126
- .node polygon {
127
- fill: ${e.mainBkg};
128
- stroke: ${e.stateBorder||e.nodeBorder};;
129
- stroke-width: ${e.strokeWidth||1}px;
130
- }
131
- [id$="-barbEnd"] {
132
- fill: ${e.lineColor};
133
- }
134
-
135
- .statediagram-cluster rect {
136
- fill: ${e.compositeTitleBackground};
137
- stroke: ${e.stateBorder||e.nodeBorder};
138
- stroke-width: ${e.strokeWidth||1}px;
139
- }
140
-
141
- .cluster-label, .nodeLabel {
142
- color: ${e.stateLabelColor};
143
- // line-height: 1;
144
- }
145
-
146
- .statediagram-cluster rect.outer {
147
- rx: 5px;
148
- ry: 5px;
149
- }
150
- .statediagram-state .divider {
151
- stroke: ${e.stateBorder||e.nodeBorder};
152
- }
153
-
154
- .statediagram-state .title-state {
155
- rx: 5px;
156
- ry: 5px;
157
- }
158
- .statediagram-cluster.statediagram-cluster .inner {
159
- fill: ${e.compositeBackground||e.background};
160
- }
161
- .statediagram-cluster.statediagram-cluster-alt .inner {
162
- fill: ${e.altBackground?e.altBackground:`#efefef`};
163
- }
164
-
165
- .statediagram-cluster .inner {
166
- rx:0;
167
- ry:0;
168
- }
169
-
170
- .statediagram-state rect.basic {
171
- rx: 5px;
172
- ry: 5px;
173
- }
174
- .statediagram-state rect.divider {
175
- stroke-dasharray: 10,10;
176
- fill: ${e.altBackground?e.altBackground:`#efefef`};
177
- }
178
-
179
- .note-edge {
180
- stroke-dasharray: 5;
181
- }
182
-
183
- .statediagram-note rect {
184
- fill: ${e.noteBkgColor};
185
- stroke: ${e.noteBorderColor};
186
- stroke-width: 1px;
187
- rx: 0;
188
- ry: 0;
189
- }
190
- .statediagram-note rect {
191
- fill: ${e.noteBkgColor};
192
- stroke: ${e.noteBorderColor};
193
- stroke-width: 1px;
194
- rx: 0;
195
- ry: 0;
196
- }
197
-
198
- .statediagram-note text {
199
- fill: ${e.noteTextColor};
200
- }
201
-
202
- .statediagram-note .nodeLabel {
203
- color: ${e.noteTextColor};
204
- }
205
- .statediagram .edgeLabel {
206
- color: red; // ${e.noteTextColor};
207
- }
208
-
209
- [id$="-dependencyStart"], [id$="-dependencyEnd"] {
210
- fill: ${e.lineColor};
211
- stroke: ${e.lineColor};
212
- stroke-width: ${e.strokeWidth||1};
213
- }
214
-
215
- .statediagramTitleText {
216
- text-anchor: middle;
217
- font-size: 18px;
218
- fill: ${e.textColor};
219
- }
220
-
221
- [data-look="neo"].statediagram-cluster rect {
222
- fill: ${e.mainBkg};
223
- stroke: ${e.useGradient?`url(`+e.svgId+`-gradient)`:e.stateBorder||e.nodeBorder};
224
- stroke-width: ${e.strokeWidth??1};
225
- }
226
- [data-look="neo"].statediagram-cluster rect.outer {
227
- rx: ${e.radius}px;
228
- ry: ${e.radius}px;
229
- filter: ${e.dropShadow?e.dropShadow.replace(`url(#drop-shadow)`,`url(${e.svgId}-drop-shadow)`):`none`}
230
- }
231
- `,`getStyles`);export{Se as i,b as n,me as r,xe as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-Dy05V--k.js";import"./chunk-75Z2AOVW-1k7HRGrm.js";import"./chunk-PWAF6VOD-Dup_NAkl.js";import"./chunk-GMAD6QVW-Bi5Ne8OE.js";import"./chunk-P2QGCYS3-BPor-azX.js";import"./chunk-4HAMMTFA-hiqoLVtf.js";import"./chunk-GVQU2GXP-BtSmWzHA.js";import"./chunk-OSK3NFVY-S95igUko.js";import"./chunk-F27PBJKO-C6rqX2gT.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-BrnPOTT-.js";import"./chunk-L3NEJ4N5-CQSamtuJ.js";import{i as t,n,r,t as i}from"./chunk-HLEWEB6X-yamDqy1M.js";import"./mermaid.core-BmGW_v8T.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-Dy05V--k.js";import"./chunk-75Z2AOVW-1k7HRGrm.js";import"./chunk-PWAF6VOD-Dup_NAkl.js";import"./chunk-GMAD6QVW-Bi5Ne8OE.js";import"./chunk-P2QGCYS3-BPor-azX.js";import"./chunk-4HAMMTFA-hiqoLVtf.js";import"./chunk-GVQU2GXP-BtSmWzHA.js";import"./chunk-OSK3NFVY-S95igUko.js";import"./chunk-F27PBJKO-C6rqX2gT.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-BrnPOTT-.js";import"./chunk-L3NEJ4N5-CQSamtuJ.js";import{i as t,n,r,t as i}from"./chunk-HLEWEB6X-yamDqy1M.js";import"./mermaid.core-BmGW_v8T.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import"./chunk-FOHPRMQF-DHwB1DNv.js";import{A as e}from"./mermaid-parser.core-CzCh9EE1.js";export{e as createCynefinServices};
@@ -1,4 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{x as n}from"./chunk-DU6HZSFF-Dy05V--k.js";import"./chunk-75Z2AOVW-1k7HRGrm.js";import"./chunk-PWAF6VOD-Dup_NAkl.js";import"./chunk-GMAD6QVW-Bi5Ne8OE.js";import"./chunk-P2QGCYS3-BPor-azX.js";import{s as r}from"./chunk-4HAMMTFA-hiqoLVtf.js";import{a as i,i as a,n as o}from"./chunk-GVQU2GXP-BtSmWzHA.js";import{a as s,c,i as l}from"./chunk-OSK3NFVY-S95igUko.js";import{t as u}from"./graphlib-DS17s2tU.js";import{t as d}from"./dagre-PrKaheQc.js";import{n as f}from"./chunk-L3NEJ4N5-CQSamtuJ.js";import{a as p,c as m,createCommonLayoutRenderer as h,i as g,l as _,o as v,s as y}from"./mermaid.core-BmGW_v8T.js";var b=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),x=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),S=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),C=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],w=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return x(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:x(i)},`getSelfLoopSide`),T=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=b(Math.max(r,e.width*.35),36,c),u=b(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),E=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),D=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=w(e,l,n,c.start,a),f=T(l,d,t,u.width??0),p=E(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),O=e(async({element:n,graph:a,diagramType:c,id:l,parentCluster:u,siteConfig:d})=>{let f=a.graph().rankdir;t.trace(`Dir in recursive render - dir:`,f);let{clusters:h,edgePaths:g,edgeLabels:_,nodes:b,rootGroups:x}=v(n,{edgePathsClass:`edgePaths`});a.nodes()?t.info(`Recursive render XXX`,a.nodes()):t.info(`No nodes found for`,a),a.edges().length>0&&t.info(`Recursive edges`,a.edge(a.edges()[0]));let C=S(c);await Promise.all(a.nodes().map(async function(e){let n=a.node(e);if(u!==void 0){let n=JSON.parse(JSON.stringify(u.clusterData));t.trace(`Setting data for parent cluster XXX
2
- Node.id = `,e,`
3
- data=`,n.height,`
4
- Parent cluster`,u.height),a.setNode(u.id,n),a.parent(e)||(t.trace(`Setting parent`,e,u.id),a.setParent(e,u.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(a.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,a.node(e));let{ranksep:o,nodesep:s}=a.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:s});let u=await F({element:b,graph:n.graph,diagramType:c,id:l,parentCluster:a.node(e),siteConfig:d}),f=u.elem;r(n,f),n.diff=u.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),i(f,n)}else a.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,a),t.trace(y(n.id,a)),p.set(n.id,{id:y(n.id,a),node:n})):(t.trace(`Node - the non recursive path XAX`,e,b,a.node(e),f),await m(b,a.node(e),{config:d,dir:f}))})),await e(async()=>{let e=a.edges().map(async function(e){let n=a.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(a.edge(e))),t.info(`Fix`,p,`ids:`,e.v,e.w,`Translating: `,p.get(e.v),p.get(e.w)),C&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await s(_,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await s(_,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:w}=o(d);return{elem:x,graph:a,groups:{clusters:h,edgePaths:g,edgeLabels:_,nodes:b,rootGroups:x},diagramType:c,id:l,mergeSelfLoops:C,subGraphTitleTotalMargin:w}},`measureDagreGraph`),k=e(e=>{t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),d(e)},`runDagreGraphLayout`),A=e((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),j=e((e,t)=>{C.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),M=e((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),N=e((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));_(n).forEach(e=>{let t=A(n,e,i);if(!t)return;j(n.node(e),t);let r=a.get(e);r&&j(r,t)});let o=i/2;return e.edges=D(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>M(e,t,n,o)),e},`applyDagreLayoutResult`),P=e(async({elem:e,graph:n,groups:{clusters:r,edgePaths:i},diagramType:o,id:s,mergeSelfLoops:u,subGraphTitleTotalMargin:d})=>{let m=0;await Promise.all(_(n).map(async function(e){let i=n.node(e);if(t.info(`Position XBX => `+e+`: (`+i.x,`,`+i.y,`) width: `,i.width,` height: `,i.height),i?.clusterNode)i.y+=d,t.info(`A tainted cluster node XBX1`,e,i.id,i.width,i.height,i.x,i.y,n.parent(e)),p.get(i.id).node=i,a(i);else if(n.children(e).length>0){t.info(`A pure cluster node XBX1`,e,i.id,i.x,i.y,i.width,i.height,n.parent(e)),i.height+=d,n.node(i.parentId);let a=i?.padding/2||0,o=i?.labelBBox?.height||0,s=o-a||0;t.debug(`OffsetY`,s,`labelHeight`,o,`halfPadding`,a),await f(r,i),p.get(i.id).node=i}else{let e=n.node(i.parentId);i.y+=d/2,t.info(`A regular node XBX1 - using the padding`,i.id,`parent`,i.parentId,i.width,i.height,i.x,i.y,`offsetY`,i.offsetY,`parent`,e,e?.offsetY,i),a(i)}}));let h=d/2;return D(n,h,{mergeSelfLoops:u}).forEach(function({edge:e,start:r,end:a}){t.info(`Edge `+r+` -> `+a+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=h);let u=n.node(r),d=n.node(a),f=l(i,e,p,o,u,d,s);c(e,f)}),n.nodes().forEach(function(e){let r=n.node(e);t.info(e,r.type,r.diff),r.isGroup&&(m=r.diff)}),t.warn(`Returning from recursive render XAX`,e,m),{elem:e,diff:m}},`paintDagreLayoutCore`),F=e(async e=>{let t=await O(e);return k(t.graph),await P(t)},`renderDagreSubgraph`),I=e(e=>{let n=new u({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,n.setEdge(t,r,s,t+`-cyclic-special-0`),n.setEdge(r,i,c,t+`-cyclic-special-1`),n.setEdge(i,t,l,t+`-cyclic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),g(n),{graph:n}},`prepareLayoutForDagre`),L=e(async(e,{element:t,preparedLayout:r})=>{let i=r??I(e),a=n(),o=await O({element:t,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),R=e((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return k(n.graph),N(e,n),n},`runDagreLayoutCore`),z=h({prepareLayout:I,measureLayout:L,runLayoutCore:R,paintOptions:{clusterDb:p,getNodes:e((e,{measure:t})=>_(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:e((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:e((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:e((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{N as applyDagreLayoutResult,D as getEdgesToRender,L as measureDagreLayout,I as prepareLayoutForDagre,z as render,R as runDagreLayoutCore};
@@ -1 +0,0 @@
1
- import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as ee,T as te,U as ne,V as re,W as ie,X as ae,Y as oe,Z as y,_ as b,a as x,b as se,c as ce,d as le,et as S,f as C,g as ue,h as de,i as w,it as fe,j as pe,k as me,l as he,m as ge,n as T,nt as _e,o as E,p as ve,q as ye,r as D,rt as be,s as xe,t as O,tt as k,u as Se,v as Ce,w as we,x as Te,y as Ee,z as A}from"./graphlib-DS17s2tU.js";var De=/\s/;function Oe(e){for(var t=e.length;t--&&De.test(e.charAt(t)););return t}var ke=/^\s+/;function Ae(e){return e&&e.slice(0,Oe(e)+1).replace(ke,``)}var je=NaN,Me=/^[-+]0x[0-9a-f]+$/i,Ne=/^0b[01]+$/i,Pe=/^0o[0-7]+$/i,Fe=parseInt;function Ie(e){if(typeof e==`number`)return e;if(S(e))return je;if(y(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=y(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Ae(e);var n=Ne.test(e);return n||Pe.test(e)?Fe(e.slice(2),n?2:8):Me.test(e)?je:+e}var Le=1/0,Re=17976931348623157e292;function j(e){return e?(e=Ie(e),e===Le||e===-Le?(e<0?-1:1)*Re:e===e?e:0):e===0?e:0}function ze(e){var t=j(e),n=t%1;return t===t?n?t-n:t:0}var Be=Object.create,Ve=function(){function e(){}return function(t){if(!y(t))return{};if(Be)return Be(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function He(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function M(e,t,n){t==`__proto__`&&ye?ye(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Ue=Object.prototype.hasOwnProperty;function N(e,t,n){var r=e[t];(!(Ue.call(e,t)&&c(r,n))||n===void 0&&!(t in e))&&M(e,t,n)}function P(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?M(n,s,c):N(n,s,c)}return n}function F(e,t,n){if(!y(n))return!1;var r=typeof t;return(r==`number`?A(n)&&ne(t,n.length):r==`string`&&t in n)?c(n[t],e):!1}function We(e){return n(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&F(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function Ge(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ke=Object.prototype.hasOwnProperty;function qe(e){if(!y(e))return Ge(e);var t=v(e),n=[];for(var r in e)r==`constructor`&&(t||!Ke.call(e,r))||n.push(r);return n}function I(e){return A(e)?p(e,!0):qe(e)}function L(e){return e!=null&&e.length?r(e,1):[]}function Je(e){return d(re(e,void 0,L),e+``)}var Ye=pe(Object.getPrototypeOf,Object),Xe=`[object Object]`,Ze=Function.prototype,Qe=Object.prototype,$e=Ze.toString,et=Qe.hasOwnProperty,tt=$e.call(Object);function nt(e){if(!k(e)||_e(e)!=Xe)return!1;var t=Ye(e);if(t===null)return!0;var n=et.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&$e.call(n)==tt}var rt=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function it(e){return rt.test(e)}function at(e,t){return e&&P(t,me(t),e)}function ot(e,t){return e&&P(t,I(t),e)}var st=typeof exports==`object`&&exports&&!exports.nodeType&&exports,ct=st&&typeof module==`object`&&module&&!module.nodeType&&module,lt=ct&&ct.exports===st?fe.Buffer:void 0,ut=lt?lt.allocUnsafe:void 0;function dt(e,t){if(t)return e.slice();var n=e.length,r=ut?ut(n):new e.constructor(n);return e.copy(r),r}function ft(e,t){return P(e,se(e),t)}var pt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)we(t,se(e)),e=Ye(e);return t}:Te;function mt(e,t){return P(e,pt(e),t)}function ht(e){return Ee(e,I,pt)}var gt=Object.prototype.hasOwnProperty;function _t(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&gt.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function vt(e){var t=new e.constructor(e.byteLength);return new ue(t).set(new ue(e)),t}function yt(e,t){var n=t?vt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var bt=/\w*$/;function xt(e){var t=new e.constructor(e.source,bt.exec(e));return t.lastIndex=e.lastIndex,t}var St=be?be.prototype:void 0,Ct=St?St.valueOf:void 0;function wt(e){return Ct?Object(Ct.call(e)):{}}function Tt(e,t){var n=t?vt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Et=`[object Boolean]`,Dt=`[object Date]`,Ot=`[object Map]`,kt=`[object Number]`,At=`[object RegExp]`,jt=`[object Set]`,Mt=`[object String]`,Nt=`[object Symbol]`,Pt=`[object ArrayBuffer]`,Ft=`[object DataView]`,It=`[object Float32Array]`,Lt=`[object Float64Array]`,Rt=`[object Int8Array]`,zt=`[object Int16Array]`,Bt=`[object Int32Array]`,Vt=`[object Uint8Array]`,Ht=`[object Uint8ClampedArray]`,Ut=`[object Uint16Array]`,Wt=`[object Uint32Array]`;function Gt(e,t,n){var r=e.constructor;switch(t){case Pt:return vt(e);case Et:case Dt:return new r(+e);case Ft:return yt(e,n);case It:case Lt:case Rt:case zt:case Bt:case Vt:case Ht:case Ut:case Wt:return Tt(e,n);case Ot:return new r;case kt:case Mt:return new r(e);case At:return xt(e);case jt:return new r;case Nt:return wt(e)}}function Kt(e){return typeof e.constructor==`function`&&!v(e)?Ve(Ye(e)):{}}var qt=`[object Map]`;function Jt(e){return k(e)&&b(e)==qt}var Yt=g&&g.isMap,Xt=Yt?o(Yt):Jt,Zt=`[object Set]`;function Qt(e){return k(e)&&b(e)==Zt}var $t=g&&g.isSet,en=$t?o($t):Qt,tn=1,nn=2,rn=4,an=`[object Arguments]`,on=`[object Array]`,sn=`[object Boolean]`,cn=`[object Date]`,ln=`[object Error]`,un=`[object Function]`,dn=`[object GeneratorFunction]`,fn=`[object Map]`,pn=`[object Number]`,mn=`[object Object]`,hn=`[object RegExp]`,gn=`[object Set]`,_n=`[object String]`,vn=`[object Symbol]`,yn=`[object WeakMap]`,bn=`[object ArrayBuffer]`,xn=`[object DataView]`,Sn=`[object Float32Array]`,Cn=`[object Float64Array]`,wn=`[object Int8Array]`,Tn=`[object Int16Array]`,En=`[object Int32Array]`,Dn=`[object Uint8Array]`,On=`[object Uint8ClampedArray]`,kn=`[object Uint16Array]`,An=`[object Uint32Array]`,R={};R[an]=R[on]=R[bn]=R[xn]=R[sn]=R[cn]=R[Sn]=R[Cn]=R[wn]=R[Tn]=R[En]=R[fn]=R[pn]=R[mn]=R[hn]=R[gn]=R[_n]=R[vn]=R[Dn]=R[On]=R[kn]=R[An]=!0,R[ln]=R[un]=R[yn]=!1;function z(e,t,n,r,i,a){var o,c=t&tn,u=t&nn,d=t&rn;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!y(e))return e;var f=_(e);if(f){if(o=_t(e),!c)return He(e,o)}else{var p=b(e),m=p==un||p==dn;if(l(e))return dt(e,c);if(p==mn||p==an||m&&!i){if(o=u||m?{}:Kt(e),!c)return u?mt(e,ot(o,e)):ft(e,at(o,e))}else{if(!R[p])return i?e:{};o=Gt(e,p,c)}}a||=new ee;var h=a.get(e);if(h)return h;a.set(e,o),en(e)?e.forEach(function(r){o.add(z(r,t,n,r,e,a))}):Xt(e)&&e.forEach(function(r,i){o.set(i,z(r,t,n,i,e,a))});var g=f?void 0:(d?u?ht:Ce:u?I:me)(e);return s(g||e,function(r,i){g&&(i=r,r=e[i]),N(o,i,z(r,t,n,i,e,a))}),o}var jn=1,Mn=4;function Nn(e){return z(e,jn|Mn)}var Pn=function(){return fe.Date.now()},Fn=Object.prototype,In=Fn.hasOwnProperty,Ln=n(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&F(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=I(a),s=-1,l=o.length;++s<l;){var u=o[s],d=e[u];(d===void 0||c(d,Fn[u])&&!In.call(e,u))&&(e[u]=a[u])}return e});function Rn(e,t,n){(n!==void 0&&!c(e[t],n)||n===void 0&&!(t in e))&&M(e,t,n)}function zn(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function Bn(e){return P(e,I(e))}function Vn(e,t,n,r,i,a,o){var s=zn(e,n),c=zn(t,n),u=o.get(c);if(u){Rn(e,n,u);return}var d=a?a(s,c,n+``,e,t,o):void 0,p=d===void 0;if(p){var h=_(c),g=!h&&l(c),v=!h&&!g&&m(c);d=c,h||g||v?_(s)?d=s:ce(s)?d=He(s):g?(p=!1,d=dt(c,!0)):v?(p=!1,d=Tt(c,!0)):d=[]:nt(c)||f(c)?(d=s,f(s)?d=Bn(s):(!y(s)||oe(s))&&(d=Kt(c))):p=!1}p&&(o.set(c,d),i(d,c,r,a,o),o.delete(c)),Rn(e,n,d)}function Hn(e,t,n,r,i){e!==t&&le(t,function(a,o){if(i||=new ee,y(a))Vn(e,t,o,n,Hn,r,i);else{var s=r?r(zn(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Rn(e,o,s)}},I)}function B(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Un(e){return function(t,n,r){var i=Object(t);if(!A(t)){var a=C(n,3);t=me(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Wn=Math.max;function Gn(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:ze(n);return i<0&&(i=Wn(r+i,0)),ie(e,C(t,3),i)}var Kn=Un(Gn);function qn(e,t){var n=-1,r=A(e)?Array(e.length):[];return he(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function V(t,n){return(_(t)?e:qn)(t,C(n,3))}function Jn(e,t){return e==null?e:le(e,xe(t),I)}function Yn(e,t){return e&&Se(e,xe(t))}function Xn(e,t){return e>t}var Zn=Object.prototype.hasOwnProperty;function Qn(e,t){return e!=null&&Zn.call(e,t)}function $n(e,t){return e!=null&&de(e,t,Qn)}var er=`[object String]`;function tr(e){return typeof e==`string`||!_(e)&&k(e)&&_e(e)==er}function nr(e,t){return e<t}function H(e,t){var n={};return t=C(t,3),Se(e,function(e,r,i){M(n,r,t(e,r,i))}),n}function rr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!S(o):n(o,s)))var s=o,c=a}return c}function U(e){return e&&e.length?rr(e,ae,Xn):void 0}var ir=We(function(e,t,n){Hn(e,t,n)});function W(e){return e&&e.length?rr(e,ae,nr):void 0}function ar(e,t){return e&&e.length?rr(e,C(t,2),nr):void 0}function or(e,t,n,r){if(!y(e))return e;t=i(t,e);for(var o=-1,s=t.length,c=s-1,l=e;l!=null&&++o<s;){var u=a(t[o]),d=n;if(u===`__proto__`||u===`constructor`||u===`prototype`)return e;if(o!=c){var f=l[u];d=r?r(f,u,l):void 0,d===void 0&&(d=y(f)?f:ne(t[o+1])?[]:{})}N(l,u,d),l=l[u]}return e}function sr(e,t,n){for(var r=-1,a=t.length,o={};++r<a;){var s=t[r],c=te(e,s);n(c,s)&&or(o,i(s,e),c)}return o}function cr(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function lr(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=S(e),o=t!==void 0,s=t===null,c=t===t,l=S(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function ur(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=lr(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function dr(t,n,r){n=n.length?e(n,function(e){return _(e)?function(t){return te(t,e.length===1?e[0]:e)}:e}):[ae];var i=-1;return n=e(n,o(C)),cr(qn(t,function(t,r,a){return{criteria:e(n,function(e){return e(t)}),index:++i,value:t}}),function(e,t){return ur(e,t,r)})}var fr=ve(`length`),pr=`\\ud800-\\udfff`,mr=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,hr=`\\ufe0e\\ufe0f`,gr=`[`+pr+`]`,_r=`[`+mr+`]`,vr=`\\ud83c[\\udffb-\\udfff]`,yr=`(?:`+_r+`|`+vr+`)`,br=`[^`+pr+`]`,xr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Sr=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Cr=`\\u200d`,wr=yr+`?`,Tr=`[`+hr+`]?`,Er=`(?:`+Cr+`(?:`+[br,xr,Sr].join(`|`)+`)`+Tr+wr+`)*`,Dr=Tr+wr+Er,Or=`(?:`+[br+_r+`?`,_r,xr,Sr,gr].join(`|`)+`)`,kr=RegExp(vr+`(?=`+vr+`)|`+Or+Dr,`g`);function Ar(e){for(var t=kr.lastIndex=0;kr.test(e);)++t;return t}function jr(e){return it(e)?Ar(e):fr(e)}function Mr(e,t){return sr(e,t,function(t,n){return ge(e,n)})}var G=Je(function(e,t){return e==null?{}:Mr(e,t)}),Nr=Math.ceil,Pr=Math.max;function Fr(e,t,n,r){for(var i=-1,a=Pr(Nr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Ir(e){return function(t,n,r){return r&&typeof r!=`number`&&F(t,n,r)&&(n=r=void 0),t=j(t),n===void 0?(n=t,t=0):n=j(n),r=r===void 0?t<n?1:-1:j(r),Fr(t,n,r,e)}}var K=Ir(),Lr=`[object Map]`,Rr=`[object Set]`;function zr(e){if(e==null)return 0;if(A(e))return tr(e)?jr(e):e.length;var n=b(e);return n==Lr||n==Rr?e.size:t(e).length}var q=n(function(e,t){if(e==null)return[];var n=t.length;return n>1&&F(e,t[0],t[1])?t=[]:n>2&&F(t[0],t[1],t[2])&&(t=[t[0]]),dr(e,r(t,1),[])}),Br=0;function Vr(e){var t=++Br;return h(e)+t}function Hr(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function Ur(e,t){return Hr(e||[],t||[],N)}var Wr=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return Gr(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&Gr(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,Kr)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Gr(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Kr(e,t){if(e!==`_next`&&e!==`_prev`)return t}var qr=u(1);function Jr(e,t){if(e.nodeCount()<=1)return[];var n=Zr(e,t||qr);return L(V(Yr(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function Yr(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)Xr(e,t,n,o);for(;o=i.dequeue();)Xr(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(Xr(e,t,n,o,!0));break}}}return r}function Xr(e,t,n,r,i){var a=i?[]:void 0;return E(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Qr(t,n,s)}),E(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Qr(t,n,o)}),e.removeNode(r.v),a}function Zr(e,t){var n=new O,r=0,i=0;E(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),E(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=K(i+r+3).map(function(){return new Wr}),o=r+1;return E(n.nodes(),function(e){Qr(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function Qr(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function $r(e){var t=e.graph().acyclicer===`greedy`?Jr(e,n(e)):ei(e);E(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Vr(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function ei(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,E(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return E(e.nodes(),i),t}function ti(e){E(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function J(e,t,n,r){var i;do i=Vr(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function ni(e){var t=new O().setGraph(e.graph());return E(e.nodes(),function(n){t.setNode(n,e.node(n))}),E(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function ri(e){var t=new O({multigraph:e.isMultigraph()}).setGraph(e.graph());return E(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),E(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function ii(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Y(e){var t=V(K(ci(e)+1),function(){return[]});return E(e.nodes(),function(n){var r=e.node(n),i=r.rank;D(i)||(t[i][r.order]=n)}),t}function ai(e){var t=W(V(e.nodes(),function(t){return e.node(t).rank}));E(e.nodes(),function(n){var r=e.node(n);$n(r,`rank`)&&(r.rank-=t)})}function oi(e){var t=W(V(e.nodes(),function(t){return e.node(t).rank})),n=[];E(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;E(n,function(t,n){D(t)&&n%i!==0?--r:r&&E(t,function(t){e.node(t).rank+=r})})}function si(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),J(e,`border`,i,t)}function ci(e){return U(V(e.nodes(),function(t){var n=e.node(t).rank;if(!D(n))return n}))}function li(e,t){var n={lhs:[],rhs:[]};return E(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function ui(e,t){var n=Pn();try{return t()}finally{console.log(e+` time: `+(Pn()-n)+`ms`)}}function di(e,t){return t()}function fi(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&E(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)pi(e,`borderLeft`,`_bl`,n,i,a),pi(e,`borderRight`,`_br`,n,i,a)}}E(e.children(),t)}function pi(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=J(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function mi(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&gi(e)}function hi(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&vi(e),(t===`lr`||t===`rl`)&&(bi(e),gi(e))}function gi(e){E(e.nodes(),function(t){_i(e.node(t))}),E(e.edges(),function(t){_i(e.edge(t))})}function _i(e){var t=e.width;e.width=e.height,e.height=t}function vi(e){E(e.nodes(),function(t){yi(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);E(n.points,yi),Object.prototype.hasOwnProperty.call(n,`y`)&&yi(n)})}function yi(e){e.y=-e.y}function bi(e){E(e.nodes(),function(t){xi(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);E(n.points,xi),Object.prototype.hasOwnProperty.call(n,`x`)&&xi(n)})}function xi(e){var t=e.x;e.x=e.y,e.y=t}function Si(e){e.graph().dummyChains=[],E(e.edges(),function(t){Ci(e,t)})}function Ci(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=J(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function wi(e){E(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function X(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=W(V(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}E(e.sources(),n)}function Z(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Ti(e){var t=new O({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Ei(t,e)<r;)i=Di(t,e),a=t.hasNode(i.v)?Z(e,i):-Z(e,i),Oi(t,e,a);return t}function Ei(e,t){function n(r){E(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Z(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return E(e.nodes(),n),e.nodeCount()}function Di(e,t){return ar(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return Z(t,n)})}function Oi(e,t,n){E(e.nodes(),function(e){t.node(e).rank+=n})}u(1),u(1),ki.CycleException=Q;function ki(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new Q;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,E(e.predecessors(a),i),delete n[a],r.push(a))}if(E(e.sinks(),i),zr(t)!==e.nodeCount())throw new Q;return r}function Q(){}Q.prototype=Error();function Ai(e,t,n){_(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return E(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);ji(e,t,n===`post`,a,r,i)}),i}function ji(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),E(i(t),function(t){ji(e,t,n,r,i,a)}),n&&a.push(t))}function Mi(e,t){return Ai(e,t,`post`)}function Ni(e,t){return Ai(e,t,`pre`)}$.initLowLimValues=Li,$.initCutValues=Pi,$.calcCutValue=Ii,$.leaveEdge=zi,$.enterEdge=Bi,$.exchangeEdges=Vi;function $(e){e=ni(e),X(e);var t=Ti(e);Li(t),Pi(t,e);for(var n,r;n=zi(t);)r=Bi(t,e,n),Vi(t,e,n,r)}function Pi(e,t){var n=Mi(e,e.nodes());n=n.slice(0,n.length-1),E(n,function(n){Fi(e,t,n)})}function Fi(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Ii(e,t,n)}function Ii(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,E(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,Ui(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Li(e,t){arguments.length<2&&(t=e.nodes()[0]),Ri(e,{},1,t)}function Ri(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,E(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=Ri(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function zi(e){return Kn(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Bi(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),ar(x(t.edges(),function(t){return c===Wi(e,e.node(t.v),s)&&c!==Wi(e,e.node(t.w),s)}),function(e){return Z(t,e)})}function Vi(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Li(e),Pi(e,t),Hi(e,t)}function Hi(e,t){var n=Ni(e,Kn(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),E(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Ui(e,t,n){return e.hasEdge(t,n)}function Wi(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Gi(e){switch(e.graph().ranker){case`network-simplex`:Ji(e);break;case`tight-tree`:qi(e);break;case`longest-path`:Ki(e);break;default:Ji(e)}}var Ki=X;function qi(e){X(e),Ti(e)}function Ji(e){$(e)}function Yi(e){var t=J(e,`root`,{},`_root`),n=Zi(e),r=U(w(n))-1,i=2*r+1;e.graph().nestingRoot=t,E(e.edges(),function(t){e.edge(t).minlen*=i});var a=Qi(e)+1;E(e.children(),function(o){Xi(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function Xi(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=si(e,`_bt`),l=si(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,E(s,function(s){Xi(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function Zi(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&E(a,function(e){n(e,i+1)}),t[r]=i}return E(e.children(),function(e){n(e,1)}),t}function Qi(e){return T(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function $i(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,E(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function ea(e,t,n){var r={},i;E(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ta(e,t,n){var r=na(e),i=new O({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return E(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),E(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=D(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function na(e){for(var t;e.hasNode(t=Vr(`_root`)););return t}function ra(e,t){for(var n=0,r=1;r<t.length;++r)n+=ia(e,t[r-1],t[r]);return n}function ia(e,t,n){for(var r=Ur(n,V(n,function(e,t){return t})),i=L(V(t,function(t){return q(V(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=V(Array(o),function(){return 0}),c=0;return E(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function aa(e){var t={},n=x(e.nodes(),function(t){return!e.children(t).length}),r=V(K(U(V(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){$n(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),E(e.successors(n),i))}var a=q(n,function(t){return e.node(t).rank});return E(a,i),r}function oa(e,t){return V(t,function(t){var n=e.inEdges(t);if(n.length){var r=T(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function sa(e,t){var n={};return E(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};D(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),E(t.edges(),function(e){var t=n[e.v],r=n[e.w];!D(t)&&!D(r)&&(r.indegree++,t.out.push(n[e.w]))}),ca(x(n,function(e){return!e.indegree}))}function ca(e){var t=[];function n(e){return function(t){t.merged||(D(t.barycenter)||D(e.barycenter)||t.barycenter>=e.barycenter)&&la(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),E(i.in.reverse(),n(i)),E(i.out,r(i))}return V(x(t,function(e){return!e.merged}),function(e){return G(e,[`vs`,`i`,`barycenter`,`weight`])})}function la(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function ua(e,t){var n=li(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=q(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(fa(!!t)),c=da(a,i,c),E(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=da(a,i,c)});var l={vs:L(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function da(e,t,n){for(var r;t.length&&(r=B(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function fa(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function pa(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=x(i,function(e){return e!==o&&e!==s}));var l=oa(e,i);E(l,function(t){if(e.children(t.v).length){var i=pa(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&ha(t,i)}});var u=sa(l,n);ma(u,c);var d=ua(u,r);if(o&&(d.vs=L([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function ma(e,t){E(e,function(e){e.vs=L(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function ha(e,t){D(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function ga(e){var t=ci(e),n=_a(e,K(1,t+1),`inEdges`),r=_a(e,K(t-1,-1,-1),`outEdges`),i=aa(e);ya(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){va(s%2?n:r,s%4>=2),i=Y(e);var l=ra(e,i);l<a&&(c=0,o=Nn(i),a=l)}ya(e,o)}function _a(e,t,n){return V(t,function(t){return ta(e,t,n)})}function va(e,t){var n=new O;E(e,function(e){var r=e.graph().root,i=pa(e,r,n,t);E(i.vs,function(t,n){e.node(t).order=n}),ea(e,n,i.vs)})}function ya(e,t){E(t,function(t){E(t,function(t,n){e.node(t).order=n})})}function ba(e){var t=Sa(e);E(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=xa(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function xa(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Sa(e){var t={},n=0;function r(i){var a=n;E(e.children(i),r),t[i]={low:a,lim:n++}}return E(e.children(),r),t}function Ca(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=B(r);return E(r,function(t,c){var l=Ta(e,t),u=l?e.node(l).order:o;(l||t===s)&&(E(r.slice(a,c+1),function(t){E(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Ea(n,r,t)})}),a=c+1,i=u)}),r}return T(t,r),n}function wa(e,t){var n={};function r(t,r,i,a,o){var s;E(K(r,i),function(r){s=t[r],e.node(s).dummy&&E(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Ea(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return E(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return T(t,i),n}function Ta(e,t){if(e.node(t).dummy)return Kn(e.predecessors(t),function(t){return e.node(t).dummy})}function Ea(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Da(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Oa(e,t,n,r){var i={},a={},o={};return E(t,function(e){E(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),E(t,function(e){var t=-1;E(e,function(e){var s=r(e);if(s.length){s=q(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Da(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function ka(e,t,n,r,i){var a={},o=Aa(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),E(r,function(e){a[e]=a[n[e]]}),a}function Aa(e,t,n,r){var i=new O,a=e.graph(),o=Fa(a.nodesep,a.edgesep,r);return E(t,function(t){var r;E(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function ja(e,t){return ar(w(t),function(t){var n=-1/0,r=1/0;return Jn(t,function(t,i){var a=Ia(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Ma(e,t){var n=w(t),r=W(n),i=U(n);E([`u`,`d`],function(n){E([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=w(s);c=a===`l`?r-W(l):i-U(l),c&&(e[o]=H(s,function(e){return e+c}))}})})}function Na(e,t){return H(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=q(V(e,r));return(i[1]+i[2])/2})}function Pa(e){var t=Y(e),n=ir(Ca(e,t),wa(e,t)),r={},i;return E([`u`,`d`],function(a){i=a===`u`?t:w(t).reverse(),E([`l`,`r`],function(t){t===`r`&&(i=V(i,function(e){return w(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Oa(e,i,n,o),c=ka(e,i,s.root,s.align,t===`r`);t===`r`&&(c=H(c,function(e){return-e})),r[a+t]=c})}),Ma(r,ja(e,r)),Na(r,e.graph().align)}function Fa(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function Ia(e,t){return e.node(t).width}function La(e){e=ri(e),Ra(e),Yn(Pa(e),function(t,n){e.node(n).x=t})}function Ra(e){var t=Y(e),n=e.graph().ranksep,r=0;E(t,function(t){var i=U(V(t,function(t){return e.node(t).height}));E(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function za(e,t){var n=t&&t.debugTiming?ui:di;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Xa(e));n(` runLayout`,()=>Ba(t,n)),n(` updateInputGraph`,()=>Va(e,t))})}function Ba(e,t){t(` makeSpaceForEdgeLabels`,()=>Za(e)),t(` removeSelfEdges`,()=>oo(e)),t(` acyclic`,()=>$r(e)),t(` nestingGraph.run`,()=>Yi(e)),t(` rank`,()=>Gi(ri(e))),t(` injectEdgeLabelProxies`,()=>Qa(e)),t(` removeEmptyRanks`,()=>oi(e)),t(` nestingGraph.cleanup`,()=>$i(e)),t(` normalizeRanks`,()=>ai(e)),t(` assignRankMinMax`,()=>$a(e)),t(` removeEdgeLabelProxies`,()=>eo(e)),t(` normalize.run`,()=>Si(e)),t(` parentDummyChains`,()=>ba(e)),t(` addBorderSegments`,()=>fi(e)),t(` order`,()=>ga(e)),t(` insertSelfEdges`,()=>so(e)),t(` adjustCoordinateSystem`,()=>mi(e)),t(` position`,()=>La(e)),t(` positionSelfEdges`,()=>co(e)),t(` removeBorderNodes`,()=>ao(e)),t(` normalize.undo`,()=>wi(e)),t(` fixupEdgeLabelCoords`,()=>ro(e)),t(` undoCoordinateSystem`,()=>hi(e)),t(` translateGraph`,()=>to(e)),t(` assignNodeIntersects`,()=>no(e)),t(` reversePoints`,()=>io(e)),t(` acyclic.undo`,()=>ti(e))}function Va(e,t){E(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),E(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Ha=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Ua={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Wa=[`acyclicer`,`ranker`,`rankdir`,`align`],Ga=[`width`,`height`],Ka={width:0,height:0},qa=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Ja={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ya=[`labelpos`];function Xa(e){var t=new O({multigraph:!0,compound:!0}),n=uo(e.graph());return t.setGraph(ir({},Ua,lo(n,Ha),G(n,Wa))),E(e.nodes(),function(n){var r=uo(e.node(n));t.setNode(n,Ln(lo(r,Ga),Ka)),t.setParent(n,e.parent(n))}),E(e.edges(),function(n){var r=uo(e.edge(n));t.setEdge(n,ir({},Ja,lo(r,qa),G(r,Ya)))}),t}function Za(e){var t=e.graph();t.ranksep/=2,E(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Qa(e){E(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);J(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function $a(e){var t=0;E(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=U(t,r.maxRank))}),e.graph().maxRank=t}function eo(e){E(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function to(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}E(e.nodes(),function(t){c(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,E(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),E(e.edges(),function(n){var i=e.edge(n);E(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function no(e){E(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(ii(r,a)),n.points.push(ii(i,o))})}function ro(e){E(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function io(e){E(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function ao(e){E(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(B(n.borderLeft)),o=e.node(B(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),E(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function oo(e){E(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function so(e){var t=Y(e);E(t,function(t){var n=0;E(t,function(t,r){var i=e.node(t);i.order=r+n,E(i.selfEdges,function(t){J(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function co(e){E(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function lo(e,t){return H(G(e,t),Number)}function uo(e){var t={};return E(e,function(e,n){t[n.toLowerCase()]=e}),t}export{za as t};
@@ -1,3 +0,0 @@
1
- import{T as e}from"./chunk-FOHPRMQF-DHwB1DNv.js";import{n as t}from"./mermaid-parser.core-CzCh9EE1.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r,p as i}from"./src-oBChb5qS.js";import{H as a,K as o,U as s,Y as c,a as l,b as u,f as d,v as f,w as p,x as m,y as h,z as g}from"./chunk-DU6HZSFF-Dy05V--k.js";import{_,i as ee,t as te}from"./chunk-75Z2AOVW-1k7HRGrm.js";import{t as ne}from"./chunk-JWPE2WC7-DVXcaiue.js";var v=`position frame`,y=`frame positioned`,b=`position relation`,x=`relation positioned`,re=n(function(e){r.debug(`options str`,e)},`setOptions`),ie=n(function(){return{}},`getOptions`),ae=n(function(){S(),l()},`clear`);function S(){C={}}n(S,`reset`);var oe=d.eventmodeling,se=n(()=>ee({...oe,...u().eventmodeling}),`getConfig`),C={};function w(){let e=ce,{ast:t}=C,n=D();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((i,a)=>{let o=P(i,t.dataEntities,n);e=J(e,{$kind:v,index:a,frame:i,textProps:o});let s;V(i)?(r.debug(`source frame`,i.sourceFrames),s=t.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),s.forEach(t=>{e=J(e,{$kind:b,index:a,frame:i,sourceFrame:t})})):e=J(e,{$kind:b,index:a,frame:i})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}n(w,`getState`);function T(e){C.ast=e}n(T,`setAst`);var E={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function D(){return E}n(D,`getDiagramProps`);var ce={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function O(e){let t=e.split(`.`);if(t.length===2)return t[0]}n(O,`extractNamespace`);function k(e){let t=e.split(`.`);return t.length===2?t[1]:e}n(k,`extractName`);function A(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}n(A,`findSwimlaneByNamespace`);function j(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}n(j,`findNextAvailableIndex`);function M(e,t){let n=O(e.entityIdentifier),r=A(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||E.labelUiAutomation}:n?{index:j(t,0,100),label:E.labelUiAutomationPrefix+n}:{index:0,label:E.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||E.labelCommandReadModel}:n?{index:j(t,100,200),label:E.labelCommandReadModelPrefix+n}:{index:100,label:E.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||E.labelEvents}:n?{index:j(t,200,300),label:E.labelEventsPrefix+n}:{index:200,label:E.labelEvents}}}n(M,`calculateSwimlaneProps`);function N(e){let{themeVariables:t}=u();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}n(N,`calculateEntityVisualProps`);function P(e,t,n){let i=u(),a=g(k(e.entityIdentifier)??``,i),o,s={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},c=`<b>${_(a,n.textMaxWidth,s)}</b>`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf(`{`)+1),o=o.substring(0,o.lastIndexOf(`}`)-1),o=g(o,i),o=_(o,n.textMaxWidth,s),o=o.replaceAll(` `,`&nbsp;`)),e.dataReference){let r=t.find(t=>t.name===e.dataReference?.$refText);r&&(o=r.dataBlockValue,o=o.substring(o.indexOf(`{
2
- `)+2),o=o.substring(0,o.lastIndexOf(`}`)-1),o=g(o,i),o=_(o,n.textMaxWidth,s),o=o.replaceAll(` `,`&nbsp;`),o+=`<br/>`)}let l=o!==void 0;l&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${o}</code>`);let d={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},f=te(c,d),p=l?f.width/3:f.width,m={content:c,width:p,height:f.height};return r.debug(`[${e.name}] ${e.entityIdentifier} text`,m),m}n(P,`calculateTextProps`);function F(e,t){let n=t,r=N(n.frame),i={width:n.textProps.width+2*E.boxTextPadding,height:n.textProps.height+2*E.boxTextPadding};return[{$kind:y,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}n(F,`decidePositionFrame`);function I(e,t,n){return t===void 0?E.contentStartX:t.index===e.index&&e.r?e.r+E.boxPadding:n===void 0?E.contentStartX:n.r-E.boxOverlap+E.boxPadding}n(I,`calculateX`);function L(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}n(L,`calculateMaxRight`);function R(e){return Object.values(e).sort((e,t)=>e.index-t.index)}n(R,`sortedSwimlanesArray`);function z(e,t){let n=t,r=M(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*E.swimlaneMinHeight+E.swimlaneGap,height:E.swimlaneMinHeight,maxHeight:E.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(E.boxMinWidth,Math.min(E.boxMaxWidth,n.dimension.width))+2*E.boxPadding,height:Math.max(E.boxMinHeight,Math.min(E.boxMaxHeight,n.dimension.height))+2*E.boxPadding},c=I(i,o,a),l=c+s.width+E.boxPadding,u=L(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(E.swimlaneMinHeight,i.maxHeight)+2*E.swimlanePadding;let d={x:c,y:E.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=R(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+E.swimlaneGap}return f}n(z,`evolveFramePositioned`);function B(e,t){return e===0&&t.sourceFrames.length===0}n(B,`isFirstFrame`);function V(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}n(V,`hasSourceFrame`);function H(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}n(H,`findBoxByFrame`);function U(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}n(U,`findBoxByLineIndex`);function W(t,n){let r=n;if(e(r.frame)||B(r.index,r.frame))return[];let i=H(t.boxes,r.frame);if(i===void 0)throw Error(`Target box not found for frame ${r.frame.name}`);let a;return a=r.sourceFrame?H(t.boxes,r.sourceFrame):U(t.boxes,i.swimlane.index,r.index-1),a===void 0?[]:[{$kind:x,frame:r.frame,index:r.index,sourceBox:a,targetBox:i}]}n(W,`decidePositionRelation`);function G(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}n(G,`evolveRelationPositioned`);var le={[v]:F,[b]:W},ue={[y]:z,[x]:G};function K(e,t){let n=le[t.$kind];if(n==null)return[];let i=n(e,t);return r.debug(`decided events`,i),i}n(K,`decide`);function q(e,t){let n=t.reduce((e,t)=>{let n=ue[t.$kind];return n==null?e:n(e,t)},e);return r.debug(`evolve events`,{state:e,newState:n,events:t}),n}n(q,`evolve`);function J(e,t){return q(e,K(e,t))}n(J,`dispatch`);var Y={getConfig:se,setOptions:re,getOptions:ie,clear:ae,setAccTitle:s,getAccTitle:h,getAccDescription:f,setAccDescription:a,setDiagramTitle:o,getDiagramTitle:p,setAst:T,getDiagramProps:D,getState:w},de={parse:n(async e=>{let n=await t(`eventmodeling`,e);r.debug(n),Y.setAst(n),ne(n,Y)},`parse`)},fe=m()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}n(X,`renderD3Box`);function Z(e,t){return e>t}n(Z,`dirUpwards`);function Q(e,t,n,i){return a=>{let o=a.sourceBox.swimlane.y+t.swimlanePadding,s=a.targetBox.swimlane.y+t.swimlanePadding,c=Z(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;r.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${n})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}n(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}n($,`renderD3Swimlane`);var pe={parser:de,db:Y,renderer:{draw:n(function(e,t,n,a){if(r.debug(`in eventmodeling renderer`,e+`
3
- `,`id:`,t,n),!fe)throw Error(`EventModeling config not found`);let o=a.db,{themeVariables:s,eventmodeling:l}=m(),u=i(`[id="${t}"]`),d=o.getDiagramProps(),f=o.getState(),p=`em-arrowhead-${t}`,h=s.emArrowhead??`#000000`;f.sortedSwimlanesArray.forEach($(u,f.maxR,d,s)),f.boxes.forEach(X(u,d)),f.relations.forEach(Q(u,d,p,s)),u.append(`defs`).append(`marker`).attr(`id`,p).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),c(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:n(e=>``,`getStyles`)};export{pe as diagram};
@@ -1 +0,0 @@
1
- import"./chunk-FOHPRMQF-DHwB1DNv.js";import{O as e}from"./mermaid-parser.core-CzCh9EE1.js";export{e as createEventModelingServices};
@@ -1 +0,0 @@
1
- import"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-Dy05V--k.js";import"./chunk-75Z2AOVW-1k7HRGrm.js";import"./chunk-PWAF6VOD-Dup_NAkl.js";import"./chunk-GMAD6QVW-Bi5Ne8OE.js";import"./chunk-P2QGCYS3-BPor-azX.js";import"./chunk-4HAMMTFA-hiqoLVtf.js";import"./chunk-GVQU2GXP-BtSmWzHA.js";import"./chunk-OSK3NFVY-S95igUko.js";import"./chunk-F27PBJKO-C6rqX2gT.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-BrnPOTT-.js";import"./chunk-L3NEJ4N5-CQSamtuJ.js";import{n as e}from"./chunk-3NF5O7KM-Dni31-nE.js";import"./mermaid.core-BmGW_v8T.js";export{e as diagram};