@eeshaai/code 0.0.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/LICENSE.md +115 -0
  2. package/README.md +335 -0
  3. package/dist/THIRD-PARTY-NOTICES.md +23 -0
  4. package/dist/claude-agent-sdk/LICENSE.md +1 -0
  5. package/dist/claude-agent-sdk/sdk.mjs +156 -0
  6. package/dist/cli.js +23 -0
  7. package/dist/pluginWorker.js +1610 -0
  8. package/dist/resources/styles/custom/instructions/design.md +284 -0
  9. package/dist/resources/styles/custom/instructions/requirements.md +161 -0
  10. package/dist/resources/styles/custom/instructions/tasks-implement.md +90 -0
  11. package/dist/resources/styles/custom/instructions/tasks.md +159 -0
  12. package/dist/resources/styles/custom/process.md +49 -0
  13. package/dist/resources/styles/custom/prompts/first.md +29 -0
  14. package/dist/resources/styles/custom/prompts/implement.md +27 -0
  15. package/dist/resources/styles/custom/prompts/rewrite-note.md +40 -0
  16. package/dist/resources/styles/custom/prompts/rewrite.md +32 -0
  17. package/dist/resources/styles/custom/style.yml +46 -0
  18. package/dist/resources/styles/grammar.md +727 -0
  19. package/dist/resources/styles/kiro/style.yml +63 -0
  20. package/dist/resources/styles/speckit/style.yml +59 -0
  21. package/dist/server.js +835 -0
  22. package/dist/web/chunks/abnfDiagram-VCTEODGH-P6AZFXJU.js +2 -0
  23. package/dist/web/chunks/architecture-7GRP2DOG-K6PMPK7N.js +2 -0
  24. package/dist/web/chunks/architectureDiagram-5GKGNRK7-JB5DD7KL.js +37 -0
  25. package/dist/web/chunks/blockDiagram-I7D4REHJ-ARCDWS5D.js +130 -0
  26. package/dist/web/chunks/c4Diagram-7LVT6UL2-57CIXPJZ.js +39 -0
  27. package/dist/web/chunks/chunk-3EZ2OKHV.js +11 -0
  28. package/dist/web/chunks/chunk-4KJ2U3VQ.js +2 -0
  29. package/dist/web/chunks/chunk-4ZUFUR3U.js +3 -0
  30. package/dist/web/chunks/chunk-63W35XXT.js +3 -0
  31. package/dist/web/chunks/chunk-6YVFH4BZ.js +2 -0
  32. package/dist/web/chunks/chunk-7PUK2GON.js +2 -0
  33. package/dist/web/chunks/chunk-7Q4TXKAS.js +2 -0
  34. package/dist/web/chunks/chunk-7QRY2XB7.js +340 -0
  35. package/dist/web/chunks/chunk-CA2KMNVI.js +33 -0
  36. package/dist/web/chunks/chunk-CFMSYLIK.js +3 -0
  37. package/dist/web/chunks/chunk-CKJRXIX7.js +2 -0
  38. package/dist/web/chunks/chunk-CXXG5KL5.js +2 -0
  39. package/dist/web/chunks/chunk-EFBAEJZJ.js +2 -0
  40. package/dist/web/chunks/chunk-FKTXB6RJ.js +2 -0
  41. package/dist/web/chunks/chunk-FU7R4QOG.js +89 -0
  42. package/dist/web/chunks/chunk-GEV6X2TZ.js +2 -0
  43. package/dist/web/chunks/chunk-GPW7TXQS.js +2 -0
  44. package/dist/web/chunks/chunk-I6RMTJPN.js +15 -0
  45. package/dist/web/chunks/chunk-IKC3ZQV7.js +2 -0
  46. package/dist/web/chunks/chunk-ITN3D7RJ.js +2 -0
  47. package/dist/web/chunks/chunk-J6N7AUC2.js +2 -0
  48. package/dist/web/chunks/chunk-J7VDGOTK.js +4 -0
  49. package/dist/web/chunks/chunk-KVRWT2YT.js +2 -0
  50. package/dist/web/chunks/chunk-NBC6B3KN.js +2 -0
  51. package/dist/web/chunks/chunk-NLHJT4GD.js +2 -0
  52. package/dist/web/chunks/chunk-NOVL2262.js +63 -0
  53. package/dist/web/chunks/chunk-NQ2XP5EN.js +73 -0
  54. package/dist/web/chunks/chunk-P44J6WNO.js +2 -0
  55. package/dist/web/chunks/chunk-QBOSTM7Q.js +3 -0
  56. package/dist/web/chunks/chunk-QKU4ZFG5.js +2 -0
  57. package/dist/web/chunks/chunk-RINQGKTH.js +2 -0
  58. package/dist/web/chunks/chunk-RK4EOCHJ.js +2 -0
  59. package/dist/web/chunks/chunk-S4X6ERXI.js +16 -0
  60. package/dist/web/chunks/chunk-SE57RN36.js +2 -0
  61. package/dist/web/chunks/chunk-SGL7WI35.js +133 -0
  62. package/dist/web/chunks/chunk-SOAWGUAD.js +2 -0
  63. package/dist/web/chunks/chunk-U6ILIHMR.js +2 -0
  64. package/dist/web/chunks/chunk-USZ3ZJYA.js +2 -0
  65. package/dist/web/chunks/chunk-UU7BHEBD.js +2 -0
  66. package/dist/web/chunks/chunk-WL4ZMLPV.js +179 -0
  67. package/dist/web/chunks/chunk-XE4RLI22.js +2 -0
  68. package/dist/web/chunks/chunk-XJ6FSQEO.js +2 -0
  69. package/dist/web/chunks/chunk-XM7VXEGI.js +207 -0
  70. package/dist/web/chunks/chunk-XO4SHRSO.js +232 -0
  71. package/dist/web/chunks/chunk-XOZZFIHV.js +2 -0
  72. package/dist/web/chunks/chunk-YYJ5VFH5.js +2 -0
  73. package/dist/web/chunks/chunk-ZX45GMMJ.js +169 -0
  74. package/dist/web/chunks/chunk-ZXMMITLE.js +2 -0
  75. package/dist/web/chunks/classDiagram-ZZMXUADV-ALD5ECFE.js +2 -0
  76. package/dist/web/chunks/classDiagram-v2-VYDZK3BY-IMIEVQNX.js +2 -0
  77. package/dist/web/chunks/cose-bilkent-JH36ORCC-YVEPG7XZ.js +2 -0
  78. package/dist/web/chunks/cynefin-OW5HDTMX-5G3MG4ZJ.js +2 -0
  79. package/dist/web/chunks/cynefinDiagram-5FMLGOSQ-A3E3NM6X.js +63 -0
  80. package/dist/web/chunks/dagre-GXQ25YYZ-WKL3XLC6.js +5 -0
  81. package/dist/web/chunks/diagram-S7CK7UJ4-AENTNBTM.js +31 -0
  82. package/dist/web/chunks/diagram-UQ7AKVKN-BN6IVDBP.js +42 -0
  83. package/dist/web/chunks/diagram-VSXAHHWV-X7IW7FU6.js +4 -0
  84. package/dist/web/chunks/diagram-VX7I27RA-4V6RQ6IS.js +25 -0
  85. package/dist/web/chunks/diagram-Z3DM3KII-ODYVRYAT.js +25 -0
  86. package/dist/web/chunks/ebnfDiagram-PWID7BFC-2KD46JNN.js +2 -0
  87. package/dist/web/chunks/erDiagram-RLTQ6QDP-6MYZ2NRT.js +100 -0
  88. package/dist/web/chunks/eventmodeling-NTZA5JFV-QZXC5VKS.js +2 -0
  89. package/dist/web/chunks/flowDiagram-HODETNUW-BILJ37ZX.js +2 -0
  90. package/dist/web/chunks/ganttDiagram-EL5Y4UJY-LVA23DND.js +293 -0
  91. package/dist/web/chunks/gitGraph-4MIJSDKK-H43S2MKN.js +2 -0
  92. package/dist/web/chunks/gitGraphDiagram-WWUBYQGX-JRB4SUZI.js +107 -0
  93. package/dist/web/chunks/info-A6RAGUB7-DKS7Q63Q.js +2 -0
  94. package/dist/web/chunks/infoDiagram-27XIBGKW-JLOVILVF.js +3 -0
  95. package/dist/web/chunks/ishikawaDiagram-5VMMS53U-SUA2YN5D.js +71 -0
  96. package/dist/web/chunks/journeyDiagram-3NMN7TZE-ORMC2WB2.js +140 -0
  97. package/dist/web/chunks/kanban-definition-UXKFOSKX-TPRG3VMF.js +90 -0
  98. package/dist/web/chunks/katex-DLHJF5VS.js +258 -0
  99. package/dist/web/chunks/mermaid.core-ZM3JSPVU.js +19 -0
  100. package/dist/web/chunks/mindmap-definition-YA3MSWOX-BLW6WWFS.js +97 -0
  101. package/dist/web/chunks/packet-AYTQ26CC-FIXQVEDM.js +2 -0
  102. package/dist/web/chunks/pegDiagram-XKGWAZYB-BYMP3YHY.js +2 -0
  103. package/dist/web/chunks/pie-WAS4IAKB-R4EUNVPB.js +2 -0
  104. package/dist/web/chunks/pieDiagram-E7YTZNPT-XOJE3H3L.js +40 -0
  105. package/dist/web/chunks/quadrantDiagram-AXDQQJYC-23VSADTC.js +8 -0
  106. package/dist/web/chunks/radar-RG4KPBEZ-O6Y2TENX.js +2 -0
  107. package/dist/web/chunks/railroad-74A4TZTK-PHWZ7KVH.js +2 -0
  108. package/dist/web/chunks/railroad-abnf-HS5TGJTU-DZ4OSJAN.js +2 -0
  109. package/dist/web/chunks/railroad-ebnf-LZEXJU2U-GYBLRQUL.js +2 -0
  110. package/dist/web/chunks/railroad-peg-WCYAUIDC-ZK4ZOBSX.js +2 -0
  111. package/dist/web/chunks/railroadDiagram-O6MQD6OU-Z5IEAZJK.js +2 -0
  112. package/dist/web/chunks/requirementDiagram-BXWQKSXE-MNP4O73E.js +85 -0
  113. package/dist/web/chunks/sankeyDiagram-P5KCCOFB-PADI35QR.js +41 -0
  114. package/dist/web/chunks/sequenceDiagram-WJ2MYXX4-FGWOVXU4.js +163 -0
  115. package/dist/web/chunks/sizeCapture-INFHLROL-Y6H3VQLE.js +2 -0
  116. package/dist/web/chunks/stateDiagram-D77RDMKH-7PRO4WYR.js +2 -0
  117. package/dist/web/chunks/stateDiagram-v2-MP3YSRHH-2Y6SWEJW.js +2 -0
  118. package/dist/web/chunks/swimlanes-42K2YHIH-DXVTFB6Q.js +2 -0
  119. package/dist/web/chunks/swimlanesDiagram-VR7AAH4N-U2LP4OEE.js +9 -0
  120. package/dist/web/chunks/timeline-definition-24CTP7MA-7ZIALE6C.js +121 -0
  121. package/dist/web/chunks/treeView-Q6P3EWNA-VSJ7TJ36.js +2 -0
  122. package/dist/web/chunks/treemap-WGGIJYW6-JZWFGRKS.js +2 -0
  123. package/dist/web/chunks/vennDiagram-4TSXK5OY-IPXNDYWM.js +35 -0
  124. package/dist/web/chunks/wardley-WFR3VGLG-PAUUFL5N.js +2 -0
  125. package/dist/web/chunks/wardleyDiagram-VM6X3IG4-4Z2U2NNR.js +79 -0
  126. package/dist/web/chunks/xychartDiagram-S5SC5T6Z-NAEIWN4K.js +8 -0
  127. package/dist/web/index.html +24 -0
  128. package/dist/web/page.css +2 -0
  129. package/dist/web/page.js +242 -0
  130. package/package.json +64 -10
  131. package/cli.js +0 -2
