@gobing-ai/spur 0.3.7 → 0.3.9

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 (123) hide show
  1. package/README.md +18 -2
  2. package/{spur-cli/config → config}/rules/boundary/sp-runtime-path.yaml +5 -0
  3. package/package.json +4 -3
  4. package/spur.js +30 -5
  5. package/web/_astro/BoardApp.Bcfvp2GH.js +1 -0
  6. package/web/_astro/BoardApp.DjpO2XHn.js +178 -0
  7. package/web/_astro/BoardApp.t7x-dYDo.css +1 -0
  8. package/web/_astro/TaskDetail.DilpuD7R.js +1 -0
  9. package/web/_astro/arc.KcqIior8.js +1 -0
  10. package/web/_astro/architectureDiagram-3BPJPVTR.BTFU70BY.js +36 -0
  11. package/web/_astro/blockDiagram-GPEHLZMM.apx49Oy9.js +132 -0
  12. package/web/_astro/c4Diagram-AAUBKEIU.BM-J4juX.js +10 -0
  13. package/web/_astro/channel.vSp82e1U.js +1 -0
  14. package/web/_astro/chunk-2J33WTMH.K6z7IYZU.js +1 -0
  15. package/web/_astro/chunk-4BX2VUAB.BDYhxKa0.js +1 -0
  16. package/web/_astro/chunk-55IACEB6.BnNOxqnI.js +1 -0
  17. package/web/_astro/chunk-727SXJPM.DNeg6N7v.js +206 -0
  18. package/web/_astro/chunk-AQP2D5EJ.BjILBkba.js +231 -0
  19. package/web/_astro/chunk-FMBD7UC4.DQ5UvvsV.js +15 -0
  20. package/web/_astro/chunk-ND2GUHAM.Yn1OvRJs.js +1 -0
  21. package/web/_astro/chunk-QZHKN3VN.UErqHgqw.js +1 -0
  22. package/web/_astro/classDiagram-4FO5ZUOK.BmjVF7iZ.js +1 -0
  23. package/web/_astro/classDiagram-v2-Q7XG4LA2.BmjVF7iZ.js +1 -0
  24. package/web/_astro/client.CdFpTatq.js +9 -0
  25. package/web/_astro/cose-bilkent-S5V4N54A.iKBxnkbb.js +1 -0
  26. package/web/_astro/cytoscape.esm.D3_iZ_3b.js +321 -0
  27. package/web/_astro/dagre-BM42HDAG.OwnCCrs6.js +4 -0
  28. package/web/_astro/defaultLocale.CrowFXzY.js +1 -0
  29. package/web/_astro/diagram-2AECGRRQ.DCdcffxE.js +43 -0
  30. package/web/_astro/diagram-5GNKFQAL.Ai-LvmVW.js +10 -0
  31. package/web/_astro/diagram-KO2AKTUF.B6e21QDN.js +3 -0
  32. package/web/_astro/diagram-LMA3HP47.oPfqy1fq.js +24 -0
  33. package/web/_astro/diagram-OG6HWLK6.Dh5QRDCE.js +24 -0
  34. package/web/_astro/erDiagram-TEJ5UH35.DpBiOcO3.js +85 -0
  35. package/web/_astro/flowDiagram-I6XJVG4X.NbMxFlVk.js +162 -0
  36. package/web/_astro/ganttDiagram-6RSMTGT7.JgZ3fDME.js +292 -0
  37. package/web/_astro/gitGraphDiagram-PVQCEYII.oMjFeZRt.js +106 -0
  38. package/web/_astro/graph.D2o_JWn5.js +1 -0
  39. package/web/_astro/index.A0eX93qW.js +1 -0
  40. package/web/_astro/index.CA3GTZM6.css +1 -0
  41. package/web/_astro/infoDiagram-5YYISTIA.kaio3YzK.js +2 -0
  42. package/web/_astro/init.Gi6I4Gst.js +1 -0
  43. package/web/_astro/ishikawaDiagram-YF4QCWOH.CXQfMyeF.js +70 -0
  44. package/web/_astro/journeyDiagram-JHISSGLW.AvNKMzx6.js +139 -0
  45. package/web/_astro/kanban-definition-UN3LZRKU.kv3cZGdE.js +89 -0
  46. package/web/_astro/katex.HP8lGamR.js +257 -0
  47. package/web/_astro/layout.DNLMvjEt.js +1 -0
  48. package/web/_astro/linear.CfLoHWjz.js +1 -0
  49. package/web/_astro/mermaid.core.BSV8pBn-.js +301 -0
  50. package/web/_astro/mindmap-definition-RKZ34NQL.CbL_3b32.js +96 -0
  51. package/web/_astro/ordinal.BYWQX77i.js +1 -0
  52. package/web/_astro/pieDiagram-4H26LBE5.5BXdOLRb.js +30 -0
  53. package/web/_astro/quadrantDiagram-W4KKPZXB.krXYbhlh.js +7 -0
  54. package/web/_astro/requirementDiagram-4Y6WPE33.COO4LapZ.js +84 -0
  55. package/web/_astro/sankeyDiagram-5OEKKPKP.BvL0Jbdx.js +40 -0
  56. package/web/_astro/sequenceDiagram-3UESZ5HK.Dk7Tu15E.js +162 -0
  57. package/web/_astro/stateDiagram-AJRCARHV.Cqh_KmEW.js +1 -0
  58. package/web/_astro/stateDiagram-v2-BHNVJYJU.WapPgDCy.js +1 -0
  59. package/web/_astro/timeline-definition-PNZ67QCA.CEVdiX0n.js +120 -0
  60. package/web/_astro/vennDiagram-CIIHVFJN.Cd9A63eF.js +34 -0
  61. package/web/_astro/wardley-L42UT6IY.DEiaHiIT.js +161 -0
  62. package/web/_astro/wardleyDiagram-YWT4CUSO.B7nGP61E.js +78 -0
  63. package/web/_astro/xychartDiagram-2RQKCTM6.Bq8CHmxC.js +7 -0
  64. package/web/favicon.svg +4 -0
  65. package/web/index.html +2 -0
  66. /package/{spur-cli/config → config}/config.example.yaml +0 -0
  67. /package/{spur-cli/config → config}/plugins/.gitkeep +0 -0
  68. /package/{spur-cli/config → config}/rules/README.md +0 -0
  69. /package/{spur-cli/config → config}/rules/boundary/config-loading-ownership.yaml +0 -0
  70. /package/{spur-cli/config → config}/rules/boundary/dao-boundary.yaml +0 -0
  71. /package/{spur-cli/config → config}/rules/boundary/planning-folder-hardcode.yaml +0 -0
  72. /package/{spur-cli/config → config}/rules/boundary/sp-no-vendor-refs.yaml +0 -0
  73. /package/{spur-cli/config → config}/rules/migration/rg-dialect.yaml +0 -0
  74. /package/{spur-cli/config → config}/rules/quality/coverage-gate.yaml +0 -0
  75. /package/{spur-cli/config → config}/rules/quality/tsdoc-exports.yaml +0 -0
  76. /package/{spur-cli/config → config}/rules/recommended-post-check.yaml +0 -0
  77. /package/{spur-cli/config → config}/rules/recommended-pre-check.yaml +0 -0
  78. /package/{spur-cli/config → config}/rules/rg-migration.yaml +0 -0
  79. /package/{spur-cli/config → config}/rules/strict/http-boundaries.yaml +0 -0
  80. /package/{spur-cli/config → config}/rules/strict/rule-files-structural.yaml +0 -0
  81. /package/{spur-cli/config → config}/rules/strict/runtime-boundaries.yaml +0 -0
  82. /package/{spur-cli/config → config}/rules/strict-check.yaml +0 -0
  83. /package/{spur-cli/config → config}/rules/structure/protected-files.yaml +0 -0
  84. /package/{spur-cli/config → config}/rules/structure/test-focus-skip.yaml +0 -0
  85. /package/{spur-cli/config → config}/rules/structure/test-location.yaml +0 -0
  86. /package/{spur-cli/config → config}/rules/surface/check-cli-surface.yaml +0 -0
  87. /package/{spur-cli/config → config}/rules/typescript/bun-tooling.yaml +0 -0
  88. /package/{spur-cli/config → config}/rules/typescript/guarded-happy-dom-register.yaml +0 -0
  89. /package/{spur-cli/config → config}/rules/typescript/happy-dom-teardown.yaml +0 -0
  90. /package/{spur-cli/config → config}/rules/typescript/no-biome-suppressions.yaml +0 -0
  91. /package/{spur-cli/config → config}/rules/typescript/no-debugger.yaml +0 -0
  92. /package/{spur-cli/config → config}/rules/typescript/no-leaky-module-mocks.yaml +0 -0
  93. /package/{spur-cli/config → config}/rules/typescript/no-module-scope-import-calls.yaml +0 -0
  94. /package/{spur-cli/config → config}/rules/typescript/no-unmocked-module-eval-side-effects.yaml +0 -0
  95. /package/{spur-cli/config → config}/rules/typescript/output-boundaries.yaml +0 -0
  96. /package/{spur-cli/config → config}/rules/ui/ui-import-boundary.yaml +0 -0
  97. /package/{spur-cli/config → config}/tasks/section-matrix.yaml +0 -0
  98. /package/{spur-cli/config → config}/templates/AGENTS.md +0 -0
  99. /package/{spur-cli/config → config}/templates/bdd/checklist.md +0 -0
  100. /package/{spur-cli/config → config}/templates/bdd/gherkin.md +0 -0
  101. /package/{spur-cli/config → config}/templates/docs/00_ADR.md +0 -0
  102. /package/{spur-cli/config → config}/templates/docs/01_PRD.md +0 -0
  103. /package/{spur-cli/config → config}/templates/docs/02_ROADMAP.md +0 -0
  104. /package/{spur-cli/config → config}/templates/docs/03_ARCHITECTURE.md +0 -0
  105. /package/{spur-cli/config → config}/templates/docs/04_DESIGN.md +0 -0
  106. /package/{spur-cli/config → config}/templates/docs/05_FEATURES.md +0 -0
  107. /package/{spur-cli/config → config}/templates/docs/99_PROJECT_CONSTITUTION.md +0 -0
  108. /package/{spur-cli/config → config}/templates/feature/default.md +0 -0
  109. /package/{spur-cli/config → config}/templates/task/brainstorm.md +0 -0
  110. /package/{spur-cli/config → config}/templates/task/feature-impl.md +0 -0
  111. /package/{spur-cli/config → config}/templates/task/issue.md +0 -0
  112. /package/{spur-cli/config → config}/templates/task/meta.md +0 -0
  113. /package/{spur-cli/config → config}/templates/task/review.md +0 -0
  114. /package/{spur-cli/config → config}/templates/task/standard.md +0 -0
  115. /package/{spur-cli/config → config}/workflows/basic.yaml +0 -0
  116. /package/{spur-cli/config → config}/workflows/docs-pipeline.yaml +0 -0
  117. /package/{spur-cli/config → config}/workflows/feature-dev.yaml +0 -0
  118. /package/{spur-cli/config → config}/workflows/feature-lifecycle.yaml +0 -0
  119. /package/{spur-cli/config → config}/workflows/idea-pipeline.yaml +0 -0
  120. /package/{spur-cli/config → config}/workflows/planning-pipeline.yaml +0 -0
  121. /package/{spur-cli/config → config}/workflows/task-lifecycle.yaml +0 -0
  122. /package/{spur-cli/config → config}/workflows/task-pipeline.yaml +0 -0
  123. /package/{spur-cli/config → config}/workflows/wrapup-pipeline.yaml +0 -0
