@flowfuse/node-red-dashboard 1.31.0 → 1.31.1-0abe89c-202609211346.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/nodes/config/ui_base.js +15 -1
  2. package/nodes/store/clients.js +71 -0
  3. package/nodes/utils/index.js +8 -1
  4. package/nodes/widgets/locales/en-US/ui_control.json +2 -1
  5. package/nodes/widgets/ui_chart.js +7 -3
  6. package/nodes/widgets/ui_control.html +1 -1
  7. package/nodes/widgets/ui_control.js +28 -0
  8. package/package.json +4 -4
  9. package/dist/apple-touch-icon.png +0 -0
  10. package/dist/assets/abnfDiagram-N423BO3Z-BOzAedUe.js +0 -1
  11. package/dist/assets/architectureDiagram-T3A2C74G-zEM8gtfO.js +0 -36
  12. package/dist/assets/blockDiagram-VBNYF7ZC-eKuDT4u2.js +0 -132
  13. package/dist/assets/c4Diagram-5PPSVZJV-CRPvpwR2.js +0 -10
  14. package/dist/assets/chunk-2GRJ4B5K-BUP9p1Ar.js +0 -1
  15. package/dist/assets/chunk-2Q5K7J3B-DASHHxaC.js +0 -1
  16. package/dist/assets/chunk-5RXB4S5H-C76llYJF.js +0 -231
  17. package/dist/assets/chunk-5VM5RSS4-DnmzQEFn.js +0 -15
  18. package/dist/assets/chunk-6Q2QTUOP-DpGB6o5S.js +0 -88
  19. package/dist/assets/chunk-GF5L2VYU-Bhzwn3VL.js +0 -206
  20. package/dist/assets/chunk-JWPE2WC7-UNqcBwu_.js +0 -1
  21. package/dist/assets/chunk-KBJHAD2P-C38IW_UU.js +0 -1
  22. package/dist/assets/chunk-RYQCIY6F-COKxTTcO.js +0 -1
  23. package/dist/assets/chunk-XXDRQBXY-BS0ojEzX.js +0 -1
  24. package/dist/assets/classDiagram-JCYQIIEL-CxMqqBtQ.js +0 -1
  25. package/dist/assets/classDiagram-v2-OCEON4UE-CxMqqBtQ.js +0 -1
  26. package/dist/assets/cose-bilkent-JH36ORCC-9jRlXuji.js +0 -1
  27. package/dist/assets/cynefin-VYW2F7L2-BDPznSFQ.js +0 -178
  28. package/dist/assets/cynefinDiagram-MW4NZA55-lSqlEkCZ.js +0 -62
  29. package/dist/assets/cytoscape.esm-D_LviqZs.js +0 -331
  30. package/dist/assets/dagre-VZM6K2ZE-Dfoe_jp9.js +0 -4
  31. package/dist/assets/diagram-7IWD3JNH-Df2T__dV.js +0 -30
  32. package/dist/assets/diagram-B4RE2ZJO-DoGtC0h7.js +0 -3
  33. package/dist/assets/diagram-LBJQPF4R-cH8DVJ6C.js +0 -24
  34. package/dist/assets/diagram-Q27KOJAE-8JJAGHRF.js +0 -24
  35. package/dist/assets/diagram-UB23O5K3-BGCDqdpG.js +0 -41
  36. package/dist/assets/disconnected-BuxohaUu.png +0 -0
  37. package/dist/assets/ebnfDiagram-BXEA7PRR-r2bgA64b.js +0 -1
  38. package/dist/assets/echarts-BB8VCqSB.js +0 -73
  39. package/dist/assets/erDiagram-JOGREHBK-BExdsKTd.js +0 -85
  40. package/dist/assets/flowDiagram-UKHOOZJN-B8wwUqLz.js +0 -156
  41. package/dist/assets/ganttDiagram-PKOTCBZU-SViiTCQN.js +0 -292
  42. package/dist/assets/gitGraphDiagram-DS77QQ5N-CmktWysd.js +0 -106
  43. package/dist/assets/graph-C9eacEi8.js +0 -1
  44. package/dist/assets/index-CizlQbSv.css +0 -13
  45. package/dist/assets/index-CrLoQPpq.js +0 -124
  46. package/dist/assets/infoDiagram-6WML65LV-BwUFVmXD.js +0 -2
  47. package/dist/assets/ishikawaDiagram-WSZJBQD7-Df6P2A6T.js +0 -70
  48. package/dist/assets/journeyDiagram-NVQOT4AX-Cjk4fifu.js +0 -139
  49. package/dist/assets/kanban-definition-27J2QSJJ-BcoyAznM.js +0 -89
  50. package/dist/assets/katex-C5jXJg4s.js +0 -257
  51. package/dist/assets/layout-DEXfKzaS.js +0 -1
  52. package/dist/assets/logo-DIAzbBuw.png +0 -0
  53. package/dist/assets/map-Czzmt4hB.js +0 -1
  54. package/dist/assets/materialdesignicons-webfont-B7mPwVP_.ttf +0 -0
  55. package/dist/assets/materialdesignicons-webfont-CSr8KVlo.eot +0 -0
  56. package/dist/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 +0 -0
  57. package/dist/assets/materialdesignicons-webfont-PXm3-2wK.woff +0 -0
  58. package/dist/assets/mermaid-CX4mRs5N.js +0 -314
  59. package/dist/assets/mindmap-definition-FAOFIHXS-D6njotiS.js +0 -96
  60. package/dist/assets/pegDiagram-VL7TDLO6-CaA_iXxT.js +0 -1
  61. package/dist/assets/pieDiagram-7S7Q4E2Y-aYh5694F.js +0 -39
  62. package/dist/assets/quadrantDiagram-CIZ2JOQS-CaWyb4Jw.js +0 -7
  63. package/dist/assets/railroadDiagram-AXF67PYL-Bd_vMLsE.js +0 -1
  64. package/dist/assets/requirementDiagram-LRYGKXZP-CMxISoyd.js +0 -84
  65. package/dist/assets/sankeyDiagram-W5VNT64P-DLbFAyXe.js +0 -40
  66. package/dist/assets/sequenceDiagram-SI44F4Z6-CzdhMpvP.js +0 -162
  67. package/dist/assets/sizeCapture-X5ZJPWSS-CnezfYZ6.js +0 -1
  68. package/dist/assets/stateDiagram-OKZ733FA-5R9RLDEM.js +0 -1
  69. package/dist/assets/stateDiagram-v2-UEYNNEHI-Ck4l-gcT.js +0 -1
  70. package/dist/assets/swimlanes-SLNWSIFB-CeEnGZwJ.js +0 -2
  71. package/dist/assets/swimlanesDiagram-ULZ7WXOC-DSebamlh.js +0 -8
  72. package/dist/assets/timeline-definition-Z64GVDOM-ZMWCENQJ.js +0 -120
  73. package/dist/assets/vennDiagram-T6HMQDX7-DVr1jz1I.js +0 -34
  74. package/dist/assets/vue-vendor-Bmy9n80X.js +0 -49
  75. package/dist/assets/wardleyDiagram-T6FBY63Y-DNp6yzs5.js +0 -78
  76. package/dist/assets/workbox-window.prod.es5-BIl4cyR9.js +0 -2
  77. package/dist/assets/xychartDiagram-ELKLHX3M-DC4NZzl1.js +0 -7
  78. package/dist/favicon.ico +0 -0
  79. package/dist/favicon.svg +0 -482
  80. package/dist/index.html +0 -24
  81. package/dist/logo-512x512.png +0 -0
  82. package/dist/logo.svg +0 -482
  83. package/dist/maskable-icon-512x512.png +0 -0
  84. package/dist/pwa-192x192.png +0 -0
  85. package/dist/pwa-512x512.png +0 -0
  86. package/dist/pwa-64x64.png +0 -0
  87. package/dist/sw.js +0 -2