@@ -0,0 +1,63 @@
1
+ import{a as ut}from"./chunk-KVRWT2YT.js";import{a as ht}from"./chunk-J7VDGOTK.js";import"./chunk-U6ILIHMR.js";import{a as yt}from"./chunk-P44J6WNO.js";import"./chunk-7PUK2GON.js";import"./chunk-NBC6B3KN.js";import"./chunk-QBOSTM7Q.js";import"./chunk-63W35XXT.js";import"./chunk-4KJ2U3VQ.js";import"./chunk-4ZUFUR3U.js";import"./chunk-6YVFH4BZ.js";import"./chunk-QKU4ZFG5.js";import"./chunk-RK4EOCHJ.js";import"./chunk-YYJ5VFH5.js";import"./chunk-SE57RN36.js";import"./chunk-XJ6FSQEO.js";import"./chunk-FKTXB6RJ.js";import"./chunk-XE4RLI22.js";import"./chunk-WL4ZMLPV.js";import{o as X}from"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{O as it,T as st,U as ct,V as lt,W as dt,X as ft,Y as mt,Z as pt,i as Q,k as rt,u as O}from"./chunk-SGL7WI35.js";import{b as E}from"./chunk-CXXG5KL5.js";import{a as r}from"./chunk-ITN3D7RJ.js";import{d as at}from"./chunk-SOAWGUAD.js";at();var gt=r(()=>({domains:new Map,transitions:[]}),"createDefaultData"),G=gt(),Mt=r(()=>G.domains,"getDomains"),zt=r(()=>G.transitions,"getTransitions"),Lt=r(t=>{if(t)for(let e of t){let n=e.domain,o=(e.items??[]).map(c=>({label:c.label}));G.domains.set(n,{name:n,items:o})}},"setDomains"),Nt=r(t=>{t&&(G.transitions=t.filter(e=>e.from===e.to?(E.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Pt=r(()=>X({...rt.cynefin,...O().cynefin}),"getConfig"),It=r(()=>{st(),G=gt()},"clear"),j={getDomains:Mt,getTransitions:zt,setDomains:Lt,setTransitions:Nt,getConfig:Pt,clear:It,setAccTitle:ct,getAccTitle:lt,setDiagramTitle:mt,getDiagramTitle:pt,getAccDescription:ft,setAccDescription:dt},Wt=r(t=>{ut(t,j),j.setDomains(t.domains),j.setTransitions(t.transitions)},"populate"),Rt={parse:r(async t=>{let e=await ht("cynefin",t);E.debug(e),Wt(e)},"parse")};function H(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}r(H,"seededRandom");function $t(t){let e=0;for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);e=(e<<5)-e+o,e|=0}return e}r($t,"hashString");function bt(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:$t(e)}r(bt,"resolveSeed");function wt(t,e,n,o){let c=t/2,m=o??t*.015,v=7,W=e/v,d=[];for(let a=0;a<=v;a++){let p=H(n+a*17)*m*2-m;d.push({x:c+p,y:a*W})}let D=`M${d[0].x},${d[0].y}`;for(let a=0;a<d.length-1;a++){let p=d[a],s=d[a+1],f=(p.y+s.y)/2,b=a%2===0?1:-1,h=m*1.5*b*H(n+a*31+7),R=p.x+h,F=f,V=s.x-h;D+=` C${R},${F} ${V},${f} ${s.x},${s.y}`}return D}r(wt,"generateFoldPath");function Ct(t,e,n,o){let c=e/2,m=o??e*.015,v=7,W=t/v,d=[];for(let a=0;a<=v;a++){let p=H(n+a*23)*m*2-m;d.push({x:a*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let a=0;a<d.length-1;a++){let p=d[a],s=d[a+1],f=(p.x+s.x)/2,b=a%2===0?1:-1,h=m*1.5*b*H(n+a*37+11),R=f,F=p.y+h,V=f,z=s.y-h;D+=` C${R},${F} ${V},${z} ${s.x},${s.y}`}return D}r(Ct,"generateHorizontalBoundary");function vt(t,e){let n=t/2,o=e*.5,c=e,m=t*.03;return[`M${n},${o}`,`C${n+m},${o+(c-o)*.2}`,`${n-m*1.5},${o+(c-o)*.55}`,`${n+m*.5},${o+(c-o)*.75}`,`C${n-m},${o+(c-o)*.85}`,`${n+m*.3},${o+(c-o)*.95}`,`${n},${c}`].join(" ")}r(vt,"generateCliffPath");function Dt(t,e,n,o){return[`M${t-n},${e}`,`A${n},${o} 0 1,1 ${t+n},${e}`,`A${n},${o} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}r(Dt,"generateConfusionPath");var xt={complex:{model:"Probe \u2192 Sense \u2192 Respond",practice:"Emergent Practices"},complicated:{model:"Sense \u2192 Analyse \u2192 Respond",practice:"Good Practices"},clear:{model:"Sense \u2192 Categorise \u2192 Respond",practice:"Best Practices"},chaotic:{model:"Act \u2192 Sense \u2192 Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Ft=r((t,e)=>{let n=t/2,o=e/2;return{complex:{cx:n/2,cy:o/2,x:0,y:0,w:n,h:o},complicated:{cx:n+n/2,cy:o/2,x:n,y:0,w:n,h:o},chaotic:{cx:n/2,cy:o+o/2,x:0,y:o,w:n,h:o},clear:{cx:n+n/2,cy:o+o/2,x:n,y:o,w:n,h:o},confusion:{cx:n,cy:o,x:n*.7,y:o*.7,w:n*.6,h:o*.6}}},"getDomainLayouts"),Vt=r(()=>{let t=Q(),e=O();return X(t,e.themeVariables).cynefin},"getCynefinDomainColors"),Z=3,_t=r((t,e,n,o)=>{let c=o.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),a=c.getConfig(),p=Vt();E.debug("Rendering Cynefin diagram");let s=a.width,f=a.height,b=a.padding,h=a.showDomainDescriptions,R=a.boundaryAmplitude,F=s+b*2,V=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=yt(e);it(k,V,F,a.useMaxWidth??!0),k.attr("viewBox",`0 0 ${F} ${V}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);let T=k.append("g").attr("transform",`translate(${b}, ${b})`),_=Ft(s,f),J=bt(a.seed,e),kt=T.append("g").attr("class","cynefin-backgrounds"),q=["complex","complicated","chaotic","clear"];for(let l of q){let i=_[l];kt.append("rect").attr("class","cynefinDomain").attr("x",i.x).attr("y",i.y).attr("width",i.w).attr("height",i.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}let U=T.append("g").attr("class","cynefin-boundaries");U.append("path").attr("class","cynefinBoundary").attr("d",wt(s,f,J,R)).attr("fill","none"),U.append("path").attr("class","cynefinBoundary").attr("d",Ct(s,f,J+100,R)).attr("fill","none"),U.append("path").attr("class","cynefinCliff").attr("d",vt(s,f)).attr("fill","none");let Tt=s*.15,At=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",Dt(s/2,f/2,Tt,At)).attr("fill",z.confusion).attr("fill-opacity",.5);let K=T.append("g").attr("class","cynefin-labels");for(let l of q){let i=_[l];K.append("text").attr("class","cynefinDomainLabel").attr("x",i.cx).attr("y",h?i.cy-30:i.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(K.append("text").attr("class","cynefinDomainLabel").attr("x",s/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){let l=T.append("g").attr("class","cynefin-subtitles");for(let i of q){let u=_[i],y=xt[i];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",s/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(xt.confusion.practice)}let tt=T.append("g").attr("class","cynefin-items"),A=26,et=10,Bt=["complex","complicated","chaotic","clear","confusion"];for(let l of Bt){let i=m.get(l);if(!i||i.items.length===0)continue;let u=_[l],y=l==="confusion",L=i.items,N=0;y&&i.items.length>Z&&(N=i.items.length-Z,L=i.items.slice(0,Z));let B;if(y){let g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{let w=B+S*(A+4),M=tt.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label),$=g.label.length*7,x=P.node();if(x&&typeof x.getBBox=="function"){let Y=x.getBBox();Y.width>0&&($=Y.width)}let C=$+et*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){let g=B+L.length*(A+4),S=`+${N} more`,w=tt.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S),P=S.length*7,$=M.node();if($&&typeof $.getBBox=="function"){let I=$.getBBox();I.width>0&&(P=I.width)}let x=P+et*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){let l=k.select("defs").empty()?k.append("defs"):k.select("defs"),i=`cynefin-arrow-${e}`;l.append("marker").attr("id",i).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");let u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{let L=_[y.from],N=_[y.to];if(!L||!N)return;if(y.from===y.to){E.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}let B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,Y=-x/C,St=$/C,nt=M+Y*I,ot=P+St*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${nt},${ot} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${i})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",nt).attr("y",ot-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&T.append("text").attr("class","cynefinTitle").attr("x",s/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Et={draw:_t},Ht=r(()=>{let t=Q(),e=O();return X(t,e.themeVariables).cynefin},"getCynefinTheme"),Gt=r(()=>{let t=Ht();return`
2
+ .cynefinDomain {
3
+ stroke: none;
4
+ }
5
+ .cynefinDomainLabel {
6
+ font-size: ${t.domainFontSize}px;
7
+ font-weight: bold;
8
+ fill: ${t.labelColor};
9
+ }
10
+ .cynefinSubtitle {
11
+ font-size: ${t.itemFontSize-1}px;
12
+ fill: ${t.textColor};
13
+ font-style: italic;
14
+ }
15
+ .cynefinItem {
16
+ fill-opacity: 0.95;
17
+ stroke: ${t.boundaryColor};
18
+ stroke-width: 1;
19
+ }
20
+ .cynefinItemText {
21
+ font-size: ${t.itemFontSize}px;
22
+ fill: ${t.textColor};
23
+ }
24
+ .cynefinItemOverflow {
25
+ fill-opacity: 0.6;
26
+ stroke: ${t.boundaryColor};
27
+ stroke-width: 1;
28
+ stroke-dasharray: 3 2;
29
+ }
30
+ .cynefinBoundary {
31
+ stroke: ${t.boundaryColor};
32
+ stroke-width: ${t.boundaryWidth};
33
+ stroke-dasharray: 6 3;
34
+ }
35
+ .cynefinCliff {
36
+ stroke: ${t.cliffColor};
37
+ stroke-width: ${t.cliffWidth};
38
+ }
39
+ .cynefinConfusion {
40
+ stroke: ${t.boundaryColor};
41
+ stroke-width: 1.5;
42
+ stroke-dasharray: 4 2;
43
+ }
44
+ .cynefinArrowLine {
45
+ stroke: ${t.arrowColor};
46
+ stroke-width: ${t.arrowWidth};
47
+ fill: none;
48
+ }
49
+ .cynefinArrowHead {
50
+ fill: ${t.arrowColor};
51
+ stroke: none;
52
+ }
53
+ .cynefinArrowLabel {
54
+ font-size: ${t.itemFontSize-1}px;
55
+ fill: ${t.textColor};
56
+ }
57
+ .cynefinTitle {
58
+ font-size: ${t.domainFontSize+2}px;
59
+ font-weight: bold;
60
+ fill: ${t.labelColor};
61
+ }
62
+ `},"styles"),Yt=Gt,Kt={parser:Rt,db:j,renderer:Et,styles:Yt};export{Kt as diagram};
63
+ //# sourceMappingURL=cynefinDiagram-5FMLGOSQ-A3E3NM6X.js.map
@@ -0,0 +1,5 @@
1
+ import{a as J}from"./chunk-CKJRXIX7.js";import{a as A,b as Y,c as E,d as D,e as _,f as x,g as H}from"./chunk-7Q4TXKAS.js";import{C as O}from"./chunk-I6RMTJPN.js";import{a as M}from"./chunk-ZXMMITLE.js";import{f as N,g as G,h as k}from"./chunk-3EZ2OKHV.js";import{a as B,c as I,e as S}from"./chunk-XOZZFIHV.js";import{b as v}from"./chunk-NOVL2262.js";import"./chunk-USZ3ZJYA.js";import"./chunk-J6N7AUC2.js";import"./chunk-NQ2XP5EN.js";import"./chunk-GPW7TXQS.js";import"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{_ as P}from"./chunk-SGL7WI35.js";import{b as p}from"./chunk-CXXG5KL5.js";import{a as m}from"./chunk-ITN3D7RJ.js";import{d as R}from"./chunk-SOAWGUAD.js";R();var T=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),z=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),K=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),Q=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],V=m((t,e,r,d,n)=>{let f=[],h=new Set;if(r.forEach(({start:s,end:o})=>{s!==d&&h.add(s),o!==d&&h.add(o)}),h.forEach(s=>{let o=t.node(s);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:s})=>{(s.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return z(n);let g=f.reduce((s,o)=>({x:s.x+o.x/f.length,y:s.y+o.y/f.length}),{x:0,y:0}),l=g.x-e.x,i=g.y-e.y;return Math.abs(l)>Math.abs(i)?l>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":z(n)},"getSelfLoopSide"),Z=m((t,e="top",r=0,d=0)=>{let n=t.x,f=t.y-r,h=t.width/2,g=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),i=T(Math.max(d,t.width*.35),36,l),s=T(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{let o=f+g;return[{x:n-i/2,y:o},{x:n-i/2,y:o+s},{x:n+i/2,y:o+s},{x:n+i/2,y:o}]}case"right":{let o=n+h;return[{x:o,y:f-i/2},{x:o+s,y:f-i/2},{x:o+s,y:f+i/2},{x:o,y:f+i/2}]}case"left":{let o=n-h;return[{x:o,y:f-i/2},{x:o-s,y:f-i/2},{x:o-s,y:f+i/2},{x:o,y:f+i/2}]}default:{let o=f-g;return[{x:n-i/2,y:o},{x:n-i/2,y:o-s},{x:n+i/2,y:o-s},{x:n+i/2,y:o}]}}},"getSelfLoopPoints"),$=m((t,e,r="top",d=0,n={})=>{let h=t.x,g=t.y-d,l=n.width??0,i=n.height??0;switch(r){case"bottom":return{x:h,y:Math.max(...e.map(s=>s.y))+i/2+4};case"right":return{x:Math.max(...e.map(s=>s.x))+l/2+4,y:g};case"left":return{x:Math.min(...e.map(s=>s.x))-l/2-4,y:g};default:return{x:h,y:Math.min(...e.map(s=>s.y))-i/2-4}}},"getSelfLoopLabelPosition"),W=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{let d=new Map,n=[],f=t.graph()?.rankdir;return t.edges().forEach(h=>{let g=t.edge(h);if(r&&g.selfLoop){let l=g.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:g,start:h.v,end:h.w})}else n.push({edge:g,start:h.v,end:h.w})}),d.forEach(h=>{if(h.length!==3){h.forEach(u=>n.push(u));return}h.sort((u,w)=>u.edge.selfLoop.order-w.edge.selfLoop.order);let[g,l,i]=h,s=g.edge.originalEdge??l.edge.originalEdge??i.edge.originalEdge??l.edge,o=t.node(s.start);if(!o){h.forEach(u=>n.push(u));return}let a={width:l.edge.width,height:l.edge.height},L=V(t,o,h,s.start,f),b=Z(o,L,e,a.width??0),y=$(o,b,L,e,a),c={...l.edge,...s,id:s.id,points:b,start:s.start,end:s.end,x:y.x,y:y.y,width:a.width,height:a.height,labelStyle:l.edge.labelStyle,fromCluster:g.edge.fromCluster??l.edge.fromCluster??i.edge.fromCluster,toCluster:g.edge.toCluster??l.edge.toCluster??i.edge.toCluster};delete c.selfLoop,delete c.originalEdge,n.push({edge:c,start:c.start,end:c.end})}),n},"getEdgesToRender"),j=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:n,siteConfig:f})=>{let h=e.graph().rankdir;p.trace("Dir in recursive render - dir:",h);let{clusters:g,edgePaths:l,edgeLabels:i,nodes:s,rootGroups:o}=A(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));let a=K(r);await Promise.all(e.nodes().map(async function(y){let c=e.node(y);if(n!==void 0){let u=JSON.parse(JSON.stringify(n.clusterData));p.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,y,`
3
+ data=`,u.height,`
4
+ Parent cluster`,n.height),e.setNode(n.id,u),e.parent(y)||(p.trace("Setting parent",y,n.id),e.setParent(y,n.id,u))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),c?.clusterNode){p.info("Cluster identified XBX",y,c.width,e.node(y));let{ranksep:u,nodesep:w}=e.graph();c.graph.setGraph({...c.graph.graph(),ranksep:u+25,nodesep:w});let X=await ne({element:s,graph:c.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),C=X.elem;v(c,C),c.diff=X.diff||0,p.info("New compound node after recursive render XAX",y,"width",c.width,"height",c.height),I(C,c)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,c.id,c,c.width,"Graph:",e),p.trace(D(c.id,e)),E.set(c.id,{id:D(c.id,e),node:c})):(p.trace("Node - the non recursive path XAX",y,s,e.node(y),h),await Y(s,e.node(y),{config:f,dir:h}))})),await m(async()=>{let y=e.edges().map(async function(c){let u=e.edge(c.v,c.w,c.name);if(p.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),p.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(e.edge(c))),p.info("Fix",E,"ids:",c.v,c.w,"Translating: ",E.get(c.v),E.get(c.w)),a&&u.selfLoop){if(u.selfLoop.order!==1)return;let w={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:u.originalEdge?.startLabelLeft??u.startLabelLeft,startLabelRight:u.originalEdge?.startLabelRight??u.startLabelRight,endLabelLeft:u.originalEdge?.endLabelLeft??u.endLabelLeft,endLabelRight:u.originalEdge?.endLabelRight??u.endLabelRight};await N(i,w),u.width=w.width,u.height=w.height,u.labelStyle=w.labelStyle;return}await N(i,u)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:b}=B(f);return{elem:o,graph:e,groups:{clusters:g,edgePaths:l,edgeLabels:i,nodes:s,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:a,subGraphTitleTotalMargin:b}},"measureDagreGraph"),q=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),J(t)},"runDagreGraphLayout"),ee=m((t,e,r)=>{let d=t.node(e);if(!d)return;let n={...d};return d?.clusterNode?n.y=(d.y??0)+r:t.children(e).length>0?n.height=(d.height??0)+r:n.y=(d.y??0)+r/2,n},"normalizeDagreNode"),F=m((t,e)=>{Q.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),te=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(n=>({...n,y:typeof n.y=="number"?n.y+d:n.y}))}),"normalizeDagreEdge"),re=m((t,e)=>{let{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:n=0}=e,f=new Map(t.nodes.map(g=>[g.id,g]));x(r).forEach(g=>{let l=ee(r,g,n);if(!l)return;F(r.node(g),l);let i=f.get(g);i&&F(i,l)});let h=n/2;return t.edges=W(r,h,{mergeSelfLoops:d}).map(({edge:g,start:l,end:i})=>te(g,l,i,h)),t},"applyDagreLayoutResult"),oe=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:n,id:f,mergeSelfLoops:h,subGraphTitleTotalMargin:g})=>{let l=0;await Promise.all(x(e).map(async function(o){let a=e.node(o);if(p.info("Position XBX => "+o+": ("+a.x,","+a.y,") width: ",a.width," height: ",a.height),a?.clusterNode)a.y+=g,p.info("A tainted cluster node XBX1",o,a.id,a.width,a.height,a.x,a.y,e.parent(o)),E.get(a.id).node=a,S(a);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,a.id,a.x,a.y,a.width,a.height,e.parent(o)),a.height+=g,e.node(a.parentId);let L=a?.padding/2||0,b=a?.labelBBox?.height||0,y=b-L||0;p.debug("OffsetY",y,"labelHeight",b,"halfPadding",L),await M(r,a),E.get(a.id).node=a}else{let L=e.node(a.parentId);a.y+=g/2,p.info("A regular node XBX1 - using the padding",a.id,"parent",a.parentId,a.width,a.height,a.x,a.y,"offsetY",a.offsetY,"parent",L,L?.offsetY,a),S(a)}}));let i=g/2;return W(e,i,{mergeSelfLoops:h}).forEach(function({edge:o,start:a,end:L}){p.info("Edge "+a+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(u=>u.y+=i);let b=e.node(a),y=e.node(L),c=k(d,o,E,n,b,y,f);G(o,c)}),e.nodes().forEach(function(o){let a=e.node(o);p.info(o,a.type,a.diff),a.isGroup&&(l=a.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),ne=m(async t=>{let e=await j(t);return q(e.graph),await oe(e)},"renderDagreSubgraph"),U=m(t=>{let e=new O({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){let d=r.start,n=d+"---"+d+"---1",f=d+"---"+d+"---2",h=e.node(d);e.setNode(n,{domId:n,id:n,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(n,h.parentId),e.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,h.parentId);let g=structuredClone(r),l=structuredClone(r),i=structuredClone(r),s=structuredClone(r);l.originalEdge=g,l.selfLoop={id:g.id,order:0},i.originalEdge=g,i.selfLoop={id:g.id,order:1},s.originalEdge=g,s.selfLoop={id:g.id,order:2},l.label="",l.arrowTypeEnd="none",l.endLabelLeft="",l.endLabelRight="",l.startLabelLeft="",l.id=d+"-cyclic-special-1",i.startLabelRight="",i.startLabelLeft="",i.endLabelLeft="",i.endLabelRight="",i.arrowTypeStart="none",i.arrowTypeEnd="none",i.id=d+"-cyclic-special-mid",s.label="",s.startLabelRight="",s.startLabelLeft="",s.arrowTypeStart="none",h.isGroup&&(l.fromCluster=d,s.toCluster=d),s.id=d+"-cyclic-special-2",s.arrowTypeStart="none",e.setEdge(d,n,l,d+"-cyclic-special-0"),e.setEdge(n,f,i,d+"-cyclic-special-1"),e.setEdge(f,d,s,d+"-cyclic-special-2")}else e.setEdge(r.start,r.end,{...r},r.id)}),_(e),{graph:e}},"prepareLayoutForDagre"),ae=m(async(t,{element:e,preparedLayout:r})=>{let d=r??U(t),n=P(),f=await j({element:e,graph:d.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:n});return d.measuredLayout=f,f},"measureDagreLayout"),ie=m((t,e)=>{let r=e.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return q(r.graph),re(t,r),r},"runDagreLayoutCore"),se=m((t,{measure:e})=>x(e.graph).map(r=>e.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),de=m((t,e,{measure:r})=>t?r.graph.node(t):void 0,"getDagreEdgeNode"),Ne=H({prepareLayout:U,measureLayout:ae,runLayoutCore:ie,paintOptions:{clusterDb:E,getNodes:se,getEdgeNode:de,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{re as applyDagreLayoutResult,W as getEdgesToRender,ae as measureDagreLayout,U as prepareLayoutForDagre,Ne as render,ie as runDagreLayoutCore};
5
+ //# sourceMappingURL=dagre-GXQ25YYZ-WKL3XLC6.js.map
@@ -0,0 +1,31 @@
1
+ import{a as O}from"./chunk-EFBAEJZJ.js";import{a as G}from"./chunk-KVRWT2YT.js";import{a as Y}from"./chunk-J7VDGOTK.js";import"./chunk-U6ILIHMR.js";import{a as W}from"./chunk-P44J6WNO.js";import"./chunk-7PUK2GON.js";import"./chunk-NBC6B3KN.js";import"./chunk-QBOSTM7Q.js";import"./chunk-63W35XXT.js";import"./chunk-4KJ2U3VQ.js";import"./chunk-4ZUFUR3U.js";import"./chunk-6YVFH4BZ.js";import"./chunk-QKU4ZFG5.js";import"./chunk-RK4EOCHJ.js";import"./chunk-YYJ5VFH5.js";import"./chunk-SE57RN36.js";import"./chunk-XJ6FSQEO.js";import"./chunk-FKTXB6RJ.js";import"./chunk-XE4RLI22.js";import"./chunk-WL4ZMLPV.js";import{b as X,d as z}from"./chunk-GPW7TXQS.js";import{o as y}from"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{H as A,O as E,T as L,U as D,V as _,W as M,X as S,Y as R,Z as H,k as N,u as I}from"./chunk-SGL7WI35.js";import{b as C}from"./chunk-CXXG5KL5.js";import{a as f}from"./chunk-ITN3D7RJ.js";import{d as k}from"./chunk-SOAWGUAD.js";k();var U=/[─━│┃└┗├┣]/,j=/[└┗├┣]/,ne=/[─━]/,P=/^[\s│┃]+$/,F=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Z=/^\s*%%/,ie=" ";function J(r){return r.some(t=>U.test(t))}f(J,"isBoxDrawingFormat");function K(r){for(let t of r){let e=j.exec(t);if(e?.index&&e.index>0)return e.index}return 4}f(K,"inferSegmentWidth");function Q(r,t){return r.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let s=parseInt(n,10),i=t.get(s);return i?`line ${i}`:e})}f(Q,"remapErrorLines");function ee(r){let t=r.split(`
2
+ `),e=new Map,n=-1;for(let[p,c]of t.entries())if(c.trim()==="treeView-beta"){n=p;break}if(n===-1)return{text:r,lineMap:e};let s=[];for(let p=n+1;p<t.length;p++){let c=t[p];c.trim()===""||Z.test(c)||F.test(c)||P.test(c)||s.push(c.replace(/\t/g," "))}if(!J(s))return{text:r,lineMap:e};let i=K(s),o=[],a=0;for(let p=0;p<=n;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=n+1;p<t.length;p++){let c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if(Z.test(c)){o.push(c),a++,e.set(a,h);continue}if(F.test(c)){o.push(c),a++,e.set(a,h);continue}if(P.test(c))continue;let l=c.replace(/\t/g," "),m=j.exec(l);if(m?.index!==void 0){let g=m.index,w=Math.round(g/i)+1,u=g+1;for(;u<l.length&&ne.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;let v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let re=ie.repeat(w);o.push(re+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(U.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
3
+ `),lineMap:e}}f(ee,"preprocessBoxDrawing");var x=new O(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),L()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=N.treeView,le=f(()=>y(ce,I().treeView),"getConfig"),de=f((r,t,e,n,s,i)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();let o={id:x.records.cnt++,level:r,name:t,nodeType:e,icon:s,cssClass:n,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:_,getAccDescription:S,getDiagramTitle:H,setAccDescription:M,setAccTitle:D,setDiagramTitle:R},B=he,pe=f(r=>{G(r,B);for(let t of r.nodes){let e=typeof t.indent=="number"?t.indent:0,n=t.name,s=n.endsWith("/");s&&(n=n.slice(0,-1));let i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?A(c,I()):void 0;B.addNode(e,n,i,o,p,d)}},"populate"),fe={parse:f(async r=>{let{text:t,lineMap:e}=ee(r);try{let n=await Y("treeView",t);C.debug(n),pe(n)}catch(n){throw e.size>0&&n instanceof Error&&(n.message=Q(n.message,e)),n}},"parse")},b={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 te(r,t){let e=t?.filenameIcons?.[r];if(e)return e;let n=r.lastIndexOf(".");if(n>0){let s=r.substring(n).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}f(te,"detectIcon");function T(r,t){return r.includes(":")?r:r in b.icons||!t?`${b.prefix}:${r}`:`${t}:${r}`}f(T,"qualifyIcon");function $(r,t){if(r.icon!=="none"){if(r.icon)return T(r.icon,t.defaultIconPack);if(t.showIcons){if(r.nodeType==="file"){let e=te(r.name,t);if(e==="none")return;if(e)return T(e,t.defaultIconPack)}return`${b.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}f($,"getNodeIcon");X([{name:b.prefix,icons:b}]);var V=14,ge=4,ue=16,me=f(async(r,t)=>{let e=[],n=f(i=>{let o=$(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(n)},"collect");n(r);let s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await z(i,{height:V,width:V})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=f((r,t,e,n,s,i)=>{let o=n.append("g"),a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);let p=V+ge,c=$(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${r+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");let h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:m}=h.node().getBBox(),g=l+s.paddingY*2,w=r+s.paddingX+(d?p:0);h.attr("x",w),h.attr("y",t+g/2);let u=w+m,v=m+s.paddingX*2+(d?p:0);return e.BBox={x:r,y:t,width:v,height:g},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",r).attr("y",t+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+g/2}},"positionLabel"),q=f((r,t,e,n,s,i)=>r.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),xe=f((r,t,e,n)=>{let s=0,i=0,o=[],a=f((d,h,l,m)=>{let g=m*(l.rowIndent+l.paddingX),w=we(g,s,h,d,l,n);o.push(w);let{height:u,width:v}=h.BBox;q(d,g-l.rowIndent,s+u/2,g,s+u/2,l.lineThickness),i=Math.max(i,g+v),s+=u},"drawNode"),p=f((d,h=0)=>{a(r,d,e,h),d.children.forEach(w=>{p(w,h+1)});let{x:l,y:m,height:g}=d.BBox;if(d.children.length){let{y:w,height:u}=d.children[d.children.length-1].BBox;q(r,l+e.paddingX,m+g,l+e.paddingX,w+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);let c=o.filter(d=>d.node.description);if(c.length>0){let h=Math.max(...o.map(l=>l.labelRightEdge))+ue;for(let l of c){let g=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+g.width+e.paddingX)}}for(let d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){let h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){let l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),ve=f(async(r,t,e,n)=>{C.debug(`Rendering treeView diagram
4
+ `+r);let s=n.db,i=s.getRoot(),o=s.getConfig(),a=W(t),p=a.append("g");p.attr("class","tree-view");let c=await me(i,o),{totalHeight:d,totalWidth:h}=xe(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),E(a,d,h,o.useMaxWidth)},"draw"),be={draw:ve},Ce=be,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:r})=>{let{labelFontSize:t,labelColor:e,lineColor:n,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=y(Ie,r);return`
5
+ .treeView-node-label {
6
+ font-size: ${t};
7
+ fill: ${e};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${n};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${s};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${t};
21
+ fill: ${i};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${o};
27
+ stroke: ${a};
28
+ stroke-width: 1;
29
+ }
30
+ `},"styles"),Be=ye,Me={db:B,renderer:Ce,parser:fe,styles:Be};export{Me as diagram};
31
+ //# sourceMappingURL=diagram-S7CK7UJ4-AENTNBTM.js.map
@@ -0,0 +1,42 @@
1
+ import{a as D}from"./chunk-KVRWT2YT.js";import{a as P}from"./chunk-J7VDGOTK.js";import"./chunk-U6ILIHMR.js";import{a as F}from"./chunk-P44J6WNO.js";import"./chunk-7PUK2GON.js";import"./chunk-NBC6B3KN.js";import"./chunk-QBOSTM7Q.js";import"./chunk-63W35XXT.js";import"./chunk-4KJ2U3VQ.js";import"./chunk-4ZUFUR3U.js";import"./chunk-6YVFH4BZ.js";import"./chunk-QKU4ZFG5.js";import"./chunk-RK4EOCHJ.js";import"./chunk-YYJ5VFH5.js";import"./chunk-SE57RN36.js";import"./chunk-XJ6FSQEO.js";import"./chunk-FKTXB6RJ.js";import"./chunk-XE4RLI22.js";import"./chunk-WL4ZMLPV.js";import{o as y}from"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{O as T,T as S,U as k,V as O,W as R,X as I,Y as _,Z as E,i as M,k as L,u as b}from"./chunk-SGL7WI35.js";import{b as C}from"./chunk-CXXG5KL5.js";import{a as i}from"./chunk-ITN3D7RJ.js";import{d as A}from"./chunk-SOAWGUAD.js";A();var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w=32,z={axes:[],curves:[],options:x},g=structuredClone(z),X=L.radar,K=i(()=>y({...X,...b().radar}),"getConfig"),G=i(()=>g.axes,"getAxes"),N=i(()=>g.curves,"getCurves"),Y=i(()=>g.options,"getOptions"),Z=i(a=>{g.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),q=i(a=>{g.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:J(t.entries)}))},"setCurves"),J=i(a=>{if(a[0].axis==null)return a.map(e=>e.value);let t=G();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{let r=a.find(n=>n.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Q=i(a=>{let t=a.reduce((e,r)=>(e[r.name]=r,e),{});g.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},g.options.ticks>w&&(C.warn(`Radar diagram ticks (${g.options.ticks}) exceeds maximum allowed (${w}). Using ${w} instead.`),g.options.ticks=w)},"setOptions"),tt=i(()=>{S(),g=structuredClone(z)},"clear"),$={getAxes:G,getCurves:N,getOptions:Y,setAxes:Z,setCurves:q,setOptions:Q,getConfig:K,clear:tt,setAccTitle:k,getAccTitle:O,setDiagramTitle:_,getDiagramTitle:E,getAccDescription:I,setAccDescription:R},et=i(a=>{D(a,$);let{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),at={parse:i(async a=>{let t=await P("radar",a);C.debug(t),et(t)},"parse")},rt=i((a,t,e,r)=>{let n=r.db,l=n.getAxes(),c=n.getCurves(),s=n.getOptions(),o=n.getConfig(),d=n.getDiagramTitle(),p=F(t),u=nt(p,o),m=s.max??Math.max(...c.map(f=>Math.max(...f.entries))),h=s.min,v=Math.min(o.width,o.height)/2;st(u,l,v,s.ticks,s.graticule),ot(u,l,v,o),B(u,l,c,h,m,s.graticule,o),H(u,c,s.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),nt=i((a,t)=>{let e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,n={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return T(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${n.x}, ${n.y})`)},"drawFrame"),st=i((a,t,e,r,n)=>{if(n==="circle")for(let l=0;l<r;l++){let c=e*(l+1)/r;a.append("circle").attr("r",c).attr("class","radarGraticule")}else if(n==="polygon"){let l=t.length;for(let c=0;c<r;c++){let s=e*(c+1)/r,o=t.map((d,p)=>{let u=2*p*Math.PI/l-Math.PI/2,m=s*Math.cos(u),h=s*Math.sin(u);return`${m},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),ot=i((a,t,e,r)=>{let n=t.length;for(let l=0;l<n;l++){let c=t[l].label,s=2*l*Math.PI/n-Math.PI/2,o=Math.cos(s),d=Math.sin(s);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");let p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",m=4;a.append("text").text(c).attr("x",e*r.axisLabelFactor*o+m*o).attr("y",e*r.axisLabelFactor*d+m*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function B(a,t,e,r,n,l,c){let s=t.length,o=Math.min(c.width,c.height)/2;e.forEach((d,p)=>{if(d.entries.length!==s)return;let u=d.entries.map((m,h)=>{let v=2*Math.PI*h/s-Math.PI/2,f=W(m,r,n,o),j=f*Math.cos(v),U=f*Math.sin(v);return{x:j,y:U}});l==="circle"?a.append("path").attr("d",V(u,c.curveTension)).attr("class",`radarCurve-${p}`):l==="polygon"&&a.append("polygon").attr("points",u.map(m=>`${m.x},${m.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}i(B,"drawCurves");function W(a,t,e,r){let n=Math.min(Math.max(a,t),e);return r*(n-t)/(e-t)}i(W,"relativeRadius");function V(a,t){let e=a.length,r=`M${a[0].x},${a[0].y}`;for(let n=0;n<e;n++){let l=a[(n-1+e)%e],c=a[n],s=a[(n+1)%e],o=a[(n+2)%e],d={x:c.x+(s.x-l.x)*t,y:c.y+(s.y-l.y)*t},p={x:s.x-(o.x-c.x)*t,y:s.y-(o.y-c.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${s.x},${s.y}`}return`${r} Z`}i(V,"closedRoundCurve");function H(a,t,e,r){if(!e)return;let n=(r.width/2+r.marginRight)*3/4,l=-(r.height/2+r.marginTop)*3/4,c=20;t.forEach((s,o)=>{let d=a.append("g").attr("transform",`translate(${n}, ${l+o*c})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}i(H,"drawLegend");var it={draw:rt},lt=i((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){let n=a[`cScale${r}`];e+=`
2
+ .radarCurve-${r} {
3
+ color: ${n};
4
+ fill: ${n};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${n};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${n};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${n};
13
+ }
14
+ `}return e},"genIndexStyles"),ct=i(a=>{let t=M(),e=b(),r=y(t,e.themeVariables),n=y(r.radar,a);return{themeVariables:r,radarOptions:n}},"buildRadarStyleOptions"),dt=i(({radar:a}={})=>{let{themeVariables:t,radarOptions:e}=ct(a);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: ${e.axisColor};
23
+ stroke-width: ${e.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ font-size: ${e.axisLabelFontSize}px;
27
+ color: ${e.axisColor};
28
+ }
29
+ .radarGraticule {
30
+ fill: ${e.graticuleColor};
31
+ fill-opacity: ${e.graticuleOpacity};
32
+ stroke: ${e.graticuleColor};
33
+ stroke-width: ${e.graticuleStrokeWidth};
34
+ }
35
+ .radarLegendText {
36
+ text-anchor: start;
37
+ font-size: ${e.legendFontSize}px;
38
+ dominant-baseline: hanging;
39
+ }
40
+ ${lt(t,e)}
41
+ `},"styles"),ft={parser:at,db:$,renderer:it,styles:dt};export{ft as diagram};
42
+ //# sourceMappingURL=diagram-UQ7AKVKN-BN6IVDBP.js.map
@@ -0,0 +1,4 @@
1
+ import{a as X}from"./chunk-KVRWT2YT.js";import{a as Y}from"./chunk-J7VDGOTK.js";import"./chunk-U6ILIHMR.js";import"./chunk-7PUK2GON.js";import"./chunk-NBC6B3KN.js";import"./chunk-QBOSTM7Q.js";import"./chunk-63W35XXT.js";import"./chunk-4KJ2U3VQ.js";import"./chunk-4ZUFUR3U.js";import"./chunk-6YVFH4BZ.js";import"./chunk-QKU4ZFG5.js";import"./chunk-RK4EOCHJ.js";import"./chunk-YYJ5VFH5.js";import"./chunk-SE57RN36.js";import"./chunk-XJ6FSQEO.js";import"./chunk-FKTXB6RJ.js";import"./chunk-XE4RLI22.js";import{f as j}from"./chunk-WL4ZMLPV.js";import{i as w,l as L,o as V}from"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{H as v,T as N,U as C,V as O,W as I,X as W,Y as H,Z as U,_ as M,ca as _,k as D,u as b}from"./chunk-SGL7WI35.js";import{b as f,h as G}from"./chunk-CXXG5KL5.js";import{a as o}from"./chunk-ITN3D7RJ.js";import{d as $}from"./chunk-SOAWGUAD.js";$();var z="position frame",K="frame positioned",k="position relation",q="relation positioned",ye=o(function(e){f.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){J(),N()},"clear");function J(){E={}}o(J,"reset");var Me=D.eventmodeling,ke=o(()=>V({...Me,...b().eventmodeling}),"getConfig"),E={};function Q(){let e=Fe,{ast:n}=E,t=A();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,r)=>{let a=ae(i,n.dataEntities,t);e=P(e,{$kind:z,index:r,frame:i,textProps:a});let d;me(i)?(f.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=P(e,{$kind:k,index:r,frame:i,sourceFrame:l})})):e=P(e,{$kind:k,index:r,frame:i})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}o(Q,"getState");function Z(e){E.ast=e}o(Z,"setAst");var s={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 A(){return s}o(A,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function ee(e){let n=e.split(".");if(n.length===2)return n[0]}o(ee,"extractNamespace");function te(e){let n=e.split(".");return n.length===2?n[1]:e}o(te,"extractName");function ne(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(ne,"findSwimlaneByNamespace");function y(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{let r=Number.parseInt(i);return r>n&&r<t}).map(i=>Number.parseInt(i)))+1}o(y,"findNextAvailableIndex");function ie(e,n){let t=ee(e.entityIdentifier),i=ne(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:y(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:y(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:y(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(ie,"calculateSwimlaneProps");function re(e){let{themeVariables:n}=b();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(re,"calculateEntityVisualProps");function ae(e,n,t){let i=b(),r=v(te(e.entityIdentifier)??"",i),a,d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},c=`<b>${w(r,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(a=e.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=v(a,i),a=w(a,t.textMaxWidth,d),a=a.replaceAll(" ","&nbsp;")),e.dataReference){let p=n.find(S=>S.name===e.dataReference?.$refText);p&&(a=p.dataBlockValue,a=a.substring(a.indexOf(`{
2
+ `)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=v(a,i),a=w(a,t.textMaxWidth,d),a=a.replaceAll(" ","&nbsp;"),a+="<br/>")}let m=a!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${a}</code>`);let x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=L(c,x),h=m?u.width/3:u.width,g={content:c,width:h,height:u.height};return f.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}o(ae,"calculateTextProps");function oe(e,n){let t=n,i=re(t.frame),r={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:K,frame:t.frame,index:t.index,visual:i,dimension:r,textProps:t.textProps}]}o(oe,"decidePositionFrame");function se(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(se,"calculateX");function de(e,n){let t=[...e.map(i=>i.r),n];return Math.max(...t)}o(de,"calculateMaxRight");function R(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(R,"sortedSwimlanesArray");function le(e,n){let t=n,i=ie(t.frame,e.swimlanes),r;i.index in e.swimlanes?r=e.swimlanes[i.index]:r={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=se(r,d,a),m=c+l.width+s.boxPadding,x=de(Object.values(e.swimlanes),m);r.r=c+l.width,r.maxHeight=Math.max(r.maxHeight,l.height),r.height=Math.max(s.swimlaneMinHeight,r.maxHeight)+2*s.swimlanePadding;let u={x:c,y:s.swimlanePadding+r.y,r:m,dimension:l,leftSibling:!1,swimlane:r,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${r.index}`]:r},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},g=R(h.swimlanes);g.length>0&&(g[0].y=0);for(let p=1;p<g.length;p++){let S=g[p],T=g[p-1];S.y=T.y+T.height+s.swimlaneGap}return h}o(le,"evolveFramePositioned");function ce(e,n){return e===0&&n.sourceFrames.length===0}o(ce,"isFirstFrame");function me(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(me,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function ue(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){let r=e[i];if(r.swimlane.index!==n)return r}}o(ue,"findBoxByLineIndex");function xe(e,n){let t=n;if(j(t.frame)||ce(t.index,t.frame))return[];let i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let r;return t.sourceFrame?r=F(e.boxes,t.sourceFrame):r=ue(e.boxes,i.swimlane.index,t.index-1),r===void 0?[]:[{$kind:q,frame:t.frame,index:t.index,sourceBox:r,targetBox:i}]}o(xe,"decidePositionRelation");function fe(e,n){let t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(fe,"evolveRelationPositioned");var Be={[z]:oe,[k]:xe},Ee={[K]:le,[q]:fe};function ge(e,n){let t=Be[n.$kind];if(t==null)return[];let i=t(e,n);return f.debug("decided events",i),i}o(ge,"decide");function he(e,n){let t=n.reduce((i,r)=>{let a=Ee[r.$kind];return a==null?i:a(i,r)},e);return f.debug("evolve events",{state:e,newState:t,events:n}),t}o(he,"evolve");function P(e,n){let t=ge(e,n);return he(e,t)}o(P,"dispatch");var B={getConfig:ke,setOptions:ye,getOptions:Pe,clear:Se,setAccTitle:C,getAccTitle:O,getAccDescription:W,setAccDescription:I,setDiagramTitle:H,getDiagramTitle:U,setAst:Z,getDiagramProps:A,getState:Q},Ae={parse:o(async e=>{let n=await Y("eventmodeling",e);f.debug(n),B.setAst(n),X(n,B)},"parse")},Re=M(),Te=Re?.eventmodeling;function pe(e,n){return t=>{let i=t.swimlane.y+n.swimlanePadding,r=e.append("g").attr("class","em-box");r.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),r.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.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(t.text)}}o(pe,"renderD3Box");function be(e,n){return e>n}o(be,"dirUpwards");function ve(e,n,t,i){return r=>{let a=r.sourceBox.swimlane.y+n.swimlanePadding,d=r.targetBox.swimlane.y+n.swimlanePadding,l=be(a,d),c=r.sourceBox.x+r.sourceBox.dimension.width*2/3,m=r.targetBox.x+r.targetBox.dimension.width/3,x,u;f.debug(`rendering relation up=${l} for `,{sourceBox:r.sourceBox,targetBox:r.targetBox}),l?(x=a,u=d+r.targetBox.dimension.height):(x=a+r.sourceBox.dimension.height,u=d);let h=i.emRelationStroke??r.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",r.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ve,"renderD3Relation");function we(e,n,t,i){return r=>{let a=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",r.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",r.height).attr("fill",d).attr("stroke",l),a.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",r.y+30).text(r.label)}}o(we,"renderD3Swimlane");var $e=o(function(e,n,t,i){if(f.debug("in eventmodeling renderer",e+`
3
+ `,"id:",n,t),!Te)throw new Error("EventModeling config not found");let r=i.db,{themeVariables:a,eventmodeling:d}=M(),l=G(`[id="${n}"]`),c=r.getDiagramProps(),m=r.getState(),x=`em-arrowhead-${n}`,u=a.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(we(l,m.maxR,c,a)),m.boxes.forEach(pe(l,c)),m.relations.forEach(ve(l,c,x,a)),l.append("defs").append("marker").attr("id",x).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",u),_(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),De={draw:$e},Ne=o(e=>"","getStyles"),Ce=Ne,Xe={parser:Ae,db:B,renderer:De,styles:Ce};export{Xe as diagram};
4
+ //# sourceMappingURL=diagram-VSXAHHWV-X7IW7FU6.js.map
@@ -0,0 +1,25 @@
1
+ import{a as ye}from"./chunk-KVRWT2YT.js";import{a as ge}from"./chunk-J7VDGOTK.js";import"./chunk-U6ILIHMR.js";import{a as me}from"./chunk-P44J6WNO.js";import"./chunk-7PUK2GON.js";import"./chunk-NBC6B3KN.js";import"./chunk-QBOSTM7Q.js";import"./chunk-63W35XXT.js";import"./chunk-4KJ2U3VQ.js";import"./chunk-4ZUFUR3U.js";import"./chunk-6YVFH4BZ.js";import"./chunk-QKU4ZFG5.js";import"./chunk-RK4EOCHJ.js";import"./chunk-YYJ5VFH5.js";import"./chunk-SE57RN36.js";import"./chunk-XJ6FSQEO.js";import"./chunk-FKTXB6RJ.js";import"./chunk-XE4RLI22.js";import"./chunk-WL4ZMLPV.js";import{a as ue}from"./chunk-IKC3ZQV7.js";import{c as fe,d as $}from"./chunk-J6N7AUC2.js";import{o as I}from"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{O as le,T as se,U as re,V as ne,W as oe,X as ie,Y as ce,Z as pe,i as te,k as ae,u as R}from"./chunk-SGL7WI35.js";import{b as H,h as V,j as N,k as de,l as he,m as B}from"./chunk-CXXG5KL5.js";import{a as h}from"./chunk-ITN3D7RJ.js";import{d as ee}from"./chunk-SOAWGUAD.js";ee();var Se=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=re,this.getAccTitle=ne,this.setDiagramTitle=ce,this.getDiagramTitle=pe,this.getAccDescription=ie,this.setAccDescription=oe}static{h(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let r=ae,s=R();return I({...r.treemap,...s.treemap??{}})}addNode(r,s){this.nodes.push(r),this.levels.set(r,s),s===0&&(this.outerNodes.push(r),this.root??=r)}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,s){let i=this.classes.get(r)??{id:r,styles:[],textStyles:[]},c=s.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");c&&c.forEach(l=>{fe(l)&&(i?.textStyles?i.textStyles.push(l):i.textStyles=[l]),i?.styles?i.styles.push(l):i.styles=[l]}),this.classes.set(r,i)}getClasses(){return this.classes}getStylesForClass(r){return this.classes.get(r)?.styles??[]}clear(){se(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function xe(r){if(!r.length)return[];let s=[],i=[];return r.forEach(c=>{let l={name:c.name,children:c.type==="Leaf"?void 0:[]};for(l.classSelector=c?.classSelector,c?.cssCompiledStyles&&(l.cssCompiledStyles=c.cssCompiledStyles),c.type==="Leaf"&&c.value!==void 0&&(l.value=c.value);i.length>0&&i[i.length-1].level>=c.level;)i.pop();if(i.length===0)s.push(l);else{let n=i[i.length-1].node;n.children?n.children.push(l):n.children=[l]}c.type!=="Leaf"&&i.push({node:l,level:c.level})}),s}h(xe,"buildHierarchy");var Ne=h((r,s)=>{ye(r,s);let i=[];for(let n of r.TreemapRows??[])n.$type==="ClassDefStatement"&&s.addClass(n.className??"",n.styleText??"");for(let n of r.TreemapRows??[]){let d=n.item;if(!d)continue;let m=n.indent?parseInt(n.indent):0,k=ze(d),a=d.classSelector?s.getStylesForClass(d.classSelector):[],A=a.length>0?a:void 0,b={level:m,name:k,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:A};i.push(b)}let c=xe(i),l=h((n,d)=>{for(let m of n)s.addNode(m,d),m.children&&m.children.length>0&&l(m.children,d+1)},"addNodesRecursively");l(c,0)},"populate"),ze=h(r=>r.name?String(r.name):"","getItemName"),be={parser:{yy:void 0},parse:h(async r=>{try{let i=await ge("treemap",r);H.debug("Treemap AST:",i);let c=be.parser?.yy;if(!(c instanceof Se))throw new 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.");Ne(i,c)}catch(s){throw H.error("Error parsing treemap:",s),s}},"parse")},Ae=10,z=10,M=25,Pe=h((r,s,i,c)=>{let l=c.db,n=l.getConfig(),d=n.padding??Ae,m=l.getDiagramTitle(),k=l.getRoot(),{themeVariables:a}=R();if(!k)return;let A=m?30:0,b=me(s),Y=n.nodeWidth?n.nodeWidth*z:960,j=n.nodeHeight?n.nodeHeight*z:500,O=Y,U=j+A;b.attr("viewBox",`0 0 ${O} ${U}`),le(b,U,O,n.useMaxWidth);let v;try{let e=n.valueFormat||",";if(e==="$0,0")v=h(t=>"$"+N(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),o=t?t[0]:"";v=h(f=>"$"+N(","+o)(f),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);v=h(o=>"$"+N(t||"")(o),"valueFormat")}else v=N(e)}catch(e){H.error("Error creating format function:",e),v=N(",")}let P=B().range(["transparent",a.cScale0,a.cScale1,a.cScale2,a.cScale3,a.cScale4,a.cScale5,a.cScale6,a.cScale7,a.cScale8,a.cScale9,a.cScale10,a.cScale11]),ve=B().range(["transparent",a.cScalePeer0,a.cScalePeer1,a.cScalePeer2,a.cScalePeer3,a.cScalePeer4,a.cScalePeer5,a.cScalePeer6,a.cScalePeer7,a.cScalePeer8,a.cScalePeer9,a.cScalePeer10,a.cScalePeer11]),W=B().range([a.cScaleLabel0,a.cScaleLabel1,a.cScaleLabel2,a.cScaleLabel3,a.cScaleLabel4,a.cScaleLabel5,a.cScaleLabel6,a.cScaleLabel7,a.cScaleLabel8,a.cScaleLabel9,a.cScaleLabel10,a.cScaleLabel11]);m&&b.append("text").attr("x",O/2).attr("y",A/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(m);let q=b.append("g").attr("transform",`translate(0, ${A})`).attr("class","treemapContainer"),Ce=de(k).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),J=he().size([Y,j]).paddingTop(e=>e.children&&e.children.length>0?M+z:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?z:0).paddingRight(e=>e.children&&e.children.length>0?z:0).paddingBottom(e=>e.children&&e.children.length>0?z:0).round(!0)(Ce),we=J.descendants().filter(e=>e.children&&e.children.length>0),D=q.selectAll(".treemapSection").data(we).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",M).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),D.append("clipPath").attr("id",(e,t)=>`clip-section-${s}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",M),D.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=>P(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>ve(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=$({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",M/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-${s}-${t})`).attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=V(this),o=e.data.name;t.text(o);let f=e.x1-e.x0,y=6,u;n.showValues!==!1&&e.value?u=f-10-30-10-y:u=f-y-6;let p=Math.max(15,u),w=t.node();if(w.getComputedTextLength()>p){let T=o;for(;T.length>0;){if(T=o.substring(0,T.length-1),T.length===0){t.text("..."),w.getComputedTextLength()>p&&t.text("");break}if(t.text(T+"..."),w.getComputedTextLength()<=p)break}}}),n.showValues!==!1&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",M/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?v(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")});let K=J.leaves(),S=K.length>20,Te=S?16:38,E=S?14:28,L=S?4:8,F=S?4:6,G=S?2:4,Q=S?8:10,X=S?1:2,_=q.selectAll(".treemapLeafGroup").data(K).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})`);_.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("style",e=>$({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("stroke-width",3),_.append("clipPath").attr("id",(e,t)=>`clip-${s}-${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)),_.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t=`text-anchor: middle; dominant-baseline: middle; font-size: ${Te}px;fill:`+W(e.data.name)+";",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${s}-${t})`).text(e=>e.data.name).each(function(e){let t=V(this),o=e.x1-e.x0,f=e.y1-e.y0,y=t.node(),u=o-2*G,C=f-2*G;if(u<Q||C<Q){t.style("display","none");return}let p=parseInt(t.style("font-size"),10),w=.6;for(;y.getComputedTextLength()>u&&p>L;)p--,t.style("font-size",`${p}px`);let g=Math.max(F,Math.min(E,Math.round(p*w))),x=p+X+g;for(;x>C&&p>L&&(p--,g=Math.max(F,Math.min(E,Math.round(p*w))),!(g<F&&p===L));)t.style("font-size",`${p}px`),x=p+X+g,g<=F&&x>C;t.style("font-size",`${p}px`),S?(p<L||C<L)&&t.style("display","none"):(y.getComputedTextLength()>u||p<L||C<p)&&t.style("display","none")}),n.showValues!==!1&&_.append("text").attr("class","treemapValue").attr("x",t=>(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{let o=`text-anchor: middle; dominant-baseline: hanging; font-size: ${E}px;fill:`+W(t.data.name)+";",f=$({cssCompiledStyles:t.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,o)=>`url(#clip-${s}-${o})`).text(t=>t.value?v(t.value):"").each(function(t){let o=V(this),f=this.parentNode;if(!f){o.style("display","none");return}let y=V(f).select(".treemapLabel");if(y.empty()||y.style("display")==="none"){o.style("display","none");return}let u=parseFloat(y.style("font-size")),p=Math.max(F,Math.min(E,Math.round(u*.6)));o.style("font-size",`${p}px`);let g=(t.y1-t.y0)/2+u/2+X;o.attr("y",g);let x=t.x1-t.x0,Z=t.y1-t.y0-4,Fe=x-2*G;o.node().getComputedTextLength()>Fe||g+p>Z||p<F?o.style("display","none"):o.style("display",null)});let $e=n.diagramPadding??8;ue(b,$e,"flowchart",n?.useMaxWidth||!1)},"draw"),De=h(function(r,s){return s.db.getClasses()},"getClasses"),Ve={draw:Pe,getClasses:De},Me={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ke=h(({treemap:r}={})=>{let s=te(),i=R(),c=I(s,i.themeVariables),l=I(Me,r),n=l.titleColor??c.titleColor,d=l.labelColor??c.textColor,m=l.valueColor??c.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${l.sectionStrokeColor};
4
+ stroke-width: ${l.sectionStrokeWidth};
5
+ fill: ${l.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${l.leafStrokeColor};
9
+ stroke-width: ${l.leafStrokeWidth};
10
+ fill: ${l.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${d};
14
+ font-size: ${l.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${m};
18
+ font-size: ${l.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${n};
22
+ font-size: ${l.titleFontSize};
23
+ }
24
+ `},"getStyles"),We=ke,Je={parser:be,get db(){return new Se},renderer:Ve,styles:We};export{Je as diagram};
25
+ //# sourceMappingURL=diagram-VX7I27RA-4V6RQ6IS.js.map
@@ -0,0 +1,25 @@
1
+ import{a as E}from"./chunk-KVRWT2YT.js";import{a as F}from"./chunk-J7VDGOTK.js";import"./chunk-U6ILIHMR.js";import{a as z}from"./chunk-P44J6WNO.js";import"./chunk-7PUK2GON.js";import"./chunk-NBC6B3KN.js";import"./chunk-QBOSTM7Q.js";import"./chunk-63W35XXT.js";import"./chunk-4KJ2U3VQ.js";import"./chunk-4ZUFUR3U.js";import"./chunk-6YVFH4BZ.js";import"./chunk-QKU4ZFG5.js";import"./chunk-RK4EOCHJ.js";import"./chunk-YYJ5VFH5.js";import"./chunk-SE57RN36.js";import"./chunk-XJ6FSQEO.js";import"./chunk-FKTXB6RJ.js";import"./chunk-XE4RLI22.js";import"./chunk-WL4ZMLPV.js";import{o as u}from"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{O as y,T as $,U as B,V as C,W as S,X as D,Y as T,Z as P,k as v,u as x}from"./chunk-SGL7WI35.js";import{b}from"./chunk-CXXG5KL5.js";import{a as h}from"./chunk-ITN3D7RJ.js";import{d as w}from"./chunk-SOAWGUAD.js";w();var L=v.packet,A=class{constructor(){this.packet=[],this.setAccTitle=B,this.getAccTitle=C,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=D,this.setAccDescription=S}static{h(this,"PacketDB")}getConfig(){let t=u({...L,...x().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){$(),this.packet=[]}},M=1e4,Y=h((t,e)=>{E(t,e);let a=-1,o=[],n=1,{bitsPerRow:l}=e.getConfig();for(let{start:r,end:s,bits:d,label:c}of t.blocks){if(r!==void 0&&s!==void 0&&s<r)throw new Error(`Packet block ${r} - ${s} is invalid. End must be greater than start.`);if(r??=a+1,r!==a+1)throw new Error(`Packet block ${r} - ${s??r} is not contiguous. It should start from ${a+1}.`);if(d===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(s??=r+(d??1)-1,d??=s-r+1,a=s,b.debug(`Packet block ${r} - ${a} with label ${c}`);o.length<=l+1&&e.getPacket().length<M;){let[p,i]=I({start:r,end:s,bits:d,label:c},n,l);if(o.push(p),p.end+1===n*l&&(e.pushWord(o),o=[],n++),!i)break;({start:r,end:s,bits:d,label:c}=i)}}e.pushWord(o)},"populate"),I=h((t,e,a)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*a)return[t,void 0];let o=e*a-1,n=e*a;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),W={parser:{yy:void 0},parse:h(async t=>{let e=await F("packet",t),a=W.parser?.yy;if(!(a instanceof A))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");b.debug(e),Y(e,a)},"parse")},O=h((t,e,a,o)=>{let n=o.db,l=n.getConfig(),{rowHeight:r,paddingY:s,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),i=n.getDiagramTitle(),f=r+s,g=f*(p.length+1)-(i?0:r),k=d*c+2,m=z(e);m.attr("viewBox",`0 0 ${k} ${g}`),y(m,g,k,l.useMaxWidth);for(let[_,N]of p.entries())j(m,N,_,l);m.append("text").text(i).attr("x",k/2).attr("y",g-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=h((t,e,a,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:r,bitsPerRow:s,showBits:d})=>{let c=t.append("g"),p=a*(o+l)+l;for(let i of e){let f=i.start%s*r+1,g=(i.end-i.start+1)*r-n;if(c.append("rect").attr("x",f).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",f+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(i.label),!d)continue;let k=i.end===i.start,m=p-2;c.append("text").attr("x",f+(k?g/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(i.start),k||c.append("text").attr("x",f+g).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(i.end)}},"drawWord"),G={draw:O},H={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},K=h(({packet:t}={})=>{let e=u(H,t);return`
2
+ .packetByte {
3
+ font-size: ${e.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${e.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${e.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${e.labelColor};
13
+ font-size: ${e.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${e.titleColor};
17
+ font-size: ${e.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${e.blockStrokeColor};
21
+ stroke-width: ${e.blockStrokeWidth};
22
+ fill: ${e.blockFillColor};
23
+ }
24
+ `},"styles"),tt={parser:W,get db(){return new A},renderer:G,styles:K};export{tt as diagram};
25
+ //# sourceMappingURL=diagram-Z3DM3KII-ODYVRYAT.js.map
@@ -0,0 +1,2 @@
1
+ import{a as n,b as f,c as u}from"./chunk-FU7R4QOG.js";import{a as m}from"./chunk-KVRWT2YT.js";import{b as p}from"./chunk-J7VDGOTK.js";import"./chunk-U6ILIHMR.js";import"./chunk-P44J6WNO.js";import"./chunk-7PUK2GON.js";import"./chunk-NBC6B3KN.js";import"./chunk-QBOSTM7Q.js";import{b as l}from"./chunk-63W35XXT.js";import"./chunk-4KJ2U3VQ.js";import"./chunk-4ZUFUR3U.js";import"./chunk-6YVFH4BZ.js";import"./chunk-QKU4ZFG5.js";import"./chunk-RK4EOCHJ.js";import"./chunk-YYJ5VFH5.js";import"./chunk-SE57RN36.js";import"./chunk-XJ6FSQEO.js";import"./chunk-FKTXB6RJ.js";import"./chunk-XE4RLI22.js";import"./chunk-WL4ZMLPV.js";import"./chunk-SGL7WI35.js";import{b as o}from"./chunk-CXXG5KL5.js";import{a as t}from"./chunk-ITN3D7RJ.js";import{d as i}from"./chunk-SOAWGUAD.js";i();var E=l().RailroadEbnf.parser.LangiumParser,s=t(e=>{let r=e.alternatives.map(b);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),b=t(e=>{let r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),c=t(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 s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),y=t((e,r)=>{switch(r.$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:"-"},c(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>y(r,a),c(e.base)),"transformTerm"),v=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),P=t(e=>{m(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(v(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");let r=E.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);let a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),P(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},F={parser:g,db:n,renderer:u,styles:f};export{F as diagram};
2
+ //# sourceMappingURL=ebnfDiagram-PWID7BFC-2KD46JNN.js.map
@@ -0,0 +1,100 @@
1
+ import{a as et}from"./chunk-NLHJT4GD.js";import{b as Je,c as $e}from"./chunk-GEV6X2TZ.js";import{a as tt}from"./chunk-IKC3ZQV7.js";import"./chunk-ZXMMITLE.js";import"./chunk-3EZ2OKHV.js";import"./chunk-XOZZFIHV.js";import"./chunk-NOVL2262.js";import"./chunk-USZ3ZJYA.js";import"./chunk-J6N7AUC2.js";import"./chunk-NQ2XP5EN.js";import"./chunk-GPW7TXQS.js";import{p as Qe,s as Xe}from"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import{N as Pe,T as ze,U as Ue,V as Ke,W as Ze,X as je,Y as qe,Z as We,_ as U,a as Fe,b as Ye}from"./chunk-SGL7WI35.js";import{b as A,h as He}from"./chunk-CXXG5KL5.js";import{a as d,b as Ge}from"./chunk-ITN3D7RJ.js";import{d as Be}from"./chunk-SOAWGUAD.js";Be();var Oe=(function(){var t=d(function(M,a,o,h){for(o=o||{},h=M.length;h--;o[M[h]]=a);return o},"o"),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],u=[2,2],r=[1,7],l=[1,9],f=[1,10],_=[1,11],p=[1,12],S=[1,30],b=[1,23],k=[1,24],x=[1,25],B=[1,26],Y=[1,27],m=[1,19],I=[1,28],K=[1,29],N=[1,20],R=[1,18],v=[1,21],D=[1,22],xe=[2,6],c=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],de=[1,36],be=[1,37],pe=[1,38],fe=[1,39],ke=[1,40],Z=[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],L=[1,46],w=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],V=[1,65],Q=[1,69],X=[1,71],ee=[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],te=[1,78],se=[1,77],ie=[1,76],Ne=[69,70,71,72,73],Ce=[1,91],Ae=[6,9,45,50],P=[6,9,12,44,45,50,51,52],re=[1,101],ae=[1,100],ne=[1,99],J=[18,61],Ie=[1,110],Re=[1,109],ve=[20,43,51,53,54,55],ge=[18,61,64,66],ye={trace:d(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:d(function(a,o,h,i,g,e,$){var s=e.length-1;switch(g){case 1:break;case 2:this.$=[];break;case 3:this.$=e[s-1].concat(e[s]);break;case 4:this.$=e[s];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(e[s-4]),i.addEntity(e[s-2]),i.addRelationship(e[s-4],e[s],e[s-2],e[s-3]),this.$=[e[s-4],e[s-2]];break;case 8:i.addEntity(e[s-8]),i.addEntity(e[s-4]),i.addRelationship(e[s-8],e[s],e[s-4],e[s-5]),i.setClass([e[s-8]],e[s-6]),i.setClass([e[s-4]],e[s-2]),this.$=[e[s-8],e[s-4]];break;case 9:i.addEntity(e[s-6]),i.addEntity(e[s-2]),i.addRelationship(e[s-6],e[s],e[s-2],e[s-3]),i.setClass([e[s-6]],e[s-4]),this.$=[e[s-6],e[s-2]];break;case 10:i.addEntity(e[s-6]),i.addEntity(e[s-4]),i.addRelationship(e[s-6],e[s],e[s-4],e[s-5]),i.setClass([e[s-4]],e[s-2]),this.$=[e[s-6],e[s-4]];break;case 11:i.addEntity(e[s-3]),i.addAttributes(e[s-3],e[s-1]),this.$=[e[s-3]];break;case 12:i.addEntity(e[s-5]),i.addAttributes(e[s-5],e[s-1]),i.setClass([e[s-5]],e[s-3]),this.$=[e[s-5]];break;case 13:i.addEntity(e[s-2]),this.$=[e[s-2]];break;case 14:i.addEntity(e[s-4]),i.setClass([e[s-4]],e[s-2]),this.$=[e[s-4]];break;case 15:i.addEntity(e[s]),this.$=[e[s]];break;case 16:i.addEntity(e[s-2]),i.setClass([e[s-2]],e[s]),this.$=[e[s-2]];break;case 17:i.addEntity(e[s-6],e[s-4]),i.addAttributes(e[s-6],e[s-1]),this.$=[e[s-6]];break;case 18:i.addEntity(e[s-8],e[s-6]),i.addAttributes(e[s-8],e[s-1]),i.setClass([e[s-8]],e[s-3]),this.$=[e[s-8]];break;case 19:i.addEntity(e[s-5],e[s-3]),this.$=[e[s-5]];break;case 20:i.addEntity(e[s-7],e[s-5]),i.setClass([e[s-7]],e[s-2]),this.$=[e[s-7]];break;case 21:i.addEntity(e[s-3],e[s-1]);break;case 22:i.addEntity(e[s-5],e[s-3]),i.setClass([e[s-5]],e[s]);break;case 23:case 24:this.$=e[s].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=e[s].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=e[s]:(i.setDirection(e[s].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:e[s-2].id},e[s-1],{text:e[s-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:e[s-1],text:e[s-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:e[s-4],text:e[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=e[s];break;case 35:this.$=e[s-1]+" "+e[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.$=e[s-3],i.addClass(e[s-2],e[s-1]);break;case 41:case 42:case 63:case 72:this.$=[e[s]];break;case 43:case 44:this.$=e[s-2].concat([e[s]]);break;case 45:this.$=e[s-2],i.setClass(e[s-1],e[s]);break;case 46:this.$=e[s-3],i.addCssStyles(e[s-2],e[s-1]);break;case 47:this.$=[e[s]];break;case 48:e[s-2].push(e[s]),this.$=e[s-2];break;case 50:this.$=e[s-1]+e[s];break;case 58:case 84:case 85:this.$=e[s].replace(/"/g,"");break;case 64:e[s].push(e[s-1]),this.$=e[s];break;case 65:this.$={type:e[s-1],name:e[s]};break;case 66:this.$={type:e[s-2],name:e[s-1],keys:e[s]};break;case 67:this.$={type:e[s-2],name:e[s-1],comment:e[s]};break;case 68:this.$={type:e[s-3],name:e[s-2],keys:e[s-1],comment:e[s]};break;case 69:case 71:case 74:this.$=e[s];break;case 70:this.$=e[s-1]+e[s];break;case 73:e[s-2].push(e[s]),this.$=e[s-2];break;case 75:this.$=e[s].replace(/"/g,"");break;case 76:this.$={cardA:e[s],relType:e[s-1],cardB:e[s-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(n,u,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:l,23:f,25:_,27:p,28:13,29:14,30:15,31:16,32:17,34:S,37:b,38:k,39:x,40:B,41:Y,43:m,46:I,47:K,51:N,53:R,54:v,55:D},t(n,xe,{1:[2,1]}),t(c,[2,3]),t(c,[2,4]),t(c,[2,5]),t(c,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:de,70:be,71:pe,72:fe,73:ke}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(c,[2,26]),t(c,[2,27]),t(c,[2,28]),t(c,[2,29]),t(c,[2,30]),t(c,u,{5:44}),t(Z,[2,58]),t(Z,[2,59]),t(Z,[2,60]),t(Z,[2,61]),t(Z,[2,62]),t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),t(c,[2,39]),{15:45,43:L,44:w},{15:48,43:L,44:w},{15:49,43:L,44:w},{10:50,43:m,51:N,53:R,54:v,55:D},{10:51,43:m,51:N,53:R,54:v,55:D},{15:52,43:L,44:w},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:m,51:N,53:R,54:v,55:D},{68:59,74:[1,60],75:[1,61]},t(q,[2,77]),t(q,[2,78]),t(q,[2,79]),t(q,[2,80]),t(q,[2,81]),t(c,[2,23]),t(c,[2,24]),t(c,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:l,23:f,25:_,27:p,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:S,37:b,38:k,39:x,40:B,41:Y,43:m,46:I,47:K,51:N,53:R,54:v,55:D},{12:W,42:64,44:H,45:V,48:66,49:67,51:Q,52:X},t(ee,[2,41]),t(ee,[2,42]),{15:72,43:L,44:w,45:V},{12:W,42:73,44:H,45:V,48:66,49:67,51:Q,52:X},{6:te,9:se,19:[1,75],35:74,50:ie},{12:[1,79],14:[1,80]},t(c,[2,16],{67:35,11:81,16:[1,82],45:V,69:de,70:be,71:pe,72:fe,73:ke}),{18:[1,83]},t(c,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:de,70:be,71:pe,72:fe,73:ke},t(Ne,[2,82]),t(Ne,[2,83]),t(c,[2,31]),t(c,xe),{6:te,9:se,35:90,45:Ce,50:ie},{43:[1,92],44:[1,93]},t(Ae,[2,47],{49:94,12:W,44:H,51:Q,52:X}),t(P,[2,49]),t(P,[2,54]),t(P,[2,55]),t(P,[2,56]),t(P,[2,57]),t(c,[2,45],{45:V}),{6:te,9:se,35:95,45:Ce,50:ie},t(c,[2,32]),{10:97,36:96,43:m,51:N,53:R,54:v,55:D},t(c,[2,51]),t(c,[2,52]),t(c,[2,53]),{13:98,43:re,53:ae,76:ne},{15:102,43:L,44:w},{10:103,43:m,51:N,53:R,54:v,55:D},{17:104,18:[1,105],56:55,57:56,61:j},t(c,[2,11]),{18:[2,64]},t(J,[2,65],{59:106,60:107,63:108,65:Ie,66:Re}),t([18,61,65,66],[2,71]),{61:[2,70]},t(c,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(c,[2,40]),{12:W,44:H,48:113,49:67,51:Q,52:X},t(ee,[2,43]),t(ee,[2,44]),t(P,[2,50]),t(c,[2,46]),{10:115,20:[1,114],43:m,51:N,53:R,54:v,55:D},t(ve,[2,34]),t(c,[2,7]),t(c,[2,84]),t(c,[2,85]),t(c,[2,86]),{12:[1,116],45:V},{12:[1,118],14:[1,117]},{18:[1,119]},t(c,[2,14]),t(J,[2,66],{60:120,64:[1,121],66:Re}),t(J,[2,67]),t(ge,[2,72]),t(J,[2,75]),t(ge,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:L,44:w},t(Ae,[2,48],{49:94,12:W,44:H,51:Q,52:X}),{6:te,9:se,35:125,50:ie},t(ve,[2,35]),{13:126,43:re,53:ae,76:ne},{15:127,43:L,44:w},{13:128,43:re,53:ae,76:ne},t(c,[2,12]),t(J,[2,68]),{63:129,65:Ie},{18:[1,130]},t(c,[2,19]),t(c,[2,22],{16:[1,131],45:V}),t(c,[2,33]),t(c,[2,10]),{12:[1,132],45:V},t(c,[2,9]),t(ge,[2,73]),t(c,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:re,53:ae,76:ne},{18:[1,136]},t(c,[2,20]),t(c,[2,8]),t(c,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:d(function(a,o){if(o.recoverable)this.trace(a);else{var h=new Error(a);throw h.hash=o,h}},"parseError"),parse:d(function(a){var o=this,h=[0],i=[],g=[null],e=[],$=this.table,s="",le=0,De=0,Le=0,at=2,we=1,nt=e.slice.call(arguments,1),y=Object.create(this.lexer),G={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(G.yy[_e]=this.yy[_e]);y.setInput(a,G.yy),G.yy.lexer=y,G.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var me=y.yylloc;e.push(me);var ot=y.options&&y.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function lt(T){h.length=h.length-2*T,g.length=g.length-T,e.length=e.length-T}d(lt,"popStack");function Ve(){var T;return T=i.pop()||y.lex()||we,typeof T!="number"&&(T instanceof Array&&(i=T,T=i.pop()),T=o.symbols_[T]||T),T}d(Ve,"lex");for(var E,Ee,F,O,ft,Se,z={},ce,C,Me,he;;){if(F=h[h.length-1],this.defaultActions[F]?O=this.defaultActions[F]:((E===null||typeof E>"u")&&(E=Ve()),O=$[F]&&$[F][E]),typeof O>"u"||!O.length||!O[0]){var Te="";he=[];for(ce in $[F])this.terminals_[ce]&&ce>at&&he.push("'"+this.terminals_[ce]+"'");y.showPosition?Te="Parse error on line "+(le+1)+`:
2
+ `+y.showPosition()+`
3
+ Expecting `+he.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Te="Parse error on line "+(le+1)+": Unexpected "+(E==we?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Te,{text:y.match,token:this.terminals_[E]||E,line:y.yylineno,loc:me,expected:he})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+E);switch(O[0]){case 1:h.push(E),g.push(y.yytext),e.push(y.yylloc),h.push(O[1]),E=null,Ee?(E=Ee,Ee=null):(De=y.yyleng,s=y.yytext,le=y.yylineno,me=y.yylloc,Le>0&&Le--);break;case 2:if(C=this.productions_[O[1]][1],z.$=g[g.length-C],z._$={first_line:e[e.length-(C||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(C||1)].first_column,last_column:e[e.length-1].last_column},ot&&(z._$.range=[e[e.length-(C||1)].range[0],e[e.length-1].range[1]]),Se=this.performAction.apply(z,[s,De,le,G.yy,O[1],g,e].concat(nt)),typeof Se<"u")return Se;C&&(h=h.slice(0,-1*C*2),g=g.slice(0,-1*C),e=e.slice(0,-1*C)),h.push(this.productions_[O[1]][0]),g.push(z.$),e.push(z._$),Me=$[h[h.length-2]][h[h.length-1]],h.push(Me);break;case 3:return!0}}return!0},"parse")},rt=(function(){var M={EOF:1,parseError:d(function(o,h){if(this.yy.parser)this.yy.parser.parseError(o,h);else throw new Error(o)},"parseError"),setInput:d(function(a,o){return this.yy=o||this.yy||{},this._input=a,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:d(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var o=a.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:d(function(a){var o=a.length,h=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var g=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:h?(h.length===i.length?this.yylloc.first_column:0)+i[i.length-h.length].length-h[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(a){this.unput(this.match.slice(a))},"less"),pastInput:d(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var a=this.pastInput(),o=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
5
+ `+o+"^"},"showPosition"),test_match:d(function(a,o){var h,i,g;if(this.options.backtrack_lexer&&(g={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&&(g.yylloc.range=this.yylloc.range.slice(0))),i=a[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],h=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var e in g)this[e]=g[e];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,o,h,i;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),e=0;e<g.length;e++)if(h=this._input.match(this.rules[g[e]]),h&&(!o||h[0].length>o[0].length)){if(o=h,i=e,this.options.backtrack_lexer){if(a=this.test_match(h,g[e]),a!==!1)return a;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(a=this.test_match(o,g[i]),a!==!1?a:!1):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:d(function(){var o=this.next();return o||this.lex()},"lex"),begin:d(function(o){this.conditionStack.push(o)},"begin"),popState:d(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:d(function(o){this.begin(o)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(o,h,i,g){var e=g;switch(i){case 0:return this.begin("acc_title"),23;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),25;break;case 3:return this.popState(),"acc_descr_value";break;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;break;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;break;case 32:return h.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;break;case 36:return this.popState(),9;break;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;break;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 h.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}}};return M})();ye.lexer=rt;function oe(){this.yy={}}return d(oe,"Parser"),oe.prototype=ye,ye.Parser=oe,new oe})();Oe.parser=Oe;var ct=Oe,ht=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=Ue,this.getAccTitle=Ke,this.setAccDescription=Ze,this.getAccDescription=je,this.setDiagramTitle=qe,this.getDiagramTitle=We,this.getConfig=d(()=>U().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{d(this,"ErDB")}addEntity(t,n=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&n&&(this.entities.get(t).alias=n,A.info(`Add alias '${n}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:n,shape:"erBox",look:U().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),A.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,n){let u=this.addEntity(t),r;for(r=n.length-1;r>=0;r--)n[r].keys||(n[r].keys=[]),n[r].comment||(n[r].comment=""),u.attributes.push(n[r]),A.debug("Added attribute ",n[r].name)}addRelationship(t,n,u,r){let l;if(this.subGraphLookup.has(t))l=t;else{let p=this.addEntity(t);if(!p)return;l=p.id}let f;if(this.subGraphLookup.has(u))f=u;else{let p=this.addEntity(u);if(!p)return;f=p.id}let _={entityA:l,roleA:n,entityB:f,relSpec:r};this.relationships.push(_),A.debug("Added new relationship :",_)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let n=[];for(let u of t){let r=this.classes.get(u);r?.styles&&(n=[...n,...r.styles??[]].map(l=>l.trim())),r?.textStyles&&(n=[...n,...r.textStyles??[]].map(l=>l.trim()))}return n}addCssStyles(t,n){for(let u of t){let r=this.entities.get(u),l=this.subGraphLookup.get(u);if(n){if(r)for(let f of n)r.cssStyles.push(f);if(l){l.cssStyles||(l.cssStyles=[]);for(let f of n)l.cssStyles.push(f)}}}}addClass(t,n){t.forEach(u=>{let r=this.classes.get(u);r===void 0&&(r={id:u,styles:[],textStyles:[]},this.classes.set(u,r)),n&&n.forEach(function(l){if(/color/.exec(l)){let f=l.replace("fill","bgFill");r.textStyles.push(f)}r.styles.push(l)})})}addSubGraph(t,n,u){let r=t.text.trim(),l=u.text,_=d(k=>{let x=new Set,B;return{nodeList:k.filter(m=>{if(m?.stmt)return m.stmt==="dir"&&(B=m.value),!1;if(typeof m!="string")return!1;let I=m.trim();return!I||x.has(I)?!1:(x.add(I),!0)}),dir:B}},"uniq")(n.flat()),p=_.nodeList,S=_.dir;r=r??"subGraph"+this.subCount,l=l||"",l=this.sanitizeText(l),this.subCount=this.subCount+1;let b={id:r,nodes:p,title:l.trim(),classes:[],cssStyles:[],dir:S,labelType:this.sanitizeNodeLabelType(u?.type)};return A.info("Adding",b.id,b.nodes,b.dir),b.nodes=this.makeUniq(b,this.subGraphs).nodes,this.subGraphs.push(b),this.subGraphLookup.set(r,b),r}getSubGraphs(){return this.subGraphs}setClass(t,n){for(let u of t){let r=this.entities.get(u);if(r)for(let f of n)r.cssClasses+=" "+f;let l=this.subGraphLookup.get(u);if(l)for(let f of n)l.classes.push(f)}}subgraphNodeCache(t){let n=new Set;for(let u of t)for(let r of u.nodes)n.add(r);return n}makeUniq(t,n){let u=this.subgraphNodeCache(n),r=[];return t.nodes.forEach((l,f)=>{u.has(l)?A.warn(`Entity '${l}' already belongs to another subgraph and will be ignored`):r.push(t.nodes[f])}),{nodes:r}}sanitizeText(t){return Pe.sanitizeText(t,U())}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;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,ze()}getData(){let t=[],n=[],u=U(),r=this.getSubGraphs(),l=new Map,f=new Map;for(let b=r.length-1;b>=0;b--){let k=r[b];k.nodes.length>0&&f.set(k.id,!0);for(let x of k.nodes)l.set(x,k.id)}for(let b=r.length-1;b>=0;b--){let k=r[b];t.push({id:k.id,label:k.title,labelStyle:"",labelType:k.labelType,parentId:l.get(k.id),padding:8,cssCompiledStyles:this.getCompiledStyles(k.classes),cssStyles:k.cssStyles,cssClasses:k.classes.join(" "),shape:"rect",dir:k.dir,isGroup:!0,look:u.look})}let _=new Set(r.map(b=>b.id)),p=0;for(let b of this.entities.keys()){if(_.has(b))continue;let k=this.entities.get(b);k&&(k.cssCompiledStyles=this.getCompiledStyles(k.cssClasses.split(" ")),k.colorIndex=p++,t.push({...k,parentId:l.get(b),isGroup:!1}))}let S=0;for(let b of this.relationships){let k={id:Xe(b.entityA,b.entityB,{prefix:"id",counter:S++}),type:"normal",curve:"basis",start:b.entityA,end:b.entityB,label:b.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:b.relSpec.cardB.toLowerCase(),arrowTypeEnd:b.relSpec.cardA.toLowerCase(),pattern:b.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:u.look,labelType:"markdown"};n.push(k)}return{nodes:t,edges:n,other:{},config:u,direction:this.direction}}},it={};Ge(it,{draw:()=>ut});var ut=d(async function(t,n,u,r){A.info("REF0:"),A.info("Drawing er diagram (unified)",n);let{securityLevel:l,er:f,layout:_}=U(),p=r.db.getData(),S=et(n,l);p.type=r.type,p.layoutAlgorithm=$e(_),p.config.flowchart.nodeSpacing=f?.nodeSpacing||140,p.config.flowchart.rankSpacing=f?.rankSpacing||80,p.direction=r.db.getDirection();let{config:b}=p,{look:k}=b;k==="neo"?p.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:p.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=n,await Je(p,S),p.layoutAlgorithm==="elk"&&S.select(".edges").lower();let x=S.selectAll('[id*="-background"]');Array.from(x).length>0&&x.each(function(){let Y=He(this),I=Y.attr("id").replace("-background",""),K=S.select(`#${CSS.escape(I)}`);if(!K.empty()){let N=K.attr("transform");Y.attr("transform",N)}});let B=8;Qe.insertTitle(S,"erDiagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),tt(S,B,"erDiagram",f?.useMaxWidth??!0)},"draw"),st=d((t,n)=>{let u=Ye,r=u(t,"r"),l=u(t,"g"),f=u(t,"b");return Fe(r,l,f,n)},"fade"),ue=new Set(["redux-color","redux-dark-color"]),dt=d(t=>{let{theme:n,look:u,bkgColorArray:r,borderColorArray:l}=t;if(!ue.has(n))return"";let f=r?.length>0,_="";for(let p=0;p<t.THEME_COLOR_LIMIT;p++)_+=`
7
+
8
+ [data-look="${u}"][data-color-id="color-${p}"].node path {
9
+ stroke: ${l[p]};
10
+ ${f?`fill: ${r[p]};`:""}
11
+ }
12
+
13
+ [data-look="${u}"][data-color-id="color-${p}"].node rect {
14
+ stroke: ${l[p]};
15
+ ${f?`fill: ${r[p]};`:""}
16
+ }
17
+ `;return _},"genColor"),bt=d(t=>{let{look:n,theme:u,erEdgeLabelBackground:r,strokeWidth:l}=t;return`
18
+ ${dt(t)}
19
+ .entityBox {
20
+ fill: ${t.mainBkg};
21
+ stroke: ${t.nodeBorder};
22
+ }
23
+
24
+ .relationshipLabelBox {
25
+ fill: ${t.tertiaryColor};
26
+ opacity: 0.7;
27
+ background-color: ${t.tertiaryColor};
28
+ rect {
29
+ opacity: 0.5;
30
+ }
31
+ }
32
+
33
+ .labelBkg {
34
+ background-color: ${ue.has(u)&&r?r:st(t.tertiaryColor,.5)};
35
+ }
36
+
37
+ .edgeLabel {
38
+ background-color: ${ue.has(u)&&r?r:t.edgeLabelBackground};
39
+ }
40
+ .edgeLabel .label rect {
41
+ fill: ${ue.has(u)&&r?r:t.edgeLabelBackground};
42
+ }
43
+ .edgeLabel .label text {
44
+ fill: ${t.textColor};
45
+ }
46
+
47
+ .edgeLabel .label {
48
+ fill: ${t.nodeBorder};
49
+ font-size: 14px;
50
+ }
51
+
52
+ .label {
53
+ font-family: ${t.fontFamily};
54
+ color: ${t.nodeTextColor||t.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: ${t.mainBkg};
67
+ stroke: ${t.nodeBorder};
68
+ stroke-width: ${n==="neo"?l:"1px"};
69
+ }
70
+
71
+ .relationshipLine {
72
+ stroke: ${t.lineColor};
73
+ stroke-width: ${n==="neo"?l:"1px"};
74
+ fill: none;
75
+ }
76
+
77
+ .marker {
78
+ fill: none !important;
79
+ stroke: ${t.lineColor} !important;
80
+ stroke-width: 1;
81
+ }
82
+ [data-look=neo].labelBkg {
83
+ background-color: ${st(t.tertiaryColor,.5)};
84
+ }
85
+
86
+ .cluster rect {
87
+ fill: ${t.clusterBkg??t.mainBkg};
88
+ stroke: ${t.clusterBorder??t.nodeBorder};
89
+ stroke-width: 1px;
90
+ }
91
+
92
+ .cluster text {
93
+ fill: ${t.titleColor??t.textColor};
94
+ }
95
+
96
+ .cluster-label text {
97
+ fill: ${t.titleColor??t.textColor};
98
+ }
99
+ `},"getStyles"),pt=bt,Lt={parser:ct,get db(){return new ht},renderer:it,styles:pt};export{Lt as diagram};
100
+ //# sourceMappingURL=erDiagram-RLTQ6QDP-6MYZ2NRT.js.map
@@ -0,0 +1,2 @@
1
+ import{a as o,b as r}from"./chunk-7PUK2GON.js";import"./chunk-WL4ZMLPV.js";import{d as e}from"./chunk-SOAWGUAD.js";e();export{o as EventModelingModule,r as createEventModelingServices};
2
+ //# sourceMappingURL=eventmodeling-NTZA5JFV-QZXC5VKS.js.map
@@ -0,0 +1,2 @@
1
+ import{b as m,c as o}from"./chunk-ZX45GMMJ.js";import"./chunk-CA2KMNVI.js";import"./chunk-S4X6ERXI.js";import"./chunk-NLHJT4GD.js";import"./chunk-GEV6X2TZ.js";import"./chunk-IKC3ZQV7.js";import"./chunk-ZXMMITLE.js";import"./chunk-3EZ2OKHV.js";import"./chunk-XOZZFIHV.js";import"./chunk-RINQGKTH.js";import"./chunk-NOVL2262.js";import"./chunk-USZ3ZJYA.js";import"./chunk-J6N7AUC2.js";import"./chunk-NQ2XP5EN.js";import"./chunk-GPW7TXQS.js";import"./chunk-CFMSYLIK.js";import"./chunk-UU7BHEBD.js";import"./chunk-SGL7WI35.js";import"./chunk-CXXG5KL5.js";import"./chunk-ITN3D7RJ.js";import{d as r}from"./chunk-SOAWGUAD.js";r();export{m as createFlowDiagram,o as diagram};
2
+ //# sourceMappingURL=flowDiagram-HODETNUW-BILJ37ZX.js.map