@ours.network/fleet 1.2.0-nightly.30 → 1.2.0-nightly.32

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 (160) hide show
  1. package/dist/build-info.json +4 -4
  2. package/dist/cli.js +48 -16
  3. package/dist/minimal-setup.d.ts +2 -0
  4. package/dist/minimal-setup.js +43 -0
  5. package/dist/web/available-port.d.ts +2 -0
  6. package/dist/web/available-port.js +23 -0
  7. package/dist/web/runtime.js +17 -2
  8. package/dist/web/service.d.ts +5 -0
  9. package/dist/web/service.js +8 -0
  10. package/dist/web-app/assets/FleetApp-D58F4xje.css +1 -0
  11. package/dist/web-app/assets/FleetApp-Gjz3h8uS.js +302 -0
  12. package/dist/web-app/assets/FleetApp-Gjz3h8uS.js.map +1 -0
  13. package/dist/web-app/assets/abnfDiagram-VCTEODGH-t4h5V8Cs.js +2 -0
  14. package/dist/web-app/assets/abnfDiagram-VCTEODGH-t4h5V8Cs.js.map +1 -0
  15. package/dist/web-app/assets/arc-DbufDTF6.js +2 -0
  16. package/dist/web-app/assets/arc-DbufDTF6.js.map +1 -0
  17. package/dist/web-app/assets/architectureDiagram-5GKGNRK7-D6K8jMN5.js +37 -0
  18. package/dist/web-app/assets/architectureDiagram-5GKGNRK7-D6K8jMN5.js.map +1 -0
  19. package/dist/web-app/assets/blockDiagram-I7D4REHJ-CWvkET2x.js +130 -0
  20. package/dist/web-app/assets/blockDiagram-I7D4REHJ-CWvkET2x.js.map +1 -0
  21. package/dist/web-app/assets/browser-B7y08DsC.js +9 -0
  22. package/dist/web-app/assets/browser-B7y08DsC.js.map +1 -0
  23. package/dist/web-app/assets/c4Diagram-7LVT6UL2-RNWA7VnD.js +39 -0
  24. package/dist/web-app/assets/c4Diagram-7LVT6UL2-RNWA7VnD.js.map +1 -0
  25. package/dist/web-app/assets/channel-BF3U9sI8.js +2 -0
  26. package/dist/web-app/assets/channel-BF3U9sI8.js.map +1 -0
  27. package/dist/web-app/assets/chunk-2Q5K7J3B-pdEuY4vj.js +2 -0
  28. package/dist/web-app/assets/chunk-2Q5K7J3B-pdEuY4vj.js.map +1 -0
  29. package/dist/web-app/assets/chunk-5VM5RSS4-DuAUtdUC.js +16 -0
  30. package/dist/web-app/assets/chunk-5VM5RSS4-DuAUtdUC.js.map +1 -0
  31. package/dist/web-app/assets/chunk-F27PBJKO-6kpb80Xt.js +2 -0
  32. package/dist/web-app/assets/chunk-F27PBJKO-6kpb80Xt.js.map +1 -0
  33. package/dist/web-app/assets/chunk-IMKFNOWR-DWC84P6A.js +232 -0
  34. package/dist/web-app/assets/chunk-IMKFNOWR-DWC84P6A.js.map +1 -0
  35. package/dist/web-app/assets/chunk-JWPE2WC7-FHO-M3vi.js +2 -0
  36. package/dist/web-app/assets/chunk-JWPE2WC7-FHO-M3vi.js.map +1 -0
  37. package/dist/web-app/assets/chunk-POPQ4Y6H-CjnlKvmR.js +2 -0
  38. package/dist/web-app/assets/chunk-POPQ4Y6H-CjnlKvmR.js.map +1 -0
  39. package/dist/web-app/assets/chunk-SVP7TREG-WHYWJ6xq.js +89 -0
  40. package/dist/web-app/assets/chunk-SVP7TREG-WHYWJ6xq.js.map +1 -0
  41. package/dist/web-app/assets/chunk-TICWLB2K-POupMpyL.js +207 -0
  42. package/dist/web-app/assets/chunk-TICWLB2K-POupMpyL.js.map +1 -0
  43. package/dist/web-app/assets/chunk-XXDRQBXY-Cw5HHqH-.js +2 -0
  44. package/dist/web-app/assets/chunk-XXDRQBXY-Cw5HHqH-.js.map +1 -0
  45. package/dist/web-app/assets/classDiagram-ZZMXUADV-1hdMzIme.js +2 -0
  46. package/dist/web-app/assets/classDiagram-ZZMXUADV-1hdMzIme.js.map +1 -0
  47. package/dist/web-app/assets/classDiagram-v2-VYDZK3BY-1hdMzIme.js +2 -0
  48. package/dist/web-app/assets/classDiagram-v2-VYDZK3BY-1hdMzIme.js.map +1 -0
  49. package/dist/web-app/assets/cose-bilkent-JH36ORCC-Cp6Hjine.js +2 -0
  50. package/dist/web-app/assets/cose-bilkent-JH36ORCC-Cp6Hjine.js.map +1 -0
  51. package/dist/web-app/assets/cynefin-OW5HDTMX-DI-DeNUk.js +179 -0
  52. package/dist/web-app/assets/cynefin-OW5HDTMX-DI-DeNUk.js.map +1 -0
  53. package/dist/web-app/assets/cynefinDiagram-5FMLGOSQ-todBCANI.js +63 -0
  54. package/dist/web-app/assets/cynefinDiagram-5FMLGOSQ-todBCANI.js.map +1 -0
  55. package/dist/web-app/assets/cytoscape.esm-CtNdOvlO.js +332 -0
  56. package/dist/web-app/assets/cytoscape.esm-CtNdOvlO.js.map +1 -0
  57. package/dist/web-app/assets/dagre-GXQ25YYZ-BvIVo7eh.js +5 -0
  58. package/dist/web-app/assets/dagre-GXQ25YYZ-BvIVo7eh.js.map +1 -0
  59. package/dist/web-app/assets/defaultLocale-DX6XiGOO.js +2 -0
  60. package/dist/web-app/assets/defaultLocale-DX6XiGOO.js.map +1 -0
  61. package/dist/web-app/assets/diagram-S7CK7UJ4-k9vDGlB5.js +31 -0
  62. package/dist/web-app/assets/diagram-S7CK7UJ4-k9vDGlB5.js.map +1 -0
  63. package/dist/web-app/assets/diagram-UQ7AKVKN-Bv7BT1dE.js +42 -0
  64. package/dist/web-app/assets/diagram-UQ7AKVKN-Bv7BT1dE.js.map +1 -0
  65. package/dist/web-app/assets/diagram-VSXAHHWV-m9I9AumX.js +4 -0
  66. package/dist/web-app/assets/diagram-VSXAHHWV-m9I9AumX.js.map +1 -0
  67. package/dist/web-app/assets/diagram-VX7I27RA-4VJ2qozS.js +25 -0
  68. package/dist/web-app/assets/diagram-VX7I27RA-4VJ2qozS.js.map +1 -0
  69. package/dist/web-app/assets/diagram-Z3DM3KII-CvH8JIEd.js +25 -0
  70. package/dist/web-app/assets/diagram-Z3DM3KII-CvH8JIEd.js.map +1 -0
  71. package/dist/web-app/assets/ebnfDiagram-PWID7BFC-DAGs23hd.js +2 -0
  72. package/dist/web-app/assets/ebnfDiagram-PWID7BFC-DAGs23hd.js.map +1 -0
  73. package/dist/web-app/assets/erDiagram-RLTQ6QDP-CEMyWKIa.js +100 -0
  74. package/dist/web-app/assets/erDiagram-RLTQ6QDP-CEMyWKIa.js.map +1 -0
  75. package/dist/web-app/assets/flowDiagram-HODETNUW-BnraxJTV.js +169 -0
  76. package/dist/web-app/assets/flowDiagram-HODETNUW-BnraxJTV.js.map +1 -0
  77. package/dist/web-app/assets/ganttDiagram-EL5Y4UJY-V6d4ICW0.js +293 -0
  78. package/dist/web-app/assets/ganttDiagram-EL5Y4UJY-V6d4ICW0.js.map +1 -0
  79. package/dist/web-app/assets/gitGraphDiagram-WWUBYQGX-Bj_gqcba.js +107 -0
  80. package/dist/web-app/assets/gitGraphDiagram-WWUBYQGX-Bj_gqcba.js.map +1 -0
  81. package/dist/web-app/assets/index-C4BdeFB9.css +1 -0
  82. package/dist/web-app/assets/index-i9rKiqYX.js +430 -0
  83. package/dist/web-app/assets/index-i9rKiqYX.js.map +1 -0
  84. package/dist/web-app/assets/infoDiagram-27XIBGKW-Dfm89NLl.js +3 -0
  85. package/dist/web-app/assets/infoDiagram-27XIBGKW-Dfm89NLl.js.map +1 -0
  86. package/dist/web-app/assets/init-Gi6I4Gst.js +2 -0
  87. package/dist/web-app/assets/init-Gi6I4Gst.js.map +1 -0
  88. package/dist/web-app/assets/ishikawaDiagram-5VMMS53U-D-ISiJTS.js +71 -0
  89. package/dist/web-app/assets/ishikawaDiagram-5VMMS53U-D-ISiJTS.js.map +1 -0
  90. package/dist/web-app/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  91. package/dist/web-app/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  92. package/dist/web-app/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  93. package/dist/web-app/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  94. package/dist/web-app/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  95. package/dist/web-app/assets/journeyDiagram-3NMN7TZE-TTySrzws.js +140 -0
  96. package/dist/web-app/assets/journeyDiagram-3NMN7TZE-TTySrzws.js.map +1 -0
  97. package/dist/web-app/assets/kanban-definition-UXKFOSKX-BxntsBft.js +90 -0
  98. package/dist/web-app/assets/kanban-definition-UXKFOSKX-BxntsBft.js.map +1 -0
  99. package/dist/web-app/assets/katex-HP8lGamR.js +258 -0
  100. package/dist/web-app/assets/katex-HP8lGamR.js.map +1 -0
  101. package/dist/web-app/assets/layout-0sZak8Ho.js +2 -0
  102. package/dist/web-app/assets/layout-0sZak8Ho.js.map +1 -0
  103. package/dist/web-app/assets/linear-D4xk4kUi.js +2 -0
  104. package/dist/web-app/assets/linear-D4xk4kUi.js.map +1 -0
  105. package/dist/web-app/assets/mermaid.core-CNKolAgz.js +313 -0
  106. package/dist/web-app/assets/mermaid.core-CNKolAgz.js.map +1 -0
  107. package/dist/web-app/assets/mindmap-definition-YA3MSWOX-DLJijY_l.js +97 -0
  108. package/dist/web-app/assets/mindmap-definition-YA3MSWOX-DLJijY_l.js.map +1 -0
  109. package/dist/web-app/assets/ordinal-Cboi1Yqb.js +2 -0
  110. package/dist/web-app/assets/ordinal-Cboi1Yqb.js.map +1 -0
  111. package/dist/web-app/assets/pegDiagram-XKGWAZYB-xjrh9rBd.js +2 -0
  112. package/dist/web-app/assets/pegDiagram-XKGWAZYB-xjrh9rBd.js.map +1 -0
  113. package/dist/web-app/assets/pieDiagram-E7YTZNPT-CHE8ZMXN.js +40 -0
  114. package/dist/web-app/assets/pieDiagram-E7YTZNPT-CHE8ZMXN.js.map +1 -0
  115. package/dist/web-app/assets/quadrantDiagram-AXDQQJYC-CDlEe9sg.js +8 -0
  116. package/dist/web-app/assets/quadrantDiagram-AXDQQJYC-CDlEe9sg.js.map +1 -0
  117. package/dist/web-app/assets/railroadDiagram-O6MQD6OU-Dv7lFZ_v.js +2 -0
  118. package/dist/web-app/assets/railroadDiagram-O6MQD6OU-Dv7lFZ_v.js.map +1 -0
  119. package/dist/web-app/assets/requirementDiagram-BXWQKSXE-BetEel-k.js +85 -0
  120. package/dist/web-app/assets/requirementDiagram-BXWQKSXE-BetEel-k.js.map +1 -0
  121. package/dist/web-app/assets/sankeyDiagram-P5KCCOFB-DCQgLfvK.js +41 -0
  122. package/dist/web-app/assets/sankeyDiagram-P5KCCOFB-DCQgLfvK.js.map +1 -0
  123. package/dist/web-app/assets/sequenceDiagram-WJ2MYXX4-CsGOoqu_.js +163 -0
  124. package/dist/web-app/assets/sequenceDiagram-WJ2MYXX4-CsGOoqu_.js.map +1 -0
  125. package/dist/web-app/assets/sizeCapture-INFHLROL-CLQRMiEc.js +2 -0
  126. package/dist/web-app/assets/sizeCapture-INFHLROL-CLQRMiEc.js.map +1 -0
  127. package/dist/web-app/assets/stateDiagram-D77RDMKH-D2MRdC5Q.js +2 -0
  128. package/dist/web-app/assets/stateDiagram-D77RDMKH-D2MRdC5Q.js.map +1 -0
  129. package/dist/web-app/assets/stateDiagram-v2-MP3YSRHH-CToAT5fD.js +2 -0
  130. package/dist/web-app/assets/stateDiagram-v2-MP3YSRHH-CToAT5fD.js.map +1 -0
  131. package/dist/web-app/assets/swimlanes-42K2YHIH-BGjHfR8x.js +2 -0
  132. package/dist/web-app/assets/swimlanes-42K2YHIH-BGjHfR8x.js.map +1 -0
  133. package/dist/web-app/assets/swimlanesDiagram-VR7AAH4N-bLHg88Vk.js +9 -0
  134. package/dist/web-app/assets/swimlanesDiagram-VR7AAH4N-bLHg88Vk.js.map +1 -0
  135. package/dist/web-app/assets/timeline-definition-24CTP7MA-DhGtHQ0p.js +121 -0
  136. package/dist/web-app/assets/timeline-definition-24CTP7MA-DhGtHQ0p.js.map +1 -0
  137. package/dist/web-app/assets/vennDiagram-4TSXK5OY-Dv5irf00.js +35 -0
  138. package/dist/web-app/assets/vennDiagram-4TSXK5OY-Dv5irf00.js.map +1 -0
  139. package/dist/web-app/assets/wardleyDiagram-VM6X3IG4-JGiUTj5x.js +79 -0
  140. package/dist/web-app/assets/wardleyDiagram-VM6X3IG4-JGiUTj5x.js.map +1 -0
  141. package/dist/web-app/assets/xychartDiagram-S5SC5T6Z-Dw5ev7_Q.js +8 -0
  142. package/dist/web-app/assets/xychartDiagram-S5SC5T6Z-Dw5ev7_Q.js.map +1 -0
  143. package/dist/web-app/fleet-index.html +19 -0
  144. package/dist/web-app/fleet.webmanifest +37 -0
  145. package/dist/web-app/icons/apple-touch-icon.png +0 -0
  146. package/dist/web-app/icons/favicon-16.png +0 -0
  147. package/dist/web-app/icons/favicon-32.png +0 -0
  148. package/dist/web-app/icons/icon-192-maskable.png +0 -0
  149. package/dist/web-app/icons/icon-192.png +0 -0
  150. package/dist/web-app/icons/icon-512-maskable.png +0 -0
  151. package/dist/web-app/icons/icon-512.png +0 -0
  152. package/dist/web-app/index.html +19 -0
  153. package/dist/web-app/manifest.webmanifest +17 -0
  154. package/dist/web-app/sw.js +221 -0
  155. package/dist/web-app/version.json +1 -0
  156. package/dist/web-app/workspace-install.sh +148 -0
  157. package/dist/web-app/workspace-tunnel.sh +40 -0
  158. package/dist/workspace-enrollment.d.ts +3 -0
  159. package/dist/workspace-enrollment.js +18 -1
  160. package/package.json +2 -2
