spatial-views 0.0.0-stage → 0.2.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 (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +245 -2
  3. package/dist/app/assets/abnfDiagram-S7VZAUFO-CFbb_Sz2.js +1 -0
  4. package/dist/app/assets/architecture-WOLXFQ4H-CsBD__5a.js +1 -0
  5. package/dist/app/assets/architectureDiagram-YGSQEFNW-C0ic4ib1.js +36 -0
  6. package/dist/app/assets/blockDiagram-APKKGZFW-BZDPbzAG.js +140 -0
  7. package/dist/app/assets/bpmnIcons-APHXDYXF-C0jbCElo.js +1 -0
  8. package/dist/app/assets/c4Diagram-KJ2TOQU5-BilBWuq5.js +38 -0
  9. package/dist/app/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  10. package/dist/app/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  11. package/dist/app/assets/chunk-6MUBBAK2-BBl-4tQr.js +2 -0
  12. package/dist/app/assets/chunk-AXFCVDMN-BhsttQ-k.js +62 -0
  13. package/dist/app/assets/chunk-BG4553SI-mWcPcFZr.js +127 -0
  14. package/dist/app/assets/chunk-DQASFODM-7FKe2gLt.js +10 -0
  15. package/dist/app/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
  16. package/dist/app/assets/chunk-HFQBQIA3-nXrQ08BL.js +1 -0
  17. package/dist/app/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
  18. package/dist/app/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  19. package/dist/app/assets/chunk-KQLB2F66-swukhFmZ.js +2 -0
  20. package/dist/app/assets/chunk-KS47KZWR-DkDkwO82.js +1 -0
  21. package/dist/app/assets/chunk-LEVMRMFU-DXH6iXv3.js +1 -0
  22. package/dist/app/assets/chunk-M57EVK23-B-kEyOJF.js +1 -0
  23. package/dist/app/assets/chunk-NGNAAXSQ-DI_UYJZ4.js +136 -0
  24. package/dist/app/assets/chunk-OY52VR5R-DweG7qYw.js +88 -0
  25. package/dist/app/assets/chunk-QB3YPZ4I-DyozK3lV.js +213 -0
  26. package/dist/app/assets/chunk-R3KSYZAL-BEXCUN6J.js +1 -0
  27. package/dist/app/assets/chunk-STOXU5M4-BaTlty4O.js +72 -0
  28. package/dist/app/assets/chunk-TU62E6Q5-_rcUP1Fh.js +1 -0
  29. package/dist/app/assets/chunk-X3CZISLH-NOpCnvgE.js +1 -0
  30. package/dist/app/assets/chunk-X4PVCEUW-DGxTL3kB.js +1 -0
  31. package/dist/app/assets/chunk-XXDRQBXY-C02Gpej2.js +1 -0
  32. package/dist/app/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  33. package/dist/app/assets/classDiagram-v2-L25IHNXF-DLEBwpvk.js +217 -0
  34. package/dist/app/assets/cose-bilkent-JH36ORCC-kNCXOm8k.js +1 -0
  35. package/dist/app/assets/cynefin-EF2NZ3EQ-6MWNLbuF.js +1 -0
  36. package/dist/app/assets/cynefinDiagram-L36ESFBY-CLFstukD.js +62 -0
  37. package/dist/app/assets/cytoscape.esm-nTrd5EVq.js +321 -0
  38. package/dist/app/assets/d3-scale-CaJQQYkF.js +1 -0
  39. package/dist/app/assets/dagre-SPEB5RXH-BaSAny1T.js +4 -0
  40. package/dist/app/assets/diagram-3B7GL73J-DJNlt5Sg.js +200 -0
  41. package/dist/app/assets/diagram-DNEMPZML-DEHeuILB.js +24 -0
  42. package/dist/app/assets/diagram-L3MUGCDN-ob5Ka2Xc.js +41 -0
  43. package/dist/app/assets/diagram-LA4NIPWU-DNESzFAc.js +24 -0
  44. package/dist/app/assets/diagram-MHCOC4E2-CVi9zKjG.js +3 -0
  45. package/dist/app/assets/diagram-XPFHEONP-DInT4C7e.js +30 -0
  46. package/dist/app/assets/dist-CjvHN74u.js +1 -0
  47. package/dist/app/assets/ebnfDiagram-UZSYDL2S-CRCZNsji.js +1 -0
  48. package/dist/app/assets/elk-XV6XMXQE-D4fsWI2l.js +2 -0
  49. package/dist/app/assets/erDiagram-EYBAPDEH-YQNM5StV.js +99 -0
  50. package/dist/app/assets/eventmodeling-K75KTNOO-Bev08J2F.js +1 -0
  51. package/dist/app/assets/flowDiagram-MALGAFMO-BhJ554DH.js +1 -0
  52. package/dist/app/assets/ganttDiagram-23REXITY-CkaBMYM4.js +292 -0
  53. package/dist/app/assets/gitGraph-VSP46ZUC-CtbZ0sIS.js +1 -0
  54. package/dist/app/assets/gitGraphDiagram-STJD7YCW-D15ZdQ-Z.js +106 -0
  55. package/dist/app/assets/graphlib-DS17s2tU.js +1 -0
  56. package/dist/app/assets/index-Bn6_wHEp.js +98 -0
  57. package/dist/app/assets/index-H-Z7MFhZ.css +1 -0
  58. package/dist/app/assets/info-OHQRW6UA-CfUW1XFR.js +1 -0
  59. package/dist/app/assets/infoDiagram-KBXO4MBG-DT7LbBRQ.js +2 -0
  60. package/dist/app/assets/ishikawaDiagram-M35NCXHK-CF51lhjB.js +70 -0
  61. package/dist/app/assets/journeyDiagram-OPLOXDXO-_36FonKk.js +139 -0
  62. package/dist/app/assets/kanban-definition-BZKZHSQY-tLk_OlQ-.js +89 -0
  63. package/dist/app/assets/katex-MEuSR36T.js +257 -0
  64. package/dist/app/assets/mermaid-parser.core-_3Vo8x6b.js +7 -0
  65. package/dist/app/assets/mermaid.core-y-x1CYxC.js +44 -0
  66. package/dist/app/assets/mindmap-definition-I2QAS2VK-BCI4HRX3.js +98 -0
  67. package/dist/app/assets/packet-JDAUHWVQ-Cco3UoaI.js +1 -0
  68. package/dist/app/assets/pegDiagram-FD4XPPHP-BOzSoNji.js +1 -0
  69. package/dist/app/assets/pie-XZMESJXO-reOB2GXn.js +1 -0
  70. package/dist/app/assets/pieDiagram-J4AKIIQI-PlHpwT_c.js +39 -0
  71. package/dist/app/assets/quadrantDiagram-XTYBLID2-CdxZ0ael.js +7 -0
  72. package/dist/app/assets/radar-ABXABTNO-DfCl8uV2.js +1 -0
  73. package/dist/app/assets/railroad-I3PHUGI6-4s14UyW1.js +1 -0
  74. package/dist/app/assets/railroad-abnf-LNEFI6M7-C49jJE4Y.js +1 -0
  75. package/dist/app/assets/railroad-ebnf-DWYD2UWJ-Bx-pcPc7.js +1 -0
  76. package/dist/app/assets/railroad-peg-JR7BVNR7-DjBPSCKV.js +1 -0
  77. package/dist/app/assets/railroadDiagram-MRQ6NCDL-wGcmIMqq.js +1 -0
  78. package/dist/app/assets/requirementDiagram-Y7LWUY3S-DprFI03z.js +84 -0
  79. package/dist/app/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  80. package/dist/app/assets/rough.esm-Dy-Kn_BL.js +1 -0
  81. package/dist/app/assets/sankeyDiagram-WGJFYUXA-DygYWLTR.js +40 -0
  82. package/dist/app/assets/sequenceDiagram-5NDRBG5M-BzIr2DBO.js +169 -0
  83. package/dist/app/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
  84. package/dist/app/assets/stateDiagram-v2-FJ4FJNEA-MGCqKnm_.js +291 -0
  85. package/dist/app/assets/swimlanes-UMQ2AFYF-CIEH82Zt.js +1 -0
  86. package/dist/app/assets/swimlanesDiagram-OMPLPG4O-YWNJjl0g.js +8 -0
  87. package/dist/app/assets/timeline-definition-SEUHKTQE-BGYSqup2.js +120 -0
  88. package/dist/app/assets/treeView-D4JQ5SDB-B39o1sJo.js +1 -0
  89. package/dist/app/assets/treemap-SAJKECNS-BoGxrUH4.js +1 -0
  90. package/dist/app/assets/usecaseDiagram-AFA6YXN4-dy6oVOke.js +328 -0
  91. package/dist/app/assets/vennDiagram-NNMJR3RB-CUyuhcAk.js +34 -0
  92. package/dist/app/assets/wardley-7MLQ67FV-sYPAvQ06.js +1 -0
  93. package/dist/app/assets/wardleyDiagram-S7YFUSEH-DYtxYUHe.js +78 -0
  94. package/dist/app/assets/xychartDiagram-GGNKY7IX-ClR06AlB.js +7 -0
  95. package/dist/app/index.html +14 -0
  96. package/dist/cli/index.js +338 -0
  97. package/dist/core/api.js +420 -0
  98. package/dist/core/approvals.js +426 -0
  99. package/dist/core/context.js +259 -0
  100. package/dist/core/diff.js +156 -0
  101. package/dist/core/docs.js +140 -0
  102. package/dist/core/doctor.js +152 -0
  103. package/dist/core/doctypes.js +79 -0
  104. package/dist/core/edit.js +130 -0
  105. package/dist/core/errors.js +3 -0
  106. package/dist/core/flags.js +13 -0
  107. package/dist/core/gaps.js +119 -0
  108. package/dist/core/heading.js +4 -0
  109. package/dist/core/history.js +50 -0
  110. package/dist/core/home.js +345 -0
  111. package/dist/core/lanes.js +134 -0
  112. package/dist/core/launch.js +34 -0
  113. package/dist/core/layout.js +362 -0
  114. package/dist/core/links.js +68 -0
  115. package/dist/core/mermaid.js +175 -0
  116. package/dist/core/newdoc.js +66 -0
  117. package/dist/core/open-folder.js +30 -0
  118. package/dist/core/openspec.js +120 -0
  119. package/dist/core/paths.js +90 -0
  120. package/dist/core/project.js +392 -0
  121. package/dist/core/resolve.js +35 -0
  122. package/dist/core/route.js +420 -0
  123. package/dist/core/scan.js +514 -0
  124. package/dist/core/schema.js +270 -0
  125. package/dist/core/scope.js +126 -0
  126. package/dist/core/setup.js +134 -0
  127. package/dist/core/skills.js +181 -0
  128. package/dist/core/storage/config.js +74 -0
  129. package/dist/core/storage/events.js +54 -0
  130. package/dist/core/storage/folder-watch.js +147 -0
  131. package/dist/core/storage/folder.js +469 -0
  132. package/dist/core/storage/index.js +8 -0
  133. package/dist/core/storage/local.js +22 -0
  134. package/dist/core/storage/migrate.js +48 -0
  135. package/dist/core/storage/postgres.js +290 -0
  136. package/dist/core/storage/types.js +101 -0
  137. package/dist/core/storage.js +589 -0
  138. package/dist/core/suggest.js +283 -0
  139. package/dist/core/tree.js +254 -0
  140. package/dist/core/types.js +583 -0
  141. package/dist/core/version.js +1 -0
  142. package/dist/core/versions.js +245 -0
  143. package/dist/core/watch.js +2 -0
  144. package/dist/core/xml.js +68 -0
  145. package/dist/demo/args.js +58 -0
  146. package/dist/demo/browser.js +301 -0
  147. package/dist/demo/platform.js +147 -0
  148. package/dist/demo/run.js +198 -0
  149. package/dist/demo/steps.js +328 -0
  150. package/dist/mcp/project-tools.js +193 -0
  151. package/dist/mcp/server.js +785 -0
  152. package/examples/platform/README.md +33 -0
  153. package/examples/platform/api/package.json +8 -0
  154. package/examples/platform/api/src/auth-middleware.js +16 -0
  155. package/examples/platform/api/src/proxy.js +7 -0
  156. package/examples/platform/api/src/rate-limit.js +13 -0
  157. package/examples/platform/api/src/server.js +40 -0
  158. package/examples/platform/auth/package.json +9 -0
  159. package/examples/platform/auth/src/server.js +24 -0
  160. package/examples/platform/auth/src/tokens.js +19 -0
  161. package/examples/platform/auth/src/users.js +16 -0
  162. package/examples/platform/docs/api/PRD.md +10 -0
  163. package/examples/platform/docs/api/SDD.md +15 -0
  164. package/examples/platform/docs/auth/PRD.md +10 -0
  165. package/examples/platform/docs/auth/SDD.md +8 -0
  166. package/examples/platform/docs/frontend/PRD.md +18 -0
  167. package/examples/platform/docs/frontend/SDD.md +13 -0
  168. package/examples/platform/docs/pricing/PRD.md +9 -0
  169. package/examples/platform/docs/pricing/SDD.md +8 -0
  170. package/examples/platform/docs/products/PRD.md +9 -0
  171. package/examples/platform/docs/products/SDD.md +8 -0
  172. package/examples/platform/frontend/package.json +8 -0
  173. package/examples/platform/frontend/src/api-client.js +21 -0
  174. package/examples/platform/frontend/src/main.js +21 -0
  175. package/examples/platform/frontend/src/pages/products.js +12 -0
  176. package/examples/platform/frontend/src/pages/sign-in.js +14 -0
  177. package/examples/platform/frontend/src/session.js +11 -0
  178. package/examples/platform/pricing/package.json +9 -0
  179. package/examples/platform/pricing/src/cache.js +19 -0
  180. package/examples/platform/pricing/src/product-events.js +17 -0
  181. package/examples/platform/pricing/src/rules.js +19 -0
  182. package/examples/platform/pricing/src/server.js +32 -0
  183. package/examples/platform/products/package.json +9 -0
  184. package/examples/platform/products/src/catalog.js +20 -0
  185. package/examples/platform/products/src/events.js +11 -0
  186. package/examples/platform/products/src/search.js +9 -0
  187. package/examples/platform/products/src/server.js +31 -0
  188. package/migrations/postgres/001_init.sql +55 -0
  189. package/migrations/postgres/002_view_versions.sql +18 -0
  190. package/package.json +69 -4
  191. package/schema/approval.schema.json +173 -0
  192. package/schema/gap.schema.json +56 -0
  193. package/schema/pins.schema.json +122 -0
  194. package/schema/project.schema.json +93 -0
  195. package/schema/settings.schema.json +86 -0
  196. package/schema/toolbox.schema.json +206 -0
  197. package/schema/type.schema.json +121 -0
  198. package/schema/view.schema.json +240 -0
  199. package/skills/claude/build-gap/SKILL.md +28 -0
  200. package/skills/claude/check-ui/SKILL.md +40 -0
  201. package/skills/claude/draw-system/SKILL.md +38 -0
  202. package/skills/claude/gap-from-view/SKILL.md +29 -0
  203. package/skills/claude/post-audit/SKILL.md +58 -0
  204. package/skills/claude/pre-audit/SKILL.md +82 -0
  205. package/skills/claude/update-state/SKILL.md +56 -0
  206. package/skills/cursor/check-ui.mdc +40 -0
  207. package/skills/cursor/draw-system.mdc +38 -0
  208. package/skills/cursor/post-audit.mdc +44 -0
  209. package/skills/cursor/pre-audit.mdc +49 -0
  210. package/skills/cursor/update-state.mdc +45 -0
  211. package/skills/windsurf/spatial-views.md +212 -0
  212. package/toolboxes/aws.yaml +43 -0
  213. package/toolboxes/azure.yaml +41 -0
  214. package/toolboxes/cloud.yaml +95 -0
  215. package/toolboxes/docs.yaml +111 -0
  216. package/toolboxes/software.yaml +114 -0
  217. package/toolboxes/types/docs/gap.yaml +15 -0
  218. package/toolboxes/types/docs/mdd.yaml +19 -0
  219. package/toolboxes/types/docs/plain.yaml +7 -0
  220. package/toolboxes/types/docs/prd.yaml +17 -0
@@ -0,0 +1,41 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as t}from"./mermaid.core-y-x1CYxC.js";import{i as n}from"./chunk-6MUBBAK2-BBl-4tQr.js";import{C as r,E as i,H as a,U as o,_ as s,a as c,c as l,f as u,q as d,v as f,y as p}from"./chunk-BG4553SI-mWcPcFZr.js";import{t as m}from"./chunk-X3CZISLH-NOpCnvgE.js";import{n as h}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as g}from"./mermaid-parser.core-_3Vo8x6b.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v=32,y={axes:[],curves:[],options:_},b=structuredClone(y),x=u.radar,S=h(()=>n({...x,...p().radar}),`getConfig`),C=h(()=>b.axes,`getAxes`),w=h(()=>b.curves,`getCurves`),T=h(()=>b.options,`getOptions`),E=h(e=>{b.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),D=h(e=>{b.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:O(e.entries)}))},`setCurves`),O=h(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=C();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),k={getAxes:C,getCurves:w,getOptions:T,setAxes:E,setCurves:D,setOptions:h(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});b.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule},b.options.ticks>v&&(m.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`),b.options.ticks=v)},`setOptions`),getConfig:S,clear:h(()=>{c(),b=structuredClone(y)},`clear`),setAccTitle:o,getAccTitle:f,setDiagramTitle:d,getDiagramTitle:r,getAccDescription:s,setAccDescription:a},A=h(t=>{e(t,k);let{axes:n,curves:r,options:i}=t;k.setAxes(n),k.setCurves(r),k.setOptions(i)},`populate`),j={parse:h(async e=>{let t=await g(`radar`,e);m.debug(t),A(t)},`parse`)},M=h((e,n,r,i)=>{let a=i.db,o=a.getAxes(),s=a.getCurves(),c=a.getOptions(),l=a.getConfig(),u=a.getDiagramTitle(),d=N(t(n),l),f=c.max??Math.max(...s.map(e=>Math.max(...e.entries))),p=c.min,m=Math.min(l.width,l.height)/2;P(d,o,m,c.ticks,c.graticule),F(d,o,m,l),I(d,o,s,p,f,c.graticule,l),z(d,s,c.showLegend,l),d.append(`text`).attr(`class`,`radarTitle`).text(u).attr(`x`,0).attr(`y`,-l.height/2-l.marginTop)},`draw`),N=h((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return l(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),P=h((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),F=h((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,c=Math.cos(s),l=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*c).attr(`y2`,n*r.axisScaleFactor*l).attr(`class`,`radarAxisLine`);let u=c>.01?`start`:c<-.01?`end`:`middle`,d=l>.01?`hanging`:l<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*c+4*c).attr(`y`,n*r.axisLabelFactor*l+4*l).attr(`text-anchor`,u).attr(`dominant-baseline`,d).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function I(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=L(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,R(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}h(I,`drawCurves`);function L(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}h(L,`relativeRadius`);function R(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}h(R,`closedRoundCurve`);function z(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}h(z,`drawLegend`);var B={draw:M},V=h((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return n},`genIndexStyles`),H=h(e=>{let t=i(),r=p(),a=n(t,r.themeVariables);return{themeVariables:a,radarOptions:n(a.radar,e)}},`buildRadarStyleOptions`),U={parser:j,db:k,renderer:B,styles:h(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=H(e);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${n.axisColor};
23
+ stroke-width: ${n.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ font-size: ${n.axisLabelFontSize}px;
27
+ color: ${n.axisColor};
28
+ }
29
+ .radarGraticule {
30
+ fill: ${n.graticuleColor};
31
+ fill-opacity: ${n.graticuleOpacity};
32
+ stroke: ${n.graticuleColor};
33
+ stroke-width: ${n.graticuleStrokeWidth};
34
+ }
35
+ .radarLegendText {
36
+ text-anchor: start;
37
+ font-size: ${n.legendFontSize}px;
38
+ dominant-baseline: hanging;
39
+ }
40
+ ${V(t,n)}
41
+ `},`styles`)};export{U as diagram};
@@ -0,0 +1,24 @@
1
+ import{t as e}from"./chunk-TU62E6Q5-_rcUP1Fh.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as n}from"./mermaid.core-y-x1CYxC.js";import{i as r,n as i}from"./chunk-X4PVCEUW-DGxTL3kB.js";import{i as a}from"./chunk-6MUBBAK2-BBl-4tQr.js";import{C as o,E as s,H as c,U as l,_ as u,a as d,c as f,f as p,q as m,v as h,y as g}from"./chunk-BG4553SI-mWcPcFZr.js";import{t as _}from"./chunk-X3CZISLH-NOpCnvgE.js";import{n as v}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as y}from"./mermaid-parser.core-_3Vo8x6b.js";import{r as b,y as x}from"./d3-scale-CaJQQYkF.js";import{d as S}from"./index-Bn6_wHEp.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ee(e){for(var t=this,n=j(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function j(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function M(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function N(){return Array.from(this)}function P(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function F(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*te(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function I(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=z)):t===void 0&&(t=R);for(var n=new H(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new H(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(V)}function L(){return I(this).eachBefore(B)}function R(e){return e.children}function z(e){return Array.isArray(e)?e[1]:null}function B(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function V(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function H(e){this.data=e,this.depth=this.height=0,this.parent=null}H.prototype=I.prototype={constructor:H,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:ee,ancestors:M,descendants:N,leaves:P,links:F,copy:L,[Symbol.iterator]:te};function U(e){if(typeof e!=`function`)throw Error();return e}function W(){return 0}function G(e){return function(){return e}}function ne(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function K(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}Object.create(H.prototype);function q(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var J=(1+Math.sqrt(5))/2;function Y(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?K(c,n,r,i,h?r+=m*g/h:a):q(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var re=(function e(t){function n(e,n,r,i,a){Y(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(J);function ie(){var e=re,t=!1,n=1,r=1,i=[0],a=W,o=W,s=W,c=W,l=W;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(ne),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=U(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:G(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:G(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:G(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:G(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:G(+e),u):l},u}(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u<f;){for(s=o[u],c=s.children,l=s.value=0,d=c.length;l<d;++l)s.value+=c[l].value;s.dice?K(s,n,r,i,p?r+=(a-r)*s.value/p:a):q(s,n,r,p?n+=(i-n)*s.value/p:i,a),p-=s.value}else e._squarify=o=Y(t,e,n,r,i,a),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(J);var X=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=l,this.getAccTitle=h,this.setDiagramTitle=m,this.getDiagramTitle=o,this.getAccDescription=u,this.setAccDescription=c}static{v(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=p,t=g();return a({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{i(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){d(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Z(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}v(Z,`buildHierarchy`);var ae=v((e,n)=>{t(e,n);let r=[];for(let t of e.TreemapRows??[])t.$type===`ClassDefStatement`&&n.addClass(t.className??``,t.styleText??``);for(let t of e.TreemapRows??[]){let e=t.item;if(!e)continue;let i=t.indent?parseInt(t.indent):0,a=oe(e),o=e.classSelector?n.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};r.push(c)}let i=Z(r),a=v((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),oe=v(e=>e.name?String(e.name):``,`getItemName`),se={parser:{yy:void 0},parse:v(async e=>{try{let t=await y(`treemap`,e);_.debug(`Treemap AST:`,t);let n=se.parser?.yy;if(!(n instanceof X))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);ae(t,n)}catch(e){throw _.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:v((t,i,a,o)=>{let s=o.db,c=s.getConfig(),l=c.padding??ce,u=s.getDiagramTitle(),d=s.getRoot(),{themeVariables:p}=g();if(!d)return;let m=u?30:0,h=n(i),y=c.nodeWidth?c.nodeWidth*Q:960,C=c.nodeHeight?c.nodeHeight*Q:500,w=y,T=C+m;h.attr(`viewBox`,`0 0 ${w} ${T}`),f(h,T,w,c.useMaxWidth);let E;try{let e=c.valueFormat||`,`;if(e===`$0,0`)E=v(e=>`$`+x(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let t=/\.\d+/.exec(e),n=t?t[0]:``;E=v(e=>`$`+x(`,`+n)(e),`valueFormat`)}else if(e.startsWith(`$`)){let t=e.substring(1);E=v(e=>`$`+x(t||``)(e),`valueFormat`)}else E=x(e)}catch(e){_.error(`Error creating format function:`,e),E=x(`,`)}let D=b().range([`transparent`,p.cScale0,p.cScale1,p.cScale2,p.cScale3,p.cScale4,p.cScale5,p.cScale6,p.cScale7,p.cScale8,p.cScale9,p.cScale10,p.cScale11]),O=b().range([`transparent`,p.cScalePeer0,p.cScalePeer1,p.cScalePeer2,p.cScalePeer3,p.cScalePeer4,p.cScalePeer5,p.cScalePeer6,p.cScalePeer7,p.cScalePeer8,p.cScalePeer9,p.cScalePeer10,p.cScalePeer11]),k=b().range([p.cScaleLabel0,p.cScaleLabel1,p.cScaleLabel2,p.cScaleLabel3,p.cScaleLabel4,p.cScaleLabel5,p.cScaleLabel6,p.cScaleLabel7,p.cScaleLabel8,p.cScaleLabel9,p.cScaleLabel10,p.cScaleLabel11]);u&&h.append(`text`).attr(`x`,w/2).attr(`y`,m/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(u);let A=h.append(`g`).attr(`transform`,`translate(0, ${m})`).attr(`class`,`treemapContainer`),ee=I(d).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),j=ie().size([y,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(l).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(ee),M=j.descendants().filter(e=>e.children&&e.children.length>0),N=A.selectAll(`.treemapSection`).data(M).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),N.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=r({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),N.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=S(this),n=e.data.name;t.text(n);let r=e.x1-e.x0,i;i=c.showValues!==!1&&e.value?r-10-30-10-6:r-6-6;let a=Math.max(15,i),o=t.node();if(o.getComputedTextLength()>a){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),o.getComputedTextLength()>a&&t.text(``);break}if(t.text(e+`...`),o.getComputedTextLength()<=a)break}}}),c.showValues!==!1&&N.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let P=j.leaves(),F=P.length>20,te=F?16:38,L=F?14:28,R=F?4:8,z=F?4:6,B=F?2:4,V=F?8:10,H=F?1:2,U=A.selectAll(`.treemapLeafGroup`).data(P).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);U.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>r({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),U.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),U.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${te}px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=S(this),n=e.x1-e.x0,r=e.y1-e.y0,i=t.node(),a=n-2*B,o=r-2*B;if(a<V||o<V){t.style(`display`,`none`);return}let s=parseInt(t.style(`font-size`),10),c=.6;for(;i.getComputedTextLength()>a&&s>R;)s--,t.style(`font-size`,`${s}px`);let l=Math.max(z,Math.min(L,Math.round(s*c))),u=s+H+l;for(;u>o&&s>R&&(s--,l=Math.max(z,Math.min(L,Math.round(s*c))),!(l<z&&s===R));)t.style(`font-size`,`${s}px`),u=s+H+l;t.style(`font-size`,`${s}px`),F?(s<R||o<R)&&t.style(`display`,`none`):(i.getComputedTextLength()>a||s<R||o<s)&&t.style(`display`,`none`)}),c.showValues!==!1&&U.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${L}px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=S(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let r=S(n).select(`.treemapLabel`);if(r.empty()||r.style(`display`)===`none`){t.style(`display`,`none`);return}let i=parseFloat(r.style(`font-size`)),a=Math.max(z,Math.min(L,Math.round(i*.6)));t.style(`font-size`,`${a}px`);let o=(e.y1-e.y0)/2+i/2+H;t.attr(`y`,o);let s=e.x1-e.x0,c=e.y1-e.y0-4,l=s-2*B;t.node().getComputedTextLength()>l||o+a>c||a<z?t.style(`display`,`none`):t.style(`display`,null)});let W=c.diagramPadding??8;e(h,W,`flowchart`,c?.useMaxWidth||!1)},`draw`),getClasses:v(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:se,get db(){return new X},renderer:le,styles:v(({treemap:e}={})=>{let t=s(),n=g(),r=a(t,n.themeVariables),i=a(ue,e),o=i.titleColor??r.titleColor,c=i.labelColor??r.textColor,l=i.valueColor??r.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${i.sectionStrokeColor};
4
+ stroke-width: ${i.sectionStrokeWidth};
5
+ fill: ${i.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${i.leafStrokeColor};
9
+ stroke-width: ${i.leafStrokeWidth};
10
+ fill: ${i.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${c};
14
+ font-size: ${i.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${l};
18
+ font-size: ${i.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${o};
22
+ font-size: ${i.titleFontSize};
23
+ }
24
+ `},`getStyles`)};export{de as diagram};
@@ -0,0 +1,3 @@
1
+ import{t as e}from"./chunk-JWPE2WC7-DVXcaiue.js";import{T as t}from"./chunk-NGNAAXSQ-DI_UYJZ4.js";import{i as n,t as r,v as i}from"./chunk-6MUBBAK2-BBl-4tQr.js";import{C as a,H as o,U as s,X as c,_ as l,a as u,b as d,f,q as p,v as m,y as h,z as g}from"./chunk-BG4553SI-mWcPcFZr.js";import{t as _}from"./chunk-X3CZISLH-NOpCnvgE.js";import{n as v}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as ee}from"./mermaid-parser.core-_3Vo8x6b.js";import{d as te}from"./index-Bn6_wHEp.js";var y=`position frame`,b=`frame positioned`,x=`position relation`,S=`relation positioned`,ne=v(function(e){_.debug(`options str`,e)},`setOptions`),re=v(function(){return{}},`getOptions`),ie=v(function(){C(),u()},`clear`);function C(){w={}}v(C,`reset`);var ae=f.eventmodeling,oe=v(()=>n({...ae,...h().eventmodeling}),`getConfig`),w={};function T(){let e=se,{ast:t}=w,n=O();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((r,i)=>{let a=F(r,t.dataEntities,n);e=J(e,{$kind:y,index:i,frame:r,textProps:a});let o;V(r)?(_.debug(`source frame`,r.sourceFrames),o=t.frames.filter(e=>r.sourceFrames.some(t=>t.$refText===e.name)),o.forEach(t=>{e=J(e,{$kind:x,index:i,frame:r,sourceFrame:t})})):e=J(e,{$kind:x,index:i,frame:r})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}v(T,`getState`);function E(e){w.ast=void 0;let t=new Set;for(let n of e.frames){if(t.has(n.name)){let e=n.$cstNode?.range.start.line,t=e===void 0?``:` on line ${e+1}`;throw Error(`Duplicate event modeling frame ID "${n.name}"${t}`)}t.add(n.name)}w.ast=e}v(E,`setAst`);var D={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 O(){return D}v(O,`getDiagramProps`);var se={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function k(e){let t=e.split(`.`);if(t.length===2)return t[0]}v(k,`extractNamespace`);function A(e){let t=e.split(`.`);return t.length===2?t[1]:e}v(A,`extractName`);function j(e,t){if(t&&t.length!==0)return Object.values(e).find(e=>e.namespace===t)}v(j,`findSwimlaneByNamespace`);function M(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}v(M,`findNextAvailableIndex`);function N(e,t){let n=k(e.entityIdentifier),r=j(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||D.labelUiAutomation}:n?{index:M(t,0,100),label:D.labelUiAutomationPrefix+n}:{index:0,label:D.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||D.labelCommandReadModel}:n?{index:M(t,100,200),label:D.labelCommandReadModelPrefix+n}:{index:100,label:D.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||D.labelEvents}:n?{index:M(t,200,300),label:D.labelEventsPrefix+n}:{index:200,label:D.labelEvents}}}v(N,`calculateSwimlaneProps`);function P(e){let{themeVariables:t}=h();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`}}}v(P,`calculateEntityVisualProps`);function F(e,t,n){let a=h(),o=g(A(e.entityIdentifier)??``,a),s,c={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},l=`<b>${i(o,n.textMaxWidth,c)}</b>`;if(e.dataInlineValue&&(s=e.dataInlineValue,s=s.substring(s.indexOf(`{`)+1),s=s.substring(0,s.lastIndexOf(`}`)-1),s=g(s,a),s=i(s,n.textMaxWidth,c),s=s.replaceAll(` `,`&nbsp;`)),e.dataReference){let r=t.find(t=>t.name===e.dataReference?.$refText);r&&(s=r.dataBlockValue,s=s.substring(s.indexOf(`{
2
+ `)+2),s=s.substring(0,s.lastIndexOf(`}`)-1),s=g(s,a),s=i(s,n.textMaxWidth,c),s=s.replaceAll(` `,`&nbsp;`),s+=`<br/>`)}let u=s!==void 0;u&&(l+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${s}</code>`);let d={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},f=r(l,d),p=u?f.width/3:f.width,m={content:l,width:p,height:f.height};return _.debug(`[${e.name}] ${e.entityIdentifier} text`,m),m}v(F,`calculateTextProps`);function I(e,t){let n=t,r=P(n.frame),i={width:n.textProps.width+2*D.boxTextPadding,height:n.textProps.height+2*D.boxTextPadding};return[{$kind:b,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}v(I,`decidePositionFrame`);function ce(e,t,n){return t===void 0?D.contentStartX:t.index===e.index&&e.r?e.r+D.boxPadding:n===void 0?D.contentStartX:n.r-D.boxOverlap+D.boxPadding}v(ce,`calculateX`);function L(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}v(L,`calculateMaxRight`);function R(e){return Object.values(e).sort((e,t)=>e.index-t.index)}v(R,`sortedSwimlanesArray`);function z(e,t){let n=t,r=N(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*D.swimlaneMinHeight+D.swimlaneGap,height:D.swimlaneMinHeight,maxHeight:D.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(D.boxMinWidth,Math.min(D.boxMaxWidth,n.dimension.width))+2*D.boxPadding,height:Math.max(D.boxMinHeight,Math.min(D.boxMaxHeight,n.dimension.height))+2*D.boxPadding},c=ce(i,o,a),l=c+s.width+D.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(D.swimlaneMinHeight,i.maxHeight)+2*D.swimlanePadding;let d={x:c,y:D.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+D.swimlaneGap}return f}v(z,`evolveFramePositioned`);function B(e,t){return e===0&&t.sourceFrames.length===0}v(B,`isFirstFrame`);function V(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}v(V,`hasSourceFrame`);function H(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}v(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}}v(U,`findBoxByLineIndex`);function W(e,n){let r=n;if(B(r.index,r.frame))return[];let i=H(e.boxes,r.frame);if(i===void 0)throw Error(`Target box not found for frame ${r.frame.name}`);let a;if(r.sourceFrame)a=H(e.boxes,r.sourceFrame);else{if(t(r.frame))return[];a=U(e.boxes,i.swimlane.index,r.index-1)}return a===void 0?[]:[{$kind:S,frame:r.frame,index:r.index,sourceBox:a,targetBox:i}]}v(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]}}v(G,`evolveRelationPositioned`);var le={[y]:I,[x]:W},ue={[b]:z,[S]:G};function K(e,t){let n=le[t.$kind];if(n==null)return[];let r=n(e,t);return _.debug(`decided events`,r),r}v(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 _.debug(`evolve events`,{state:e,newState:n,events:t}),n}v(q,`evolve`);function J(e,t){return q(e,K(e,t))}v(J,`dispatch`);var Y={getConfig:oe,preserveCommentsWhenParsing:!0,setOptions:ne,getOptions:re,clear:ie,setAccTitle:s,getAccTitle:m,getAccDescription:l,setAccDescription:o,setDiagramTitle:p,getDiagramTitle:a,setAst:E,getDiagramProps:O,getState:T},de={parse:v(async t=>{let n=await ee(`eventmodeling`,t);_.debug(n),Y.setAst(n),e(n,Y)},`parse`)},fe=d()?.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)}}v(X,`renderD3Box`);function Z(e,t){return e>t}v(Z,`dirUpwards`);function Q(e,t,n,r){return i=>{let a=i.sourceBox.swimlane.y+t.swimlanePadding,o=i.targetBox.swimlane.y+t.swimlanePadding,s=Z(a,o),c=i.sourceBox.x+i.sourceBox.dimension.width*2/3,l=i.targetBox.x+i.targetBox.dimension.width/3,u,d;_.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(u=a,d=o+i.targetBox.dimension.height):(u=a+i.sourceBox.dimension.height,d=o);let f=r.emRelationStroke??i.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,i.visual.fill).attr(`stroke`,f).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${n})`).attr(`d`,`M${c} ${u} L${l} ${d}`)}}v(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)}}v($,`renderD3Swimlane`);var pe={parser:de,db:Y,renderer:{draw:v(function(e,t,n,r){if(_.debug(`in eventmodeling renderer`,e+`
3
+ `,`id:`,t,n),!fe)throw Error(`EventModeling config not found`);let i=r.db,{themeVariables:a,eventmodeling:o}=d(),s=te(`[id="${t}"]`),l=i.getDiagramProps(),u=i.getState(),f=`em-arrowhead-${t}`,p=a.emArrowhead??`#000000`;u.sortedSwimlanesArray.forEach($(s,u.maxR,l,a)),u.boxes.forEach(X(s,l)),u.relations.forEach(Q(s,l,f,a)),s.append(`defs`).append(`marker`).attr(`id`,f).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`,p),c(void 0,s,o?.padding??30,o?.useMaxWidth)},`draw`)},styles:v(e=>``,`getStyles`)};export{pe as diagram};
@@ -0,0 +1,30 @@
1
+ import{t as e}from"./chunk-2Q5K7J3B-C1jixKkw.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as n}from"./mermaid.core-y-x1CYxC.js";import{i as r,t as i}from"./chunk-R3KSYZAL-BEXCUN6J.js";import{i as a}from"./chunk-6MUBBAK2-BBl-4tQr.js";import{C as o,H as s,U as c,_ as l,a as u,c as d,f,q as p,v as m,y as h,z as g}from"./chunk-BG4553SI-mWcPcFZr.js";import{t as _}from"./chunk-X3CZISLH-NOpCnvgE.js";import{n as v}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as y}from"./mermaid-parser.core-_3Vo8x6b.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}v(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}v(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}v(k,`remapErrorLines`);function A(e){let t=e.split(`
2
+ `),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e<t.length;e++){let n=t[e];n.trim()===``||T.test(n)||w.test(n)||C.test(n)||i.push(n.replace(/\t/g,` `))}if(!D(i))return{text:e,lineMap:n};let a=O(i),o=[],s=0;for(let e=0;e<=r;e++)o.push(t[e]),s++,n.set(s,e+1);for(let e=r+1;e<t.length;e++){let r=t[e],i=r.trim(),c=e+1;if(i===``||T.test(r)||w.test(r)){o.push(r),s++,n.set(s,c);continue}if(C.test(r))continue;let l=r.replace(/\t/g,` `),u=x.exec(l);if(u?.index!==void 0){let e=u.index,t=Math.round(e/a)+1,r=e+1;for(;r<l.length&&S.test(l[r]);)r++;for(;r<l.length&&l[r]===` `;)r++;let i=l.slice(r).trimEnd();if(!i)throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let d=E.repeat(t);o.push(d+i),s++,n.set(s,c)}else if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;else if(b.test(l))o.push(r),s++,n.set(s,c);else if(/^\s+/.test(l))throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);else o.push(r),s++,n.set(s,c)}return{text:o.join(`
3
+ `),lineMap:n}}v(A,`preprocessBoxDrawing`);var j=new e(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=v(()=>{j.reset(),u()},`clear`),N=v(()=>j.records.stack[0],`getRoot`),P=v(()=>j.records.cnt,`getCount`),F=f.treeView,I={clear:M,addNode:v((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:v(()=>a(F,h().treeView),`getConfig`),getAccTitle:m,getAccDescription:l,getDiagramTitle:o,setAccDescription:s,setAccTitle:c,setDiagramTitle:p},L=v(e=>{t(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,a=t.classAnnotation||void 0,o=t.iconAnnotation,s=o===void 0?void 0:o||`none`,c=t.descAnnotation||void 0,l=c?g(c,h()):void 0;I.addNode(e,n,i,a,s,l)}},`populate`),R={parse:v(async e=>{let{text:t,lineMap:n}=A(e);try{let e=await y(`treeView`,t);_.debug(e),L(e)}catch(e){throw n.size>0&&e instanceof Error&&(e.message=k(e.message,n)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:`<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>`},file:{body:`<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>`}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}v(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}v(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}v(H,`getNodeIcon`),r([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=v(async(e,t)=>{let n=[],r=v(e=>{let i=H(e,t);i&&n.push({icon:i,node:e}),e.children.forEach(r)},`collect`);r(e);let a=await Promise.all(n.map(async({icon:e,node:t})=>({id:t.id,svg:await i(e,{height:U,width:U})})));return new Map(a.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=v((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=v((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=v((e,t,n,r)=>{let i=0,a=0,o=[],s=v((e,t,n,s)=>{let c=s*(n.rowIndent+n.paddingX),l=q(c,i,t,e,n,r);o.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,i+u/2,c,i+u/2,n.lineThickness),a=Math.max(a,c+d),i+=u},`drawNode`),c=v((t,r=0)=>{s(e,t,n,r),t.children.forEach(e=>{c(e,r+1)});let{x:i,y:a,height:o}=t.BBox;if(t.children.length){let{y:r,height:s}=t.children[t.children.length-1].BBox;J(e,i+n.paddingX,a+o,i+n.paddingX,r+s/2+n.lineThickness/2,n.lineThickness)}},`processNode`);c(t);let l=o.filter(e=>e.node.description);if(l.length>0){let e=Math.max(...o.map(e=>e.labelRightEdge))+G;for(let t of l){let r=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();a=Math.max(a,e+r.width+n.paddingX)}}for(let e of o)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=a-e.node.BBox.x+8;t.attr(`width`,n),a=Math.max(a,e.node.BBox.x+n+2)}}return{totalHeight:i,totalWidth:a}},`drawTree`),X={draw:v(async(e,t,r,i)=>{_.debug(`Rendering treeView diagram
4
+ `+e);let a=i.db,o=a.getRoot(),s=a.getConfig(),c=n(t),l=c.append(`g`);l.attr(`class`,`tree-view`);let{totalHeight:u,totalWidth:f}=Y(l,o,s,await K(o,s));c.attr(`viewBox`,`-${s.lineThickness/2} 0 ${f} ${u}`),d(c,u,f,s.useMaxWidth)},`draw`)},Z={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},Q={db:I,renderer:X,parser:R,styles:v(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:o,highlightBg:s,highlightStroke:c}=a(Z,e);return`
5
+ .treeView-node-label {
6
+ font-size: ${t};
7
+ fill: ${n};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${r};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${i};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${t};
21
+ fill: ${o};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${s};
27
+ stroke: ${c};
28
+ stroke-width: 1;
29
+ }
30
+ `},`styles`)};export{Q as diagram};
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-XKyaHtl9.js";var t=Math.PI,n=2*t,r=1e-6,i=n-r;function a(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function o(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return a;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}function s(e,t,n,r){return e===n&&t===r}function c(e){let t=Math.floor(e);if(!(t<=15))return s;let n=10**t,r=function(e){return Math.round(e*n)};return function(e,t,n,i){return r(e)===r(n)&&r(t)===r(i)}}var l=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?a:o(e),this._equal=e==null?s:c(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,n,i,a,o){if(e=+e,n=+n,i=+i,a=+a,o=+o,o<0)throw Error(`negative radius: ${o}`);let s=this._x1,c=this._y1,l=i-e,u=a-n,d=s-e,f=c-n,p=d*d+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(p>r){if(!(Math.abs(f*l-u*d)>r)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let m=i-s,h=a-c,g=l*l+u*u,_=m*m+h*h,v=Math.sqrt(g),y=Math.sqrt(p),b=o*Math.tan((t-Math.acos((g+p-_)/(2*v*y)))/2),x=b/y,S=b/v;Math.abs(x-1)>r&&this._append`L${e+x*d},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*m>d*h)},${this._x1=e+S*l},${this._y1=n+S*u}`}}}arc(e,a,o,s,c,l){if(e=+e,a=+a,o=+o,l=!!l,o<0)throw Error(`negative radius: ${o}`);let u=o*Math.cos(s),d=o*Math.sin(s),f=e+u,p=a+d,m=1^l,h=l?s-c:c-s;if(this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>r||Math.abs(this._y1-p)>r)&&this._append`L${f},${p}`,o){if(h<0&&(h=h%n+n),h>i)this._append`A${o},${o},0,1,${m},${e-u},${a-d}A${o},${o},0,1,${m},${this._x1=f},${this._y1=p}`;else if(h>r){let n=e+o*Math.cos(c),r=a+o*Math.sin(c);if(h>=t&&this._equal(f,p,n,r)){h/=2;let n=s+h;this._append`A${o},${o},0,${+(h>=t)},${m},${e+o*Math.cos(n)},${a+o*Math.sin(n)}`}this._append`A${o},${o},0,${+(h>=t)},${m},${this._x1=n},${this._y1=r}`}}}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};l.prototype;function u(e){return function(){return e}}var d=Math.abs,f=Math.atan2,p=Math.cos,m=Math.max,h=Math.min,g=Math.sin,_=Math.sqrt,v=1e-12,y=Math.PI,b=y/2,x=2*y;function S(e){return e>1?0:e<-1?y:Math.acos(e)}function C(e){return e>=1?b:e<=-1?-b:Math.asin(e)}function w(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new l(t)}function T(e){return e.innerRadius}function E(e){return e.outerRadius}function D(e){return e.startAngle}function O(e){return e.endAngle}function k(e){return e&&e.padAngle}function ee(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<v))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function A(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/_(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,h=n+u,g=r+d,v=(f+h)/2,y=(p+g)/2,b=h-f,x=g-p,S=b*b+x*x,C=i-a,w=f*g-h*p,T=(x<0?-1:1)*_(m(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,ee=E-v,A=D-y,j=O-v,M=k-y;return ee*ee+A*A>j*j+M*M&&(E=O,D=k),{cx:E,cy:D,x01:-u,y01:-d,x11:E*(i/C-1),y11:D*(i/C-1)}}function j(){var e=T,t=E,n=u(0),r=null,i=D,a=O,o=k,s=null,c=w(l);function l(){var l,u,m=+e.apply(this,arguments),w=+t.apply(this,arguments),T=i.apply(this,arguments)-b,E=a.apply(this,arguments)-b,D=d(E-T),O=E>T;if(s||=l=c(),w<m&&(u=w,w=m,m=u),!(w>v))s.moveTo(0,0);else if(D>x-v)s.moveTo(w*p(T),w*g(T)),s.arc(0,0,w,T,E,!O),m>v&&(s.moveTo(m*p(E),m*g(E)),s.arc(0,0,m,E,T,O));else{var k=T,j=E,M=T,N=E,P=D,te=D,ne=o.apply(this,arguments)/2,F=ne>v&&(r?+r.apply(this,arguments):_(m*m+w*w)),I=h(d(w-m)/2,+n.apply(this,arguments)),L=I,R=I,z,B;if(F>v){var V=C(F/m*g(ne)),H=C(F/w*g(ne));(P-=V*2)>v?(V*=O?1:-1,M+=V,N-=V):(P=0,M=N=(T+E)/2),(te-=H*2)>v?(H*=O?1:-1,k+=H,j-=H):(te=0,k=j=(T+E)/2)}var U=w*p(k),W=w*g(k),G=m*p(N),K=m*g(N);if(I>v){var q=w*p(j),J=w*g(j),Y=m*p(M),re=m*g(M),X;if(D<y){if(X=ee(U,W,Y,re,q,J,G,K)){var ie=U-X[0],Z=W-X[1],ae=q-X[0],Q=J-X[1],$=1/g(S((ie*ae+Z*Q)/(_(ie*ie+Z*Z)*_(ae*ae+Q*Q)))/2),oe=_(X[0]*X[0]+X[1]*X[1]);L=h(I,(m-oe)/($-1)),R=h(I,(w-oe)/($+1))}else L=R=0}}te>v?R>v?(z=A(Y,re,U,W,w,R,O),B=A(q,J,G,K,w,R,O),s.moveTo(z.cx+z.x01,z.cy+z.y01),R<I?s.arc(z.cx,z.cy,R,f(z.y01,z.x01),f(B.y01,B.x01),!O):(s.arc(z.cx,z.cy,R,f(z.y01,z.x01),f(z.y11,z.x11),!O),s.arc(0,0,w,f(z.cy+z.y11,z.cx+z.x11),f(B.cy+B.y11,B.cx+B.x11),!O),s.arc(B.cx,B.cy,R,f(B.y11,B.x11),f(B.y01,B.x01),!O))):(s.moveTo(U,W),s.arc(0,0,w,k,j,!O)):s.moveTo(U,W),!(m>v)||!(P>v)?s.lineTo(G,K):L>v?(z=A(G,K,q,J,m,-L,O),B=A(U,W,Y,re,m,-L,O),s.lineTo(z.cx+z.x01,z.cy+z.y01),L<I?s.arc(z.cx,z.cy,L,f(z.y01,z.x01),f(B.y01,B.x01),!O):(s.arc(z.cx,z.cy,L,f(z.y01,z.x01),f(z.y11,z.x11),!O),s.arc(0,0,m,f(z.cy+z.y11,z.cx+z.x11),f(B.cy+B.y11,B.cx+B.x11),O),s.arc(B.cx,B.cy,L,f(B.y11,B.x11),f(B.y01,B.x01),!O))):s.arc(0,0,m,N,M,O)}if(s.closePath(),l)return s=null,l+``||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-y/2;return[p(r)*n,g(r)*n]},l.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:u(+t),l):e},l.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:u(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:u(+e),l):n},l.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:u(+e),l):r},l.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:u(+e),l):i},l.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:u(+e),l):a},l.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:u(+e),l):o},l.context=function(e){return arguments.length?(s=e??null,l):s},l}Array.prototype.slice;function M(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function N(e){this._context=e}N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function P(e){return new N(e)}function te(e){return e[0]}function ne(e){return e[1]}function F(e,t){var n=u(!0),r=null,i=P,a=null,o=w(s);e=typeof e==`function`?e:e===void 0?te:u(e),t=typeof t==`function`?t:t===void 0?ne:u(t);function s(s){var c,l=(s=M(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:u(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:u(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:u(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function I(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function L(e){return e}function R(){var e=L,t=I,n=null,r=u(0),i=u(x),a=u(0);function o(o){var s,c=(o=M(o)).length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),h=Math.min(x,Math.max(-x,i.apply(this,arguments)-m)),g,_=Math.min(Math.abs(h)/c,a.apply(this,arguments)),v=_*(h<0?-1:1),y;for(s=0;s<c;++s)(y=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=y);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(h-c*v)/d:0;s<c;++s,m=g)l=f[s],y=p[l],g=m+(y>0?y*u:0)+v,p[l]={data:o[l],index:s,value:y,startAngle:m,endAngle:g,padAngle:_};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:u(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:u(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:u(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:u(+e),o):a},o}B(P);function z(e){this._curve=e}z.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function B(e){function t(t){return new z(e(t))}return t._curve=e,t}var V=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function H(e){return new V(e,!0)}function U(e){return new V(e,!1)}_(3),_(1/3)*2;var W=g(y/10)/g(7*y/10);g(x/10)*W,-p(x/10)*W,_(3),_(3),_(3)/2,(1/_(12)/2+1)*3;function G(){}function K(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function q(e){this._context=e}q.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:K(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:K(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J(e){return new q(e)}function Y(e){this._context=e}Y.prototype={areaStart:G,areaEnd:G,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:K(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function re(e){return new Y(e)}function X(e){this._context=e}X.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:K(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ie(e){return new X(e)}function Z(e,t){this._basis=new q(e),this._beta=t}Z.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var ae=(function e(t){function n(e){return t===1?new q(e):new Z(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function Q(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function $(e,t){this._context=e,this._k=(1-t)/6}$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Q(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Q(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var oe=(function e(t){function n(e){return new $(e,t)}return n.tension=function(t){return e(+t)},n})(0);function se(e,t){this._context=e,this._k=(1-t)/6}se.prototype={areaStart:G,areaEnd:G,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Q(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ce=(function e(t){function n(e){return new se(e,t)}return n.tension=function(t){return e(+t)},n})(0);function le(e,t){this._context=e,this._k=(1-t)/6}le.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Q(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ue=(function e(t){function n(e){return new le(e,t)}return n.tension=function(t){return e(+t)},n})(0);function de(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>v){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>v){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function fe(e,t){this._context=e,this._alpha=t}fe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:de(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var pe=(function e(t){function n(e){return t?new fe(e,t):new $(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function me(e,t){this._context=e,this._alpha=t}me.prototype={areaStart:G,areaEnd:G,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:de(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var he=(function e(t){function n(e){return t?new me(e,t):new se(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function ge(e,t){this._context=e,this._alpha=t}ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:de(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var _e=(function e(t){function n(e){return t?new ge(e,t):new le(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function ve(e){this._context=e}ve.prototype={areaStart:G,areaEnd:G,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ye(e){return new ve(e)}function be(e){return e<0?-1:1}function xe(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(be(a)+be(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Se(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ce(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function we(e){this._context=e}we.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ce(this,this._t0,Se(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ce(this,Se(this,n=xe(this,e,t)),n);break;default:Ce(this,this._t0,n=xe(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Te(e){this._context=new Ee(e)}(Te.prototype=Object.create(we.prototype)).point=function(e,t){we.prototype.point.call(this,t,e)};function Ee(e){this._context=e}Ee.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function De(e){return new we(e)}function Oe(e){return new Te(e)}function ke(e){this._context=e}ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Ae(e),i=Ae(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Ae(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function je(e){return new ke(e)}function Me(e,t){this._context=e,this._t=t}Me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function Ne(e){return new Me(e,.5)}function Pe(e){return new Me(e,0)}function Fe(e){return new Me(e,1)}var Ie=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|&colon;)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[`.`,`/`],e.BLANK_URL=`about:blank`})),Le=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sanitizeUrl=o;var t=Ie();function n(e){return t.relativeFirstCharacters.indexOf(e[0])>-1}function r(e){return e.replace(t.ctrlCharactersRegex,``).replace(t.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function i(e){return URL.canParse(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e){if(!e)return t.BLANK_URL;var o,s=a(e.trim());do s=r(s).replace(t.htmlCtrlEntityRegex,``).replace(t.ctrlCharactersRegex,``).replace(t.whitespaceEscapeCharsRegex,``).trim(),s=a(s),o=s.match(t.ctrlCharactersRegex)||s.match(t.htmlEntitiesRegex)||s.match(t.htmlCtrlEntityRegex)||s.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var c=s;if(!c)return t.BLANK_URL;if(n(c))return c;var l=c.trimStart(),u=l.match(t.urlSchemeRegex);if(!u)return c;var d=u[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(d))return t.BLANK_URL;var f=l.replace(/\\/g,`/`);if(d===`mailto:`||d.includes(`://`))return f;if(d===`http:`||d===`https:`){if(!i(f))return t.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}}));export{Fe as C,Ne as S,ye as _,ie as a,je as b,ae as c,ue as d,pe as f,F as g,P as h,re as i,oe as l,_e as m,j as n,H as o,he as p,J as r,U as s,Le as t,ce as u,De as v,Pe as w,R as x,Oe as y};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./chunk-OY52VR5R-DweG7qYw.js";import{t as r}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-y-x1CYxC.js";import"./chunk-BG4553SI-mWcPcFZr.js";import{t as i}from"./chunk-X3CZISLH-NOpCnvgE.js";import{n as a}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{f as o,t as s}from"./mermaid-parser.core-_3Vo8x6b.js";var c=o().RailroadEbnf.parser.LangiumParser,l=a(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=a(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=a(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=a((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=a(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=a(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=a(e=>{r(e,n),e.title&&n.setTitle(e.title),e.rules.map(e=>n.addRule(m(e)))},`populateDb`),g={parser:{parse:a(e=>{n.clear(),i.debug(`[EBNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;i.debug(`[EBNF Parser] Parsed rules:`,r.rules.length),h(r),i.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:n}},db:n,renderer:t,styles:e};export{g as diagram};
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./chunk-KS47KZWR-DkDkwO82.js";import{a as t,r as n}from"./chunk-KQLB2F66-swukhFmZ.js";import{n as r}from"./chunk-M57EVK23-B-kEyOJF.js";import{c as i,l as a}from"./chunk-DQASFODM-7FKe2gLt.js";import"./chunk-LEVMRMFU-DXH6iXv3.js";import"./chunk-AXFCVDMN-BhsttQ-k.js";import"./chunk-X4PVCEUW-DGxTL3kB.js";import"./chunk-STOXU5M4-BaTlty4O.js";import"./chunk-R3KSYZAL-BEXCUN6J.js";import"./chunk-6MUBBAK2-BBl-4tQr.js";import{G as o}from"./chunk-BG4553SI-mWcPcFZr.js";import"./chunk-X3CZISLH-NOpCnvgE.js";import{n as s}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{h as c}from"./dist-CjvHN74u.js";var l=class{constructor(){throw Error(`The ELK layout is not included in Spatial Views; use Mermaid's default layout.`)}},u=s((e,t,{parentById:n})=>{let r=new Set,i=e;if(e===t)return n[e]||`root`;for(;i;){if(r.add(i),i===t)return i;i=n[i]}for(i=t;i;){if(r.has(i))return i;i=n[i]}return`root`},`findCommonAncestor`),d=`root`;function f(e,t,{parentById:n}){let r=e;for(;(n[r]??d)!==t;)r=n[r];return r}s(f,`childOnPath`);function p(e,t){let n=e.map(()=>!1),r=new Map;e.forEach(({source:e,target:n},i)=>{if(e===n)return;let a=u(e,n,t);if(a===e||a===n)return;let o=f(e,a,t),s=f(n,a,t),c=r.get(a)??[];c.push({index:i,from:o,to:s,collapsed:o!==e||s!==n}),r.set(a,c)});for(let e of r.values()){let t=new Map,r=[],i=new Map;for(let n of e){for(let e of[n.from,n.to])t.has(e)||(t.set(e,[]),r.push(e),i.set(e,0));t.get(n.from).push(n),i.set(n.to,i.get(n.to)+1)}let a=new Map,o=[...r.filter(e=>i.get(e)===0),...r];for(let e of o){if(a.has(e))continue;a.set(e,1);let r=[{node:e,next:0}];for(;r.length>0;){let e=r[r.length-1],i=t.get(e.node);if(e.next>=i.length){a.set(e.node,2),r.pop();continue}let o=i[e.next++],s=a.get(o.to);s===1?n[o.index]=o.collapsed:s===void 0&&(a.set(o.to,1),r.push({node:o.to,next:0}))}}}return n}s(p,`findSubgraphFeedbackEdges`);function m(e,t,{parentById:n}){let r=n[e];for(;r!==void 0;){if(r===t)return!0;r=n[r]}return!1}s(m,`isInside`);function h(e,t){let n=e.map((e,t)=>t);return e.forEach(({source:r,target:i},a)=>{let o=n.indexOf(a),s=n.findIndex((n,a)=>{let s=e[n];return a<o&&(s.target===i&&m(r,s.source,t)||s.source===r&&m(i,s.target,t))});s!==-1&&(n.splice(o,1),n.splice(s,0,a))}),n}s(h,`orderNestedEdgeEnds`);var g=6;function _(t,{measure:n}){let r=t.config?.elk?.lineHops;if(r===!1)return;let i=t.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));e(n.groups.edgePaths,i,{enabled:!0,jumpRadius:g,jumpStyle:r===`gap`?`gap`:`arc`})}s(_,`applyElkLineJumps`);var v={},y={},ee={},te={},b=1,ne=10,x=s((e,t,n=.5)=>{let r=e.width/2,i=e.height/2,a=e.x-r,o=e.x+r,s=e.y-i,c=e.y+i,l=Math.abs(t.x-a)<=n&&t.y>=s-n&&t.y<=c+n,u=Math.abs(t.x-o)<=n&&t.y>=s-n&&t.y<=c+n,d=Math.abs(t.y-s)<=n&&t.x>=a-n&&t.x<=o+n,f=Math.abs(t.y-c)<=n&&t.x>=a-n&&t.x<=o+n;return l||u||d||f},`onBorder`),re=s((e,t,n)=>{let r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2,s=n.x<t.x?o-a:o+a,c=e.height/2,l=Math.abs(t.y-n.y),u=Math.abs(t.x-n.x);if(Math.abs(i-t.y)*o>Math.abs(r-t.x)*c){let e=n.y<t.y?t.y-c-i:i-c-t.y;s=u*e/l;let r={x:n.x<t.x?n.x+s:n.x-u+s,y:n.y<t.y?n.y+l-e:n.y-l+e};return u===0&&(r.x=t.x),l===0&&(r.y=t.y),r}{s=n.x<t.x?t.x-o-r:r-o-t.x;let e=l*s/u,i=n.x<t.x?n.x+u-s:n.x-u+s,a=n.y<t.y?n.y+e:n.y-e;return u===0&&(i=t.x),l===0&&(a=t.y),{x:i,y:a}}},`intersection`),S=s((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),ie=s((e,t,n=ne)=>{let r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),a=e.width/2,o=e.height/2;if(Math.abs(r-a)<b||Math.abs(i-o)<b){let r=t.x-e.x,i=t.y-e.y,a=Math.sqrt(r*r+i*i);if(a>0)return{x:e.x+r/a*(a+n),y:e.y+i/a*(a+n)}}return t},`ensureTrulyOutside`),ae=s((e,t,n)=>{let r=Math.abs(t.x-e.x)<b,i=Math.abs(t.y-e.y)<b;return{x:r?t.x:t.x<e.x?e.x-e.width/4:e.x+e.width/4,y:i?t.y:n.y}},`makeInsidePoint`),oe=s((e,t,n)=>{if(!e?.intersect)return null;let r=e.intersect(n);return!r||n.x<t.x&&r.x>t.x||n.x>t.x&&r.x<t.x||Math.hypot(n.x-r.x,n.y-r.y)<=b?null:r},`tryNodeIntersect`),se=s((e,t,n)=>re(e,t,ae(e,t,n)),`fallbackIntersection`),ce=20,le=1e-6,C=s((e,t,n)=>{let r=e.intersect?.(n);return r?Math.hypot(n.x-t.x,n.y-t.y)<=Math.hypot(r.x-t.x,r.y-t.y)+1e-9:!1},`insideOutline`),ue=s((e,t,n,r)=>{if(!e?.intersect)return null;let i=r.x-n.x,a=r.y-n.y;if(i===0&&a===0||Math.abs(i)>le&&Math.abs(a)>le)return null;let o={x:t.x,y:t.y},c=Math.abs(i)>Math.abs(a),l=s(e=>c?{x:e,y:n.y}:{x:n.x,y:e},`along`),u=c?o.x:o.y,d=c?n.x:n.y;if(!C(e,o,l(u)))return null;if(C(e,o,l(d)))return{...n};for(let t=0;t<ce;t++){let t=(u+d)/2;C(e,o,l(t))?u=t:d=t}return l(u)},`outlineAttachPoint`),w=s((e,t,n,r)=>{let i=ie(t,n);return oe(e,t,i)??se(t,i,r)},`computeNodeIntersection`),T=s((e,t,n,r=.1)=>{if(n&&e.length!==0){if(t===`start`)e.length>0&&Math.abs(e[0].x-n.x)<r&&Math.abs(e[0].y-n.y)<r?e.shift():e[0]=n;else{let t=e.length-1;e.length>0&&Math.abs(e[t].x-n.x)<r&&Math.abs(e[t].y-n.y)<r?e.pop():e[t]=n}}},`replaceEndpoint`),de=8,fe=s(e=>typeof e==`string`?Math.max(i[e]??0,a[e]??0):0,`markerPathOffset`),pe={arrow_open:[`none`,`none`],arrow_cross:[`none`,`arrow_cross`],double_arrow_cross:[`arrow_cross`,`arrow_cross`],arrow_point:[`none`,`arrow_point`],double_arrow_point:[`arrow_point`,`arrow_point`],arrow_circle:[`none`,`arrow_circle`],double_arrow_circle:[`arrow_circle`,`arrow_circle`]},E=12,me=`[top=${E},left=${E},bottom=${E},right=${E}]`,D=24,he=24,ge=50,O=15,k=10,A={"spacing.baseValue":15,"spacing.nodeNode":15,"elk.aspectRatio":`1.6`,"elk.expandNodes":`true`,"elk.rectpacking.trybox":`true`,"elk.rectpacking.packing.compaction.rowHeightReevaluation":`true`,"elk.rectpacking.packing.compaction.iterations":10,"elk.rectpacking.whiteSpaceElimination.strategy":`EQUAL_BETWEEN_STRUCTURES`,"elk.rectpacking.widthApproximation.strategy":`SCANLINE`},_e=[`nodeSize.constraints`,`nodeSize.minimum`,`elk.algorithm`,`elk.aspectRatio`,`elk.contentAlignment`,`elk.expandNodes`,`elk.padding`,...Object.keys(A)];function ve(e){for(let t of _e)delete e[t];e[`spacing.baseValue`]=he,e[`spacing.nodeNode`]=ge}s(ve,`clearContainerAlgorithmOptions`);var ye=new Set([`elk.layered`,`elk.box`,`elk.rectpacking`,`elk.stress`,`elk.force`,`elk.mrtree`,`elk.radial`,`elk.sporeOverlap`]);function j(e,t){if(typeof e==`string`){if(!ye.has(e))t?.warn(`Unknown container layout algorithm "${e}". Supported values: ${[...ye].join(`, `)}. Falling back to the diagram's layout algorithm.`);else return e}}s(j,`resolveContainerAlgorithm`);function M(e){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`TB`:case`TD`:return`DOWN`;case`BT`:return`UP`;default:return`DOWN`}}s(M,`dir2ElkDirection`);function N(e){return r(e.shape)?(e.labelData?.width??e.labels?.[0]?.width??0)+(e.padding??0):0}s(N,`groupTitleWidth`);function P(e){return r(e.shape)?{"nodeSize.constraints":`[MINIMUM_SIZE, NODE_LABELS]`,"nodeSize.minimum":`(${N(e)}, 0)`}:{}}s(P,`groupTitleSizeOptions`);function be(e,t,n,r){let i=(e.labelData?.width??0)+2*(e.padding??0),a=e.labelData?.height??0,o=R(t?.preset),s={...P(e),"spacing.baseValue":he,"elk.layered.spacing.edgeNodeBetweenLayers":30,"elk.spacing.edgeEdge":20,"spacing.nodeNode":ge,"elk.padding":`[top=${D},left=${D},bottom=${D},right=${D}]`,"nodeLabels.placement":`[H_CENTER V_TOP, INSIDE]`,"elk.layered.mergeEdges":t?.mergeEdges,"elk.layered.nodePlacement.bk.fixedAlignment":t?.nodePlacementAlignment??o.alignment,"elk.layered.nodePlacement.strategy":t?.nodePlacementStrategy??o.containerPlacement,"elk.layered.cycleBreaking.strategy":t?.cycleBreakingStrategy??o.cycleBreaking,"elk.layered.nodePlacement.networkSimplex.nodeFlexibility":`PORT_POSITION`,"elk.spacing.portsSurrounding":me},c=j(e.metadata?.algorithm,r);if(c){let e=a+O;if(s[`nodeSize.constraints`]=`[MINIMUM_SIZE, NODE_LABELS]`,s[`nodeSize.minimum`]=`(${i}, ${e+O})`,s[`elk.algorithm`]=c,s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`,s[`elk.aspectRatio`]=`2.0`,s[`elk.contentAlignment`]=`H_CENTER V_TOP`,s[`elk.expandNodes`]=`true`,s[`elk.padding`]=`[top=${e},left=${O},bottom=${O},right=${O}]`,c===`elk.rectpacking`){let e=a+k;Object.assign(s,A,{"elk.padding":`[top=${e},left=${k},bottom=${k},right=${k}]`,"nodeSize.minimum":`(${i}, ${e+k})`})}}else e.dir&&(s[`elk.algorithm`]=n,s[`elk.direction`]=M(e.dir),s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`);return Object.assign(s,te),s}s(be,`buildSubgraphLayoutOptions`);function xe(e,t){let n=new Set,r=new Map;for(let{id:t,parentId:n}of e){let e=r.get(n);e?e.push(t):r.set(n,[t])}for(let e of r.values()){let r=new Set(e),i=new Map(e.map(e=>[e,0])),a=new Map(e.map(e=>[e,[]])),o=[];for(let e of t){let t=e.source==null?void 0:String(e.source),n=e.target==null?void 0:String(e.target);t&&n&&t!==n&&r.has(t)&&r.has(n)&&(i.set(n,(i.get(n)??0)+1),a.get(t).push(n),a.get(n).push(t),o.push([t,n]))}let c=new Map,l=0;for(let t of e){if(c.has(t))continue;let e=[t];for(c.set(t,l);e.length>0;){let t=e.pop();for(let n of a.get(t))c.has(n)||(c.set(n,l),e.push(n))}l++}let u=Array(l).fill(!1);for(let t of e)(i.get(t)??0)===0&&(u[c.get(t)]=!0);if(!u.includes(!1))continue;let d=new Map(e.map(e=>[e,[]])),f=new Map(e.map(e=>[e,0])),p=s((e,t)=>{let n=new Set([e]),r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;for(let t of d.get(e))n.has(t)||(n.add(t),r.push(t))}return!1},`reaches`);for(let[e,t]of o)p(t,e)||(d.get(e).push(t),f.set(t,(f.get(t)??0)+1));let m=Array(l).fill(!1);for(let t of e){let e=c.get(t);!u[e]&&!m[e]&&f.get(t)===0&&(n.add(t),m[e]=!0)}}return n}s(xe,`findCyclicEntryNodes`);function Se(e,t){if(!e.config.elk?.keepEntryNodeOnTop)return;let n=xe(e.nodes,e.edges.map(e=>({source:e.start,target:e.end})));for(let e of n){let n=t[e];n&&(n.layoutOptions={...n.layoutOptions,"elk.layered.layering.layerConstraint":`FIRST`})}}s(Se,`applyCyclicEntryConstraint`);function Ce(e,t){let n=I(t);return ke(n),_t(e,n),{algorithm:n.algorithm}}s(Ce,`prepareLayoutForElk`);async function we(e,t){let n=I(t),r=Te(e,n),i=new l;n.log.info(`Drawing flowchart using v4 renderer`,i);let a=await He(i,r.elkGraph,n.log);return Ue(e,a,r,n.log),Ae(e.nodes),a}s(we,`runElkLayoutCore`);function Te(e,t){let n={},r=je(e,t.algorithm,t.rootLayoutOptions),i=e.direction??`DOWN`;r.layoutOptions[`elk.direction`]=M(i);let a=Me(e.nodes,t.log);return z(e.nodes,r,n,t),Ie(e,r,n,t),Be(e,n,a,t),Ve(r,n,a,t.log),e.config.elk?.orientFeedbackEdges!==!1&&Ee(r,a),De(r,a),Se(e,n),{elkGraph:r,nodeDb:n,parentLookupDb:a}}s(Te,`buildElkGraphFromLayoutData`);function Ee(e,t){let n=p(e.edges.map(e=>({source:e.sources[0],target:e.targets[0]})),t);e.edges.forEach((e,t)=>{n[t]&&([e.sources,e.targets]=[e.targets,e.sources],e.layoutReversed=!0)})}s(Ee,`reverseSubgraphFeedbackEdges`);function De(e,t){e.edges=h(e.edges.map(e=>({source:e.sources[0],target:e.targets[0]})),t).map(t=>e.edges[t])}s(De,`orderEdgesByNesting`);var Oe=n({afterPaint:_,prepareLayout:Ce,measureLayout:s((e,n)=>t(e,n,{unwrapGroupLabels:!0}),`measureLayout`),runLayoutCore:we,paintOptions:{skipIntersect:!0}});function ke(e){o(e.getConfig())}s(ke,`syncHostConfig`);function Ae(e){let t=new Map(e.map(e=>[e.id,e]));e.sort((e,n)=>e.isGroup===n.isGroup?e.isGroup&&n.isGroup?F(e,t)-F(n,t):0:e.isGroup?-1:1)}s(Ae,`orderNodesForElkPaint`);function F(e,t){let n=0,r=new Set,i=e.parentId;for(;i&&!r.has(i);){r.add(i);let e=t.get(i);if(!e?.isGroup)break;n++,i=e.parentId}return n}s(F,`getGroupDepth`);function I(e){let t=e.helpers;if(!t)throw Error(`ELK layout requires Mermaid internal helpers`);return{algorithm:e.preparedLayout?.algorithm??e.options?.algorithm,rootLayoutOptions:e.options?.rootLayoutOptions,common:t.common,getConfig:t.getConfig,interpolateToCurve:t.interpolateToCurve,log:t.log}}s(I,`getElkLayoutContext`);var L={default:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`BALANCED`,cycleBreaking:`DEPTH_FIRST`},legacy:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY`},modelOrder:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY_MODEL_ORDER`},depthFirst:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`DEPTH_FIRST`}};function R(e){return e!==void 0&&Object.hasOwn(L,e)?L[e]:L.default}s(R,`resolveElkPreset`);function je(e,t,n){let r=R(e.config.elk?.preset),i={id:`root`,layoutOptions:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.algorithm":t,"elk.layered.nodePlacement.strategy":e.config.elk?.nodePlacementStrategy??r.placement,"elk.layered.nodePlacement.bk.fixedAlignment":e.config.elk?.nodePlacementAlignment??r.alignment,"elk.layered.mergeEdges":e.config.elk?.mergeEdges,"elk.direction":`DOWN`,"spacing.baseValue":40,"elk.layered.crossingMinimization.forceNodeModelOrder":e.config.elk?.forceNodeModelOrder,"elk.layered.considerModelOrder.strategy":e.config.elk?.considerModelOrder,"elk.layered.unnecessaryBendpoints":!0,"elk.layered.cycleBreaking.strategy":e.config.elk?.cycleBreakingStrategy??r.cycleBreaking,"elk.layered.layering.strategy":e.config.elk?.layeringStrategy??r.layering,"elk.layered.layering.coffmanGraham.layerBound":e.config.elk?.layeringLayerBound,"elk.layered.wrapping.multiEdge.improveCuts":!0,"elk.layered.wrapping.multiEdge.improveWrappedEdges":!0,"elk.layered.edgeRouting.selfLoopDistribution":`EQUALLY`,"elk.layered.mergeHierarchyEdges":!0,"elk.spacing.portsSurrounding":me},children:[],edges:[]};return t===`elk.rectpacking`&&Object.assign(i.layoutOptions,A,{"elk.contentAlignment":`H_CENTER V_TOP`,"elk.padding":`[top=15,left=15,bottom=15,right=15]`}),n&&Object.assign(i.layoutOptions,n),Object.assign(i.layoutOptions,v,y,ee),i}s(je,`createRootElkGraph`);function Me(e,t){let n={parentById:{},childrenById:{}},r=e.filter(e=>e.isGroup);return t.info(`Subgraphs - `,r),r.forEach(t=>{e.filter(e=>e.parentId===t.id).forEach(e=>{n.parentById[e.id]=t.id,n.childrenById[t.id]??=[],n.childrenById[t.id].push(e.id)})}),n}s(Me,`addSubGraphs`);function z(e,t,n,r,i){let a=e.filter(e=>e?.parentId===i);return r.log.info(`addVertices APA12`,a,i),a.forEach(i=>{Ne(t,e,i,n,r)}),t}s(z,`addVertices`);function Ne(e,t,n,r,i){let a=Pe(n);e.children.push(a),r[n.id]=a,n.isGroup&&(a.children=[],z(t,a,r,i,n.id),a.labelData=Fe(n,i.getConfig()))}s(Ne,`addVertex`);function Pe(e){let t={...e};return delete t.domId,e.isGroup?t.children=[]:(t.width=e.width??0,t.height=e.height??0,e.spreadPorts&&(t.layoutOptions={...t.layoutOptions,"elk.portAlignment.default":`CENTER`})),t}s(Pe,`createElkNode`);function Fe(e,t){return e.labelData||(e.labelBBox?{width:e.labelBBox.width,height:Math.max(0,e.labelBBox.height-2),wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth}:{width:0,height:0,wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth})}s(Fe,`getMeasuredLabelData`);function Ie(e,t,n,r){r.log.info(`abc78 DAGA edges = `,e);let i={};return e.edges.forEach(e=>{let a=e.id;i[a]=(i[a]??-1)+1;let o=a;e.id=o,r.log.info(`abc78 new link id to be used is`,a,o,i[a]);let{source:s,target:c,sourceId:l,targetId:u}=ze(e,n);r.log.debug(`abc78 source and target`,s,c),t.edges.push({...e,sources:[s],targets:[c],sourceId:l,targetId:u,labels:[{width:e.width??0,height:e.height??0,orgWidth:e.width??0,orgHeight:e.height??0,text:e.label??``,layoutOptions:{"edgeLabels.inline":`true`,"edgeLabels.placement":`CENTER`}},...(r.rootLayoutOptions?.[`elk.algorithm`]??r.algorithm??`elk.layered`)===`elk.layered`?Re(e):[]]})}),t}s(Ie,`addEdgesToElkGraph`);var Le=6;function Re(e){let t={startLeft:e.startLabelLeft,startRight:e.startLabelRight,endLeft:e.endLabelLeft,endRight:e.endLabelRight};return Object.entries(e.terminalLabelSizes??{}).map(([n,r])=>{let i=n.startsWith(`start`),a=i?e.arrowTypeStart:e.arrowTypeEnd,o=a&&a!==`none`?Le:0;return{terminal:n,text:t[n],width:r.width+2*o,height:r.height+2*o,layoutOptions:{"edgeLabels.placement":i?`TAIL`:`HEAD`}}})}s(Re,`terminalElkLabels`);function ze(e,t){let n=e.start,r=e.end,i=n,a=r,o=n?t[n]:void 0,s=r?t[r]:void 0;return!o||!s?{source:i,target:a}:{source:i,target:a,sourceId:n,targetId:r}}s(ze,`getEdgeStartEndPoint`);function Be(e,t,n,r){e.nodes.forEach(i=>{let a=t[i.id];a&&n.childrenById[a.id]!==void 0&&(a.labels=[{text:a.label,width:a?.labelData?.width??50,height:a?.labelData?.height??50}],r.log.debug(`UIO node label`,a?.labelData?.width,a.padding),a.layoutOptions=be(a,e.config.elk,r.algorithm,r.log),delete a.x,delete a.y,delete a.width,delete a.height)})}s(Be,`configureSubgraphNodes`);function Ve(e,t,n,r){r.debug(`APA01 processing edges, count:`,e.edges.length),e.edges.forEach((e,i)=>{r.debug(`APA01 processing edge`,i,`:`,e);let a=e.sources[0],o=e.targets[0];if(r.debug(`APA01 source:`,a,`target:`,o),r.debug(`APA01 nodeDb[source]:`,t[a]),r.debug(`APA01 nodeDb[target]:`,t[o]),t[a]&&t[o]&&t[a].parentId!==t[o].parentId){let e=u(a,o,n);B(t,a,e,r),B(t,o,e,r)}})}s(Ve,`configureCrossHierarchyEdges`);function B(e,t,n,r){let i=e[t];i&&(i.layoutOptions??={},i.layoutOptions[`elk.hierarchyHandling`]===`SEPARATE_CHILDREN`&&j(i.metadata?.algorithm)&&(r.debug(`Dropping explicit algorithm for node`,i.id,`due to cross-boundary edges`),ve(i.layoutOptions),Object.assign(i.layoutOptions,P(i))),i.layoutOptions[`elk.hierarchyHandling`]=`INCLUDE_CHILDREN`,i.id!==n&&i.parentId&&B(e,i.parentId,n,r))}s(B,`setIncludeChildrenPolicy`);async function He(e,t,n){let r=globalThis.__mermaidProfiler;try{r?.begin(`layoutCore`);let i;try{i=await e.layout(t)}finally{r?.end()}return n.debug(`APA01 after - success`),n.debug(`APA01 layout result:`,i),i}catch(e){throw n.error(`ELK layout error:`,e),e}}s(He,`runElkLayout`);function Ue(e,t,n,r){let i=new Map(e.nodes.map(e=>[e.id,e]));U(t.children??[],n,i,0,0,0,r),H(t.children??[],n,i,t),Qe(e,t,n,r)}s(Ue,`applyElkLayoutResult`);function V(e,t=new Set){for(let n of e.children??[])t.add(n.id),V(n,t);return t}s(V,`collectDescendantIds`);function We(e,t,n,r){let i=[];for(let a of e.edges??[]){let e=a.sources?.[0]??a.start,o=a.targets?.[0]??a.end,s=t.has(e)&&t.has(o),c=e===r,l=o===r;if(!s&&!c&&!l)continue;let u=Z(e,o,n.parentLookupDb,n.nodeDb);for(let e of a.sections??[]){let t=s?[e.startPoint,...e.bendPoints??[],e.endPoint]:[c?e.startPoint:null,l?e.endPoint:null];for(let e of t)e&&i.push({x:e.x+u.x,y:e.y+u.y})}}return i}s(We,`internalEdgePoints`);function H(e,t,n,r={}){for(let i of e){if(!i?.isGroup)continue;let e=i.children??[];H(e,t,n,r);let a=t.nodeDb[i.id],o=e.map(e=>t.nodeDb[e.id]).filter(e=>e?.offset&&e.width&&e.height);if(!a?.offset||o.length===0)continue;let s=We(r,V(i),t,i.id),c=[...o.map(e=>e.offset.posX),...o.map(e=>e.offset.posX+e.width),...s.map(e=>e.x)],l=[...o.map(e=>e.offset.posY),...o.map(e=>e.offset.posY+e.height),...s.map(e=>e.y)],u=a.offset,d=Math.max(u.posX,Math.min(...c)-D),f=Math.min(u.posX+a.width,Math.max(...c)+D),p=Math.min(u.posY+a.height,Math.max(...l)+D),m=u.posY,h=N(i),g=d,_=f-d;if(_<h){g-=(h-_)/2,_=h;let e=u.posX+a.width;g=Math.max(u.posX,Math.min(g,e-_)),_=Math.min(_,a.width)}let v=p-m;if(v<=0||_<=0)continue;a.elkOrigin??={posX:u.posX,posY:u.posY},a.offset.posX=g,a.offset.width=_,a.offset.height=v,a.width=_,a.height=v,a.x=g+_/2,a.y=m+v/2;let y=n.get(i.id);y&&(y.x=a.x,y.y=a.y,y.width=_,y.height=v)}}s(H,`evenGroupFrames`);function U(e,t,n,r,i,a,o){e.forEach(e=>{if(!e)return;let s=t.nodeDb[e.id]??e,c=Math.max(e.width,e.labels&&e.labels[0]?.width||0),l={posX:e.x+r,posY:e.y+i,x:r,y:i,depth:a,width:c,height:e.height};s.offset=l,s.x=l.posX+e.width/2,s.y=l.posY+e.height/2,s.width=e.width,s.height=e.height;let u=n.get(e.id);if(u){u.x=s.x,u.y=s.y,u.width=e.isGroup?Math.max(e.width,e.labelData?.width??0):e.width,u.height=e.height;let t=u;t.labelData=e.labelData,t.labels=e.labels}e.isGroup?(o.debug(`Id abc88 subgraph = `,e.id,e.x,e.y,e.labelData),U(e.children??[],t,n,l.posX,l.posY,a+1,o)):o.info(`Id NODE = `,e.id,e.x,e.y,r,i,`translate(${s.x}, ${s.y})`)})}s(U,`applyElkNodePositions`);var Ge=16,Ke=30,W=.01;function G(e,t){let n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);if(n>W&&r<=W)return`h`;if(r>W&&n<=W)return`v`}s(G,`axisOf`);function qe(e){let t=[],n=e,r=K(n);r&&(n=r.points,t.push(r.run));let i=K([...n].reverse());return i&&(n=i.points.reverse(),t.push(i.run)),{points:n,runs:t}}s(qe,`straightenTerminalJogsWithRuns`);function K(e){if(e.length<5)return null;let[t,n,r,i]=e,a=G(t,n);if(!a||G(r,i)!==a||G(n,r)!==(a===`h`?`v`:`h`)||Math.hypot(n.x-t.x,n.y-t.y)>Ke)return null;let o=Math.abs(a===`h`?r.y-n.y:r.x-n.x);if(o<W||o>Ge||!(a===`h`?Math.sign(n.x-t.x)===Math.sign(i.x-r.x):Math.sign(n.y-t.y)===Math.sign(i.y-r.y)))return null;let s=3;for(;s+1<e.length&&G(e[s],e[s+1])===a;)s++;if(s===e.length-1)return null;let c=[...e];for(let n=2;n<=s;n++)c[n]=a===`h`?{x:e[n].x,y:t.y}:{x:t.x,y:e[n].y};let l={old:{a:e[2],b:e[s]},new:{a:c[2],b:c[s]}};return c.splice(1,2),{points:c,run:l}}s(K,`straightenFront`);function Je(e,t,n,r){let i=s((e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),`side`),a=i(n,r,e),o=i(n,r,t),c=i(e,t,n),l=i(e,t,r);return(a>0&&o<0||a<0&&o>0)&&(c>0&&l<0||c<0&&l>0)}s(Je,`segmentsCrossStrict`);function q(e,t){let n=0;for(let r=0;r<e.length-1;r++)for(let i=0;i<t.length-1;i++)Je(e[r],e[r+1],t[i],t[i+1])&&n++;return n}s(q,`crossingCount`);function Ye(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;return a===0?0:Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a))}s(Ye,`paramOnSegment`);function J(e,t,n){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}s(J,`pointAtParam`);function Xe(e,t){let n=null;for(let r of t){let t=Ye(e,r.old.a,r.old.b),i=J(r.old.a,r.old.b,t),a=i.x-e.x,o=i.y-e.y,s=a*a+o*o;(!n||s<n.distSq)&&(n={distSq:s,point:J(r.new.a,r.new.b,t)})}return n?.point??null}s(Xe,`projectLabelOntoStraightenedRun`);function Y(e,t,n){let r=0,i=1,a=t.x-e.x,o=t.y-e.y;for(let[t,s]of[[-a,e.x-n.x1],[a,n.x2-e.x],[-o,e.y-n.y1],[o,n.y2-e.y]])if(t===0){if(s<0)return!1}else t<0?r=Math.max(r,s/t):i=Math.min(i,s/t);return r<i}s(Y,`segmentHitsBox`);var X=s((e,t)=>({x1:e.x-t.width/2,y1:e.y-t.height/2,x2:e.x+t.width/2,y2:e.y+t.height/2}),`labelBox`);function Ze(e){let t=e.map(e=>e.points??[]),n=e.map(e=>e.x==null||e.y==null||!e.label||!e.width||!e.height?void 0:{centre:{x:e.x,y:e.y},size:{width:e.width,height:e.height}}),r=s((e,t)=>{let n=t&&X(t.centre,t.size);return!!n&&e.some((t,r)=>r<e.length-1&&Y(t,e[r+1],n))},`covers`),i=[];for(let[a,o]of e.entries()){let e=t[a];if(e.length<5)continue;let{points:s,runs:c}=qe(e);if(s===e)continue;let l=n[a],u=l&&Xe(l.centre,c),d=l&&u?{centre:u,size:l.size}:l,f=0,p=0,m=0,h=0;for(let[i,o]of t.entries())i===a||o.length<2||(f+=q(e,o),p+=q(s,o),m+=Number(r(o,l))+Number(r(e,n[i])),h+=Number(r(o,d))+Number(r(s,n[i])));p>f||h>m||(o.points=s,t[a]=s,n[a]=d,i.push({edge:o,runs:c}))}return i}s(Ze,`straightenEdgeTerminals`);function Qe(e,t,n,r){let i=new Map(e.edges.map(e=>[e.id,e])),a=e.config.elk?.straightenEdges!==!1,o=new Map;for(let t of e.edges)delete t.terminalLabelCenters;let c=new Map(e.nodes.map(e=>[e.id,e])),l=new Set;if(t.edges?.forEach(e=>{if(!e.sections?.length)return;let t=n.nodeDb[e.sources?.[0]??e.start],r=n.nodeDb[e.targets?.[0]??e.end];if(!t||!r)return;let i=Z(e.start??e.sourceId??e.sources?.[0],e.end??e.targetId??e.targets?.[0],n.parentLookupDb,n.nodeDb),a=e.sections[0];t.shape!==`rect33`&&ct(t,{x:a.startPoint.x+i.x,y:a.startPoint.y+i.y},c,l),r.shape!==`rect33`&&ct(r,{x:a.endPoint.x+i.x,y:a.endPoint.y+i.y},c,l)}),t.edges?.forEach(e=>{let t=i.get(e.id);if(!t)return;let a=e.layoutReversed===!0,c=e.sources?.[0]??e.start,l=e.targets?.[0]??e.end;a&&([c,l]=[l,c]);let u=n.nodeDb[c],d=n.nodeDb[l];if(!u||!d)return;if(!e.sections?.length){let n=s(e=>({x:(e.offset?.posX??e.x??0)+(e.width??0)/2,y:(e.offset?.posY??e.y??0)+(e.height??0)/2}),`centre`),i=n(u),a=n(d);u.x=i.x,u.y=i.y,d.x=a.x,d.y=a.y;let o=ut([i,a],u,d,r);t.points=o,t.curve=`linear`;let c=o[0],l=o[o.length-1];t.x=(c.x+l.x)/2,t.y=(c.y+l.y)/2,r.debug(`APA18 no edge sections, using a straight line`,e.id,t.points);return}let f=e.start??e.sourceId??c,p=e.end??e.targetId??l,m=Z(f,p,n.parentLookupDb,n.nodeDb);r.debug(`APA18 offset`,m,f,` ==> `,p,`edge:`,e,u);let h=e.sections[0],g=lt(h,m);a&&g.reverse();let _={start:g[0],end:g[g.length-1]};u.x=u.offset.posX+u.width/2,u.y=u.offset.posY+u.height/2,d.x=d.offset.posX+d.width/2,d.y=d.offset.posY+d.height/2,u.shape!==`rect33`&&g.unshift({x:u.x,y:u.y}),d.shape!==`rect33`&&g.push({x:d.x,y:d.y}),t.points=ht(gt(ut(g,u,d,r),Q(d),pt(t),r),Q(u),mt(t),r),t.curve=`rounded`;let v=e.labels?.[0];v&&(t.x=v.x+m.x+v.width/2,t.y=v.y+m.y+v.height/2);for(let n of e.labels??[])n.terminal&&(n.x||n.y)&&(t.terminalLabelCenters??={},t.terminalLabelCenters[n.terminal]={x:n.x+m.x+n.width/2,y:n.y+m.y+n.height/2});t.terminalLabelCenters&&o.set(t,_)}),a){let t=Ze(e.edges);for(let{edge:e,runs:n}of t){if(e.x==null||e.y==null)continue;let t=Xe({x:e.x,y:e.y},n);t&&(e.x=t.x,e.y=t.y)}}for(let[e,t]of o)st(e,t);at(e.edges,e.nodes),ot(e.edges,e.nodes),et(e.edges)}s(Qe,`applyElkEdgeLayout`);var $e=4;function et(e){let t=new Map;for(let n of e){if(n.x==null||n.y==null||!n.label||!n.width)continue;let e=[n.start??``,n.end??``].sort().join(`\0`),r=t.get(e);r?r.push(n):t.set(e,[n])}for(let e of t.values()){if(e.length!==2)continue;let[t,n]=e;if(Math.abs(t.y-n.y)>Math.max(t.height??0,n.height??0))continue;let r=t.width/2+n.width/2+$e,i=n.x-t.x,a=r-Math.abs(i);if(a<=0)continue;let o=Math.sign(i)||1;t.x-=o*a/2,n.x+=o*a/2}}s(et,`separateOppositeEdgeLabels`);var tt=s((e,t)=>e.x1<t.x2&&t.x1<e.x2&&e.y1<t.y2&&t.y1<e.y2,`boxesOverlap`);function nt(e,t){let n=t.filter(e=>e.x!==void 0&&e.y!==void 0),r=s(e=>X({x:e.x,y:e.y},{width:e.width??0,height:e.height??0}),`boxOf`),i=n.filter(e=>!e.isGroup).map(r),a=n.filter(e=>e.isGroup).map(r).flatMap(({x1:e,y1:t,x2:n,y2:r})=>[[{x:e,y:t},{x:n,y:t}],[{x:n,y:t},{x:n,y:r}],[{x:n,y:r},{x:e,y:r}],[{x:e,y:r},{x:e,y:t}]]),o=e.filter(e=>e.label&&e.width&&e.height&&e.x!==void 0).map(e=>X({x:e.x,y:e.y},{width:e.width,height:e.height})),c=s((e,t=0)=>{let n={x1:e.x1-t,y1:e.y1-t,x2:e.x2+t,y2:e.y2+t};return a.some(([e,t])=>Y(e,t,n))},`hitsFrame`);return{hitsFrame:c,blocked:s((t,n,r,a,s=0)=>i.some(e=>tt(t,e))||o.some(e=>tt(t,e))||c(t,s)||e.some(e=>(e.points??[]).some((r,i,o)=>i<o.length-1&&(e!==n||i!==a)&&Y(r,o[i+1],t)))||e.some(e=>Object.entries(e.terminalLabelCenters??{}).some(([i,a])=>{let o=e.terminalLabelSizes?.[i];return(e!==n||i!==r)&&o!==void 0&&tt(t,X(a,o))})),`blocked`)}}s(nt,`terminalLabelObstacles`);function*rt(e){for(let t of e){let e=t.points;if(!(!e||e.length<2||!t.terminalLabelCenters||!t.terminalLabelSizes))for(let[n,r]of Object.entries(t.terminalLabelCenters)){let i=t.terminalLabelSizes[n],a=n.startsWith(`start`),o=a?0:e.length-2,[s,c]=[e[o],e[o+1]],l=Math.hypot(c.x-s.x,c.y-s.y);i&&l!==0&&(yield{edge:t,key:n,center:r,size:i,atStart:a,segment:o,from:s,to:c,length:l})}}}s(rt,`placedTerminalLabels`);var it=2;function at(e,t){let{hitsFrame:n,blocked:r}=nt(e,t);for(let{edge:t,key:i,center:a,size:o,atStart:c,segment:l,from:u,to:d,length:f}of rt(e)){if(!n(X(a,o)))continue;let[e,p]=c?[d,u]:[u,d],m={x:(p.x-e.x)/f,y:(p.y-e.y)/f},h=(Math.abs(m.x)*o.width+Math.abs(m.y)*o.height)/2,g=s(e=>(e.x-p.x)*m.x+(e.y-p.y)*m.y,`along`),_=s(e=>g(e)+h<=0&&g(e)-h>=-f,`onSegment`);for(let e=1;e<=f;e++){let n=[e,-e].map(e=>({x:a.x+e*m.x,y:a.y+e*m.y})).find(e=>_(e)&&!r(X(e,o),t,i,l,it));if(n){t.terminalLabelCenters[i]=n;break}}}}s(at,`slideTerminalLabelsOffFrames`);function ot(e,t){let{blocked:n}=nt(e,t);for(let{edge:t,key:r,center:i,size:a,segment:o,from:s,to:c,length:l}of rt(e)){let e={x:-(c.y-s.y)/l,y:(c.x-s.x)/l},u=(i.x-s.x)*e.x+(i.y-s.y)*e.y;if(u===0||u>0===r.endsWith(`Right`))continue;let d={x:i.x-2*u*e.x,y:i.y-2*u*e.y};n(X(d,a),t,r,o)||(t.terminalLabelCenters[r]=d)}}s(ot,`putTerminalLabelsOnTheirSide`);function st(e,t){let n=e.points;if(!n?.length||!e.terminalLabelCenters)return;let r={start:{x:n[0].x-t.start.x,y:n[0].y-t.start.y},end:{x:n[n.length-1].x-t.end.x,y:n[n.length-1].y-t.end.y}};for(let[t,n]of Object.entries(e.terminalLabelCenters)){let i=t.startsWith(`start`)?r.start:r.end;e.terminalLabelCenters[t]={x:n.x+i.x,y:n.y+i.y}}}s(st,`followMovedEndpoints`);function ct(e,t,n,r){let i=e.width??0,a=e.height??0,o=e.offset.posY,s=o+a,c=.5,l=Math.abs(t.y-o)<=c||Math.abs(t.y-s)<=c;if((l?i:a)>=2*E||r.has(e.id))return;r.add(e.id);let u=l?t.x-(e.offset.posX+i/2):t.y-(e.offset.posY+a/2);if(Math.abs(u)<.01)return;l?(e.offset.posX+=u,e.x=e.offset.posX+i/2):(e.offset.posY+=u,e.y=e.offset.posY+a/2);let d=n.get(e.id);d&&(d.x=e.offset.posX+i/2,d.y=e.offset.posY+a/2)}s(ct,`alignDegenerateNodeToAnchor`);function lt(e,t){let n=e.startPoint,r=e.endPoint,i=(e.bendPoints?e.bendPoints:[]).map(e=>({x:e.x+t.x,y:e.y+t.y}));return[{x:n.x+t.x,y:n.y+t.y},...i,{x:r.x+t.x,y:r.y+t.y}]}s(lt,`createEdgePointsFromSection`);function Z(e,t,n,r){let i=u(e,t,n);if(i===void 0||i===`root`)return{x:0,y:0};let a=r[i],o=a?.elkOrigin??a?.offset;return{x:o?.posX??0,y:o?.posY??0}}s(Z,`calcOffset`);function ut(e,t,n,r){let i=Array.isArray(e)?[...e]:[],a=Q(n);r.debug(`PPP cutter2: Points before cutter2:`,JSON.stringify(e),`endBounds:`,a,x(a,e[e.length-1]));let o;{let e=Q(t),a=Q(n),s=!!t?.isGroup,c=!!n?.isGroup,{candidate:l,centerApprox:u}=Tt(i,t,`start`),{candidate:d,centerApprox:f}=Tt(i,n,`end`),p=s&&x(e,l),m=c&&x(a,d);Et(i,`start`,p&&u),Et(i,`end`,m&&f),s&&!p&&(p=Dt(i,e,`start`)),c&&!m&&(m=Dt(i,a,`end`)),p||m?(p||Ot(i,t,e,r),m||kt(i,n,a,r),r.debug(`PPP cutter2: skipping cutter2 due to on-border group endpoint(s)`,{skipStart:p,skipEnd:m,startCenterApprox:u,endCenterApprox:f,startCandidate:l,endCandidate:d}),o=i):o=At(t,n,i,r)}if(r.debug(`PPP cutter2: Points after cutter2:`,JSON.stringify(o)),!Array.isArray(o)||o.length<2||dt(o)){r.warn(`POI cutter2: Invalid points from cutter2, falling back to prevPoints`,o);let e=i.filter(e=>Number.isFinite(e?.x)&&Number.isFinite(e?.y));o=e.length>=2?e:i}return r.debug(`UIO cutter2: Points after cutter2 (sanitized):`,o),ft(o,r)}s(ut,`sanitizeElkEdgePoints`);function dt(e){return e?.some(e=>!Number.isFinite(e?.x)||!Number.isFinite(e?.y))}s(dt,`hasInvalidPoint`);function ft(e,t){let n=e.filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return Math.abs(e.x-r.x)>1e-6||Math.abs(e.y-r.y)>1e-6});return n.length!==e.length&&t.debug(`UIO cutter2: removed consecutive duplicate points`,{before:e,after:n}),n}s(ft,`dedupeConsecutivePoints`);function pt(e){return fe(e.arrowTypeEnd)}s(pt,`getEndMarkerPathOffset`);function mt(e){return fe(e.arrowTypeStart)}s(mt,`getStartMarkerPathOffset`);function ht(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[0],a=e[1],o=Math.hypot(a.x-i.x,a.y-i.y);if(o>=Math.max(de,n*2)||!x(t,a,1))return e;let s=[i,...e.slice(2)];return r.debug(`UIO cutter2: removed short start marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}s(ht,`ensureStartMarkerSegmentLength`);function gt(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[e.length-1],a=e[e.length-2],o=Math.hypot(i.x-a.x,i.y-a.y);if(o>=Math.max(de,n*2)||!x(t,a,1))return e;let s=[...e.slice(0,-2),i];return r.debug(`UIO cutter2: removed short end marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}s(gt,`ensureEndMarkerSegmentLength`);function _t(e,t){let n=e.edges.defaultInterpolate,r=e.edges.defaultStyle,i=t.getConfig();e.edges.forEach(e=>{let a=xt(e,{defaultStyle:r,defaultInterpolate:n,confCurve:i.curve},t);Object.assign(e,a)})}s(_t,`applyElkEdgeRenderData`);function vt(e){if(e.classes!==void 0)return e.classes;if(e.start&&e.end)return`flowchart-link LS_${e.start} LE_${e.end}`}s(vt,`buildFallbackEdgeClasses`);function yt(e,t,n){let r=`normal`,i=`solid`,a=[],o=[];return e===`dotted`?(i=`dotted`,a=[`fill:none`,`stroke-width:2px`,`stroke-dasharray:3`]):e===`thick`?(r=`thick`,a=[`stroke-width: 3.5px`,`fill:none`]):(a=t??[`fill:none`],n!==void 0&&(o=n)),{thickness:r,pattern:i,style:a,labelStyle:o}}s(yt,`computeStroke`);function bt(e,t,n){return e===void 0?t===void 0?n:t:e}s(bt,`getCurve`);function xt(e,t,n){let r={};r.minlen=e.minlen??e.length??1,r.text=e.text??e.label,r.arrowhead=e.arrowhead??(e.type===`arrow_open`?`none`:`normal`);let i=pe[e.type??`arrow_open`]??pe.arrow_open;r.arrowTypeStart=e.arrowTypeStart??i[0],r.arrowTypeEnd=e.arrowTypeEnd??i[1],r.startLabelRight=e.startLabelRight,r.endLabelLeft=e.endLabelLeft;let a=yt(e.stroke,t.defaultStyle,t.defaultLabelStyle);r.thickness=e.thickness??a.thickness,r.pattern=e.pattern??a.pattern,r.style=e.style??a.style,r.labelStyle=e.labelStyle??a.labelStyle,r.classes=vt(e),r.curve=n.interpolateToCurve(bt(e.curve??e.interpolate,t.defaultInterpolate,t.confCurve),c);let o=(r.text??``)!==``;return e.arrowheadStyle===void 0?(o||e.style!==void 0)&&(r.arrowheadStyle=`fill: #333`):r.arrowheadStyle=e.arrowheadStyle,r.labelpos=e.labelpos??(o?`c`:void 0),r.labelType=e.labelType,r.label=(e.label??r.text??``).replace(n.common.lineBreakRegex,`
2
+ `),r}s(xt,`buildEdgeData`);function St(e){return Math.max(e.width??0,N(e))}s(St,`getEffectiveGroupWidth`);function Q(e){let t=e?.isGroup?St(e):e.width;return{x:e.offset.posX+e.width/2,y:e.offset.posY+e.height/2,width:t??0,height:e.height??0,padding:e.padding}}s(Q,`boundsFor`);function Ct(e,t,n=1e-6){return Math.abs(e-t)<n}s(Ct,`approxEq`);function wt(e,t){return Ct(e.x,t.x??0)&&Ct(e.y,t.y??0)}s(wt,`isCenterApprox`);function Tt(e,t,n){if(!e?.length)return{candidate:{x:t.x??0,y:t.y??0},centerApprox:!0};if(n===`start`){let n=e[0],r=wt(n,t);return{candidate:r&&e.length>1?e[1]:n,centerApprox:r}}{let n=e[e.length-1],r=wt(n,t);return{candidate:r&&e.length>1?e[e.length-2]:n,centerApprox:r}}}s(Tt,`getCandidateBorderPoint`);function Et(e,t,n){n&&(t===`start`?e.length>0&&e.shift():e.length>0&&e.pop())}s(Et,`dropAutoCenterPoint`);function Dt(e,t,n){let r=n===`start`?1:-1,i=n===`start`?0:e.length-1,a=i;for(;i>=0&&i<e.length&&!S(t,e[i]);)i+=r;if(i===a||i<0||i>=e.length)return!1;let o=e[i],s=e[i-r],c=o.x-s.x,l=o.y-s.y,u=c===0?1/0:(t.x+Math.sign(c)*t.width/2-s.x)/c,d=l===0?1/0:(t.y+Math.sign(l)*t.height/2-s.y)/l,f=Math.min(u,d),p={x:s.x+f*c,y:s.y+f*l};return n===`start`?e.splice(0,i,p):e.splice(i+1,e.length-i-1,p),!0}s(Dt,`clipGroupEndpoint`);function Ot(e,t,n,r){let i=-1;for(let[t,r]of e.entries())if(S(n,r)){i=t;break}if(i!==-1){let a=e[i],o=e[0],s=w(t,n,a,o);T(e,`start`,s),r.debug(`UIO cutter2: start-only intersection applied`,{startIntersection:s})}}s(Ot,`applyStartIntersectionIfNeeded`);function kt(e,t,n,r){let i=-1;for(let t=e.length-1;t>=0;t--)if(S(n,e[t])){i=t;break}if(i!==-1){let a=e[i],o=e[e.length-1],s=w(t,n,a,o);T(e,`end`,s),r.debug(`UIO cutter2: end-only intersection applied`,{endIntersection:s})}}s(kt,`applyEndIntersectionIfNeeded`);function $(e,t,n,r,i){if(e?.isGroup)return null;let a=n[r],o=n[r+i];return!a||!o?null:ue(e,t,a,o)}s($,`attachAlongDepartureAxis`);function At(e,t,n,r){let i=Q(e),a=Q(t);if(n.length===0)return[];let o=[...n],s=o[0],c=o[o.length-1];r.debug(`PPP cutter2: bounds`,{startBounds:i,endBounds:a}),r.debug(`PPP cutter2: original points`,n);let l=-1;for(let[e,t]of o.entries())l===-1&&S(i,t)&&(l=e);if(l!==-1){let t=o[l],n=$(e,i,o,l,1)??w(e,i,t,s);r.debug(`UIO cutter2: start intersection`,n),T(o,`start`,n)}let u=null,d=-1;for(let e=o.length-1;e>=0;e--)if(S(a,o[e])){u=o[e],d=e;break}if(!u&&o.length>1&&(u=o[o.length-2],d=o.length-2),u){let e=$(t,a,o,d,-1)??w(t,a,u,c);r.debug(`UIO cutter2: end intersection`,{endIntersection:e,outsideIndexForEnd:d}),T(o,`end`,e)}if(o.length>1){let e=o[o.length-1],t=o[o.length-2],n=Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2);n<2&&(r.debug(`UIO cutter2: trimming tail point (too close)`,{distance:n,lastPoint:e,secondLastPoint:t}),o.pop())}return r.debug(`UIO cutter2: final points`,o),o}s(At,`cutter2`);export{Oe as render};
@@ -0,0 +1,99 @@
1
+ import{t as e}from"./chunk-XXDRQBXY-C02Gpej2.js";import{t}from"./chunk-TU62E6Q5-_rcUP1Fh.js";import{i as n,r}from"./mermaid.core-y-x1CYxC.js";import"./chunk-M57EVK23-B-kEyOJF.js";import{h as i}from"./chunk-DQASFODM-7FKe2gLt.js";import"./chunk-LEVMRMFU-DXH6iXv3.js";import"./chunk-AXFCVDMN-BhsttQ-k.js";import"./chunk-X4PVCEUW-DGxTL3kB.js";import"./chunk-STOXU5M4-BaTlty4O.js";import"./chunk-R3KSYZAL-BEXCUN6J.js";import{a,i as o,o as s,r as c,t as l}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{_ as u,c as d}from"./chunk-6MUBBAK2-BBl-4tQr.js";import{C as f,H as p,U as m,_ as h,a as g,b as _,it as v,q as y,s as b,v as x}from"./chunk-BG4553SI-mWcPcFZr.js";import{t as S}from"./chunk-X3CZISLH-NOpCnvgE.js";import{n as C,t as w}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{d as T}from"./index-Bn6_wHEp.js";var E=(function(){var e=C(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],n=[2,2],r=[1,7],i=[1,9],a=[1,10],o=[1,11],s=[1,12],c=[1,30],l=[1,23],u=[1,24],d=[1,25],f=[1,26],p=[1,27],m=[1,19],h=[1,28],g=[1,29],_=[1,20],v=[1,18],y=[1,21],b=[1,22],x=[2,6],S=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],w=[1,36],T=[1,37],E=[1,38],D=[1,39],O=[1,40],k=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],A=[1,46],j=[1,47],M=[1,57],N=[43,51,53,54,55,74,75],P=[1,70],F=[1,68],I=[1,65],L=[1,69],R=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],B=[1,78],V=[1,77],H=[1,76],U=[69,70,71,72,73],W=[1,91],G=[6,9,45,50],K=[6,9,12,44,45,50,51,52],q=[1,101],J=[1,100],Y=[1,99],X=[18,61],ee=[1,110],te=[1,109],ne=[20,43,51,53,54,55],Z=[18,61,64,66],Q={trace:C(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,9:`NEWLINE`,12:`COLON`,14:`STYLE_SEPARATOR`,16:`BLOCK_START`,18:`BLOCK_STOP`,19:`SQS`,20:`SQE`,21:`title`,22:`title_value`,23:`acc_title`,24:`acc_title_value`,25:`acc_descr`,26:`acc_descr_value`,27:`acc_descr_multiline_value`,33:`END`,34:`SUBGRAPH`,37:`direction_tb`,38:`direction_bt`,39:`direction_rl`,40:`direction_lr`,41:`CLASSDEF`,43:`UNICODE_TEXT`,44:`STYLE_TEXT`,45:`COMMA`,46:`CLASS`,47:`STYLE`,50:`SEMI`,51:`NUM`,52:`BRKT`,53:`ENTITY_NAME`,54:`DECIMAL_NUM`,55:`ENTITY_ONE`,61:`ATTRIBUTE_WORD`,62:`?`,64:`,`,65:`ATTRIBUTE_KEY`,66:`COMMENT`,69:`ZERO_OR_ONE`,70:`ZERO_OR_MORE`,71:`ONE_OR_MORE`,72:`ONLY_ONE`,73:`MD_PARENT`,74:`NON_IDENTIFYING`,75:`IDENTIFYING`,76:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:C(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:this.$=a[s-1].concat(a[s]);break;case 4:this.$=a[s];break;case 5:case 6:this.$=[];break;case 7:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]),this.$=[a[s-4],a[s-2]];break;case 8:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-8],a[s-4]];break;case 9:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]),this.$=[a[s-6],a[s-2]];break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-6],a[s-4]];break;case 11:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]),this.$=[a[s-3]];break;case 12:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]),this.$=[a[s-5]];break;case 13:r.addEntity(a[s-2]),this.$=[a[s-2]];break;case 14:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-4]];break;case 15:r.addEntity(a[s]),this.$=[a[s]];break;case 16:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]),this.$=[a[s-2]];break;case 17:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]),this.$=[a[s-6]];break;case 18:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]),this.$=[a[s-8]];break;case 19:r.addEntity(a[s-5],a[s-3]),this.$=[a[s-5]];break;case 20:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]),this.$=[a[s-7]];break;case 21:r.addEntity(a[s-3],a[s-1]);break;case 22:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 23:case 24:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 25:case 26:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 27:r.subgraphDepth?this.$=a[s]:(r.setDirection(a[s].value),this.$=[]);break;case 31:r.subgraphDepth=(r.subgraphDepth||1)-1,this.$=r.addSubGraph({text:a[s-2].id},a[s-1],{text:a[s-2].text});break;case 32:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-1],text:a[s-1]};break;case 33:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-4],text:a[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=a[s];break;case 35:this.$=a[s-1]+` `+a[s];break;case 36:this.$={stmt:`dir`,value:`TB`};break;case 37:this.$={stmt:`dir`,value:`BT`};break;case 38:this.$={stmt:`dir`,value:`RL`};break;case 39:this.$={stmt:`dir`,value:`LR`};break;case 40:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 41:case 42:case 63:case 72:this.$=[a[s]];break;case 43:case 44:this.$=a[s-2].concat([a[s]]);break;case 45:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 46:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 47:this.$=[a[s]];break;case 48:a[s-2].push(a[s]),this.$=a[s-2];break;case 50:this.$=a[s-1]+a[s];break;case 58:case 84:case 85:this.$=a[s].replace(/"/g,``);break;case 64:a[s].push(a[s-1]),this.$=a[s];break;case 65:this.$={type:a[s-1],name:a[s]};break;case 66:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 67:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 68:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 69:case 71:case 74:this.$=a[s];break;case 70:this.$=a[s-1]+a[s];break;case 73:a[s-2].push(a[s]),this.$=a[s-2];break;case 75:this.$=a[s].replace(/"/g,``);break;case 76:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 77:this.$=r.Cardinality.ZERO_OR_ONE;break;case 78:this.$=r.Cardinality.ZERO_OR_MORE;break;case 79:this.$=r.Cardinality.ONE_OR_MORE;break;case 80:this.$=r.Cardinality.ONLY_ONE;break;case 81:this.$=r.Cardinality.MD_PARENT;break;case 82:this.$=r.Identification.NON_IDENTIFYING;break;case 83:this.$=r.Identification.IDENTIFYING}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,n,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,34:c,37:l,38:u,39:d,40:f,41:p,43:m,46:h,47:g,51:_,53:v,54:y,55:b},e(t,x,{1:[2,1]}),e(S,[2,3]),e(S,[2,4]),e(S,[2,5]),e(S,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:w,70:T,71:E,72:D,73:O}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(S,[2,26]),e(S,[2,27]),e(S,[2,28]),e(S,[2,29]),e(S,[2,30]),e(S,n,{5:44}),e(k,[2,58]),e(k,[2,59]),e(k,[2,60]),e(k,[2,61]),e(k,[2,62]),e(S,[2,36]),e(S,[2,37]),e(S,[2,38]),e(S,[2,39]),{15:45,43:A,44:j},{15:48,43:A,44:j},{15:49,43:A,44:j},{10:50,43:m,51:_,53:v,54:y,55:b},{10:51,43:m,51:_,53:v,54:y,55:b},{15:52,43:A,44:j},{17:53,18:[1,54],56:55,57:56,61:M},{10:58,43:m,51:_,53:v,54:y,55:b},{68:59,74:[1,60],75:[1,61]},e(N,[2,77]),e(N,[2,78]),e(N,[2,79]),e(N,[2,80]),e(N,[2,81]),e(S,[2,23]),e(S,[2,24]),e(S,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:c,37:l,38:u,39:d,40:f,41:p,43:m,46:h,47:g,51:_,53:v,54:y,55:b},{12:P,42:64,44:F,45:I,48:66,49:67,51:L,52:R},e(z,[2,41]),e(z,[2,42]),{15:72,43:A,44:j,45:I},{12:P,42:73,44:F,45:I,48:66,49:67,51:L,52:R},{6:B,9:V,19:[1,75],35:74,50:H},{12:[1,79],14:[1,80]},e(S,[2,16],{67:35,11:81,16:[1,82],45:I,69:w,70:T,71:E,72:D,73:O}),{18:[1,83]},e(S,[2,13]),{17:84,18:[2,63],56:55,57:56,61:M},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:w,70:T,71:E,72:D,73:O},e(U,[2,82]),e(U,[2,83]),e(S,[2,31]),e(S,x),{6:B,9:V,35:90,45:W,50:H},{43:[1,92],44:[1,93]},e(G,[2,47],{49:94,12:P,44:F,51:L,52:R}),e(K,[2,49]),e(K,[2,54]),e(K,[2,55]),e(K,[2,56]),e(K,[2,57]),e(S,[2,45],{45:I}),{6:B,9:V,35:95,45:W,50:H},e(S,[2,32]),{10:97,36:96,43:m,51:_,53:v,54:y,55:b},e(S,[2,51]),e(S,[2,52]),e(S,[2,53]),{13:98,43:q,53:J,76:Y},{15:102,43:A,44:j},{10:103,43:m,51:_,53:v,54:y,55:b},{17:104,18:[1,105],56:55,57:56,61:M},e(S,[2,11]),{18:[2,64]},e(X,[2,65],{59:106,60:107,63:108,65:ee,66:te}),e([18,61,65,66],[2,71]),{61:[2,70]},e(S,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(S,[2,40]),{12:P,44:F,48:113,49:67,51:L,52:R},e(z,[2,43]),e(z,[2,44]),e(K,[2,50]),e(S,[2,46]),{10:115,20:[1,114],43:m,51:_,53:v,54:y,55:b},e(ne,[2,34]),e(S,[2,7]),e(S,[2,84]),e(S,[2,85]),e(S,[2,86]),{12:[1,116],45:I},{12:[1,118],14:[1,117]},{18:[1,119]},e(S,[2,14]),e(X,[2,66],{60:120,64:[1,121],66:te}),e(X,[2,67]),e(Z,[2,72]),e(X,[2,75]),e(Z,[2,74]),{17:122,18:[1,123],56:55,57:56,61:M},{15:124,43:A,44:j},e(G,[2,48],{49:94,12:P,44:F,51:L,52:R}),{6:B,9:V,35:125,50:H},e(ne,[2,35]),{13:126,43:q,53:J,76:Y},{15:127,43:A,44:j},{13:128,43:q,53:J,76:Y},e(S,[2,12]),e(X,[2,68]),{63:129,65:ee},{18:[1,130]},e(S,[2,19]),e(S,[2,22],{16:[1,131],45:I}),e(S,[2,33]),e(S,[2,10]),{12:[1,132],45:I},e(S,[2,9]),e(Z,[2,73]),e(S,[2,17]),{17:133,18:[1,134],56:55,57:56,61:M},{13:135,43:q,53:J,76:Y},{18:[1,136]},e(S,[2,20]),e(S,[2,8]),e(S,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:C(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:C(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,f=1,p=a.slice.call(arguments,1),m=Object.create(this.lexer),h={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(h.yy[g]=this.yy[g]);m.setInput(e,h.yy),h.yy.lexer=m,h.yy.parser=this,m.yylloc===void 0&&(m.yylloc={});var _=m.yylloc;a.push(_);var v=m.options&&m.options.ranges;this.parseError=typeof h.yy.parseError==`function`?h.yy.parseError:Object.getPrototypeOf(this).parseError;function y(e){n.length-=2*e,i.length-=e,a.length-=e}C(y,`popStack`);function b(){var e=r.pop()||m.lex()||f;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}C(b,`lex`);for(var x,S,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(x??=b(),T=o[w]&&o[w][x]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],o[w])this.terminals_[O]&&O>d&&j.push(`'`+this.terminals_[O]+`'`);M=m.showPosition?`Parse error on line `+(c+1)+`:
2
+ `+m.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[x]||x)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(x==f?`end of input`:`'`+(this.terminals_[x]||x)+`'`),this.parseError(M,{text:m.match,token:this.terminals_[x]||x,line:m.yylineno,loc:_,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+x);switch(T[0]){case 1:n.push(x),i.push(m.yytext),a.push(m.yylloc),n.push(T[1]),x=null,S?(x=S,S=null):(l=m.yyleng,s=m.yytext,c=m.yylineno,_=m.yylloc,u>0&&u--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},v&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,h.yy,T[1],i,a].concat(p)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};Q.lexer=(function(){return{EOF:1,parseError:C(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:C(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:C(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:C(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:C(function(){return this._more=!0,this},`more`),reject:C(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:C(function(e){this.unput(this.match.slice(e))},`less`),pastInput:C(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:C(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:C(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:C(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:C(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:C(function(){return this.next()||this.lex()},`lex`),begin:C(function(e){this.conditionStack.push(e)},`begin`),popState:C(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:C(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:C(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:C(function(e){this.begin(e)},`pushState`),stateStackSize:C(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:C(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),23;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),25;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin(`block`),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin(`block_bq`);break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return t.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin(`style`),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin(`style`),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return t.yytext[0];case 82:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}})();function $(){this.yy={}}return C($,`Parser`),$.prototype=Q,Q.Parser=$,new $})();E.parser=E;var D=E,O=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=m,this.getAccTitle=x,this.setAccDescription=p,this.getAccDescription=h,this.setDiagramTitle=y,this.getDiagramTitle=f,this.getConfig=C(()=>_().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{C(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,S.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:_().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),S.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let n=this.addEntity(e),r;for(r=t.length-1;r>=0;r--)t[r].keys||(t[r].keys=[]),t[r].comment||(t[r].comment=``),n.attributes.push(t[r]),S.debug(`Added attribute `,t[r].name)}addRelationship(e,t,n,r){let i;if(this.subGraphLookup.has(e))i=e;else{let t=this.addEntity(e);if(!t)return;i=t.id}let a;if(this.subGraphLookup.has(n))a=n;else{let e=this.addEntity(n);if(!e)return;a=e.id}let o={entityA:i,roleA:t,entityB:a,relSpec:r};this.relationships.push(o),S.debug(`Added new relationship :`,o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n),r=this.subGraphLookup.get(n);if(t){if(e)for(let n of t)e.cssStyles.push(n);if(r){r.cssStyles||=[];for(let e of t)r.cssStyles.push(e)}}}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}addSubGraph(e,t,n){let r=e.text.trim(),i=n.text,a=C(e=>{let t=new Set,n;return{nodeList:e.filter(e=>{if(e?.stmt)return e.stmt===`dir`&&(n=e.value),!1;if(typeof e!=`string`)return!1;let r=e.trim();return!r||t.has(r)?!1:(t.add(r),!0)}),dir:n}},`uniq`)(t.flat()),o=a.nodeList,s=a.dir;r??=`subGraph`+this.subCount,i||=``,i=this.sanitizeText(i),this.subCount+=1;let c={id:r,nodes:o,title:i.trim(),classes:[],cssStyles:[],dir:s,labelType:this.sanitizeNodeLabelType(n?.type)};return S.info(`Adding`,c.id,c.nodes,c.dir),c.nodes=this.makeUniq(c,this.subGraphs).nodes,this.subGraphs.push(c),this.subGraphLookup.set(r,c),r}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subGraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}subgraphNodeCache(e){let t=new Set;for(let n of e)for(let e of n.nodes)t.add(e);return t}makeUniq(e,t){let n=this.subgraphNodeCache(t),r=[];return e.nodes.forEach((t,i)=>{n.has(t)?S.warn(`Entity '${t}' already belongs to another subgraph and will be ignored`):r.push(e.nodes[i])}),{nodes:r}}sanitizeText(e){return b.sanitizeText(e,_())}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,g()}getData(){let e=[],t=[],n=_(),r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){let t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}for(let t=r.length-1;t>=0;t--){let a=r[t];e.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:n.look})}let o=new Set(r.map(e=>e.id)),s=0;for(let t of this.entities.keys()){if(o.has(t))continue;let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=s++,e.push({...n,parentId:i.get(t),isGroup:!1}))}let c=0;for(let e of this.relationships){let r={id:d(e.entityA,e.entityB,{prefix:`id`,counter:c++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.direction}}},k={};w(k,{draw:()=>A});var A=C(async function(i,a,o,s){S.info(`REF0:`),S.info(`Drawing er diagram (unified)`,a);let{securityLevel:c,er:l,layout:d}=_(),f=s.db.getData(),p=e(a,c);f.type=s.type,f.layoutAlgorithm=r(d),f.config.flowchart.nodeSpacing=l?.nodeSpacing||140,f.config.flowchart.rankSpacing=l?.rankSpacing||80,f.direction=s.db.getDirection();let{config:m}=f,{look:h}=m;f.markers=h===`neo`?[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],f.diagramId=a,await n(f,p);let g=p.selectAll(`[id*="-background"]`);Array.from(g).length>0&&g.each(function(){let e=T(this),t=e.attr(`id`).replace(`-background`,``),n=p.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),u.insertTitle(p,`erDiagramTitleText`,l?.titleTopMargin??25,s.db.getDiagramTitle()),t(p,8,`erDiagram`,l?.useMaxWidth??!0)},`draw`),j=C((e,t)=>{let n=i,r=n(e,`r`),a=n(e,`g`),o=n(e,`b`);return v(r,a,o,t)},`fade`),M=C(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!o(t,r))return``;let i=s(e.look),l=c(n),u=``;for(let e=0;e<a(r);e++){let t=r[e],a=l?`fill: ${n[e%n.length]};`:``;u+=`
7
+
8
+ [data-look="${i}"][data-color-id="color-${e}"].node path {
9
+ stroke: ${t};
10
+ ${a}
11
+ }
12
+
13
+ [data-look="${i}"][data-color-id="color-${e}"].node rect {
14
+ stroke: ${t};
15
+ ${a}
16
+ }
17
+ `}return u},`genColor`),N={parser:D,get db(){return new O},renderer:k,styles:C(e=>{let{look:t,theme:n,erEdgeLabelBackground:r,strokeWidth:i}=e;return`
18
+ ${M(e)}
19
+ .entityBox {
20
+ fill: ${e.mainBkg};
21
+ stroke: ${e.nodeBorder};
22
+ }
23
+
24
+ .relationshipLabelBox {
25
+ fill: ${e.tertiaryColor};
26
+ opacity: 0.7;
27
+ background-color: ${e.tertiaryColor};
28
+ rect {
29
+ opacity: 0.5;
30
+ }
31
+ }
32
+
33
+ .labelBkg {
34
+ background-color: ${l.has(n)&&r?r:j(e.tertiaryColor,.5)};
35
+ }
36
+
37
+ .edgeLabel {
38
+ background-color: ${l.has(n)&&r?r:e.edgeLabelBackground};
39
+ }
40
+ .edgeLabel .label rect {
41
+ fill: ${l.has(n)&&r?r:e.edgeLabelBackground};
42
+ }
43
+ .edgeLabel .label text {
44
+ fill: ${e.textColor};
45
+ }
46
+
47
+ .edgeLabel .label {
48
+ fill: ${e.nodeBorder};
49
+ font-size: 14px;
50
+ }
51
+
52
+ .label {
53
+ font-family: ${e.fontFamily};
54
+ color: ${e.nodeTextColor||e.textColor};
55
+ }
56
+
57
+ .edge-pattern-dashed {
58
+ stroke-dasharray: 8,8;
59
+ }
60
+
61
+ .node rect,
62
+ .node circle,
63
+ .node ellipse,
64
+ .node polygon
65
+ {
66
+ fill: ${e.mainBkg};
67
+ stroke: ${e.nodeBorder};
68
+ stroke-width: ${t===`neo`?i:`1px`};
69
+ }
70
+
71
+ .relationshipLine {
72
+ stroke: ${e.lineColor};
73
+ stroke-width: ${t===`neo`?i:`1px`};
74
+ fill: none;
75
+ }
76
+
77
+ .marker {
78
+ fill: none !important;
79
+ stroke: ${e.lineColor} !important;
80
+ stroke-width: 1;
81
+ }
82
+ [data-look=neo].labelBkg {
83
+ background-color: ${j(e.tertiaryColor,.5)};
84
+ }
85
+
86
+ .cluster rect {
87
+ fill: ${e.clusterBkg??e.mainBkg};
88
+ stroke: ${e.clusterBorder??e.nodeBorder};
89
+ stroke-width: 1px;
90
+ }
91
+
92
+ .cluster text {
93
+ fill: ${e.titleColor??e.textColor};
94
+ }
95
+
96
+ .cluster-label text {
97
+ fill: ${e.titleColor??e.textColor};
98
+ }
99
+ `},`getStyles`)};export{N as diagram};
@@ -0,0 +1 @@
1
+ export{O as createEventModelingServices}from"./mermaid-parser.core-_3Vo8x6b.js";import"./chunk-NGNAAXSQ-DI_UYJZ4.js";
@@ -0,0 +1 @@
1
+ export{n as diagram}from"./chunk-QB3YPZ4I-DyozK3lV.js";import"./chunk-TU62E6Q5-_rcUP1Fh.js";import"./mermaid.core-y-x1CYxC.js";import"./chunk-HFQBQIA3-nXrQ08BL.js";import"./chunk-M57EVK23-B-kEyOJF.js";import"./chunk-DQASFODM-7FKe2gLt.js";import"./chunk-LEVMRMFU-DXH6iXv3.js";import"./chunk-AXFCVDMN-BhsttQ-k.js";import"./chunk-X4PVCEUW-DGxTL3kB.js";import"./chunk-STOXU5M4-BaTlty4O.js";import"./chunk-R3KSYZAL-BEXCUN6J.js";import"./chunk-6MUBBAK2-BBl-4tQr.js";import"./chunk-BG4553SI-mWcPcFZr.js";import"./chunk-X3CZISLH-NOpCnvgE.js";