@@ -0,0 +1,78 @@
1
+ import{a$ as St,a1 as Mt,a5 as Nt,b2 as zt,a2 as Lt,b0 as Tt,b as u,ae as At,a3 as Xt,s as U,aD as K,a_ as Et,E as Yt,t as It,a4 as j}from"./mermaid.core.BSV8pBn-.js";import{p as Bt}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{p as Ft}from"./wardley-L42UT6IY.DEiaHiIT.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(Bt(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(),It()}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:Tt,getAccTitle:Lt,setDiagramTitle:zt,getDiagramTitle:Nt,getAccDescription:Mt,setAccDescription:St},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=Et(n);E.selectAll("*").remove(),Yt(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=At(),r=Xt(),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"),Qt={parser:Q,db:Dt,renderer:Vt,styles:_t};export{Qt as diagram};
@@ -0,0 +1,7 @@
1
+ import{a$ as ei,a1 as si,a5 as Lt,b2 as ni,a2 as ai,b0 as ri,b as a,aD as Et,a_ as oi,E as hi,t as li,a3 as dt,aY as ci,s as Mt,S as ui,ae as gi,A as xi,aA as Tt}from"./mermaid.core.BSV8pBn-.js";import{i as di}from"./init.Gi6I4Gst.js";import{o as fi}from"./ordinal.BYWQX77i.js";import{l as Dt}from"./linear.CfLoHWjz.js";function pi(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,g=new Array(n);++s<n;)g[s]=t+s*e;return g}function lt(){var t=fi().unknown(void 0),i=t.domain,e=t.range,s=0,n=1,g,c,p=!1,k=0,v=0,P=.5;delete t.unknown;function S(){var m=i().length,E=n<s,D=E?n:s,L=E?s:n;g=(L-D)/Math.max(1,m-k+v*2),p&&(g=Math.floor(g)),D+=(L-D-g*(m-k))*P,c=g*(1-k),p&&(D=Math.round(D),c=Math.round(c));var M=pi(m).map(function(f){return D+g*f});return e(E?M.reverse():M)}return t.domain=function(m){return arguments.length?(i(m),S()):i()},t.range=function(m){return arguments.length?([s,n]=m,s=+s,n=+n,S()):[s,n]},t.rangeRound=function(m){return[s,n]=m,s=+s,n=+n,p=!0,S()},t.bandwidth=function(){return c},t.step=function(){return g},t.round=function(m){return arguments.length?(p=!!m,S()):p},t.padding=function(m){return arguments.length?(k=Math.min(1,v=+m),S()):k},t.paddingInner=function(m){return arguments.length?(k=Math.min(1,m),S()):k},t.paddingOuter=function(m){return arguments.length?(v=+m,S()):v},t.align=function(m){return arguments.length?(P=Math.max(0,Math.min(1,m)),S()):P},t.copy=function(){return lt(i(),[s,n]).round(p).paddingInner(k).paddingOuter(v).align(P)},di.apply(S(),arguments)}var ct=(function(){var t=a(function(F,o,l,u){for(l=l||{},u=F.length;u--;l[F[u]]=o);return l},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],g=[1,6],c=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],k=[1,25],v=[1,26],P=[1,28],S=[1,29],m=[1,30],E=[1,31],D=[1,32],L=[1,33],M=[1,34],f=[1,35],R=[1,36],h=[1,37],W=[1,43],O=[1,42],X=[1,47],Y=[1,50],C=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],y=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],A=[1,64],V={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,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$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",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"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],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(o,l,u,x,w,r,Q){var d=r.length-1;switch(w){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:n,35:g,36:c}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:n,35:g,36:c}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:g,36:c}),{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(p,[2,34]),t(p,[2,35]),t(p,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:n,35:g,36:c}),{1:[2,3]},t(p,[2,5]),t(i,[2,7],{4:22,34:n,35:g,36:c}),{11:23,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h},{11:39,13:38,24:W,27:O,29:40,30:41,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h},{11:45,15:44,27:X,33:46,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h},{11:49,17:48,24:Y,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h},{11:52,17:51,24:Y,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h},{20:[1,53]},{22:[1,54]},t(C,[2,18]),{1:[2,2]},t(C,[2,8]),t(C,[2,9]),t(U,[2,37],{40:55,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h}),t(U,[2,38]),t(U,[2,39]),t(y,[2,40]),t(y,[2,42]),t(y,[2,43]),t(y,[2,44]),t(y,[2,45]),t(y,[2,46]),t(y,[2,47]),t(y,[2,48]),t(y,[2,49]),t(y,[2,50]),t(y,[2,51]),t(C,[2,10]),t(C,[2,22],{30:41,29:56,24:W,27:O}),t(C,[2,24]),t(C,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h},t(C,[2,11]),t(C,[2,30],{33:60,27:X}),t(C,[2,32]),{31:[1,61]},t(C,[2,12]),{17:62,24:Y},{25:63,27:A},t(C,[2,14]),{17:65,24:Y},t(C,[2,16]),t(C,[2,17]),t(y,[2,41]),t(C,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(C,[2,31]),{27:[1,69]},t(C,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(C,[2,15]),t(C,[2,26]),t(C,[2,27]),{11:59,32:72,37:24,38:k,39:v,40:27,41:P,42:S,43:m,44:E,45:D,46:L,47:M,48:f,49:R,50:h},t(C,[2,33]),t(C,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(o,l){if(l.recoverable)this.trace(o);else{var u=new Error(o);throw u.hash=l,u}},"parseError"),parse:a(function(o){var l=this,u=[0],x=[],w=[null],r=[],Q=this.table,d="",tt=0,St=0,Zt=2,_t=1,Jt=r.slice.call(arguments,1),T=Object.create(this.lexer),$={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&($.yy[at]=this.yy[at]);T.setInput(o,$.yy),$.yy.lexer=T,$.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var rt=T.yylloc;r.push(rt);var ti=T.options&&T.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(B){u.length=u.length-2*B,w.length=w.length-B,r.length=r.length-B}a(ii,"popStack");function kt(){var B;return B=x.pop()||T.lex()||_t,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=l.symbols_[B]||B),B}a(kt,"lex");for(var I,q,z,ot,G={},it,N,Rt,et;;){if(q=u[u.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((I===null||typeof I>"u")&&(I=kt()),z=Q[q]&&Q[q][I]),typeof z>"u"||!z.length||!z[0]){var ht="";et=[];for(it in Q[q])this.terminals_[it]&&it>Zt&&et.push("'"+this.terminals_[it]+"'");T.showPosition?ht="Parse error on line "+(tt+1)+`:
2
+ `+T.showPosition()+`
3
+ Expecting `+et.join(", ")+", got '"+(this.terminals_[I]||I)+"'":ht="Parse error on line "+(tt+1)+": Unexpected "+(I==_t?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(ht,{text:T.match,token:this.terminals_[I]||I,line:T.yylineno,loc:rt,expected:et})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+I);switch(z[0]){case 1:u.push(I),w.push(T.yytext),r.push(T.yylloc),u.push(z[1]),I=null,St=T.yyleng,d=T.yytext,tt=T.yylineno,rt=T.yylloc;break;case 2:if(N=this.productions_[z[1]][1],G.$=w[w.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ti&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),ot=this.performAction.apply(G,[d,St,tt,$.yy,z[1],w,r].concat(Jt)),typeof ot<"u")return ot;N&&(u=u.slice(0,-1*N*2),w=w.slice(0,-1*N),r=r.slice(0,-1*N)),u.push(this.productions_[z[1]][0]),w.push(G.$),r.push(G._$),Rt=Q[u[u.length-2]][u[u.length-1]],u.push(Rt);break;case 3:return!0}}return!0},"parse")},_=(function(){var F={EOF:1,parseError:a(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:a(function(o,l){return this.yy=l||this.yy||{},this._input=o,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 o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:a(function(o){var l=o.length,u=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var x=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 w=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===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-l]),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(o){this.unput(this.match.slice(o))},"less"),pastInput:a(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
5
+ `+l+"^"},"showPosition"),test_match:a(function(o,l){var u,x,w;if(this.options.backtrack_lexer&&(w={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&&(w.yylloc.range=this.yylloc.range.slice(0))),x=o[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,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(o[0].length),this.matched+=o[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var r in w)this[r]=w[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,u,x;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),r=0;r<w.length;r++)if(u=this._input.match(this.rules[w[r]]),u&&(!l||u[0].length>l[0].length)){if(l=u,x=r,this.options.backtrack_lexer){if(o=this.test_match(u,w[r]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,w[x]),o!==!1?o:!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 l=this.next();return l||this.lex()},"lex"),begin:a(function(l){this.conditionStack.push(l)},"begin"),popState:a(function(){var l=this.conditionStack.length-1;return l>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(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:a(function(l){this.begin(l)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(l,u,x,w){switch(x){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;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 31;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 27;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 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"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 F})();V.lexer=_;function H(){this.yy={}}return a(H,"Parser"),H.prototype=V,V.Parser=H,new H})();ct.parser=ct;var mi=ct;function ut(t){return t.type==="bar"}a(ut,"isBarPlot");function ft(t){return t.type==="band"}a(ft,"isBandAxisData");function j(t){return t.type==="linear"}a(j,"isLinearAxisData");var It=class{constructor(t){this.parentGroup=t}static{a(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((n,g)=>Math.max(g.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 g=xi(s,1,n),c=g?g.width:n.length*i,p=g?g.height:i;e.width=Math.max(e.width,c),e.height=Math.max(e.height,p)}return s.remove(),e}},vt=.7,Pt=.2,Vt=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.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}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(){vt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(vt*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=Pt*t.width;this.outerPadding=Math.min(e.width/2,s);const n=e.height+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=Pt*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}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),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,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():[]}},yi=class extends Vt{static{a(this,"BandAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.categories=e,this.scale=lt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=lt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Et.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},bi=class extends Vt{static{a(this,"LinearAxis")}constructor(t,i,e,s,n){super(t,s,n,i),this.domain=e,this.scale=Dt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Dt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function gt(t,i,e,s){const n=new It(s);return ft(t)?new yi(i,e,t.categories,t.title,n):new bi(i,e,[t.min,t.max],t.title,n)}a(gt,"getAxis");var Ai=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 Bt(t,i,e,s){const n=new It(s);return new Ai(n,t,i,e)}a(Bt,"getChartTitleComponent");var wi=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(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let i;return this.orientation==="horizontal"?i=Tt().y(e=>e[0]).x(e=>e[1])(t):i=Tt().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},Ci=class{constructor(t,i,e,s,n,g){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=n,this.plotIndex=g}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}))}]}},Si=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 wi(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new Ci(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 Si(t,i,e)}a(Wt,"getPlotComponent");var _i=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Bt(t,i,e,s),plot:Wt(t,i,e),xAxis:gt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:gt(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=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),c=this.componentStore.plot.calculateSpace({width:n,height:g});t-=c.width,i-=c.height,c=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=c.height,i-=c.height,this.componentStore.xAxis.setAxisPosition("bottom"),c=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=c.height,this.componentStore.yAxis.setAxisPosition("left"),c=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=c.width,t-=c.width,t>0&&(n+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:g}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+g}),this.componentStore.yAxis.setRange([s,s+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(p=>ut(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:g,height:c});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("left"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=p.width,s=p.width,this.componentStore.yAxis.setAxisPosition("top"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=p.height,n=e+p.height,t>0&&(g+=t,t=0),i>0&&(c+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.yAxis.setRange([s,s+g]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([n,n+c]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(k=>ut(k))&&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}},ki=class{static{a(this,"XYChartBuilder")}static build(t,i,e,s){return new _i(t,i,e,s).getDrawableElement()}},K=0,zt,Z=yt(),J=mt(),b=bt(),xt=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,pt=!1;function mt(){const t=gi(),i=dt();return Mt(t.xyChart,i.themeVariables.xyChart)}a(mt,"getChartDefaultThemeConfig");function yt(){const t=dt();return Mt(ui.xyChart,t.xyChart)}a(yt,"getChartDefaultConfig");function bt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(bt,"getChartDefaultData");function nt(t){const i=dt();return ci(t.trim(),i)}a(nt,"textSanitizer");function Ot(t){zt=t}a(Ot,"setTmpSVGG");function Ft(t){t==="horizontal"?Z.chartOrientation="horizontal":Z.chartOrientation="vertical"}a(Ft,"setOrientation");function Xt(t){b.xAxis.title=nt(t.text)}a(Xt,"setXAxisTitle");function At(t,i){b.xAxis={type:"linear",title:b.xAxis.title,min:t,max:i},st=!0}a(At,"setXAxisRangeData");function Yt(t){b.xAxis={type:"band",title:b.xAxis.title,categories:t.map(i=>nt(i.text))},st=!0}a(Yt,"setXAxisBand");function Nt(t){b.yAxis.title=nt(t.text)}a(Nt,"setYAxisTitle");function Ht(t,i){b.yAxis={type:"linear",title:b.yAxis.title,min:t,max:i},pt=!0}a(Ht,"setYAxisRangeData");function Ut(t){const i=Math.min(...t),e=Math.max(...t),s=j(b.yAxis)?b.yAxis.min:1/0,n=j(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(s,i),max:Math.max(n,e)}}a(Ut,"setYAxisRangeFromPlotData");function wt(t){let i=[];if(t.length===0)return i;if(!st){const e=j(b.xAxis)?b.xAxis.min:1/0,s=j(b.xAxis)?b.xAxis.max:-1/0;At(Math.min(e,1),Math.max(s,t.length))}if(pt||Ut(t),ft(b.xAxis)&&(i=b.xAxis.categories.map((e,s)=>[e,t[s]])),j(b.xAxis)){const e=b.xAxis.min,s=b.xAxis.max,n=(s-e)/(t.length-1),g=[];for(let c=e;c<=s;c+=n)g.push(`${c}`);i=g.map((c,p)=>[c,t[p]])}return i}a(wt,"transformDataWithoutCategory");function Ct(t){return xt[t===0?0:t%xt.length]}a(Ct,"getPlotColorFromPalette");function $t(t,i){const e=wt(i);b.plots.push({type:"line",strokeFill:Ct(K),strokeWidth:2,data:e}),K++}a($t,"setLineData");function qt(t,i){const e=wt(i);b.plots.push({type:"bar",fill:Ct(K),data:e}),K++}a(qt,"setBarData");function Gt(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=Lt(),ki.build(Z,b,J,zt)}a(Gt,"getDrawableElem");function jt(){return J}a(jt,"getChartThemeConfig");function Qt(){return Z}a(Qt,"getChartConfig");function Kt(){return b}a(Kt,"getXYChartData");var Ri=a(function(){li(),K=0,Z=yt(),b=bt(),J=mt(),xt=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,pt=!1},"clear"),Ti={getDrawableElem:Gt,clear:Ri,setAccTitle:ri,getAccTitle:ai,setDiagramTitle:ni,getDiagramTitle:Lt,getAccDescription:si,setAccDescription:ei,setOrientation:Ft,setXAxisTitle:Xt,setXAxisRangeData:At,setXAxisBand:Yt,setYAxisTitle:Nt,setYAxisRangeData:Ht,setLineData:$t,setBarData:qt,setTmpSVGG:Ot,getChartThemeConfig:jt,getChartConfig:Qt,getXYChartData:Kt},Di=a((t,i,e,s)=>{const n=s.db,g=n.getChartThemeConfig(),c=n.getChartConfig(),p=n.getXYChartData().plots[0].data.map(f=>f[1]);function k(f){return f==="top"?"text-before-edge":"middle"}a(k,"getDominantBaseLine");function v(f){return f==="left"?"start":f==="right"?"end":"middle"}a(v,"getTextAnchor");function P(f){return`translate(${f.x}, ${f.y}) rotate(${f.rotation||0})`}a(P,"getTextTransformation"),Et.debug(`Rendering xychart chart
7
+ `+t);const S=oi(i),m=S.append("g").attr("class","main"),E=m.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");hi(S,c.height,c.width,!0),S.attr("viewBox",`0 0 ${c.width} ${c.height}`),E.attr("fill",g.backgroundColor),n.setTmpSVGG(S.append("g").attr("class","mermaid-tmp-group"));const D=n.getDrawableElem(),L={};function M(f){let R=m,h="";for(const[W]of f.entries()){let O=m;W>0&&L[h]&&(O=L[h]),h+=f[W],R=L[h],R||(R=L[h]=O.append("g").attr("class",f[W]))}return R}a(M,"getGroup");for(const f of D){if(f.data.length===0)continue;const R=M(f.groupTexts);switch(f.type){case"rect":if(R.selectAll("rect").data(f.data).enter().append("rect").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).attr("fill",h=>h.fill).attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth),c.showDataLabel){const h=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let W=function(A,V){const{data:_,label:H}=A;return V*H.length*O<=_.width-X};a(W,"fitsHorizontally");const O=.7,X=10,Y=f.data.map((A,V)=>({data:A,label:p[V].toString()})).filter(A=>A.data.width>0&&A.data.height>0),C=Y.map(A=>{const{data:V}=A;let _=V.height*.7;for(;!W(A,_)&&_>0;)_-=1;return _}),U=Math.floor(Math.min(...C)),y=a(A=>h?A.data.x+A.data.width+X:A.data.x+A.data.width-X,"determineLabelXPosition");R.selectAll("text").data(Y).enter().append("text").attr("x",y).attr("y",A=>A.data.y+A.data.height/2).attr("text-anchor",h?"start":"end").attr("dominant-baseline","middle").attr("fill",g.dataLabelColor).attr("font-size",`${U}px`).text(A=>A.label)}else{let W=function(y,A,V){const{data:_,label:H}=y,o=A*H.length*.7,l=_.x+_.width/2,u=l-o/2,x=l+o/2,w=u>=_.x&&x<=_.x+_.width,r=_.y+V+A<=_.y+_.height;return w&&r};a(W,"fitsInBar");const O=10,X=f.data.map((y,A)=>({data:y,label:p[A].toString()})).filter(y=>y.data.width>0&&y.data.height>0),Y=X.map(y=>{const{data:A,label:V}=y;let _=A.width/(V.length*.7);for(;!W(y,_,O)&&_>0;)_-=1;return _}),C=Math.floor(Math.min(...Y)),U=a(y=>h?y.data.y-O:y.data.y+O,"determineLabelYPosition");R.selectAll("text").data(X).enter().append("text").attr("x",y=>y.data.x+y.data.width/2).attr("y",U).attr("text-anchor","middle").attr("dominant-baseline",h?"auto":"hanging").attr("fill",g.dataLabelColor).attr("font-size",`${C}px`).text(y=>y.label)}}break;case"text":R.selectAll("text").data(f.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",h=>h.fill).attr("font-size",h=>h.fontSize).attr("dominant-baseline",h=>k(h.verticalPos)).attr("text-anchor",h=>v(h.horizontalPos)).attr("transform",h=>P(h)).text(h=>h.text);break;case"path":R.selectAll("path").data(f.data).enter().append("path").attr("d",h=>h.path).attr("fill",h=>h.fill?h.fill:"none").attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth);break}}},"draw"),vi={draw:Di},Ii={parser:mi,db:Ti,renderer:vi};export{Ii as diagram};
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
+ <rect width="32" height="32" rx="6" fill="#162019" />
3
+ <path d="M8 21h16v3H8v-3Zm2-5h12v3H10v-3Zm3-5h11v3H13v-3ZM8 6h8v3H8V6Z" fill="#d9e3ee" />
4
+ </svg>
package/web/index.html ADDED
@@ -0,0 +1,2 @@
1
+ <!DOCTYPE html><html lang="en"> <head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Spur Board</title><script type="module">(function(){var e=localStorage.getItem("spur-theme"),t=e||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");document.documentElement.setAttribute("data-theme",t)})();</script><link rel="stylesheet" href="/_astro/index.CA3GTZM6.css">
2
+ <link rel="stylesheet" href="/_astro/BoardApp.t7x-dYDo.css"></head> <body> <style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event("astro:only"));})();</script><script>(()=>{var g=Object.defineProperty;var w=(c,s,d)=>s in c?g(c,s,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[s]=d;var l=(c,s,d)=>w(c,typeof s!="symbol"?s+"":s,d);var E=new Set(["__proto__","constructor","prototype"]);{let c={0:t=>y(t),1:t=>d(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(d(t)),5:t=>new Set(d(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>Number.POSITIVE_INFINITY*t},s=t=>{let[p,e]=t;return p in c?c[p](e):void 0},d=t=>t.map(s),y=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([p,e])=>[p,s(e)]));class f extends HTMLElement{constructor(){super(...arguments);l(this,"Component");l(this,"hydrator");l(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let n=this.querySelectorAll("astro-slot"),r={},i=this.querySelectorAll("template[data-astro-template]");for(let o of i){let a=o.closest(this.tagName);a!=null&&a.isSameNode(this)&&(r[o.getAttribute("data-astro-template")||"default"]=o.innerHTML,o.remove())}for(let o of n){let a=o.closest(this.tagName);a!=null&&a.isSameNode(this)&&(r[o.getAttribute("name")||"default"]=o.innerHTML)}let u;try{u=this.hasAttribute("props")?y(JSON.parse(this.getAttribute("props"))):{}}catch(o){let a=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(a+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${a}`,this.getAttribute("props"),o),o}let h;await this.hydrator(this)(this.Component,u,r,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});l(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),n.disconnect(),this.childrenConnectedCallback()},n=new MutationObserver(()=>{var r;((r=this.lastChild)==null?void 0:r.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});n.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}getRetryImportUrl(e){let n=new URL(e,document.baseURI),r=`astro-retry=${Date.now()}`,i=n.hash.replace(/^#/,"");return n.hash=i?`${i}&${r}`:r,n.toString()}async importWithRetry(e){try{return await import(e)}catch(n){return await new Promise(r=>setTimeout(r,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let n=this.getAttribute("component-url"),r=new CustomEvent("astro:hydration-error",{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:n}});this.dispatchEvent(r)&&console.error(`[astro-island] Error hydrating ${n}`,e)}async start(){let e=JSON.parse(this.getAttribute("opts")),n=this.getAttribute("client");if(Astro[n]===void 0){window.addEventListener(`astro:${n}`,()=>this.start(),{once:!0});return}try{await Astro[n](async()=>{let r=this.getAttribute("renderer-url");try{let[i,{default:u}]=await Promise.all([this.importWithRetry(this.getAttribute("component-url")),r?this.importWithRetry(r):Promise.resolve({default:()=>()=>{}})]),h=this.getAttribute("component-export")||"default";if(h.includes(".")){this.Component=i;for(let m of h.split(".")){if(E.has(m)||!this.Component||typeof this.Component!="object"&&typeof this.Component!="function"||!Object.hasOwn(this.Component,m))throw new Error(`Invalid component export path: ${h}`);this.Component=this.Component[m]}}else{if(E.has(h))throw new Error(`Invalid component export path: ${h}`);this.Component=i[h]}return this.hydrator=u,this.hydrate}catch(i){return this.handleHydrationError(i),()=>{}}},e,this)}catch(r){this.handleHydrationError(r)}}attributeChangedCallback(){this.hydrate()}}l(f,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",f)}})();</script><astro-island uid="WVsOk" component-url="/_astro/BoardApp.Bcfvp2GH.js" component-export="default" renderer-url="/_astro/client.CdFpTatq.js" props="{}" ssr client="only" opts="{&quot;name&quot;:&quot;BoardApp&quot;,&quot;value&quot;:&quot;react&quot;}"></astro-island> </body></html>
File without changes
File without changes
File without changes
File without changes