@@ -0,0 +1,79 @@
1
+ import{p as St}from"./chunk-JWPE2WC7-FHO-M3vi.js";import{s as Mt,g as Nt,o as zt,n as Lt,a as Tt,b as At,_ as u,E as Xt,y as Et,A as U,l as K,D as Yt,d as It,p as Bt,c as j}from"./mermaid.core-CNKolAgz.js";import{p as Ft}from"./cynefin-OW5HDTMX-DI-DeNUk.js";import"./index-i9rKiqYX.js";var D=u((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=u((e,n,r)=>({x:D(n,`${r} evolution`),y:D(e,`${r} visibility`)}),"toCoordinates"),J=u(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Rt=u(e=>{if(!e?.startsWith("+"))return{};const r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Ot=u((e,n)=>{if(St(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),x=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:x})}if(e.anchors.forEach(r=>{const x=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,x.x,x.y,"anchor")}),e.components.forEach(r=>{const x=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,d=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,w=r.decorator?.strategy;n.addNode(r.name,r.name,x.x,x.y,"component",a,d,r.inertia,w)}),e.notes.forEach(r=>{const x=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,x.x,x.y)}),e.pipelines.forEach(r=>{const x=n.getNode(r.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=x.y;n.startPipeline(r.parent),r.components.forEach(d=>{const w=`${r.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,F,a,"pipeline-component",C,g),n.addPipelineComponent(r.parent,w)})}),e.links.forEach(r=>{const x=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=J(r.fromPort)??J(r.toPort);const{flow:d,label:w}=Rt(r.arrow);!a&&d&&(a=d);const C=r.linkLabel,g=w??C;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),x,g,a)}),e.evolves.forEach(r=>{const x=n.getNode(r.component);if(x?.y!==void 0){const a=D(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,x.y)}}),e.annotations.length>0){const r=e.annotations[0],x=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(x.x,x.y)}e.annotation.forEach(r=>{const x=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:x.x,y:x.y}],r.text)}),e.accelerators.forEach(r=>{const x=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,x.x,x.y)}),e.deaccelerators.forEach(r=>{const x=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,x.x,x.y)})},"populateDb"),Q={parser:{yy:void 0},parse:u(async e=>{const n=await Ft("wardley",e);K.debug(n);const r=Q.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ot(n,r)},"parse")},Wt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{u(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const x=this.nodes.get(n);x&&(x.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k=new Wt;function tt(){return j()["wardley-beta"]}u(tt,"getConfig");function et(e,n,r,x,a,d,w,C,g){k.addNode({id:e,label:n,x:r,y:x,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(et,"addNode");function at(e,n,r=!1,x,a){k.addLink({source:e,target:n,dashed:r,label:x,flow:a})}u(at,"addLink");function rt(e,n,r){k.addTrend({nodeId:e,targetX:n,targetY:r})}u(rt,"addTrend");function ot(e,n,r){k.addAnnotation({number:e,coordinates:n,text:r})}u(ot,"addAnnotation");function nt(e,n,r){k.addNote({text:e,x:n,y:r})}u(nt,"addNote");function st(e,n,r){k.addAccelerator({name:e,x:n,y:r})}u(st,"addAccelerator");function it(e,n,r){k.addDeaccelerator({name:e,x:n,y:r})}u(it,"addDeaccelerator");function dt(e,n){k.setAnnotationsBox(e,n)}u(dt,"setAnnotationsBox");function lt(e,n){k.setSize(e,n)}u(lt,"setSize");function ct(e){k.startPipeline(e)}u(ct,"startPipeline");function pt(e,n){k.addPipelineComponent(e,n)}u(pt,"addPipelineComponent");function ft(e){k.setAxes(e)}u(ft,"updateAxes");function ht(e){return k.getNode(e)}u(ht,"getNode");function xt(e){return k.resolveNodeId(e)}u(xt,"resolveNodeId");function gt(){return k.build()}u(gt,"getWardleyData");function yt(){k.clear(),Bt()}u(yt,"clear");var Dt={getConfig:tt,addNode:et,addLink:at,addTrend:rt,addAnnotation:ot,addNote:nt,addAccelerator:st,addDeaccelerator:it,setAnnotationsBox:dt,setSize:lt,startPipeline:ct,addPipelineComponent:pt,updateAxes:ft,getNode:ht,resolveNodeId:xt,getWardleyData:gt,clear:yt,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},Gt=["Genesis","Custom Built","Product","Commodity"],qt=u(()=>{const{themeVariables:e}=j();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),Ht=u(()=>{const e=j()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),jt=u((e,n,r,x)=>{K.debug(`Rendering Wardley map
2
+ `+e);const a=Ht(),d=qt(),w=a.nodeRadius*1.6,C=x.db,g=C.getWardleyData(),F=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,E=Yt(n);E.selectAll("*").remove(),It(E,b,S,a.useMaxWidth),E.attr("viewBox",`0 0 ${S} ${b}`);const v=E.append("g").attr("class","wardley-map"),G=E.append("defs");G.append("marker").attr("id",`arrow-${n}`).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("fill",d.evolutionStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-end-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-start-${n}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const Y=S-a.padding*2,I=b-a.padding*2;F&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(F);const z=u(t=>a.padding+t/100*Y,"projectX"),L=u(t=>b-a.padding-t/100*I,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const ut=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+Y/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(ut),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+I/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+I/2})`).text(wt);const B=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Gt;if(B.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===B.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{const i=1/B.length;B.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}B.forEach((i,p)=>{const l=o[p],f=a.padding+l.start*Y,h=a.padding+l.end*Y,y=(f+h)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const o=s/4,i=a.padding+Y*o;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-I*o).attr("y2",b-a.padding-I*o).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(o=>{if(o.componentIds.length===0)return;const i=o.componentIds.map(h=>({id:h,pos:c.get(h),node:g.nodes.find(y=>y.id===h)})).filter(h=>h.pos&&h.node).sort((h,y)=>h.node.x-y.node.x);for(let h=0;h<i.length-1;h++){const y=i[h],m=i[h+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(o.componentIds.forEach(h=>{const y=c.get(h);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(o.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const V=v.append("g").attr("class","wardley-links"),_=new Map;g.pipelines.forEach(t=>{_.set(t.nodeId,new Set(t.componentIds))});const Z=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||_.get(t.target)?.has(t.source)));V.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.x+l/h*p}).attr("y1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.y+f/h*p}).attr("x2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.x+l/h*p}).attr("y2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.y+f/h*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${n})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${n})`:null),V.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=o.y-s.y,l=o.x-s.x,f=Math.sqrt(l*l+p*p),h=8,y=p/f;return i+y*h}).attr("y",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.y+o.y)/2,p=o.x-s.x,l=o.y-s.y,f=Math.sqrt(p*p+l*l),h=8,y=-p/f;return i+y*h}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=(s.y+o.y)/2,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f),y=8,m=f/h,P=-l/h,N=i+m*y,O=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${O})`}).text(t=>t.label);const mt=v.append("g").attr("class","wardley-trends"),kt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const o=z(t.targetX),i=L(t.targetY),p=o-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),h=a.nodeRadius+2,y=f>h?o-p/f*h:o,m=f>h?i-l/f*h:i;return{origin:s,targetX:o,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);mt.selectAll("line").data(kt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${n})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y1",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y-o/2}).attr("x2",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y2",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y+o/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let o=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(o+=10);const i=t.labelOffsetX??o;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let o=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(o-=10);const i=t.labelOffsetY??o;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const o=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(o.length>1)for(let i=0;i<o.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",o[i].x).attr("y1",o[i].y).attr("x2",o[i+1].x).attr("y2",o[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");o.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),o=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),h=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(h.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",o+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(H=>{const W=H.node(),Pt=W.getComputedTextLength();m=Math.max(m,Pt);const Ct=W.getBBox();P=Math.max(P,Ct.height)});const N=m+i*2+105,O=h.length*p+i*2+P/2,X=a.padding,bt=S-a.padding-N,$t=a.padding,vt=b-a.padding-O;s=Math.max(X,Math.min(s,bt)),o=Math.max($t,Math.min(o,vt)),y.forEach((H,W)=>{H.attr("x",s+i).attr("y",o+i+(W+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",o).attr("width",N).attr("height",O).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const o=z(s.x),i=L(s.y);t.append("text").attr("x",o).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=`
3
+ M ${o} ${i-l/2}
4
+ L ${o+p-f} ${i-l/2}
5
+ L ${o+p-f} ${i-l/2-8}
6
+ L ${o+p} ${i}
7
+ L ${o+p-f} ${i+l/2+8}
8
+ L ${o+p-f} ${i+l/2}
9
+ L ${o} ${i+l/2}
10
+ Z
11
+ `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){const t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=`
12
+ M ${o+p} ${i-l/2}
13
+ L ${o+f} ${i-l/2}
14
+ L ${o+f} ${i-l/2-8}
15
+ L ${o} ${i}
16
+ L ${o+f} ${i+l/2+8}
17
+ L ${o+f} ${i+l/2}
18
+ L ${o+p} ${i+l/2}
19
+ Z
20
+ `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),Vt={draw:jt},_t=u(({wardley:e}={})=>{const n=Xt(),r=Et(),x=U(n,r.themeVariables),a=U(x.wardley,e);return`
21
+ .wardley-background {
22
+ fill: ${a.backgroundColor};
23
+ }
24
+ .wardley-axes line, .wardley-axes path {
25
+ stroke: ${a.axisColor};
26
+ }
27
+ .wardley-axis-label {
28
+ fill: ${a.axisTextColor};
29
+ }
30
+ .wardley-stage-label {
31
+ fill: ${a.axisTextColor};
32
+ }
33
+ .wardley-grid line {
34
+ stroke: ${a.gridColor};
35
+ }
36
+ .wardley-node circle {
37
+ fill: ${a.componentFill};
38
+ stroke: ${a.componentStroke};
39
+ }
40
+ .wardley-node-label {
41
+ fill: ${a.componentLabelColor};
42
+ }
43
+ .wardley-link {
44
+ stroke: ${a.linkStroke};
45
+ }
46
+ .wardley-link--dashed {
47
+ stroke-dasharray: 4 4;
48
+ }
49
+ .wardley-link-label {
50
+ fill: ${a.axisTextColor};
51
+ }
52
+ .wardley-trend line {
53
+ stroke: ${a.evolutionStroke};
54
+ }
55
+ .wardley-annotation-line {
56
+ stroke: ${a.annotationStroke};
57
+ }
58
+ .wardley-annotation circle {
59
+ fill: ${a.annotationFill};
60
+ stroke: ${a.annotationStroke};
61
+ }
62
+ .wardley-annotation text {
63
+ fill: ${a.annotationTextColor};
64
+ }
65
+ .wardley-annotations-box rect {
66
+ fill: ${a.annotationFill};
67
+ stroke: ${a.annotationStroke};
68
+ }
69
+ .wardley-annotations-box text {
70
+ fill: ${a.annotationTextColor};
71
+ }
72
+ .wardley-pipeline-box {
73
+ stroke: ${a.componentStroke};
74
+ }
75
+ .wardley-notes text {
76
+ fill: ${a.axisTextColor};
77
+ }
78
+ `},"styles"),te={parser:Q,db:Dt,renderer:Vt,styles:_t};export{te as diagram};
79
+ //# sourceMappingURL=wardleyDiagram-VM6X3IG4-JGiUTj5x.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wardleyDiagram-VM6X3IG4-JGiUTj5x.js","sources":["../../../node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-VM6X3IG4.mjs"],"sourcesContent":["import {\n populateCommonDb\n} from \"./chunk-JWPE2WC7.mjs\";\nimport {\n selectSvgElement\n} from \"./chunk-CLGD4ZFX.mjs\";\nimport {\n cleanAndMerge\n} from \"./chunk-75Z2AOVW.mjs\";\nimport {\n clear,\n configureSvgSize,\n getAccDescription,\n getAccTitle,\n getConfig,\n getConfig2,\n getDiagramTitle,\n getThemeVariables,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-DU6HZSFF.mjs\";\nimport {\n log\n} from \"./chunk-X3CZISLH.mjs\";\nimport {\n __name\n} from \"./chunk-Y2CYZVJY.mjs\";\n\n// src/diagrams/wardley/wardleyParser.ts\nimport { parse } from \"@mermaid-js/parser\";\nvar toPercent = /* @__PURE__ */ __name((value, context) => {\n const normalized = value <= 1 ? value * 100 : value;\n if (normalized < 0 || normalized > 100) {\n throw new Error(\n `${context} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${value}`\n );\n }\n return normalized;\n}, \"toPercent\");\nvar toCoordinates = /* @__PURE__ */ __name((visibility, evolution, context) => {\n return {\n x: toPercent(evolution, `${context} evolution`),\n y: toPercent(visibility, `${context} visibility`)\n };\n}, \"toCoordinates\");\nvar getFlowFromPort = /* @__PURE__ */ __name((port) => {\n if (!port) {\n return void 0;\n }\n if (port === \"+<>\") {\n return \"bidirectional\";\n }\n if (port === \"+<\") {\n return \"backward\";\n }\n if (port === \"+>\") {\n return \"forward\";\n }\n return void 0;\n}, \"getFlowFromPort\");\nvar extractFlowFromArrow = /* @__PURE__ */ __name((arrow) => {\n if (!arrow?.startsWith(\"+\")) {\n return {};\n }\n const labelMatch = /^\\+'([^']*)'/.exec(arrow);\n const flowLabel = labelMatch?.[1];\n if (arrow.includes(\"<>\")) {\n return { flow: \"bidirectional\", label: flowLabel };\n }\n if (arrow.includes(\"<\")) {\n return { flow: \"backward\", label: flowLabel };\n }\n if (arrow.includes(\">\")) {\n return { flow: \"forward\", label: flowLabel };\n }\n return { label: flowLabel };\n}, \"extractFlowFromArrow\");\nvar populateDb = /* @__PURE__ */ __name((ast, db) => {\n populateCommonDb(ast, db);\n if (ast.size) {\n db.setSize(ast.size.width, ast.size.height);\n }\n if (ast.evolution) {\n const stages = ast.evolution.stages.map((stage) => {\n if (stage.secondName) {\n return `${stage.name.trim()} / ${stage.secondName.trim()}`;\n }\n return stage.name.trim();\n });\n const stageBoundaries = ast.evolution.stages.filter((stage) => stage.boundary !== void 0).map((stage) => stage.boundary);\n db.updateAxes({ stages, stageBoundaries });\n }\n ast.anchors.forEach((anchor) => {\n const coords = toCoordinates(anchor.visibility, anchor.evolution, `Anchor \"${anchor.name}\"`);\n db.addNode(anchor.name, anchor.name, coords.x, coords.y, \"anchor\");\n });\n ast.components.forEach((component) => {\n const coords = toCoordinates(\n component.visibility,\n component.evolution,\n `Component \"${component.name}\"`\n );\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const sourceStrategy = component.decorator?.strategy;\n db.addNode(\n component.name,\n component.name,\n coords.x,\n coords.y,\n \"component\",\n labelOffsetX,\n labelOffsetY,\n component.inertia,\n sourceStrategy\n );\n });\n ast.notes.forEach((note) => {\n const coords = toCoordinates(note.visibility, note.evolution, `Note \"${note.text}\"`);\n db.addNote(note.text, coords.x, coords.y);\n });\n ast.pipelines.forEach((pipeline) => {\n const parentNode = db.getNode(pipeline.parent);\n if (!parentNode || typeof parentNode.y !== \"number\") {\n throw new Error(\n `Pipeline \"${pipeline.parent}\" must reference an existing component with coordinates.`\n );\n }\n const parentY = parentNode.y;\n db.startPipeline(pipeline.parent);\n pipeline.components.forEach((component) => {\n const componentId = `${pipeline.parent}_${component.name}`;\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const x = toPercent(component.evolution, `Pipeline component \"${component.name}\" evolution`);\n db.addNode(\n componentId,\n component.name,\n x,\n parentY,\n \"pipeline-component\",\n labelOffsetX,\n labelOffsetY\n );\n db.addPipelineComponent(pipeline.parent, componentId);\n });\n });\n ast.links.forEach((link) => {\n const isDashed = !!link.arrow && (link.arrow.includes(\"-.->\") || link.arrow.includes(\".-.\"));\n let flow = getFlowFromPort(link.fromPort) ?? getFlowFromPort(link.toPort);\n const { flow: arrowFlow, label: flowLabel } = extractFlowFromArrow(link.arrow);\n if (!flow && arrowFlow) {\n flow = arrowFlow;\n }\n const annotation = link.linkLabel;\n const label = flowLabel ?? annotation;\n db.addLink(db.resolveNodeId(link.from), db.resolveNodeId(link.to), isDashed, label, flow);\n });\n ast.evolves.forEach((evolve) => {\n const node = db.getNode(evolve.component);\n if (node?.y !== void 0) {\n const target = toPercent(evolve.target, `Evolve target for \"${evolve.component}\"`);\n db.addTrend(evolve.component, target, node.y);\n }\n });\n if (ast.annotations.length > 0) {\n const annotationsBox = ast.annotations[0];\n const coords = toCoordinates(annotationsBox.x, annotationsBox.y, \"Annotations box\");\n db.setAnnotationsBox(coords.x, coords.y);\n }\n ast.annotation.forEach((annotation) => {\n const coords = toCoordinates(annotation.x, annotation.y, `Annotation ${annotation.number}`);\n db.addAnnotation(annotation.number, [{ x: coords.x, y: coords.y }], annotation.text);\n });\n ast.accelerators.forEach((accelerator) => {\n const coords = toCoordinates(accelerator.x, accelerator.y, `Accelerator \"${accelerator.name}\"`);\n db.addAccelerator(accelerator.name, coords.x, coords.y);\n });\n ast.deaccelerators.forEach((deaccelerator) => {\n const coords = toCoordinates(\n deaccelerator.x,\n deaccelerator.y,\n `Deaccelerator \"${deaccelerator.name}\"`\n );\n db.addDeaccelerator(deaccelerator.name, coords.x, coords.y);\n });\n}, \"populateDb\");\nvar parser = {\n parser: {\n // @ts-expect-error - WardleyDB is not assignable to DiagramDB\n yy: void 0\n },\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"wardley\", input);\n log.debug(ast);\n const db = parser.parser?.yy;\n if (!db || typeof db.addNode !== \"function\") {\n throw new Error(\n \"parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.\"\n );\n }\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/wardley/wardleyBuilder.ts\nvar WardleyBuilder = class {\n constructor() {\n this.nodes = /* @__PURE__ */ new Map();\n this.links = [];\n this.trends = /* @__PURE__ */ new Map();\n this.pipelines = /* @__PURE__ */ new Map();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.axes = {};\n }\n static {\n __name(this, \"WardleyBuilder\");\n }\n addNode(node) {\n const existing = this.nodes.get(node.id) ?? { id: node.id, label: node.label };\n const merged = {\n ...existing,\n ...node,\n className: node.className ?? existing.className,\n labelOffsetX: node.labelOffsetX ?? existing.labelOffsetX,\n labelOffsetY: node.labelOffsetY ?? existing.labelOffsetY\n };\n this.nodes.set(node.id, merged);\n }\n addLink(link) {\n this.links.push(link);\n }\n addTrend(trend) {\n this.trends.set(trend.nodeId, trend);\n }\n startPipeline(nodeId) {\n this.pipelines.set(nodeId, { nodeId, componentIds: [] });\n const node = this.nodes.get(nodeId);\n if (node) {\n node.isPipelineParent = true;\n }\n }\n addPipelineComponent(pipelineNodeId, componentId) {\n const pipeline = this.pipelines.get(pipelineNodeId);\n if (pipeline) {\n pipeline.componentIds.push(componentId);\n }\n const node = this.nodes.get(componentId);\n if (node) {\n node.inPipeline = true;\n }\n }\n addAnnotation(annotation) {\n this.annotations.push(annotation);\n }\n addNote(note) {\n this.notes.push(note);\n }\n addAccelerator(accelerator) {\n this.accelerators.push(accelerator);\n }\n addDeaccelerator(deaccelerator) {\n this.deaccelerators.push(deaccelerator);\n }\n setAnnotationsBox(x, y) {\n this.annotationsBox = { x, y };\n }\n setAxes(partial) {\n this.axes = {\n ...this.axes,\n ...partial\n };\n }\n setSize(width, height) {\n this.size = { width, height };\n }\n getNode(id) {\n return this.nodes.get(id);\n }\n /**\n * Resolve a name to a node ID. Tries exact ID match first,\n * then falls back to finding a node whose label matches the name\n * (handles pipeline components which have synthetic IDs like \"Parent_Child\").\n */\n resolveNodeId(name) {\n if (this.nodes.has(name)) {\n return name;\n }\n for (const [id, node] of this.nodes) {\n if (node.label === name) {\n return id;\n }\n }\n return name;\n }\n build() {\n const nodes = [];\n for (const node of this.nodes.values()) {\n if (typeof node.x !== \"number\" || typeof node.y !== \"number\") {\n throw new Error(`Node \"${node.label}\" is missing coordinates`);\n }\n nodes.push(node);\n }\n return {\n nodes,\n links: [...this.links],\n trends: [...this.trends.values()],\n pipelines: [...this.pipelines.values()],\n annotations: [...this.annotations],\n notes: [...this.notes],\n accelerators: [...this.accelerators],\n deaccelerators: [...this.deaccelerators],\n annotationsBox: this.annotationsBox,\n axes: { ...this.axes },\n size: this.size\n };\n }\n clear() {\n this.nodes.clear();\n this.links = [];\n this.trends.clear();\n this.pipelines.clear();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.annotationsBox = void 0;\n this.axes = {};\n this.size = void 0;\n }\n};\n\n// src/diagrams/wardley/wardleyDb.ts\nvar builder = new WardleyBuilder();\nfunction getConfig3() {\n return getConfig2()[\"wardley-beta\"];\n}\n__name(getConfig3, \"getConfig\");\nfunction addNode(id, label, x, y, className, labelOffsetX, labelOffsetY, inertia, sourceStrategy) {\n builder.addNode({\n id,\n label,\n x,\n y,\n className,\n labelOffsetX,\n labelOffsetY,\n inertia,\n sourceStrategy\n });\n}\n__name(addNode, \"addNode\");\nfunction addLink(sourceId, targetId, dashed = false, label, flow) {\n builder.addLink({\n source: sourceId,\n target: targetId,\n dashed,\n label,\n flow\n });\n}\n__name(addLink, \"addLink\");\nfunction addTrend(nodeId, targetX, targetY) {\n builder.addTrend({ nodeId, targetX, targetY });\n}\n__name(addTrend, \"addTrend\");\nfunction addAnnotation(number, coordinates, text) {\n builder.addAnnotation({\n number,\n coordinates,\n text\n });\n}\n__name(addAnnotation, \"addAnnotation\");\nfunction addNote(text, x, y) {\n builder.addNote({\n text,\n x,\n y\n });\n}\n__name(addNote, \"addNote\");\nfunction addAccelerator(name, x, y) {\n builder.addAccelerator({\n name,\n x,\n y\n });\n}\n__name(addAccelerator, \"addAccelerator\");\nfunction addDeaccelerator(name, x, y) {\n builder.addDeaccelerator({\n name,\n x,\n y\n });\n}\n__name(addDeaccelerator, \"addDeaccelerator\");\nfunction setAnnotationsBox(x, y) {\n builder.setAnnotationsBox(x, y);\n}\n__name(setAnnotationsBox, \"setAnnotationsBox\");\nfunction setSize(width, height) {\n builder.setSize(width, height);\n}\n__name(setSize, \"setSize\");\nfunction startPipeline(nodeId) {\n builder.startPipeline(nodeId);\n}\n__name(startPipeline, \"startPipeline\");\nfunction addPipelineComponent(pipelineNodeId, componentId) {\n builder.addPipelineComponent(pipelineNodeId, componentId);\n}\n__name(addPipelineComponent, \"addPipelineComponent\");\nfunction updateAxes(partial) {\n builder.setAxes(partial);\n}\n__name(updateAxes, \"updateAxes\");\nfunction getNode(id) {\n return builder.getNode(id);\n}\n__name(getNode, \"getNode\");\nfunction resolveNodeId(name) {\n return builder.resolveNodeId(name);\n}\n__name(resolveNodeId, \"resolveNodeId\");\nfunction getWardleyData() {\n return builder.build();\n}\n__name(getWardleyData, \"getWardleyData\");\nfunction clear2() {\n builder.clear();\n clear();\n}\n__name(clear2, \"clear\");\nvar wardleyDb_default = {\n getConfig: getConfig3,\n addNode,\n addLink,\n addTrend,\n addAnnotation,\n addNote,\n addAccelerator,\n addDeaccelerator,\n setAnnotationsBox,\n setSize,\n startPipeline,\n addPipelineComponent,\n updateAxes,\n getNode,\n resolveNodeId,\n getWardleyData,\n clear: clear2,\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle,\n getAccDescription,\n setAccDescription\n};\n\n// src/diagrams/wardley/wardleyRenderer.ts\nvar DEFAULT_STAGES = [\"Genesis\", \"Custom Built\", \"Product\", \"Commodity\"];\nvar getTheme = /* @__PURE__ */ __name(() => {\n const { themeVariables } = getConfig2();\n return {\n backgroundColor: themeVariables.wardley?.backgroundColor ?? themeVariables.background ?? \"#fff\",\n axisColor: themeVariables.wardley?.axisColor ?? \"#000\",\n axisTextColor: themeVariables.wardley?.axisTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n gridColor: themeVariables.wardley?.gridColor ?? \"rgba(100, 100, 100, 0.2)\",\n componentFill: themeVariables.wardley?.componentFill ?? \"#fff\",\n componentStroke: themeVariables.wardley?.componentStroke ?? \"#000\",\n componentLabelColor: themeVariables.wardley?.componentLabelColor ?? themeVariables.primaryTextColor ?? \"#222\",\n linkStroke: themeVariables.wardley?.linkStroke ?? \"#000\",\n evolutionStroke: themeVariables.wardley?.evolutionStroke ?? \"#dc3545\",\n annotationStroke: themeVariables.wardley?.annotationStroke ?? \"#000\",\n annotationTextColor: themeVariables.wardley?.annotationTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n annotationFill: themeVariables.wardley?.annotationFill ?? themeVariables.background ?? \"#fff\"\n };\n}, \"getTheme\");\nvar getConfigValues = /* @__PURE__ */ __name(() => {\n const wardleyConfig = getConfig2()[\"wardley-beta\"];\n return {\n width: wardleyConfig?.width ?? 900,\n height: wardleyConfig?.height ?? 600,\n padding: wardleyConfig?.padding ?? 48,\n nodeRadius: wardleyConfig?.nodeRadius ?? 6,\n nodeLabelOffset: wardleyConfig?.nodeLabelOffset ?? 8,\n axisFontSize: wardleyConfig?.axisFontSize ?? 12,\n labelFontSize: wardleyConfig?.labelFontSize ?? 10,\n showGrid: wardleyConfig?.showGrid ?? false,\n useMaxWidth: wardleyConfig?.useMaxWidth ?? true\n };\n}, \"getConfigValues\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"Rendering Wardley map\\n\" + text);\n const configValues = getConfigValues();\n const theme = getTheme();\n const squareSize = configValues.nodeRadius * 1.6;\n const db = diagObj.db;\n const data = db.getWardleyData();\n const title = db.getDiagramTitle();\n const width = data.size?.width ?? configValues.width;\n const height = data.size?.height ?? configValues.height;\n const svg = selectSvgElement(id);\n svg.selectAll(\"*\").remove();\n configureSvgSize(svg, height, width, configValues.useMaxWidth);\n svg.attr(\"viewBox\", `0 0 ${width} ${height}`);\n const root = svg.append(\"g\").attr(\"class\", \"wardley-map\");\n const defs = svg.append(\"defs\");\n defs.append(\"marker\").attr(\"id\", `arrow-${id}`).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(\"fill\", theme.evolutionStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-end-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-start-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 1).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 10 0 L 0 5 L 10 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n root.append(\"rect\").attr(\"class\", \"wardley-background\").attr(\"width\", width).attr(\"height\", height).attr(\"fill\", theme.backgroundColor);\n const chartWidth = width - configValues.padding * 2;\n const chartHeight = height - configValues.padding * 2;\n if (title) {\n root.append(\"text\").attr(\"class\", \"wardley-title\").attr(\"x\", width / 2).attr(\"y\", configValues.padding / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize * 1.05).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(title);\n }\n const projectX = /* @__PURE__ */ __name((value) => configValues.padding + value / 100 * chartWidth, \"projectX\");\n const projectY = /* @__PURE__ */ __name((value) => height - configValues.padding - value / 100 * chartHeight, \"projectY\");\n const axisGroup = root.append(\"g\").attr(\"class\", \"wardley-axes\");\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", configValues.padding).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n const xLabel = data.axes.xLabel ?? \"Evolution\";\n const yLabel = data.axes.yLabel ?? \"Visibility\";\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-x\").attr(\"x\", configValues.padding + chartWidth / 2).attr(\"y\", height - configValues.padding / 4).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").text(xLabel);\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-y\").attr(\"x\", configValues.padding / 3).attr(\"y\", configValues.padding + chartHeight / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\n \"transform\",\n `rotate(-90 ${configValues.padding / 3} ${configValues.padding + chartHeight / 2})`\n ).text(yLabel);\n const stages = data.axes.stages && data.axes.stages.length > 0 ? data.axes.stages : DEFAULT_STAGES;\n if (stages.length > 0) {\n const stageGroup = root.append(\"g\").attr(\"class\", \"wardley-stages\");\n const boundaries = data.axes.stageBoundaries;\n const stagePositions = [];\n if (boundaries && boundaries.length === stages.length) {\n let prevBoundary = 0;\n boundaries.forEach((boundary) => {\n stagePositions.push({ start: prevBoundary, end: boundary });\n prevBoundary = boundary;\n });\n } else {\n const stageWidth = 1 / stages.length;\n stages.forEach((_, index) => {\n stagePositions.push({\n start: index * stageWidth,\n end: (index + 1) * stageWidth\n });\n });\n }\n stages.forEach((stage, index) => {\n const pos = stagePositions[index];\n const startX = configValues.padding + pos.start * chartWidth;\n const endX = configValues.padding + pos.end * chartWidth;\n const centerX = (startX + endX) / 2;\n if (index > 0) {\n stageGroup.append(\"line\").attr(\"x1\", startX).attr(\"x2\", startX).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"5 5\").attr(\"opacity\", 0.8);\n }\n stageGroup.append(\"text\").attr(\"class\", \"wardley-stage-label\").attr(\"x\", centerX).attr(\"y\", height - configValues.padding / 1.5).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize - 2).attr(\"text-anchor\", \"middle\").text(stage);\n });\n }\n if (configValues.showGrid) {\n const gridGroup = root.append(\"g\").attr(\"class\", \"wardley-grid\");\n for (let i = 1; i < 4; i++) {\n const ratio = i / 4;\n const x = configValues.padding + chartWidth * ratio;\n gridGroup.append(\"line\").attr(\"x1\", x).attr(\"x2\", x).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n gridGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding - chartHeight * ratio).attr(\"y2\", height - configValues.padding - chartHeight * ratio).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n }\n }\n const positions = /* @__PURE__ */ new Map();\n data.nodes.forEach((node) => {\n positions.set(node.id, {\n x: projectX(node.x),\n y: projectY(node.y),\n node\n });\n });\n if (data.pipelines.length > 0) {\n const pipelineGroup = root.append(\"g\").attr(\"class\", \"wardley-pipelines\");\n const pipelineLinksGroup = root.append(\"g\").attr(\"class\", \"wardley-pipeline-links\");\n data.pipelines.forEach((pipeline) => {\n if (pipeline.componentIds.length === 0) {\n return;\n }\n const sortedComponents = pipeline.componentIds.map((id2) => ({ id: id2, pos: positions.get(id2), node: data.nodes.find((n) => n.id === id2) })).filter((c) => c.pos && c.node).sort((a, b) => a.node.x - b.node.x);\n for (let i = 0; i < sortedComponents.length - 1; i++) {\n const current = sortedComponents[i];\n const next = sortedComponents[i + 1];\n pipelineLinksGroup.append(\"line\").attr(\"class\", \"wardley-pipeline-evolution-link\").attr(\"x1\", current.pos.x).attr(\"y1\", current.pos.y).attr(\"x2\", next.pos.x).attr(\"y2\", next.pos.y).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\");\n }\n let minX = Infinity;\n let maxX = -Infinity;\n let y = 0;\n pipeline.componentIds.forEach((componentId) => {\n const pos = positions.get(componentId);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n y = pos.y;\n }\n });\n if (minX !== Infinity && maxX !== -Infinity) {\n const padding = 15;\n const height2 = configValues.nodeRadius * 4;\n const boxTop = y - height2 / 2;\n const parentPos = positions.get(pipeline.nodeId);\n if (parentPos) {\n const centerX = (minX + maxX) / 2;\n parentPos.x = centerX;\n parentPos.y = boxTop - squareSize / 6;\n }\n pipelineGroup.append(\"rect\").attr(\"class\", \"wardley-pipeline-box\").attr(\"x\", minX - padding).attr(\"y\", boxTop).attr(\"width\", maxX - minX + padding * 2).attr(\"height\", height2).attr(\"fill\", \"none\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n });\n }\n const linksGroup = root.append(\"g\").attr(\"class\", \"wardley-links\");\n const pipelineMap = /* @__PURE__ */ new Map();\n data.pipelines.forEach((pipeline) => {\n pipelineMap.set(pipeline.nodeId, new Set(pipeline.componentIds));\n });\n const validLinks = data.links.filter((link) => {\n if (!positions.has(link.source) || !positions.has(link.target)) {\n return false;\n }\n const pipelineComponents = pipelineMap.get(link.target);\n if (pipelineComponents?.has(link.source)) {\n return false;\n }\n return true;\n });\n linksGroup.selectAll(\"line\").data(validLinks).enter().append(\"line\").attr(\"class\", (link) => `wardley-link${link.dashed ? \" wardley-link--dashed\" : \"\"}`).attr(\"x1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.x + dx / distance * radius;\n }).attr(\"y1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.y + dy / distance * radius;\n }).attr(\"x2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.x + dx / distance * radius;\n }).attr(\"y2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.y + dy / distance * radius;\n }).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", (link) => link.dashed ? \"6 6\" : null).attr(\"marker-end\", (link) => {\n if (link.flow === \"forward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-end-${id})`;\n }\n return null;\n }).attr(\"marker-start\", (link) => {\n if (link.flow === \"backward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-start-${id})`;\n }\n return null;\n });\n linksGroup.selectAll(\"text\").data(validLinks.filter((link) => link.label)).enter().append(\"text\").attr(\"class\", \"wardley-link-label\").attr(\"x\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const dy = targetPos.y - sourcePos.y;\n const dx = targetPos.x - sourcePos.x;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n return midX + perpX * offset;\n }).attr(\"y\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpY = -dx / distance;\n return midY + perpY * offset;\n }).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.labelFontSize).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").attr(\"transform\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n const perpY = -dx / distance;\n const labelX = midX + perpX * offset;\n const labelY = midY + perpY * offset;\n let angle = Math.atan2(dy, dx) * 180 / Math.PI;\n if (angle > 90 || angle < -90) {\n angle += 180;\n }\n return `rotate(${angle} ${labelX} ${labelY})`;\n }).text((link) => link.label);\n const trendGroup = root.append(\"g\").attr(\"class\", \"wardley-trends\");\n const trendsWithPositions = data.trends.map((trend) => {\n const origin = positions.get(trend.nodeId);\n if (!origin) {\n return null;\n }\n const targetX = projectX(trend.targetX);\n const targetY = projectY(trend.targetY);\n const dx = targetX - origin.x;\n const dy = targetY - origin.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const shortenBy = configValues.nodeRadius + 2;\n const adjustedX2 = distance > shortenBy ? targetX - dx / distance * shortenBy : targetX;\n const adjustedY2 = distance > shortenBy ? targetY - dy / distance * shortenBy : targetY;\n return {\n origin,\n targetX,\n targetY,\n adjustedX2,\n adjustedY2\n };\n }).filter((trend) => trend !== null);\n trendGroup.selectAll(\"line\").data(trendsWithPositions).enter().append(\"line\").attr(\"class\", \"wardley-trend\").attr(\"x1\", (trend) => trend.origin.x).attr(\"y1\", (trend) => trend.origin.y).attr(\"x2\", (trend) => trend.adjustedX2).attr(\"y2\", (trend) => trend.adjustedY2).attr(\"stroke\", theme.evolutionStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\").attr(\"marker-end\", `url(#arrow-${id})`);\n const nodesGroup = root.append(\"g\").attr(\"class\", \"wardley-nodes\");\n const nodeEnter = nodesGroup.selectAll(\"g\").data(data.nodes).enter().append(\"g\").attr(\n \"class\",\n (node) => [\"wardley-node\", node.className ? `wardley-node--${node.className}` : \"\"].filter(Boolean).join(\" \")\n );\n nodeEnter.filter((node) => node.sourceStrategy === \"outsource\").append(\"circle\").attr(\"class\", \"wardley-outsource-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#666\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"buy\").append(\"circle\").attr(\"class\", \"wardley-buy-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#ccc\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"build\").append(\"circle\").attr(\"class\", \"wardley-build-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#eee\").attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1);\n const marketNodes = nodeEnter.filter((node) => node.sourceStrategy === \"market\");\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter(\n (node) => !node.isPipelineParent && node.sourceStrategy !== \"market\" && node.className !== \"anchor\"\n ).append(\"circle\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n const smallCircleRadius = configValues.nodeRadius * 0.7;\n const triangleRadius = configValues.nodeRadius * 1.2;\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x).attr(\"y1\", (node) => positions.get(node.id).y - triangleRadius).attr(\"x2\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x).attr(\"y2\", (node) => positions.get(node.id).y - triangleRadius).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y - triangleRadius).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n nodeEnter.filter((node) => node.isPipelineParent === true).append(\"rect\").attr(\"x\", (node) => positions.get(node.id).x - squareSize / 2).attr(\"y\", (node) => positions.get(node.id).y - squareSize / 2).attr(\"width\", squareSize).attr(\"height\", squareSize).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.inertia === true).append(\"line\").attr(\"class\", \"wardley-inertia\").attr(\"x1\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y1\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y - lineHeight / 2;\n }).attr(\"x2\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y2\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y + lineHeight / 2;\n }).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 6);\n nodeEnter.append(\"text\").attr(\"x\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetX !== void 0 ? pos.x + node.labelOffsetX : pos.x;\n }\n let defaultOffset = configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetX === void 0) {\n defaultOffset += 10;\n }\n const customOffset = node.labelOffsetX ?? defaultOffset;\n return pos.x + customOffset;\n }).attr(\"y\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetY !== void 0 ? pos.y + node.labelOffsetY : pos.y - 3;\n }\n let defaultOffset = -configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetY === void 0) {\n defaultOffset -= 10;\n }\n const customOffset = node.labelOffsetY ?? defaultOffset;\n return pos.y + customOffset;\n }).attr(\"class\", \"wardley-node-label\").attr(\"fill\", (node) => {\n if (node.className === \"evolved\") {\n return theme.evolutionStroke;\n }\n if (node.className === \"anchor\") {\n return \"#000\";\n }\n return theme.componentLabelColor;\n }).attr(\"font-size\", configValues.labelFontSize).attr(\"font-weight\", (node) => node.className === \"anchor\" ? \"bold\" : \"normal\").attr(\"text-anchor\", (node) => node.className === \"anchor\" ? \"middle\" : \"start\").attr(\"dominant-baseline\", (node) => node.className === \"anchor\" ? \"middle\" : \"auto\").text((node) => node.label);\n if (data.annotations.length > 0) {\n const annotationsGroup = root.append(\"g\").attr(\"class\", \"wardley-annotations\");\n data.annotations.forEach((annotation) => {\n const projectedCoords = annotation.coordinates.map((coord) => ({\n x: projectX(coord.x),\n y: projectY(coord.y)\n }));\n if (projectedCoords.length > 1) {\n for (let i = 0; i < projectedCoords.length - 1; i++) {\n annotationsGroup.append(\"line\").attr(\"class\", \"wardley-annotation-line\").attr(\"x1\", projectedCoords[i].x).attr(\"y1\", projectedCoords[i].y).attr(\"x2\", projectedCoords[i + 1].x).attr(\"y2\", projectedCoords[i + 1].y).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"stroke-dasharray\", \"4 4\");\n }\n }\n projectedCoords.forEach((coord) => {\n const annotationNode = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotation\");\n annotationNode.append(\"circle\").attr(\"cx\", coord.x).attr(\"cy\", coord.y).attr(\"r\", 10).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5);\n annotationNode.append(\"text\").attr(\"x\", coord.x).attr(\"y\", coord.y).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"central\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(annotation.number);\n });\n });\n if (data.annotationsBox) {\n let boxX = projectX(data.annotationsBox.x);\n let boxY = projectY(data.annotationsBox.y);\n const padding = 10;\n const lineHeight = 16;\n const fontSize = 11;\n const textBoxGroup = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotations-box\");\n const sortedAnnotations = [...data.annotations].filter((a) => a.text).sort((a, b) => a.number - b.number);\n const textElements = [];\n sortedAnnotations.forEach((annotation, idx) => {\n const text2 = textBoxGroup.append(\"text\").attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight).attr(\"font-size\", fontSize).attr(\"fill\", theme.axisTextColor).attr(\"text-anchor\", \"start\").attr(\"dominant-baseline\", \"middle\").text(`${annotation.number}. ${annotation.text}`);\n textElements.push(text2);\n });\n if (textElements.length > 0) {\n let maxWidth = 0;\n let maxHeight = 0;\n textElements.forEach((text2) => {\n const textNode = text2.node();\n const textWidth = textNode.getComputedTextLength();\n maxWidth = Math.max(maxWidth, textWidth);\n const bbox = textNode.getBBox();\n maxHeight = Math.max(maxHeight, bbox.height);\n });\n const boxWidth = maxWidth + padding * 2 + 105;\n const boxHeight = sortedAnnotations.length * lineHeight + padding * 2 + maxHeight / 2;\n const minX = configValues.padding;\n const maxX = width - configValues.padding - boxWidth;\n const minY = configValues.padding;\n const maxY = height - configValues.padding - boxHeight;\n boxX = Math.max(minX, Math.min(boxX, maxX));\n boxY = Math.max(minY, Math.min(boxY, maxY));\n textElements.forEach((text2, idx) => {\n text2.attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight);\n });\n textBoxGroup.insert(\"rect\", \"text\").attr(\"x\", boxX).attr(\"y\", boxY).attr(\"width\", boxWidth).attr(\"height\", boxHeight).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n }\n }\n if (data.notes.length > 0) {\n const notesGroup = root.append(\"g\").attr(\"class\", \"wardley-notes\");\n data.notes.forEach((note) => {\n const noteX = projectX(note.x);\n const noteY = projectY(note.y);\n notesGroup.append(\"text\").attr(\"x\", noteX).attr(\"y\", noteY).attr(\"text-anchor\", \"start\").attr(\"font-size\", 11).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(note.text);\n });\n }\n if (data.accelerators.length > 0) {\n const acceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-accelerators\");\n data.accelerators.forEach((accelerator) => {\n const accX = projectX(accelerator.x);\n const accY = projectY(accelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${accX} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2 - 8}\n L ${accX + arrowWidth} ${accY}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2 + 8}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2}\n L ${accX} ${accY + arrowHeight / 2}\n Z\n `;\n acceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n acceleratorsGroup.append(\"text\").attr(\"x\", accX + arrowWidth / 2).attr(\"y\", accY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(accelerator.name);\n });\n }\n if (data.deaccelerators.length > 0) {\n const deacceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-deaccelerators\");\n data.deaccelerators.forEach((deaccelerator) => {\n const decX = projectX(deaccelerator.x);\n const decY = projectY(deaccelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${decX + arrowWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2 - 8}\n L ${decX} ${decY}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2 + 8}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2}\n L ${decX + arrowWidth} ${decY + arrowHeight / 2}\n Z\n `;\n deacceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n deacceleratorsGroup.append(\"text\").attr(\"x\", decX + arrowWidth / 2).attr(\"y\", decY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(deaccelerator.name);\n });\n }\n}, \"draw\");\nvar wardleyRenderer_default = {\n draw\n};\n\n// src/diagrams/wardley/styles.ts\nvar styles = /* @__PURE__ */ __name(({\n wardley\n} = {}) => {\n const defaultThemeVariables = getThemeVariables();\n const currentConfig = getConfig();\n const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);\n const w = cleanAndMerge(themeVariables.wardley, wardley);\n return `\n .wardley-background {\n fill: ${w.backgroundColor};\n }\n .wardley-axes line, .wardley-axes path {\n stroke: ${w.axisColor};\n }\n .wardley-axis-label {\n fill: ${w.axisTextColor};\n }\n .wardley-stage-label {\n fill: ${w.axisTextColor};\n }\n .wardley-grid line {\n stroke: ${w.gridColor};\n }\n .wardley-node circle {\n fill: ${w.componentFill};\n stroke: ${w.componentStroke};\n }\n .wardley-node-label {\n fill: ${w.componentLabelColor};\n }\n .wardley-link {\n stroke: ${w.linkStroke};\n }\n .wardley-link--dashed {\n stroke-dasharray: 4 4;\n }\n .wardley-link-label {\n fill: ${w.axisTextColor};\n }\n .wardley-trend line {\n stroke: ${w.evolutionStroke};\n }\n .wardley-annotation-line {\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation circle {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation text {\n fill: ${w.annotationTextColor};\n }\n .wardley-annotations-box rect {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotations-box text {\n fill: ${w.annotationTextColor};\n }\n .wardley-pipeline-box {\n stroke: ${w.componentStroke};\n }\n .wardley-notes text {\n fill: ${w.axisTextColor};\n }\n `;\n}, \"styles\");\n\n// src/diagrams/wardley/wardleyDiagram.ts\nvar diagram = {\n parser,\n db: wardleyDb_default,\n renderer: wardleyRenderer_default,\n styles\n};\nexport {\n diagram\n};\n"],"names":["toPercent","__name","value","context","normalized","toCoordinates","visibility","evolution","getFlowFromPort","port","extractFlowFromArrow","arrow","flowLabel","populateDb","ast","db","populateCommonDb","stages","stage","stageBoundaries","anchor","coords","component","labelOffsetX","labelOffsetY","sourceStrategy","note","pipeline","parentNode","parentY","componentId","x","link","isDashed","flow","arrowFlow","annotation","label","evolve","node","target","annotationsBox","accelerator","deaccelerator","parser","input","parse","log","WardleyBuilder","existing","merged","trend","nodeId","pipelineNodeId","y","partial","width","height","id","name","nodes","builder","getConfig3","getConfig2","addNode","className","inertia","addLink","sourceId","targetId","dashed","addTrend","targetX","targetY","addAnnotation","number","coordinates","text","addNote","addAccelerator","addDeaccelerator","setAnnotationsBox","setSize","startPipeline","addPipelineComponent","updateAxes","getNode","resolveNodeId","getWardleyData","clear2","clear","wardleyDb_default","setAccTitle","getAccTitle","setDiagramTitle","getDiagramTitle","getAccDescription","setAccDescription","DEFAULT_STAGES","getTheme","themeVariables","getConfigValues","wardleyConfig","draw","_version","diagObj","configValues","theme","squareSize","data","title","svg","selectSvgElement","configureSvgSize","root","defs","chartWidth","chartHeight","projectX","projectY","axisGroup","xLabel","yLabel","stageGroup","boundaries","stagePositions","prevBoundary","boundary","stageWidth","_","index","pos","startX","endX","centerX","gridGroup","i","ratio","positions","pipelineGroup","pipelineLinksGroup","sortedComponents","id2","n","c","a","b","current","next","minX","maxX","height2","boxTop","parentPos","linksGroup","pipelineMap","validLinks","sourcePos","targetPos","radius","dx","dy","distance","midX","offset","perpX","midY","perpY","labelX","labelY","angle","trendGroup","trendsWithPositions","origin","shortenBy","adjustedX2","adjustedY2","nodeEnter","marketNodes","smallCircleRadius","triangleRadius","lineHeight","defaultOffset","customOffset","annotationsGroup","projectedCoords","coord","annotationNode","boxX","boxY","padding","fontSize","textBoxGroup","sortedAnnotations","textElements","idx","text2","maxWidth","maxHeight","textNode","textWidth","bbox","boxWidth","boxHeight","minY","maxY","notesGroup","noteX","noteY","acceleratorsGroup","accX","accY","arrowWidth","arrowHeight","arrowHeadWidth","arrowPath","deacceleratorsGroup","decX","decY","wardleyRenderer_default","styles","wardley","defaultThemeVariables","getThemeVariables","currentConfig","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AGbA,EAAE,eAAe;AAAA;AAAA;AAAA,cAGjBA,EAAE,gBAAgB;AAAA;AAAA;AAAA,YAGpBA,EAAE,cAAc;AAAA,cACdA,EAAE,gBAAgB;AAAA;AAAA;AAAA,YAGpBA,EAAE,mBAAmB;AAAA;AAAA;AAAA,YAGrBA,EAAE,cAAc;AAAA,cACdA,EAAE,gBAAgB;AAAA;AAAA;AAAA,YAGpBA,EAAE,mBAAmB;AAAA;AAAA;AAAA,cAGnBA,EAAE,eAAe;AAAA;AAAA;AAAA,YAGnBA,EAAE,aAAa;AAAA;AAAA,GAG3B,EAAG,QAAQ,EAGPC,GAAU,CACZ,OAAAxL,EACA,GAAI+C,GACJ,SAAUgI,GACV,OAAAC,EACF","x_google_ignoreList":[0]}
@@ -0,0 +1,8 @@
1
+ import{s as ai,g as oi,o as It,n as ri,a as hi,b as li,_ as a,l as Bt,D as ci,d as gi,p as ui,y as mt,i as di,A as zt,B as xi,E as fi,aC as pi,R as vt}from"./mermaid.core-CNKolAgz.js";import{i as mi}from"./init-Gi6I4Gst.js";import{o as yi}from"./ordinal-Cboi1Yqb.js";import{l as Lt}from"./linear-D4xk4kUi.js";import"./index-i9rKiqYX.js";import"./defaultLocale-DX6XiGOO.js";function bi(t,i,e){t=+t,i=+i,e=(n=arguments.length)<2?(i=t,t=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((i-t)/e))|0,h=new Array(n);++s<n;)h[s]=t+s*e;return h}function ut(){var t=yi().unknown(void 0),i=t.domain,e=t.range,s=0,n=1,h,l,d=!1,x=0,C=0,k=.5;delete t.unknown;function R(){var b=i().length,E=n<s,v=E?n:s,L=E?s:n;h=(L-v)/Math.max(1,b-x+C*2),d&&(h=Math.floor(h)),v+=(L-v-h*(b-x))*k,l=h*(1-x),d&&(v=Math.round(v),l=Math.round(l));var M=bi(b).map(function(m){return v+h*m});return e(E?M.reverse():M)}return t.domain=function(b){return arguments.length?(i(b),R()):i()},t.range=function(b){return arguments.length?([s,n]=b,s=+s,n=+n,R()):[s,n]},t.rangeRound=function(b){return[s,n]=b,s=+s,n=+n,d=!0,R()},t.bandwidth=function(){return l},t.step=function(){return h},t.round=function(b){return arguments.length?(d=!!b,R()):d},t.padding=function(b){return arguments.length?(x=Math.min(1,C=+b),R()):x},t.paddingInner=function(b){return arguments.length?(x=Math.min(1,b),R()):x},t.paddingOuter=function(b){return arguments.length?(C=+b,R()):C},t.align=function(b){return arguments.length?(k=Math.max(0,Math.min(1,b)),R()):k},t.copy=function(){return ut(i(),[s,n]).round(d).paddingInner(x).paddingOuter(C).align(k)},mi.apply(R(),arguments)}var dt=(function(){var t=a(function(W,r,g,u){for(g=g||{},u=W.length;u--;g[W[u]]=r);return g},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],h=[1,6],l=[1,7],d=[1,5,10,12,14,16,18,19,21,23,36,37,38],x=[1,25],C=[1,26],k=[1,28],R=[1,29],b=[1,30],E=[1,31],v=[1,32],L=[1,33],M=[1,34],m=[1,35],D=[1,36],c=[1,37],z=[1,43],F=[1,42],X=[1,47],N=[1,50],_=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],w=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],A=[1,65],O=[26,28],T={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:a(function(r,g,u,f,S,o,Z){var p=o.length-1;switch(S){case 5:f.setOrientation(o[p]);break;case 9:f.setDiagramTitle(o[p].text.trim());break;case 12:f.setLineData({text:"",type:"text"},o[p]);break;case 13:f.setLineData(o[p-1],o[p]);break;case 14:f.setBarData({text:"",type:"text"},o[p]);break;case 15:f.setBarData(o[p-1],o[p]);break;case 16:this.$=o[p].trim(),f.setAccTitle(this.$);break;case 17:case 18:this.$=o[p].trim(),f.setAccDescription(this.$);break;case 19:this.$=o[p-1];break;case 20:case 30:this.$=[o[p-2],...o[p]];break;case 21:case 31:this.$=[o[p]];break;case 22:this.$={value:Number(o[p-1]),label:o[p]};break;case 23:this.$={value:Number(o[p]),label:""};break;case 24:f.setXAxisTitle(o[p]);break;case 25:f.setXAxisTitle(o[p-1]);break;case 26:f.setXAxisTitle({type:"text",text:""});break;case 27:f.setXAxisBand(o[p]);break;case 28:f.setXAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 29:this.$=o[p-1];break;case 32:f.setYAxisTitle(o[p]);break;case 33:f.setYAxisTitle(o[p-1]);break;case 34:f.setYAxisTitle({type:"text",text:""});break;case 35:f.setYAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 39:this.$={text:o[p],type:"text"};break;case 40:this.$={text:o[p],type:"text"};break;case 41:this.$={text:o[p],type:"markdown"};break;case 42:this.$=o[p];break;case 43:this.$=o[p-1]+""+o[p];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,36:n,37:h,38:l}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,36:n,37:h,38:l}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:n,37:h,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,36:n,37:h,38:l}),{1:[2,3]},t(d,[2,5]),t(i,[2,7],{4:22,36:n,37:h,38:l}),{11:23,30:x,39:24,40:C,41:27,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c},{11:39,13:38,24:z,29:F,30:x,31:40,32:41,39:24,40:C,41:27,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c},{11:45,15:44,29:X,30:x,35:46,39:24,40:C,41:27,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c},{11:49,17:48,24:N,30:x,39:24,40:C,41:27,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c},{11:52,17:51,24:N,30:x,39:24,40:C,41:27,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(H,[2,39],{41:55,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c}),t(H,[2,40]),t(H,[2,41]),t(w,[2,42]),t(w,[2,44]),t(w,[2,45]),t(w,[2,46]),t(w,[2,47]),t(w,[2,48]),t(w,[2,49]),t(w,[2,50]),t(w,[2,51]),t(w,[2,52]),t(w,[2,53]),t(_,[2,10]),t(_,[2,24],{32:41,31:56,24:z,29:F}),t(_,[2,26]),t(_,[2,27]),{33:[1,57]},{11:59,30:x,34:58,39:24,40:C,41:27,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c},t(_,[2,11]),t(_,[2,32],{35:60,29:X}),t(_,[2,34]),{33:[1,61]},t(_,[2,12]),{17:62,24:N},{25:63,27:64,29:A},t(_,[2,14]),{17:66,24:N},t(_,[2,16]),t(_,[2,17]),t(w,[2,43]),t(_,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(_,[2,33]),{29:[1,70]},t(_,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(O,[2,23],{30:[1,73]}),t(_,[2,15]),t(_,[2,28]),t(_,[2,29]),{11:59,30:x,34:74,39:24,40:C,41:27,42:k,43:R,44:b,45:E,46:v,47:L,48:M,49:m,50:D,51:c},t(_,[2,35]),t(_,[2,19]),{25:75,27:64,29:A},t(O,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:a(function(r,g){if(g.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=g,u}},"parseError"),parse:a(function(r){var g=this,u=[0],f=[],S=[null],o=[],Z=this.table,p="",et=0,kt=0,ii=2,Tt=1,ei=o.slice.call(arguments,1),P=Object.create(this.lexer),$={yy:{}};for(var ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ht)&&($.yy[ht]=this.yy[ht]);P.setInput(r,$.yy),$.yy.lexer=P,$.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var lt=P.yylloc;o.push(lt);var si=P.options&&P.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ni(B){u.length=u.length-2*B,S.length=S.length-B,o.length=o.length-B}a(ni,"popStack");function Dt(){var B;return B=f.pop()||P.lex()||Tt,typeof B!="number"&&(B instanceof Array&&(f=B,B=f.pop()),B=g.symbols_[B]||B),B}a(Dt,"lex");for(var I,U,V,ct,j={},st,Y,Pt,nt;;){if(U=u[u.length-1],this.defaultActions[U]?V=this.defaultActions[U]:((I===null||typeof I>"u")&&(I=Dt()),V=Z[U]&&Z[U][I]),typeof V>"u"||!V.length||!V[0]){var gt="";nt=[];for(st in Z[U])this.terminals_[st]&&st>ii&&nt.push("'"+this.terminals_[st]+"'");P.showPosition?gt="Parse error on line "+(et+1)+`:
2
+ `+P.showPosition()+`
3
+ Expecting `+nt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":gt="Parse error on line "+(et+1)+": Unexpected "+(I==Tt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(gt,{text:P.match,token:this.terminals_[I]||I,line:P.yylineno,loc:lt,expected:nt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+I);switch(V[0]){case 1:u.push(I),S.push(P.yytext),o.push(P.yylloc),u.push(V[1]),I=null,kt=P.yyleng,p=P.yytext,et=P.yylineno,lt=P.yylloc;break;case 2:if(Y=this.productions_[V[1]][1],j.$=S[S.length-Y],j._$={first_line:o[o.length-(Y||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Y||1)].first_column,last_column:o[o.length-1].last_column},si&&(j._$.range=[o[o.length-(Y||1)].range[0],o[o.length-1].range[1]]),ct=this.performAction.apply(j,[p,kt,et,$.yy,V[1],S,o].concat(ei)),typeof ct<"u")return ct;Y&&(u=u.slice(0,-1*Y*2),S=S.slice(0,-1*Y),o=o.slice(0,-1*Y)),u.push(this.productions_[V[1]][0]),S.push(j.$),o.push(j._$),Pt=Z[u[u.length-2]][u[u.length-1]],u.push(Pt);break;case 3:return!0}}return!0},"parse")},K=(function(){var W={EOF:1,parseError:a(function(g,u){if(this.yy.parser)this.yy.parser.parseError(g,u);else throw new Error(g)},"parseError"),setInput:a(function(r,g){return this.yy=g||this.yy||{},this._input=r,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:a(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:a(function(r){var g=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var f=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),u.length-1&&(this.yylineno-=u.length-1);var S=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:u?(u.length===f.length?this.yylloc.first_column:0)+f[f.length-u.length].length-u[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var r=this.pastInput(),g=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
+ `+g+"^"},"showPosition"),test_match:a(function(r,g){var u,f,S;if(this.options.backtrack_lexer&&(S={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&&(S.yylloc.range=this.yylloc.range.slice(0))),f=r[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],u=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var o in S)this[o]=S[o];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,g,u,f;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),o=0;o<S.length;o++)if(u=this._input.match(this.rules[S[o]]),u&&(!g||u[0].length>g[0].length)){if(g=u,f=o,this.options.backtrack_lexer){if(r=this.test_match(u,S[o]),r!==!1)return r;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(r=this.test_match(g,S[f]),r!==!1?r:!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:a(function(){var g=this.next();return g||this.lex()},"lex"),begin:a(function(g){this.conditionStack.push(g)},"begin"),popState:a(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(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:a(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:a(function(g){this.begin(g)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(g,u,f,S){switch(f){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return W})();T.lexer=K;function q(){this.yy={}}return a(q,"Parser"),q.prototype=T,T.Parser=q,new q})();dt.parser=dt;var wi=dt;function at(t){return t.type==="bar"}a(at,"isBarPlot");function ot(t){return t.type==="band"}a(ot,"isBandAxisData");function Q(t){return t.type==="linear"}a(Q,"isLinearAxisData");var yt=class{constructor(t){this.parentGroup=t}static{a(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((n,h)=>Math.max(h.length,n),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const n of t){const h=pi(s,1,n),l=h?h.width:n.length*i,d=h?h.height:i;e.width=Math.max(e.width,l),e.height=Math.max(e.height,d)}return s.remove(),e}},Et=.7,Mt=.2,Ot=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{a(this,"BaseAxis")}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Et*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Et*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Mt*t.width;this.outerPadding=Math.min(e.width/2,s);let n=e.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(n=Math.max(n,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*e.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*e.height))),n+=this.axisConfig.labelPadding*2,this.labelTextHeight=e.height,n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Mt*t.height;this.outerPadding=Math.min(e.height/2,s);const n=e.width+this.axisConfig.labelPadding*2;n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return i===0?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},Ai=class extends Ot{static{a(this,"BandAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.categories=e,this.scale=ut().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=ut().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Bt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},Ci=class extends Ot{static{a(this,"LinearAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.domain=e,this.scale=Lt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Lt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function xt(t,i,e,s){const n=new yt(s);return ot(t)?new Ai(i,e,t.categories,t.title,n):new Ci(i,e,[t.min,t.max],t.title,n)}a(xt,"getAxis");var Si=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{a(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function Vt(t,i,e,s){const n=new yt(s);return new Si(n,t,i,e)}a(Vt,"getChartTitleComponent");var Ri=.75,_i=.5,ki=.35;function ft(t){return{fontSize:t,markerSize:t*Ri,markerSpacing:t*ki,itemSpacing:t*_i}}a(ft,"getLegendLayout");var Ti=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{a(this,"ChartLegend")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(x=>x.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:i,markerSize:e,markerSpacing:s,itemSpacing:n}=ft(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(x=>x.title),i),l=this.chartConfig.legendPadding*2+e+s+h.width,d=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*n;return l<=t.width&&d<=t.height?(this.boundingRect.width=l,this.boundingRect.height=d):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];const{fontSize:t,markerSize:i,markerSpacing:e,itemSpacing:s}=ft(this.chartConfig.legendFontSize),n=t+s,h=this.boundingRect.x+this.chartConfig.legendPadding,l=this.boundingRect.y+this.chartConfig.legendPadding,d=[],x=[];for(const[C,k]of this.visiblePlots.entries())if(at(k))d.push({x:h,y:l+C*n,width:i,height:i,fill:k.fill,strokeFill:k.fill,strokeWidth:0});else{const R=l+C*n+i/2;x.push({path:`M ${h},${R} L ${h+i},${R}`,strokeFill:k.strokeFill,strokeWidth:k.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:d},{groupTexts:["legend","markers"],type:"path",data:x},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((C,k)=>({text:C.title,x:h+i+e,y:l+k*n+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Ft(t,i,e,s){const n=new yt(s);return new Ti(n,t,i,e)}a(Ft,"getChartLegendComponent");var Di=class{constructor(t,i,e,s,n){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=n}static{a(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let i;if(this.orientation==="horizontal"?i=vt().y(s=>s[0]).x(s=>s[1])(t):i=vt().x(s=>s[0]).y(s=>s[1])(t),!i)return[];const e=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const h=[];for(const[l,[d,x]]of t.entries()){const C=this.plotData.pointLabels[l];C&&(this.orientation==="horizontal"?h.push({x:x+10,y:d,text:C,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):h.push({x:d,y:x-10,text:C,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}h.length>0&&e.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return e}},Pi=class{constructor(t,i,e,s,n,h){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=n,this.plotIndex=h}static{a(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:e,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:e,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},vi=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{a(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new Di(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new Pi(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break}return t}};function Wt(t,i,e){return new vi(t,i,e)}a(Wt,"getPlotComponent");var Li=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Vt(t,i,e,s),plot:Wt(t,i,e),legend:Ft(t,i,e,s),xAxis:xt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:xt(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{a(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n={width:0,height:0},h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),d=this.componentStore.plot.calculateSpace({width:h,height:l});t-=d.width,i-=d.height,d=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=d.height,i-=d.height,this.componentStore.xAxis.setAxisPosition("bottom"),d=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=d.height,this.componentStore.yAxis.setAxisPosition("left"),d=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=d.width,t-=d.width,n=this.componentStore.legend.calculateSpace({width:t,height:l}),t-=n.width,t>0&&(h+=t,t=0),i>0&&(l+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:l}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.legend.setBoundingBoxXY({x:e+h,y:s+Math.max((l-n.height)/2,0)}),this.componentStore.xAxis.setRange([e,e+h]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+l}),this.componentStore.yAxis.setRange([s,s+l]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(x=>at(x))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=0,h={width:0,height:0},l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),d=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:l,height:d});t-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("left"),x=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=x.width,s=x.width,this.componentStore.yAxis.setAxisPosition("top"),x=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=x.height,n=e+x.height,h=this.componentStore.legend.calculateSpace({width:t,height:d}),t-=h.width,t>0&&(l+=t,t=0),i>0&&(d+=i,i=0),this.componentStore.plot.calculateSpace({width:l,height:d}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+l,y:n+Math.max((d-h.height)/2,0)}),this.componentStore.yAxis.setRange([s,s+l]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([n,n+d]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(C=>at(C))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},Ei=class{static{a(this,"XYChartBuilder")}static build(t,i,e,s){return new Li(t,i,e,s).getDrawableElement()}},J=0,Xt,tt=At(),it=wt(),y=Ct(),pt=it.plotColorPalette.split(",").map(t=>t.trim()),rt=!1,bt=!1;function wt(){const t=fi(),i=mt();return zt(t.xyChart,i.themeVariables.xyChart)}a(wt,"getChartDefaultThemeConfig");function At(){const t=mt();return zt(xi.xyChart,t.xyChart)}a(At,"getChartDefaultConfig");function Ct(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(Ct,"getChartDefaultData");function G(t){const i=mt();return di(t.trim(),i)}a(G,"textSanitizer");function Nt(t){Xt=t}a(Nt,"setTmpSVGG");function Yt(t){t==="horizontal"?tt.chartOrientation="horizontal":tt.chartOrientation="vertical"}a(Yt,"setOrientation");function Ht(t){y.xAxis.title=G(t.text)}a(Ht,"setXAxisTitle");function St(t,i){y.xAxis={type:"linear",title:y.xAxis.title,min:t,max:i},rt=!0}a(St,"setXAxisRangeData");function $t(t){y.xAxis={type:"band",title:y.xAxis.title,categories:t.map(i=>G(i.text))},rt=!0}a($t,"setXAxisBand");function Ut(t){y.yAxis.title=G(t.text)}a(Ut,"setYAxisTitle");function Gt(t,i){y.yAxis={type:"linear",title:y.yAxis.title,min:t,max:i},bt=!0}a(Gt,"setYAxisRangeData");function qt(t){const i=Math.min(...t),e=Math.max(...t),s=Q(y.yAxis)?y.yAxis.min:1/0,n=Q(y.yAxis)?y.yAxis.max:-1/0;y.yAxis={type:"linear",title:y.yAxis.title,min:Math.min(s,i),max:Math.max(n,e)}}a(qt,"setYAxisRangeFromPlotData");function Rt(t){let i=[];if(t.length===0)return i;if(!rt){const e=Q(y.xAxis)?y.xAxis.min:1/0,s=Q(y.xAxis)?y.xAxis.max:-1/0;St(Math.min(e,1),Math.max(s,t.length))}if(ot(y.xAxis)&&t.length>y.xAxis.categories.length&&(t=t.slice(0,y.xAxis.categories.length)),bt||qt(t),ot(y.xAxis)&&(i=y.xAxis.categories.map((e,s)=>[e,t[s]])),Q(y.xAxis)){const e=y.xAxis.min,s=y.xAxis.max;if(t.length===1)i=[[`${e}`,t[0]]];else{const n=(s-e)/(t.length-1);i=t.map((h,l)=>[`${e+l*n}`,h])}}return i}a(Rt,"transformDataWithoutCategory");function _t(t){return pt[t===0?0:t%pt.length]}a(_t,"getPlotColorFromPalette");function jt(t,i){const e=i.map(l=>l.value),s=i.map(l=>l.label?G(l.label):""),n=Rt(e),h=s.some(l=>l!=="");y.plots.push({type:"line",title:G(t.text),strokeFill:_t(J),strokeWidth:2,data:n,...h?{pointLabels:s}:{}}),J++}a(jt,"setLineData");function Qt(t,i){const e=i.map(n=>n.value),s=Rt(e);y.plots.push({type:"bar",title:G(t.text),fill:_t(J),data:s}),J++}a(Qt,"setBarData");function Kt(){if(y.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return y.title=It(),Ei.build(tt,y,it,Xt)}a(Kt,"getDrawableElem");function Zt(){return it}a(Zt,"getChartThemeConfig");function Jt(){return tt}a(Jt,"getChartConfig");function ti(){return y}a(ti,"getXYChartData");var Mi=a(function(){ui(),J=0,tt=At(),y=Ct(),it=wt(),pt=it.plotColorPalette.split(",").map(t=>t.trim()),rt=!1,bt=!1},"clear"),Ii={getDrawableElem:Kt,clear:Mi,setAccTitle:li,getAccTitle:hi,setDiagramTitle:ri,getDiagramTitle:It,getAccDescription:oi,setAccDescription:ai,setOrientation:Yt,setXAxisTitle:Ht,setXAxisRangeData:St,setXAxisBand:$t,setYAxisTitle:Ut,setYAxisRangeData:Gt,setLineData:jt,setBarData:Qt,setTmpSVGG:Nt,getChartThemeConfig:Zt,getChartConfig:Jt,getXYChartData:ti},Bi=a((t,i,e,s)=>{const n=s.db,h=n.getChartThemeConfig(),l=n.getChartConfig(),d=n.getXYChartData().plots[0].data.map(m=>m[1]);function x(m){return m==="top"?"text-before-edge":"middle"}a(x,"getDominantBaseLine");function C(m){return m==="left"?"start":m==="right"?"end":"middle"}a(C,"getTextAnchor");function k(m){return`translate(${m.x}, ${m.y}) rotate(${m.rotation||0})`}a(k,"getTextTransformation"),Bt.debug(`Rendering xychart chart
7
+ `+t);const R=ci(i),b=R.append("g").attr("class","main"),E=b.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");gi(R,l.height,l.width,!0),R.attr("viewBox",`0 0 ${l.width} ${l.height}`),E.attr("fill",h.backgroundColor),n.setTmpSVGG(R.append("g").attr("class","mermaid-tmp-group"));const v=n.getDrawableElem(),L={};function M(m){let D=b,c="";for(const[z]of m.entries()){let F=b;z>0&&L[c]&&(F=L[c]),c+=m[z],D=L[c],D||(D=L[c]=F.append("g").attr("class",m[z]))}return D}a(M,"getGroup");for(const m of v){if(m.data.length===0)continue;const D=M(m.groupTexts);switch(m.type){case"rect":if(D.selectAll("rect").data(m.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),l.showDataLabel){const c=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let z=function(A,O){const{data:T,label:K}=A;return O*K.length*F<=T.width-X};a(z,"fitsHorizontally");const F=.7,X=10,N=m.data.map((A,O)=>({data:A,label:d[O].toString()})).filter(A=>A.data.width>0&&A.data.height>0),_=N.map(A=>{const{data:O}=A;let T=O.height*.7;for(;!z(A,T)&&T>0;)T-=1;return T}),H=Math.floor(Math.min(..._)),w=a(A=>c?A.data.x+A.data.width+X:A.data.x+A.data.width-X,"determineLabelXPosition");D.selectAll("text").data(N).enter().append("text").attr("x",w).attr("y",A=>A.data.y+A.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${H}px`).text(A=>A.label)}else{let z=function(w,A,O){const{data:T,label:K}=w,W=A*K.length*.7,r=T.x+T.width/2,g=r-W/2,u=r+W/2,f=g>=T.x&&u<=T.x+T.width,S=T.y+O+A<=T.y+T.height;return f&&S};a(z,"fitsInBar");const F=10,X=m.data.map((w,A)=>({data:w,label:d[A].toString()})).filter(w=>w.data.width>0&&w.data.height>0),N=X.map(w=>{const{data:A,label:O}=w;let T=A.width/(O.length*.7);for(;!z(w,T,F)&&T>0;)T-=1;return T}),_=Math.floor(Math.min(...N)),H=a(w=>c?w.data.y-F:w.data.y+F,"determineLabelYPosition");D.selectAll("text").data(X).enter().append("text").attr("x",w=>w.data.x+w.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${_}px`).text(w=>w.label)}}break;case"text":D.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>x(c.verticalPos)).attr("text-anchor",c=>C(c.horizontalPos)).attr("transform",c=>k(c)).text(c=>c.text);break;case"path":D.selectAll("path").data(m.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),zi={draw:Bi},Yi={parser:wi,db:Ii,renderer:zi};export{Yi as diagram};
8
+ //# sourceMappingURL=xychartDiagram-S5SC5T6Z-Dw5ev7_Q.js.map