@@ -1,78 +0,0 @@
1
- import{p as zt}from"./chunk-JWPE2WC7-UNqcBwu_.js";import{s as Lt,g as Tt,o as At,n as Xt,a as Et,b as Yt,_ as y,K as It,z as Bt,B as Q,l as et,E as Ft,e as Rt,p as Ot,c as V}from"./mermaid-CX4mRs5N.js";import{p as Wt}from"./cynefin-VYW2F7L2-BDPznSFQ.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(zt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=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,L=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.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.");Gt(o,e)},"parse")},I,qt=(I=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={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,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}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:Xt,getDiagramTitle:At,getAccDescription:Tt,setAccDescription:Lt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,L,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var U,J;et.debug(`Rendering Wardley map
2
- `+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),L=v.getDiagramTitle(),M=((U=g.size)==null?void 0:U.width)??r.width,k=((J=g.size)==null?void 0:J.height)??r.height,N=Ft(o);N.selectAll("*").remove(),Rt(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),q=N.append("defs");q.append("marker").attr("id",`arrow-${o}`).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"),q.append("marker").attr("id",`link-arrow-end-${o}`).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"),q.append("marker").attr("id",`link-arrow-start-${o}`).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"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const B=M-r.padding*2,F=k-r.padding*2;L&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(L);const T=y(t=>r.padding+t/100*B,"projectX"),A=y(t=>k-r.padding-t/100*F,"projectY"),O=P.append("g").attr("class","wardley-axes");O.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+B/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+F/2})`).text(bt);const R=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(R.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===R.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/R.length;R.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}R.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*B,f=r.padding+l.end*B,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.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",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+B*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-F*s).attr("y2",k-r.padding-F*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:A(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f<i.length-1;f++){const u=i[f],w=i[f+1];n.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,l=-1/0,x=0;if(s.componentIds.forEach(f=>{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const z=(h+l)/2;S.x=z,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+30).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const K=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(K).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).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-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(K.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,z=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${z} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=T(t.targetX),i=A(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).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-${o})`);const C=P.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(" "));C.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",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.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",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.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",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const X=C.filter(t=>t.sourceStrategy==="market");X.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",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.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",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(X.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),X.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),X.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),X.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",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.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",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.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",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.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=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:T(i.x),y:A(i.y)}));if(s.length>1)for(let i=0;i<s.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[i].x).attr("y1",s[i].y).attr("x2",s[i+1].x).attr("y2",s[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach(i=>{const h=t.append("g").attr("class","wardley-annotation");h.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),h.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(n.number)})}),g.annotationsBox){let n=T(g.annotationsBox.x),s=A(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const z=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(z)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const z=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-z,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",z).attr("height",W).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=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=T(n.x),i=A(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
3
- M ${s} ${i-l/2}
4
- L ${s+h-x} ${i-l/2}
5
- L ${s+h-x} ${i-l/2-8}
6
- L ${s+h} ${i}
7
- L ${s+h-x} ${i+l/2+8}
8
- L ${s+h-x} ${i+l/2}
9
- L ${s} ${i+l/2}
10
- Z
11
- `;t.append("path").attr("d",f).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+h/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.name)})}if(g.deaccelerators.length>0){const t=P.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
12
- M ${s+h} ${i-l/2}
13
- L ${s+x} ${i-l/2}
14
- L ${s+x} ${i-l/2-8}
15
- L ${s} ${i}
16
- L ${s+x} ${i+l/2+8}
17
- L ${s+x} ${i+l/2}
18
- L ${s+h} ${i+l/2}
19
- Z
20
- `;t.append("path").attr("d",f).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+h/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.name)})}},"draw"),Kt={draw:Zt},Ut=y(({wardley:a}={})=>{const o=It(),e=Bt(),p=Q(o,e.themeVariables),r=Q(p.wardley,a);return`
21
- .wardley-background {
22
- fill: ${r.backgroundColor};
23
- }
24
- .wardley-axes line, .wardley-axes path {
25
- stroke: ${r.axisColor};
26
- }
27
- .wardley-axis-label {
28
- fill: ${r.axisTextColor};
29
- }
30
- .wardley-stage-label {
31
- fill: ${r.axisTextColor};
32
- }
33
- .wardley-grid line {
34
- stroke: ${r.gridColor};
35
- }
36
- .wardley-node circle {
37
- fill: ${r.componentFill};
38
- stroke: ${r.componentStroke};
39
- }
40
- .wardley-node-label {
41
- fill: ${r.componentLabelColor};
42
- }
43
- .wardley-link {
44
- stroke: ${r.linkStroke};
45
- }
46
- .wardley-link--dashed {
47
- stroke-dasharray: 4 4;
48
- }
49
- .wardley-link-label {
50
- fill: ${r.axisTextColor};
51
- }
52
- .wardley-trend line {
53
- stroke: ${r.evolutionStroke};
54
- }
55
- .wardley-annotation-line {
56
- stroke: ${r.annotationStroke};
57
- }
58
- .wardley-annotation circle {
59
- fill: ${r.annotationFill};
60
- stroke: ${r.annotationStroke};
61
- }
62
- .wardley-annotation text {
63
- fill: ${r.annotationTextColor};
64
- }
65
- .wardley-annotations-box rect {
66
- fill: ${r.annotationFill};
67
- stroke: ${r.annotationStroke};
68
- }
69
- .wardley-annotations-box text {
70
- fill: ${r.annotationTextColor};
71
- }
72
- .wardley-pipeline-box {
73
- stroke: ${r.componentStroke};
74
- }
75
- .wardley-notes text {
76
- fill: ${r.axisTextColor};
77
- }
78
- `},"styles"),ae={parser:at,db:Ht,renderer:Kt,styles:Ut};export{ae as diagram};
@@ -1,2 +0,0 @@
1
- try{self["workbox:window:7.3.0"]&&_()}catch{}function b(n,r){return new Promise((function(t){var o=new MessageChannel;o.port1.onmessage=function(f){t(f.data)},n.postMessage(r,[o.port2])}))}function P(n,r){(r==null||r>n.length)&&(r=n.length);for(var t=0,o=Array(r);t<r;t++)o[t]=n[t];return o}function j(n,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,W(o.key),o)}}function S(n,r){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=(function(f,c){if(f){if(typeof f=="string")return P(f,c);var a={}.toString.call(f).slice(8,-1);return a==="Object"&&f.constructor&&(a=f.constructor.name),a==="Map"||a==="Set"?Array.from(f):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?P(f,c):void 0}})(n))||r){t&&(n=t);var o=0;return function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(n,r){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(n,r)}function W(n){var r=(function(t,o){if(typeof t!="object"||!t)return t;var f=t[Symbol.toPrimitive];if(f!==void 0){var c=f.call(t,o);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)})(n,"string");return typeof r=="symbol"?r:r+""}try{self["workbox:core:7.3.0"]&&_()}catch{}var m=function(){var n=this;this.promise=new Promise((function(r,t){n.resolve=r,n.reject=t}))};function y(n,r){var t=location.href;return new URL(n,t).href===new URL(r,t).href}var d=function(n,r){this.type=n,Object.assign(this,r)};function l(n,r,t){return t?r?r(n):n:(n&&n.then||(n=Promise.resolve(n)),r?n.then(r):n)}function k(){}var L={type:"SKIP_WAITING"};function E(n,r){return n&&n.then?n.then(k):Promise.resolve()}var O=(function(n){function r(c,a){var e,i;return a===void 0&&(a={}),(e=n.call(this)||this).nn={},e.tn=0,e.rn=new m,e.en=new m,e.on=new m,e.un=0,e.an=new Set,e.cn=function(){var u=e.fn,s=u.installing;e.tn>0||!y(s.scriptURL,e.sn.toString())||performance.now()>e.un+6e4?(e.vn=s,u.removeEventListener("updatefound",e.cn)):(e.hn=s,e.an.add(s),e.rn.resolve(s)),++e.tn,s.addEventListener("statechange",e.ln)},e.ln=function(u){var s=e.fn,v=u.target,h=v.state,p=v===e.vn,g={sw:v,isExternal:p,originalEvent:u};!p&&e.mn&&(g.isUpdate=!0),e.dispatchEvent(new d(h,g)),h==="installed"?e.wn=self.setTimeout((function(){h==="installed"&&s.waiting===v&&e.dispatchEvent(new d("waiting",g))}),200):h==="activating"&&(clearTimeout(e.wn),p||e.en.resolve(v))},e.yn=function(u){var s=e.hn,v=s!==navigator.serviceWorker.controller;e.dispatchEvent(new d("controlling",{isExternal:v,originalEvent:u,sw:s,isUpdate:e.mn})),v||e.on.resolve(s)},e.gn=(i=function(u){var s=u.data,v=u.ports,h=u.source;return l(e.getSW(),(function(){e.an.has(h)&&e.dispatchEvent(new d("message",{data:s,originalEvent:u,ports:v,sw:h}))}))},function(){for(var u=[],s=0;s<arguments.length;s++)u[s]=arguments[s];try{return Promise.resolve(i.apply(this,u))}catch(v){return Promise.reject(v)}}),e.sn=c,e.nn=a,navigator.serviceWorker.addEventListener("message",e.gn),e}var t,o;o=n,(t=r).prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o);var f=r.prototype;return f.register=function(c){var a=(c===void 0?{}:c).immediate,e=a!==void 0&&a;try{var i=this;return l((function(u,s){var v=u();return v&&v.then?v.then(s):s(v)})((function(){if(!e&&document.readyState!=="complete")return E(new Promise((function(u){return window.addEventListener("load",u)})))}),(function(){return i.mn=!!navigator.serviceWorker.controller,i.dn=i.pn(),l(i.bn(),(function(u){i.fn=u,i.dn&&(i.hn=i.dn,i.en.resolve(i.dn),i.on.resolve(i.dn),i.dn.addEventListener("statechange",i.ln,{once:!0}));var s=i.fn.waiting;return s&&y(s.scriptURL,i.sn.toString())&&(i.hn=s,Promise.resolve().then((function(){i.dispatchEvent(new d("waiting",{sw:s,wasWaitingBeforeRegister:!0}))})).then((function(){}))),i.hn&&(i.rn.resolve(i.hn),i.an.add(i.hn)),i.fn.addEventListener("updatefound",i.cn),navigator.serviceWorker.addEventListener("controllerchange",i.yn),i.fn}))})))}catch(u){return Promise.reject(u)}},f.update=function(){try{return this.fn?l(E(this.fn.update())):l()}catch(c){return Promise.reject(c)}},f.getSW=function(){return this.hn!==void 0?Promise.resolve(this.hn):this.rn.promise},f.messageSW=function(c){try{return l(this.getSW(),(function(a){return b(a,c)}))}catch(a){return Promise.reject(a)}},f.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&b(this.fn.waiting,L)},f.pn=function(){var c=navigator.serviceWorker.controller;return c&&y(c.scriptURL,this.sn.toString())?c:void 0},f.bn=function(){try{var c=this;return l((function(a,e){try{var i=a()}catch(u){return e(u)}return i&&i.then?i.then(void 0,e):i})((function(){return l(navigator.serviceWorker.register(c.sn,c.nn),(function(a){return c.un=performance.now(),a}))}),(function(a){throw a})))}catch(a){return Promise.reject(a)}},(function(c,a,e){return a&&j(c.prototype,a),Object.defineProperty(c,"prototype",{writable:!1}),c})(r,[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])})((function(){function n(){this.Pn=new Map}var r=n.prototype;return r.addEventListener=function(t,o){this.jn(t).add(o)},r.removeEventListener=function(t,o){this.jn(t).delete(o)},r.dispatchEvent=function(t){t.target=this;for(var o,f=S(this.jn(t.type));!(o=f()).done;)(0,o.value)(t)},r.jn=function(t){return this.Pn.has(t)||this.Pn.set(t,new Set),this.Pn.get(t)},n})());export{O as Workbox,d as WorkboxEvent,b as messageSW};
@@ -1,7 +0,0 @@
1
- import{s as xi,g as di,o as Yt,n as fi,a as pi,b as yi,_ as n,l as Nt,E as mi,e as bi,p as Ai,z as Rt,i as wi,B as Ht,C as Ci,K as Si,L as Vt,M as _i,J as Ot,N as Wt}from"./mermaid-CX4mRs5N.js";var wt=(function(){var e=n(function(O,h,c,g){for(c=c||{},g=O.length;g--;c[O[g]]=h);return c},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],r=[1,6],u=[1,7],A=[1,5,10,12,14,16,18,19,21,23,36,37,38],m=[1,25],k=[1,26],T=[1,28],L=[1,29],E=[1,30],W=[1,31],F=[1,32],P=[1,33],B=[1,34],p=[1,35],_=[1,36],l=[1,37],I=[1,43],V=[1,42],X=[1,47],Y=[1,50],C=[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],y=[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],b=[1,65],M=[26,28],S={trace:n(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:n(function(h,c,g,x,w,o,ht){var d=o.length-1;switch(w){case 5:x.setOrientation(o[d]);break;case 9:x.setDiagramTitle(o[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[d]);break;case 13:x.setLineData(o[d-1],o[d]);break;case 14:x.setBarData({text:"",type:"text"},o[d]);break;case 15:x.setBarData(o[d-1],o[d]);break;case 16:this.$=o[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=o[d-1];break;case 20:case 30:this.$=[o[d-2],...o[d]];break;case 21:case 31:this.$=[o[d]];break;case 22:this.$={value:Number(o[d-1]),label:o[d]};break;case 23:this.$={value:Number(o[d]),label:""};break;case 24:x.setXAxisTitle(o[d]);break;case 25:x.setXAxisTitle(o[d-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(o[d]);break;case 28:x.setXAxisRangeData(Number(o[d-2]),Number(o[d]));break;case 29:this.$=o[d-1];break;case 32:x.setYAxisTitle(o[d]);break;case 33:x.setYAxisTitle(o[d-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(o[d-2]),Number(o[d]));break;case 39:this.$={text:o[d],type:"text"};break;case 40:this.$={text:o[d],type:"text"};break;case 41:this.$={text:o[d],type:"markdown"};break;case 42:this.$=o[d];break;case 43:this.$=o[d-1]+""+o[d];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:r,38:u}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:r,38:u}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:r,38:u}),{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]},e(A,[2,36]),e(A,[2,37]),e(A,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:r,38:u}),{1:[2,3]},e(A,[2,5]),e(t,[2,7],{4:22,36:a,37:r,38:u}),{11:23,30:m,39:24,40:k,41:27,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l},{11:39,13:38,24:I,29:V,30:m,31:40,32:41,39:24,40:k,41:27,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l},{11:45,15:44,29:X,30:m,35:46,39:24,40:k,41:27,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l},{11:49,17:48,24:Y,30:m,39:24,40:k,41:27,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l},{11:52,17:51,24:Y,30:m,39:24,40:k,41:27,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l},{20:[1,53]},{22:[1,54]},e(C,[2,18]),{1:[2,2]},e(C,[2,8]),e(C,[2,9]),e(H,[2,39],{41:55,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l}),e(H,[2,40]),e(H,[2,41]),e(y,[2,42]),e(y,[2,44]),e(y,[2,45]),e(y,[2,46]),e(y,[2,47]),e(y,[2,48]),e(y,[2,49]),e(y,[2,50]),e(y,[2,51]),e(y,[2,52]),e(y,[2,53]),e(C,[2,10]),e(C,[2,24],{32:41,31:56,24:I,29:V}),e(C,[2,26]),e(C,[2,27]),{33:[1,57]},{11:59,30:m,34:58,39:24,40:k,41:27,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l},e(C,[2,11]),e(C,[2,32],{35:60,29:X}),e(C,[2,34]),{33:[1,61]},e(C,[2,12]),{17:62,24:Y},{25:63,27:64,29:b},e(C,[2,14]),{17:66,24:Y},e(C,[2,16]),e(C,[2,17]),e(y,[2,43]),e(C,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(C,[2,33]),{29:[1,70]},e(C,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(M,[2,23],{30:[1,73]}),e(C,[2,15]),e(C,[2,28]),e(C,[2,29]),{11:59,30:m,34:74,39:24,40:k,41:27,42:T,43:L,44:E,45:W,46:F,47:P,48:B,49:p,50:_,51:l},e(C,[2,35]),e(C,[2,19]),{25:75,27:64,29:b},e(M,[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:n(function(h,c){if(c.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=c,g}},"parseError"),parse:n(function(h){var c=this,g=[0],x=[],w=[null],o=[],ht=this.table,d="",gt=0,It=0,li=2,Mt=1,ci=o.slice.call(arguments,1),R=Object.create(this.lexer),$={yy:{}};for(var yt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,yt)&&($.yy[yt]=this.yy[yt]);R.setInput(h,$.yy),$.yy.lexer=R,$.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var mt=R.yylloc;o.push(mt);var ui=R.options&&R.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(v){g.length=g.length-2*v,w.length=w.length-v,o.length=o.length-v}n(gi,"popStack");function zt(){var v;return v=x.pop()||R.lex()||Mt,typeof v!="number"&&(v instanceof Array&&(x=v,v=x.pop()),v=c.symbols_[v]||v),v}n(zt,"lex");for(var D,U,z,bt,G={},xt,N,Bt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?z=this.defaultActions[U]:((D===null||typeof D>"u")&&(D=zt()),z=ht[U]&&ht[U][D]),typeof z>"u"||!z.length||!z[0]){var At="";dt=[];for(xt in ht[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");R.showPosition?At="Parse error on line "+(gt+1)+`:
2
- `+R.showPosition()+`
3
- Expecting `+dt.join(", ")+", got '"+(this.terminals_[D]||D)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(D==Mt?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(At,{text:R.match,token:this.terminals_[D]||D,line:R.yylineno,loc:mt,expected:dt})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+D);switch(z[0]){case 1:g.push(D),w.push(R.yytext),o.push(R.yylloc),g.push(z[1]),D=null,It=R.yyleng,d=R.yytext,gt=R.yylineno,mt=R.yylloc;break;case 2:if(N=this.productions_[z[1]][1],G.$=w[w.length-N],G._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},ui&&(G._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),bt=this.performAction.apply(G,[d,It,gt,$.yy,z[1],w,o].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),w=w.slice(0,-1*N),o=o.slice(0,-1*N)),g.push(this.productions_[z[1]][0]),w.push(G.$),o.push(G._$),Bt=ht[g[g.length-2]][g[g.length-1]],g.push(Bt);break;case 3:return!0}}return!0},"parse")},ot=(function(){var O={EOF:1,parseError:n(function(c,g){if(this.yy.parser)this.yy.parser.parseError(c,g);else throw new Error(c)},"parseError"),setInput:n(function(h,c){return this.yy=c||this.yy||{},this._input=h,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:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var c=h.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var c=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;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),g.length-1&&(this.yylineno-=g.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:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),c=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
- `+c+"^"},"showPosition"),test_match:n(function(h,c){var g,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=h[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+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],g=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var o in w)this[o]=w[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,c,g,x;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),o=0;o<w.length;o++)if(g=this._input.match(this.rules[w[o]]),g&&(!c||g[0].length>c[0].length)){if(c=g,x=o,this.options.backtrack_lexer){if(h=this.test_match(g,w[o]),h!==!1)return h;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(h=this.test_match(c,w[x]),h!==!1?h:!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:n(function(){var c=this.next();return c||this.lex()},"lex"),begin:n(function(c){this.conditionStack.push(c)},"begin"),popState:n(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(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:n(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:n(function(c){this.begin(c)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(c,g,x,w){switch(x){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 O})();S.lexer=ot;function q(){this.yy={}}return n(q,"Parser"),q.prototype=S,S.Parser=q,new q})();wt.parser=wt;var Ri=wt;function Ct(e){return e.type==="bar"}n(Ct,"isBarPlot");function ft(e){return e.type==="band"}n(ft,"isBandAxisData");function j(e){return e.type==="linear"}n(j,"isLinearAxisData");var Q,$t=(Q=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((r,u)=>Math.max(u.length,r),0)*i,height:i};const s={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const r of t){const u=_i(a,1,r),A=u?u.width:r.length*i,m=u?u.height:i;s.width=Math.max(s.width,A),s.height=Math.max(s.height,m)}return a.remove(),s}},n(Q,"TextDimensionCalculatorWithFont"),Q),Ft=.7,Xt=.2,K,Ut=(K=class{constructor(t,i,s,a){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=a,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}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(){Ft*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Ft*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 s=this.getLabelDimension(),a=Xt*t.width;this.outerPadding=Math.min(s.width/2,a);let r=s.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(r=Math.max(r,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height))),r+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,r<=i&&(i-=r,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=i&&(i-=a,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 s=this.getLabelDimension(),a=Xt*t.height;this.outerPadding=Math.min(s.height/2,a);const r=s.width+this.axisConfig.labelPadding*2;r<=i&&(i-=r,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=i&&(i-=a,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(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,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(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${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(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${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():[]}},n(K,"BaseAxis"),K),J,ki=(J=class extends Ut{constructor(t,i,s,a,r){super(t,a,r,i),this.categories=s,this.scale=Vt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Vt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Nt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n(J,"BandAxis"),J),Z,Ti=(Z=class extends Ut{constructor(t,i,s,a,r){super(t,a,r,i),this.domain=s,this.scale=Ot().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Ot().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n(Z,"LinearAxis"),Z);function St(e,t,i,s){const a=new $t(s);return ft(e)?new ki(t,i,e.categories,e.title,a):new Ti(t,i,[e.min,e.max],e.title,a)}n(St,"getAxis");var tt,Di=(tt=class{constructor(t,i,s,a){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}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),s=Math.max(i.width,t.width),a=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=a,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}},n(tt,"ChartTitle"),tt);function qt(e,t,i,s){const a=new $t(s);return new Di(a,e,t,i)}n(qt,"getChartTitleComponent");var it,Li=(it=class{constructor(t,i,s,a,r){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=a,this.plotIndex=r}getDrawableElement(){const t=this.plotData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]);let i;if(this.orientation==="horizontal"?i=Wt().y(a=>a[0]).x(a=>a[1])(t):i=Wt().x(a=>a[0]).y(a=>a[1])(t),!i)return[];const s=[{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 u=[];for(const[A,[m,k]]of t.entries()){const T=this.plotData.pointLabels[A];T&&(this.orientation==="horizontal"?u.push({x:k+10,y:m,text:T,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):u.push({x:m,y:k-10,text:T,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}u.length>0&&s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:u})}return s}},n(it,"LinePlot"),it),et,Pi=(et=class{constructor(t,i,s,a,r,u){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=a,this.orientation=r,this.plotIndex=u}getDrawableElement(){const t=this.barData.data.map(r=>[this.xAxis.getScaleValue(r[0]),this.yAxis.getScaleValue(r[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(r=>({x:this.boundingRect.x,y:r[0]-a,height:s,width:r[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(r=>({x:r[0]-a,y:r[1],width:s,height:this.boundingRect.y+this.boundingRect.height-r[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n(et,"BarPlot"),et),st,vi=(st=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}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,s]of this.chartData.plots.entries())switch(s.type){case"line":{const a=new Li(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break;case"bar":{const a=new Pi(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break}return t}},n(st,"BasePlot"),st);function Gt(e,t,i){return new vi(e,t,i)}n(Gt,"getPlotComponent");var at,Ei=(at=class{constructor(t,i,s,a){this.chartConfig=t,this.chartData=i,this.componentStore={title:qt(t,i,s,a),plot:Gt(t,i,s),xAxis:St(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},a),yAxis:St(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,a=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),u=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),A=this.componentStore.plot.calculateSpace({width:r,height:u});t-=A.width,i-=A.height,A=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),a=A.height,i-=A.height,this.componentStore.xAxis.setAxisPosition("bottom"),A=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=A.height,this.componentStore.yAxis.setAxisPosition("left"),A=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=A.width,t-=A.width,t>0&&(r+=t,t=0),i>0&&(u+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:u}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.xAxis.setRange([s,s+r]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:a+u}),this.componentStore.yAxis.setRange([a,a+u]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(m=>Ct(m))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,a=0,r=0,u=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),A=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),m=this.componentStore.plot.calculateSpace({width:u,height:A});t-=m.width,i-=m.height,m=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=m.height,i-=m.height,this.componentStore.xAxis.setAxisPosition("left"),m=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=m.width,a=m.width,this.componentStore.yAxis.setAxisPosition("top"),m=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=m.height,r=s+m.height,t>0&&(u+=t,t=0),i>0&&(A+=i,i=0),this.componentStore.plot.calculateSpace({width:u,height:A}),this.componentStore.plot.setBoundingBoxXY({x:a,y:r}),this.componentStore.yAxis.setRange([a,a+u]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:s}),this.componentStore.xAxis.setRange([r,r+A]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(k=>Ct(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}},n(at,"Orchestrator"),at),nt,Ii=(nt=class{static build(t,i,s,a){return new Ei(t,i,s,a).getDrawableElement()}},n(nt,"XYChartBuilder"),nt),rt=0,jt,lt=Dt(),ct=Tt(),f=Lt(),_t=ct.plotColorPalette.split(",").map(e=>e.trim()),pt=!1,kt=!1;function Tt(){const e=Si(),t=Rt();return Ht(e.xyChart,t.themeVariables.xyChart)}n(Tt,"getChartDefaultThemeConfig");function Dt(){const e=Rt();return Ht(Ci.xyChart,e.xyChart)}n(Dt,"getChartDefaultConfig");function Lt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n(Lt,"getChartDefaultData");function ut(e){const t=Rt();return wi(e.trim(),t)}n(ut,"textSanitizer");function Qt(e){jt=e}n(Qt,"setTmpSVGG");function Kt(e){e==="horizontal"?lt.chartOrientation="horizontal":lt.chartOrientation="vertical"}n(Kt,"setOrientation");function Jt(e){f.xAxis.title=ut(e.text)}n(Jt,"setXAxisTitle");function Pt(e,t){f.xAxis={type:"linear",title:f.xAxis.title,min:e,max:t},pt=!0}n(Pt,"setXAxisRangeData");function Zt(e){f.xAxis={type:"band",title:f.xAxis.title,categories:e.map(t=>ut(t.text))},pt=!0}n(Zt,"setXAxisBand");function ti(e){f.yAxis.title=ut(e.text)}n(ti,"setYAxisTitle");function ii(e,t){f.yAxis={type:"linear",title:f.yAxis.title,min:e,max:t},kt=!0}n(ii,"setYAxisRangeData");function ei(e){const t=Math.min(...e),i=Math.max(...e),s=j(f.yAxis)?f.yAxis.min:1/0,a=j(f.yAxis)?f.yAxis.max:-1/0;f.yAxis={type:"linear",title:f.yAxis.title,min:Math.min(s,t),max:Math.max(a,i)}}n(ei,"setYAxisRangeFromPlotData");function vt(e){let t=[];if(e.length===0)return t;if(!pt){const i=j(f.xAxis)?f.xAxis.min:1/0,s=j(f.xAxis)?f.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(s,e.length))}if(ft(f.xAxis)&&e.length>f.xAxis.categories.length&&(e=e.slice(0,f.xAxis.categories.length)),kt||ei(e),ft(f.xAxis)&&(t=f.xAxis.categories.map((i,s)=>[i,e[s]])),j(f.xAxis)){const i=f.xAxis.min,s=f.xAxis.max;if(e.length===1)t=[[`${i}`,e[0]]];else{const a=(s-i)/(e.length-1);t=e.map((r,u)=>[`${i+u*a}`,r])}}return t}n(vt,"transformDataWithoutCategory");function Et(e){return _t[e===0?0:e%_t.length]}n(Et,"getPlotColorFromPalette");function si(e,t){const i=t.map(u=>u.value),s=t.map(u=>u.label?ut(u.label):""),a=vt(i),r=s.some(u=>u!=="");f.plots.push({type:"line",strokeFill:Et(rt),strokeWidth:2,data:a,...r?{pointLabels:s}:{}}),rt++}n(si,"setLineData");function ai(e,t){const i=t.map(a=>a.value),s=vt(i);f.plots.push({type:"bar",fill:Et(rt),data:s}),rt++}n(ai,"setBarData");function ni(){if(f.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return f.title=Yt(),Ii.build(lt,f,ct,jt)}n(ni,"getDrawableElem");function oi(){return ct}n(oi,"getChartThemeConfig");function hi(){return lt}n(hi,"getChartConfig");function ri(){return f}n(ri,"getXYChartData");var Mi=n(function(){Ai(),rt=0,lt=Dt(),f=Lt(),ct=Tt(),_t=ct.plotColorPalette.split(",").map(e=>e.trim()),pt=!1,kt=!1},"clear"),zi={getDrawableElem:ni,clear:Mi,setAccTitle:yi,getAccTitle:pi,setDiagramTitle:fi,getDiagramTitle:Yt,getAccDescription:di,setAccDescription:xi,setOrientation:Kt,setXAxisTitle:Jt,setXAxisRangeData:Pt,setXAxisBand:Zt,setYAxisTitle:ti,setYAxisRangeData:ii,setLineData:si,setBarData:ai,setTmpSVGG:Qt,getChartThemeConfig:oi,getChartConfig:hi,getXYChartData:ri},Bi=n((e,t,i,s)=>{const a=s.db,r=a.getChartThemeConfig(),u=a.getChartConfig(),A=a.getXYChartData().plots[0].data.map(p=>p[1]);function m(p){return p==="top"?"text-before-edge":"middle"}n(m,"getDominantBaseLine");function k(p){return p==="left"?"start":p==="right"?"end":"middle"}n(k,"getTextAnchor");function T(p){return`translate(${p.x}, ${p.y}) rotate(${p.rotation||0})`}n(T,"getTextTransformation"),Nt.debug(`Rendering xychart chart
7
- `+e);const L=mi(t),E=L.append("g").attr("class","main"),W=E.append("rect").attr("width",u.width).attr("height",u.height).attr("class","background");bi(L,u.height,u.width,!0),L.attr("viewBox",`0 0 ${u.width} ${u.height}`),W.attr("fill",r.backgroundColor),a.setTmpSVGG(L.append("g").attr("class","mermaid-tmp-group"));const F=a.getDrawableElem(),P={};function B(p){let _=E,l="";for(const[I]of p.entries()){let V=E;I>0&&P[l]&&(V=P[l]),l+=p[I],_=P[l],_||(_=P[l]=V.append("g").attr("class",p[I]))}return _}n(B,"getGroup");for(const p of F){if(p.data.length===0)continue;const _=B(p.groupTexts);switch(p.type){case"rect":if(_.selectAll("rect").data(p.data).enter().append("rect").attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height).attr("fill",l=>l.fill).attr("stroke",l=>l.strokeFill).attr("stroke-width",l=>l.strokeWidth),u.showDataLabel){const l=u.showDataLabelOutsideBar;if(u.chartOrientation==="horizontal"){let I=function(b,M){const{data:S,label:ot}=b;return M*ot.length*V<=S.width-X};n(I,"fitsHorizontally");const V=.7,X=10,Y=p.data.map((b,M)=>({data:b,label:A[M].toString()})).filter(b=>b.data.width>0&&b.data.height>0),C=Y.map(b=>{const{data:M}=b;let S=M.height*.7;for(;!I(b,S)&&S>0;)S-=1;return S}),H=Math.floor(Math.min(...C)),y=n(b=>l?b.data.x+b.data.width+X:b.data.x+b.data.width-X,"determineLabelXPosition");_.selectAll("text").data(Y).enter().append("text").attr("x",y).attr("y",b=>b.data.y+b.data.height/2).attr("text-anchor",l?"start":"end").attr("dominant-baseline","middle").attr("fill",r.dataLabelColor).attr("font-size",`${H}px`).text(b=>b.label)}else{let I=function(y,b,M){const{data:S,label:ot}=y,O=b*ot.length*.7,h=S.x+S.width/2,c=h-O/2,g=h+O/2,x=c>=S.x&&g<=S.x+S.width,w=S.y+M+b<=S.y+S.height;return x&&w};n(I,"fitsInBar");const V=10,X=p.data.map((y,b)=>({data:y,label:A[b].toString()})).filter(y=>y.data.width>0&&y.data.height>0),Y=X.map(y=>{const{data:b,label:M}=y;let S=b.width/(M.length*.7);for(;!I(y,S,V)&&S>0;)S-=1;return S}),C=Math.floor(Math.min(...Y)),H=n(y=>l?y.data.y-V:y.data.y+V,"determineLabelYPosition");_.selectAll("text").data(X).enter().append("text").attr("x",y=>y.data.x+y.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",l?"auto":"hanging").attr("fill",r.dataLabelColor).attr("font-size",`${C}px`).text(y=>y.label)}}break;case"text":_.selectAll("text").data(p.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",l=>l.fill).attr("font-size",l=>l.fontSize).attr("dominant-baseline",l=>m(l.verticalPos)).attr("text-anchor",l=>k(l.horizontalPos)).attr("transform",l=>T(l)).text(l=>l.text);break;case"path":_.selectAll("path").data(p.data).enter().append("path").attr("d",l=>l.path).attr("fill",l=>l.fill?l.fill:"none").attr("stroke",l=>l.strokeFill).attr("stroke-width",l=>l.strokeWidth);break}}},"draw"),Vi={draw:Bi},Wi={parser:Ri,db:zi,renderer:Vi};export{Wi as diagram};
package/dist/favicon.ico DELETED
Binary file