omni-context-cli 0.0.92 → 0.0.94

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 (61) hide show
  1. package/README.md +4 -2
  2. package/README.zh-CN.md +4 -2
  3. package/dist/cli.js +7 -7
  4. package/dist/clients/extension.vsix +0 -0
  5. package/dist/clients/web/assets/{App-CM8Va3JQ.js → App-DjDfFse6.js} +2 -2
  6. package/dist/clients/web/assets/{ImageWorkshop-D0woOaMP.js → ImageWorkshop-hyT9YKCC.js} +1 -1
  7. package/dist/clients/web/assets/{_baseUniq-8ZoXEUbL.js → _baseUniq-Bf5ZQo04.js} +1 -1
  8. package/dist/clients/web/assets/{arc-B2TpLZAc.js → arc-CksI4bMI.js} +1 -1
  9. package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-sCw1Bqxj.js → architectureDiagram-VXUJARFQ-EZ1kfr-B.js} +1 -1
  10. package/dist/clients/web/assets/{blockDiagram-VD42YOAC-TzLCV8cu.js → blockDiagram-VD42YOAC-I78PD5A0.js} +1 -1
  11. package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-CB75g8mk.js → c4Diagram-YG6GDRKO-RL3uo7H9.js} +1 -1
  12. package/dist/clients/web/assets/channel-JIkUSSh2.js +1 -0
  13. package/dist/clients/web/assets/{chunk-4BX2VUAB-CnCH9PHV.js → chunk-4BX2VUAB-Dajhvqsl.js} +1 -1
  14. package/dist/clients/web/assets/{chunk-55IACEB6-j6kgk2Ub.js → chunk-55IACEB6-DHeJD3yo.js} +1 -1
  15. package/dist/clients/web/assets/{chunk-B4BG7PRW-CU5TkBMe.js → chunk-B4BG7PRW-DSm_fvYj.js} +1 -1
  16. package/dist/clients/web/assets/{chunk-DI55MBZ5-B9PNM453.js → chunk-DI55MBZ5-DZpq0vb0.js} +1 -1
  17. package/dist/clients/web/assets/{chunk-FMBD7UC4-ubTGnudB.js → chunk-FMBD7UC4-T7us9cyM.js} +1 -1
  18. package/dist/clients/web/assets/{chunk-QN33PNHL-D5no8Jfp.js → chunk-QN33PNHL-BnwFtpaC.js} +1 -1
  19. package/dist/clients/web/assets/{chunk-QZHKN3VN-RIiVnjQx.js → chunk-QZHKN3VN-DoJJAdPJ.js} +1 -1
  20. package/dist/clients/web/assets/{chunk-TZMSLE5B-DTy2vR2B.js → chunk-TZMSLE5B-CPRKeX5Y.js} +1 -1
  21. package/dist/clients/web/assets/classDiagram-2ON5EDUG-BDYZ047q.js +1 -0
  22. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-BDYZ047q.js +1 -0
  23. package/dist/clients/web/assets/clone-IghYl_Ok.js +1 -0
  24. package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-Bqct6Lvl.js → cose-bilkent-S5V4N54A-DiBahR7x.js} +1 -1
  25. package/dist/clients/web/assets/{dagre-6UL2VRFP-441VQkK1.js → dagre-6UL2VRFP-Cb0eMfHk.js} +1 -1
  26. package/dist/clients/web/assets/{diagram-PSM6KHXK-BO9H2Aak.js → diagram-PSM6KHXK-A8_5l2sp.js} +1 -1
  27. package/dist/clients/web/assets/{diagram-QEK2KX5R-3lGBBCVw.js → diagram-QEK2KX5R-DqpCDEmy.js} +1 -1
  28. package/dist/clients/web/assets/{diagram-S2PKOQOG-DY84HL8G.js → diagram-S2PKOQOG-Z0-s4not.js} +1 -1
  29. package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-DWcgMtNO.js → erDiagram-Q2GNP2WA-Bpi4ggfg.js} +1 -1
  30. package/dist/clients/web/assets/{flowDiagram-NV44I4VS-Ybex1wXj.js → flowDiagram-NV44I4VS-DLXyF4QH.js} +1 -1
  31. package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-ChWIAt1T.js → ganttDiagram-JELNMOA3-BVffxweM.js} +1 -1
  32. package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-ClJFv0ul.js → gitGraphDiagram-NY62KEGX-DdvEsKru.js} +1 -1
  33. package/dist/clients/web/assets/{graph-Cs6Qxtax.js → graph-B5RnG_15.js} +1 -1
  34. package/dist/clients/web/assets/{index-DPbcKIIg.js → index-ld8vzNT7.js} +2 -2
  35. package/dist/clients/web/assets/{infoDiagram-WHAUD3N6-DnTUhHY0.js → infoDiagram-WHAUD3N6-BDYBeNO3.js} +1 -1
  36. package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-CIENPsGT.js → journeyDiagram-XKPGCS4Q-B1kCTS3g.js} +1 -1
  37. package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-AhFkjsY3.js → kanban-definition-3W4ZIXB7-klJ-AOxg.js} +1 -1
  38. package/dist/clients/web/assets/{layout-BntZLQYy.js → layout-BXxQSVDe.js} +1 -1
  39. package/dist/clients/web/assets/{linear-CbNyjCBb.js → linear-B6Ksl5C9.js} +1 -1
  40. package/dist/clients/web/assets/{min-1nUrt3JX.js → min-JwhjXiR7.js} +1 -1
  41. package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-Cs3o7Dfz.js → mindmap-definition-VGOIOE7T-h8v8ASn1.js} +1 -1
  42. package/dist/clients/web/assets/{pieDiagram-ADFJNKIX-yQPBfZ8y.js → pieDiagram-ADFJNKIX-CMMpWf_d.js} +1 -1
  43. package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-5kPfWslR.js → quadrantDiagram-AYHSOK5B-pC9zZrgu.js} +1 -1
  44. package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-DoucrOtZ.js → requirementDiagram-UZGBJVZJ-DIgNRW2g.js} +1 -1
  45. package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-PTFbpc-u.js → sankeyDiagram-TZEHDZUN-Brr1MQ0p.js} +1 -1
  46. package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-BZ33cKfm.js → sequenceDiagram-WL72ISMW-CDQhAH2B.js} +1 -1
  47. package/dist/clients/web/assets/{stateDiagram-FKZM4ZOC-C4idf-WB.js → stateDiagram-FKZM4ZOC-B-jiiQoR.js} +1 -1
  48. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-JSFPsD14.js +1 -0
  49. package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-P1su699P.js → timeline-definition-IT6M3QCI-e7EJOQT2.js} +1 -1
  50. package/dist/clients/web/assets/{treemap-KMMF4GRG-BmD_DFh3.js → treemap-KMMF4GRG-CVM-vGMH.js} +1 -1
  51. package/dist/clients/web/assets/{useAppearance-PXtz8423.js → useAppearance-BZtw0eF7.js} +1 -1
  52. package/dist/clients/web/assets/{xychartDiagram-PRI3JC2R-DtIpn1yU.js → xychartDiagram-PRI3JC2R-CyDwivj3.js} +1 -1
  53. package/dist/clients/web/index.html +1 -1
  54. package/dist/model-prompts/gpt-5.5.md +5 -0
  55. package/dist/skills/cookbook/SKILL.md +57 -3
  56. package/package.json +1 -1
  57. package/dist/clients/web/assets/channel-Cc6WLpkH.js +0 -1
  58. package/dist/clients/web/assets/classDiagram-2ON5EDUG-8oZ_o2z8.js +0 -1
  59. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-8oZ_o2z8.js +0 -1
  60. package/dist/clients/web/assets/clone-Z2wHm8pw.js +0 -1
  61. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-B-b2Duqy.js +0 -1
@@ -1 +1 @@
1
- import{R as e,r as t,j as o,e as r,d as n}from"./index-DPbcKIIg.js";const c=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"})),i=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 18H8v-2h2v2Zm-2-2H6v-2h2v2Zm4-2v2h-2v-2h2Zm-6 0H4v-2h2v2Zm8 0h-2v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V8h2v2Zm2-2h-2V6h2v2Z"})),s=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 16h-2v-2h2v2Zm-2-2H9v-2h2v2Zm4 0h-2v-2h2v2Zm-6-2H7v-2h2v2Zm8 0h-2v-2h2v2ZM7 10H5V8h2v2Zm12 0h-2V8h2v2Z"})),h=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4z"})),a=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"}),e.createElement("path",{d:"M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"})),l=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 22h-2v-6h2v6Zm-6-3H5v-2h2v2Zm12 0h-2v-2h2v2ZM9 17H7v-2h2v2Zm8 0h-2v-2h2v2Zm-9-4H2v-2h6v2Zm14 0h-6v-2h6v2ZM9 9H7V7h2v2Zm8 0h-2V7h2v2Zm-4-1h-2V2h2v6ZM7 7H5V5h2v2Zm12 0h-2V5h2v2Z"})),d=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 11h7v2h-7v7h-2v-7H4v-2h7V4h2v7Z"})),v=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16 4h2v6h-2zm-2-2h2v2h-2zm0 2h2v8h-2zM4 8H2v5h2z"}),e.createElement("path",{d:"M4 6h16v2H4zm4 14H6v-6h2zm2 2H8v-2h2zm0-2H8v-8h2zm10-4h2v-5h-2z"}),e.createElement("path",{d:"M20 18H4v-2h16z"})),m=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm-3-5h2v-2h-2zm0-4h2V7h-2z"})),g=t.memo(function({icon:e,title:t,onClick:r,disabled:n=!1,className:c=""}){return o.jsx("button",{type:"button",onClick:r,disabled:n,className:`p-2.5 transition-all duration-200 shrink-0 border border-transparent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent ${n?"text-vscode-text-muted cursor-not-allowed opacity-50":"text-vscode-text-muted hover:text-vscode-text hover:bg-vscode-element cursor-pointer"} ${c}`,title:t,children:o.jsx(e,{width:16,height:16})})});let f=0;const w=r(e=>({toasts:[],dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function b(e,t="info"){const o=f++;w.setState(r=>({toasts:[...r.toasts,{id:o,message:e,type:t}]}))}const u={info:t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"})),success:i,error:m},x={info:"bg-vscode-sidebar border-vscode-border text-vscode-text",success:"bg-vscode-sidebar border-vscode-info/70 text-vscode-text",error:"bg-vscode-sidebar border-vscode-error/70 text-vscode-text"};function p({toast:e,onDismiss:r}){const n=u[e.type];return t.useEffect(()=>{if("error"!==e.type){const t=setTimeout(()=>r(e.id),3e3);return()=>clearTimeout(t)}},[r,e.id,e.type]),o.jsxs("div",{className:`flex items-center gap-3 pl-4 pr-2 py-2.5 border border-dashed animate-fade-in ${x[e.type]}`,children:[o.jsx(n,{width:16,height:16,className:"shrink-0"}),o.jsx("span",{className:"text-sm flex-1 min-w-0 break-words",children:e.message}),o.jsx("button",{type:"button","aria-label":"Dismiss toast",onClick:()=>r(e.id),className:"p-1 hover:bg-white/10 opacity-75 hover:opacity-100 transition-opacity",children:o.jsx(c,{width:14,height:14})})]})}function z(){const{toasts:e,dismiss:t}=w();return 0===e.length?null:o.jsx("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 flex flex-col gap-2 max-w-lg w-full px-4",children:e.map(e=>o.jsx(p,{toast:e,onDismiss:t},e.id))})}function H({icon:e,title:r,sessions:n,currentId:c,emptyText:i,newTitle:h,onSelect:a,onNew:l,disabled:v=!1}){const[m,g]=t.useState(!1),f=t.useRef(null);return t.useEffect(()=>{const e=e=>{f.current&&!f.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),o.jsxs("div",{className:"flex items-center gap-2 w-full",ref:f,children:[o.jsxs("div",{className:"relative flex-1 min-w-0",children:[o.jsxs("button",{type:"button",onClick:()=>!v&&g(e=>!e),disabled:v,className:"group w-full flex items-center gap-2 px-3 py-2 transition-all duration-200 border border-dashed border-vscode-border bg-vscode-sidebar focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(v?"opacity-50 cursor-not-allowed":"hover:bg-vscode-element hover:border-vscode-border-active cursor-pointer"),children:[o.jsx(e,{width:16,height:16,className:"text-vscode-accent shrink-0"}),o.jsx("span",{className:"truncate text-sm font-medium text-vscode-text group-hover:text-vscode-text-header transition-colors",children:r}),o.jsx(s,{width:14,height:14,className:"text-vscode-text-muted transition-transform duration-200 shrink-0 ml-auto "+(m?"rotate-180":"")})]}),m&&o.jsx("div",{className:"absolute top-full left-0 z-50 w-full mt-2 bg-vscode-sidebar border border-dashed border-vscode-border overflow-hidden animate-fade-in",children:0===n.length?o.jsx("div",{className:"px-4 py-3 text-sm text-vscode-text-muted text-center",children:i}):o.jsx("ul",{className:"max-h-80 overflow-y-auto py-1",children:n.map(e=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>{a(e),g(!1)},className:"w-full text-left px-4 py-2.5 text-sm transition-colors border-l-2 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(e.id===c?"border-vscode-accent bg-vscode-accent/10 text-vscode-text-header":"border-transparent text-vscode-text hover:bg-vscode-element hover:text-vscode-text-header"),children:[o.jsx("div",{className:"truncate",children:e.title}),o.jsx("div",{className:"text-xs text-vscode-text-muted mt-0.5 font-mono",children:new Date(e.updatedAt).toLocaleDateString()})]})},e.id))})})]}),o.jsx("button",{type:"button",onClick:()=>{l(),g(!1)},disabled:v,className:"p-2.5 bg-vscode-element hover:brightness-110 text-vscode-text-header transition-all shrink-0 border border-dashed border-vscode-border hover:border-vscode-border-active focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(v?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:h,children:o.jsx(d,{width:16,height:16})})]})}const M={crystal:{accent:"#4fc4cf",info:"#5cd0d8",warning:"#fbdd74",error:"#e86060",light:{accent:"#0e8a95",info:"#0e8a95",warning:"#b89800",error:"#cc0000"}},splash:{accent:"#00ebc7",info:"#00ebc7",warning:"#fde24f",error:"#ff5470",light:{accent:"#009080",info:"#009080",warning:"#b89800",error:"#cc0000"}},horizon:{accent:"#3da9fc",info:"#60c0a0",warning:"#e8c060",error:"#ef4565",light:{accent:"#2878c0",info:"#308060",warning:"#b89800",error:"#cc0000"}},neon:{accent:"#7f5af0",info:"#2cb67d",warning:"#e8c060",error:"#e45858",light:{accent:"#6040c0",info:"#1a8050",warning:"#b89800",error:"#cc0000"}},forest:{accent:"#faae2b",info:"#5cb88c",warning:"#f5d070",error:"#fa5246",light:{accent:"#b07810",info:"#308060",warning:"#b89800",error:"#cc0000"}},indigo:{accent:"#6246ea",info:"#8888ef",warning:"#e8c060",error:"#e45858",light:{accent:"#4830c0",info:"#5858c8",warning:"#b89800",error:"#cc0000"}},rosette:{accent:"#fec7d7",info:"#a786df",warning:"#f0c88e",error:"#e06080",light:{accent:"#c05080",info:"#7048a8",warning:"#b89800",error:"#cc0000"}},retro:{accent:"#078080",info:"#078080",warning:"#f0c878",error:"#f45d48",light:{accent:"#067070",info:"#067070",warning:"#b89800",error:"#cc0000"}},tangerine:{accent:"#ff8e3c",info:"#68c8a0",warning:"#f5d070",error:"#d9376e",light:{accent:"#c87018",info:"#308060",warning:"#b89800",error:"#cc0000"}},emerald:{accent:"#f9bc60",info:"#abd1c6",warning:"#f5e078",error:"#e16162",light:{accent:"#b07810",info:"#407868",warning:"#b89800",error:"#cc0000"}},earth:{accent:"#8c7851",info:"#a0a078",warning:"#c8a868",error:"#f25042",light:{accent:"#705838",info:"#607030",warning:"#907018",error:"#cc0000"}},twilight:{accent:"#eebbc3",info:"#b8c1ec",warning:"#e8c890",error:"#d45060",light:{accent:"#a85068",info:"#4858a8",warning:"#b89800",error:"#cc0000"}},inferno:{accent:"#ff8906",info:"#68c8a0",warning:"#f5d070",error:"#e53170",light:{accent:"#c87000",info:"#308060",warning:"#b89800",error:"#cc0000"}},sunshine:{accent:"#ffd803",info:"#bae8e8",warning:"#e8a040",error:"#e06070",light:{accent:"#907800",info:"#207880",warning:"#986808",error:"#cc0000"}},blossom:{accent:"#ff8ba7",info:"#c3f0ca",warning:"#f0c878",error:"#d04050",light:{accent:"#c04868",info:"#287040",warning:"#b89800",error:"#cc0000"}},cocoa:{accent:"#e78fb3",info:"#c088d0",warning:"#f0c090",error:"#d05050",light:{accent:"#a85878",info:"#6838a0",warning:"#987010",error:"#cc0000"}},nautical:{accent:"#f582ae",info:"#8bd3dd",warning:"#f0c878",error:"#e06060",light:{accent:"#c05080",info:"#207890",warning:"#b89800",error:"#cc0000"}}},N={crystal:"Crystal",splash:"Splash",horizon:"Horizon",neon:"Neon",forest:"Forest",indigo:"Indigo",rosette:"Rosette",retro:"Retro",tangerine:"Tangerine",emerald:"Emerald",earth:"Earth",twilight:"Twilight",inferno:"Inferno",sunshine:"Sunshine",blossom:"Blossom",cocoa:"Cocoa",nautical:"Nautical"},y=Object.keys(M);function Z(e){let t=document.getElementById("omx-color-theme");t||(t=document.createElement("style"),t.id="omx-color-theme",document.head.appendChild(t));const o=e?M[e]:void 0;t.textContent=o?`\n :root {\n --vscode-accent: ${o.accent};\n --vscode-info: ${o.info};\n --vscode-warning: ${o.warning};\n --vscode-error: ${o.error};\n }\n :root.light {\n --vscode-accent: ${o.light.accent};\n --vscode-info: ${o.light.info};\n --vscode-warning: ${o.light.warning};\n --vscode-error: ${o.light.error};\n }\n `:""}const C=t.memo(function({label:e,description:r,value:n,onChange:c,options:i,placeholder:h,disabled:a}){const l=t.useId();return o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:l,className:"block text-sm font-medium text-vscode-text",children:e}),o.jsxs("div",{className:"relative",children:[o.jsxs("select",{id:l,value:n,onChange:e=>c(e.target.value),disabled:a,className:"w-full px-4 py-2.5 bg-vscode-bg border border-dashed border-vscode-border text-sm text-vscode-text focus:outline-none focus:border-vscode-accent focus-visible:ring-1 focus-visible:ring-vscode-accent appearance-none "+(a?"opacity-60 cursor-not-allowed":"cursor-pointer"),children:[h&&o.jsx("option",{value:"",children:h}),i.map(e=>o.jsx("option",{value:e.value,children:e.label},e.value))]}),o.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-vscode-text-muted",children:o.jsx(s,{width:14,height:14})})]}),r&&o.jsx("p",{className:"text-xs text-vscode-text-muted",children:r})]})});function k(){const e=n(e=>e.config),o=n(e=>e.setTheme);t.useEffect(()=>{const t=null==e?void 0:e.webTheme,r=e=>{const t="light"===e||"auto"===e&&window.matchMedia("(prefers-color-scheme: light)").matches;document.documentElement.classList.toggle("light",t),o(t?"light":"dark")};if(r(t),"auto"===t){const e=window.matchMedia("(prefers-color-scheme: light)"),o=()=>r(t);e.addEventListener("change",o);const n=e=>{var t;"themeChange"===(null==(t=e.data)?void 0:t.type)&&r(e.data.theme)};return window.addEventListener("message",n),()=>{e.removeEventListener("change",o),window.removeEventListener("message",n)}}},[null==e?void 0:e.webTheme,o]),t.useEffect(()=>{Z((null==e?void 0:e.colorTheme)??"neon")},[null==e?void 0:e.colorTheme])}export{c as C,g as I,l as L,d as P,v as R,C as S,z as T,m as W,a,h as b,H as c,i as d,s as e,M as f,Z as g,y as p,b as s,N as t,k as u};
1
+ import{R as e,r as t,j as o,e as r,d as n}from"./index-ld8vzNT7.js";const c=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"})),i=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 18H8v-2h2v2Zm-2-2H6v-2h2v2Zm4-2v2h-2v-2h2Zm-6 0H4v-2h2v2Zm8 0h-2v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V8h2v2Zm2-2h-2V6h2v2Z"})),s=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 16h-2v-2h2v2Zm-2-2H9v-2h2v2Zm4 0h-2v-2h2v2Zm-6-2H7v-2h2v2Zm8 0h-2v-2h2v2ZM7 10H5V8h2v2Zm12 0h-2V8h2v2Z"})),h=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4z"})),a=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"}),e.createElement("path",{d:"M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"})),l=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 22h-2v-6h2v6Zm-6-3H5v-2h2v2Zm12 0h-2v-2h2v2ZM9 17H7v-2h2v2Zm8 0h-2v-2h2v2Zm-9-4H2v-2h6v2Zm14 0h-6v-2h6v2ZM9 9H7V7h2v2Zm8 0h-2V7h2v2Zm-4-1h-2V2h2v6ZM7 7H5V5h2v2Zm12 0h-2V5h2v2Z"})),d=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 11h7v2h-7v7h-2v-7H4v-2h7V4h2v7Z"})),v=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16 4h2v6h-2zm-2-2h2v2h-2zm0 2h2v8h-2zM4 8H2v5h2z"}),e.createElement("path",{d:"M4 6h16v2H4zm4 14H6v-6h2zm2 2H8v-2h2zm0-2H8v-8h2zm10-4h2v-5h-2z"}),e.createElement("path",{d:"M20 18H4v-2h16z"})),m=t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm-3-5h2v-2h-2zm0-4h2V7h-2z"})),g=t.memo(function({icon:e,title:t,onClick:r,disabled:n=!1,className:c=""}){return o.jsx("button",{type:"button",onClick:r,disabled:n,className:`p-2.5 transition-all duration-200 shrink-0 border border-transparent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent ${n?"text-vscode-text-muted cursor-not-allowed opacity-50":"text-vscode-text-muted hover:text-vscode-text hover:bg-vscode-element cursor-pointer"} ${c}`,title:t,children:o.jsx(e,{width:16,height:16})})});let f=0;const w=r(e=>({toasts:[],dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function b(e,t="info"){const o=f++;w.setState(r=>({toasts:[...r.toasts,{id:o,message:e,type:t}]}))}const u={info:t=>e.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"})),success:i,error:m},x={info:"bg-vscode-sidebar border-vscode-border text-vscode-text",success:"bg-vscode-sidebar border-vscode-info/70 text-vscode-text",error:"bg-vscode-sidebar border-vscode-error/70 text-vscode-text"};function p({toast:e,onDismiss:r}){const n=u[e.type];return t.useEffect(()=>{if("error"!==e.type){const t=setTimeout(()=>r(e.id),3e3);return()=>clearTimeout(t)}},[r,e.id,e.type]),o.jsxs("div",{className:`flex items-center gap-3 pl-4 pr-2 py-2.5 border border-dashed animate-fade-in ${x[e.type]}`,children:[o.jsx(n,{width:16,height:16,className:"shrink-0"}),o.jsx("span",{className:"text-sm flex-1 min-w-0 break-words",children:e.message}),o.jsx("button",{type:"button","aria-label":"Dismiss toast",onClick:()=>r(e.id),className:"p-1 hover:bg-white/10 opacity-75 hover:opacity-100 transition-opacity",children:o.jsx(c,{width:14,height:14})})]})}function z(){const{toasts:e,dismiss:t}=w();return 0===e.length?null:o.jsx("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 flex flex-col gap-2 max-w-lg w-full px-4",children:e.map(e=>o.jsx(p,{toast:e,onDismiss:t},e.id))})}function H({icon:e,title:r,sessions:n,currentId:c,emptyText:i,newTitle:h,onSelect:a,onNew:l,disabled:v=!1}){const[m,g]=t.useState(!1),f=t.useRef(null);return t.useEffect(()=>{const e=e=>{f.current&&!f.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),o.jsxs("div",{className:"flex items-center gap-2 w-full",ref:f,children:[o.jsxs("div",{className:"relative flex-1 min-w-0",children:[o.jsxs("button",{type:"button",onClick:()=>!v&&g(e=>!e),disabled:v,className:"group w-full flex items-center gap-2 px-3 py-2 transition-all duration-200 border border-dashed border-vscode-border bg-vscode-sidebar focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(v?"opacity-50 cursor-not-allowed":"hover:bg-vscode-element hover:border-vscode-border-active cursor-pointer"),children:[o.jsx(e,{width:16,height:16,className:"text-vscode-accent shrink-0"}),o.jsx("span",{className:"truncate text-sm font-medium text-vscode-text group-hover:text-vscode-text-header transition-colors",children:r}),o.jsx(s,{width:14,height:14,className:"text-vscode-text-muted transition-transform duration-200 shrink-0 ml-auto "+(m?"rotate-180":"")})]}),m&&o.jsx("div",{className:"absolute top-full left-0 z-50 w-full mt-2 bg-vscode-sidebar border border-dashed border-vscode-border overflow-hidden animate-fade-in",children:0===n.length?o.jsx("div",{className:"px-4 py-3 text-sm text-vscode-text-muted text-center",children:i}):o.jsx("ul",{className:"max-h-80 overflow-y-auto py-1",children:n.map(e=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>{a(e),g(!1)},className:"w-full text-left px-4 py-2.5 text-sm transition-colors border-l-2 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(e.id===c?"border-vscode-accent bg-vscode-accent/10 text-vscode-text-header":"border-transparent text-vscode-text hover:bg-vscode-element hover:text-vscode-text-header"),children:[o.jsx("div",{className:"truncate",children:e.title}),o.jsx("div",{className:"text-xs text-vscode-text-muted mt-0.5 font-mono",children:new Date(e.updatedAt).toLocaleDateString()})]})},e.id))})})]}),o.jsx("button",{type:"button",onClick:()=>{l(),g(!1)},disabled:v,className:"p-2.5 bg-vscode-element hover:brightness-110 text-vscode-text-header transition-all shrink-0 border border-dashed border-vscode-border hover:border-vscode-border-active focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-vscode-accent "+(v?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:h,children:o.jsx(d,{width:16,height:16})})]})}const M={crystal:{accent:"#4fc4cf",info:"#5cd0d8",warning:"#fbdd74",error:"#e86060",light:{accent:"#0e8a95",info:"#0e8a95",warning:"#b89800",error:"#cc0000"}},splash:{accent:"#00ebc7",info:"#00ebc7",warning:"#fde24f",error:"#ff5470",light:{accent:"#009080",info:"#009080",warning:"#b89800",error:"#cc0000"}},horizon:{accent:"#3da9fc",info:"#60c0a0",warning:"#e8c060",error:"#ef4565",light:{accent:"#2878c0",info:"#308060",warning:"#b89800",error:"#cc0000"}},neon:{accent:"#7f5af0",info:"#2cb67d",warning:"#e8c060",error:"#e45858",light:{accent:"#6040c0",info:"#1a8050",warning:"#b89800",error:"#cc0000"}},forest:{accent:"#faae2b",info:"#5cb88c",warning:"#f5d070",error:"#fa5246",light:{accent:"#b07810",info:"#308060",warning:"#b89800",error:"#cc0000"}},indigo:{accent:"#6246ea",info:"#8888ef",warning:"#e8c060",error:"#e45858",light:{accent:"#4830c0",info:"#5858c8",warning:"#b89800",error:"#cc0000"}},rosette:{accent:"#fec7d7",info:"#a786df",warning:"#f0c88e",error:"#e06080",light:{accent:"#c05080",info:"#7048a8",warning:"#b89800",error:"#cc0000"}},retro:{accent:"#078080",info:"#078080",warning:"#f0c878",error:"#f45d48",light:{accent:"#067070",info:"#067070",warning:"#b89800",error:"#cc0000"}},tangerine:{accent:"#ff8e3c",info:"#68c8a0",warning:"#f5d070",error:"#d9376e",light:{accent:"#c87018",info:"#308060",warning:"#b89800",error:"#cc0000"}},emerald:{accent:"#f9bc60",info:"#abd1c6",warning:"#f5e078",error:"#e16162",light:{accent:"#b07810",info:"#407868",warning:"#b89800",error:"#cc0000"}},earth:{accent:"#8c7851",info:"#a0a078",warning:"#c8a868",error:"#f25042",light:{accent:"#705838",info:"#607030",warning:"#907018",error:"#cc0000"}},twilight:{accent:"#eebbc3",info:"#b8c1ec",warning:"#e8c890",error:"#d45060",light:{accent:"#a85068",info:"#4858a8",warning:"#b89800",error:"#cc0000"}},inferno:{accent:"#ff8906",info:"#68c8a0",warning:"#f5d070",error:"#e53170",light:{accent:"#c87000",info:"#308060",warning:"#b89800",error:"#cc0000"}},sunshine:{accent:"#ffd803",info:"#bae8e8",warning:"#e8a040",error:"#e06070",light:{accent:"#907800",info:"#207880",warning:"#986808",error:"#cc0000"}},blossom:{accent:"#ff8ba7",info:"#c3f0ca",warning:"#f0c878",error:"#d04050",light:{accent:"#c04868",info:"#287040",warning:"#b89800",error:"#cc0000"}},cocoa:{accent:"#e78fb3",info:"#c088d0",warning:"#f0c090",error:"#d05050",light:{accent:"#a85878",info:"#6838a0",warning:"#987010",error:"#cc0000"}},nautical:{accent:"#f582ae",info:"#8bd3dd",warning:"#f0c878",error:"#e06060",light:{accent:"#c05080",info:"#207890",warning:"#b89800",error:"#cc0000"}}},N={crystal:"Crystal",splash:"Splash",horizon:"Horizon",neon:"Neon",forest:"Forest",indigo:"Indigo",rosette:"Rosette",retro:"Retro",tangerine:"Tangerine",emerald:"Emerald",earth:"Earth",twilight:"Twilight",inferno:"Inferno",sunshine:"Sunshine",blossom:"Blossom",cocoa:"Cocoa",nautical:"Nautical"},y=Object.keys(M);function Z(e){let t=document.getElementById("omx-color-theme");t||(t=document.createElement("style"),t.id="omx-color-theme",document.head.appendChild(t));const o=e?M[e]:void 0;t.textContent=o?`\n :root {\n --vscode-accent: ${o.accent};\n --vscode-info: ${o.info};\n --vscode-warning: ${o.warning};\n --vscode-error: ${o.error};\n }\n :root.light {\n --vscode-accent: ${o.light.accent};\n --vscode-info: ${o.light.info};\n --vscode-warning: ${o.light.warning};\n --vscode-error: ${o.light.error};\n }\n `:""}const C=t.memo(function({label:e,description:r,value:n,onChange:c,options:i,placeholder:h,disabled:a}){const l=t.useId();return o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:l,className:"block text-sm font-medium text-vscode-text",children:e}),o.jsxs("div",{className:"relative",children:[o.jsxs("select",{id:l,value:n,onChange:e=>c(e.target.value),disabled:a,className:"w-full px-4 py-2.5 bg-vscode-bg border border-dashed border-vscode-border text-sm text-vscode-text focus:outline-none focus:border-vscode-accent focus-visible:ring-1 focus-visible:ring-vscode-accent appearance-none "+(a?"opacity-60 cursor-not-allowed":"cursor-pointer"),children:[h&&o.jsx("option",{value:"",children:h}),i.map(e=>o.jsx("option",{value:e.value,children:e.label},e.value))]}),o.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-vscode-text-muted",children:o.jsx(s,{width:14,height:14})})]}),r&&o.jsx("p",{className:"text-xs text-vscode-text-muted",children:r})]})});function k(){const e=n(e=>e.config),o=n(e=>e.setTheme);t.useEffect(()=>{const t=null==e?void 0:e.webTheme,r=e=>{const t="light"===e||"auto"===e&&window.matchMedia("(prefers-color-scheme: light)").matches;document.documentElement.classList.toggle("light",t),o(t?"light":"dark")};if(r(t),"auto"===t){const e=window.matchMedia("(prefers-color-scheme: light)"),o=()=>r(t);e.addEventListener("change",o);const n=e=>{var t;"themeChange"===(null==(t=e.data)?void 0:t.type)&&r(e.data.theme)};return window.addEventListener("message",n),()=>{e.removeEventListener("change",o),window.removeEventListener("message",n)}}},[null==e?void 0:e.webTheme,o]),t.useEffect(()=>{Z((null==e?void 0:e.colorTheme)??"neon")},[null==e?void 0:e.colorTheme])}export{c as C,g as I,l as L,d as P,v as R,C as S,z as T,m as W,a,h as b,H as c,i as d,s as e,M as f,Z as g,y as p,b as s,N as t,k as u};
@@ -1 +1 @@
1
- var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./App-CM8Va3JQ.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-CbNyjCBb.js";import"./index-DPbcKIIg.js";import"./useAppearance-PXtz8423.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[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],D=[1,64],E={trace:g(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:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(function(t,i){return this.yy=i||this.yy||{},this._input=t,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:g(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:g(function(t){var i=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var e=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),s.length-1&&(this.yylineno-=s.length-1);var h=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:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;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:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14: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 27:this.pushState("string");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 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}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?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(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*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(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.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 s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?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(t=>({text:t.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(t),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(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,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(t=>({text:t.toString(),x:this.getScaleValue(t),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(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${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(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding: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(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${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("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,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),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,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}},"ChartTitle"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;return i="horizontal"===this.orientation?M().y(t=>t[0]).x(t=>t[1])(t):M().x(t=>t[0]).y(t=>t[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),s=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-s,height:i,width:t[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(t=>({x:t[0]-s,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),a),H=(g(n=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 e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var G,Q=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=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&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?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}},"Orchestrator"),o),K=(g(c=class{static build(t,i,s,e){return new Q(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){G=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,G)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{Tt as diagram};
1
+ var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./App-DjDfFse6.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-B6Ksl5C9.js";import"./index-ld8vzNT7.js";import"./useAppearance-BZtw0eF7.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[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],D=[1,64],E={trace:g(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:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(function(t,i){return this.yy=i||this.yy||{},this._input=t,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:g(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:g(function(t){var i=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var e=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),s.length-1&&(this.yylineno-=s.length-1);var h=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:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;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:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14: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 27:this.pushState("string");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 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}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?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(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*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(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.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 s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?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(t=>({text:t.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(t),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(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,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(t=>({text:t.toString(),x:this.getScaleValue(t),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(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${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(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding: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(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${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("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,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),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,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}},"ChartTitle"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;return i="horizontal"===this.orientation?M().y(t=>t[0]).x(t=>t[1])(t):M().x(t=>t[0]).y(t=>t[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),s=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-s,height:i,width:t[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(t=>({x:t[0]-s,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),a),H=(g(n=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 e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var G,Q=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=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&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?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}},"Orchestrator"),o),K=(g(c=class{static build(t,i,s,e){return new Q(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){G=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,G)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{Tt as diagram};
@@ -9,7 +9,7 @@
9
9
  <meta name="mobile-web-app-capable" content="yes" />
10
10
  <link rel="icon" type="image/png" href="/favicon.png" />
11
11
  <title>OmniContext CLI</title>
12
- <script type="module" crossorigin src="/assets/index-DPbcKIIg.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-ld8vzNT7.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/assets/index-Fz55nSNP.css">
14
14
  </head>
15
15
 
@@ -0,0 +1,5 @@
1
+ ---
2
+ match: gpt-5.5
3
+ ---
4
+
5
+ Preserve the requested artifact, length, structure, and genre first. Quietly improve clarity, flow, and correctness. Do not add new claims, extra sections, or a more promotional tone unless explicitly requested.
@@ -3,9 +3,9 @@ name: cookbook
3
3
  description: Setup recipes for MCP servers, skills, agents, and workflows.
4
4
  ---
5
5
 
6
- Help the user set up OMX extensions with practical recipes. First identify what they want to set up: an MCP server, skill, agent, workflow, or external tool. If they already gave a target, proceed. If not, ask one short question with those choices.
6
+ Help the user set up OMX extensions with practical recipes. First identify what they want to set up: an MCP server, skill, agent, workflow, hook, or external tool. If they already gave a target, proceed. If not, ask one short question with those choices.
7
7
 
8
- Prefer project-local extension files when the request is for one repo, and user-level files when they want the setup available everywhere. Be precise about the path before showing content. Do not cover app settings, model settings, or server mode in this skill.
8
+ Prefer project-local extension files when the request is for one repo, and user-level files when they want the setup available everywhere. Be precise about the path before showing content. Do not cover app settings, model settings, or server mode in this skill, except for the `hooksEnabled` switch when explaining hooks.
9
9
 
10
10
  MCP servers are configured in JSON files. Load order is `~/.claude.json`, `.mcp.json`, `~/.omx/mcp.json`, then `.omx/mcp.json`; later entries with the same server id override earlier ones. Use `.omx/mcp.json` for one project and `~/.omx/mcp.json` for all projects. Avoid underscores in server ids, since MCP tool names are parsed as `Mcp_<serverId>_<toolName>`. The stdio shape is:
11
11
 
@@ -91,6 +91,60 @@ allowRemoteTools: true
91
91
  Write the base behavior for this workflow here.
92
92
  ```
93
93
 
94
+ Hooks are JSON-configured lifecycle handlers. Use `.omx/hooks.json` for one project and `~/.omx/hooks/name.json` for all projects. Hook files are loaded at process startup, so restart OMX after editing them. Hooks can use command handlers or HTTP handlers. Supported events are `UserPromptSubmit`, `PreToolUse`, `PreCompact`, `PostCompact`, and `Stop`. `UserPromptSubmit`, `PreToolUse`, and `PreCompact` can block by returning `{ "block": true, "reason": "..." }`. `PreToolUse` handlers can include `tools` to match specific tool names. Hook failures are silently ignored. Command hooks receive the hook input JSON on stdin. HTTP hooks receive a POST with the hook input JSON. HTTP header values can reference allowed environment variables with `${VAR}` only, plus `allowedEnvVars`; do not use bare `$VAR`. If hooks are disabled, tell the user to turn on `hooksEnabled` from the TUI preferences, Web Settings, or app config.
95
+
96
+ Minimal project command hook config at `.omx/hooks.json`:
97
+
98
+ ```json
99
+ {
100
+ "hooks": {
101
+ "PreToolUse": [
102
+ {
103
+ "tools": ["Bash"],
104
+ "command": "node",
105
+ "args": [".omx/hooks/check-bash.mjs"],
106
+ "timeout": 30
107
+ }
108
+ ]
109
+ }
110
+ }
111
+ ```
112
+
113
+ Minimal user HTTP hook config at `~/.omx/hooks/audit.json`:
114
+
115
+ ```json
116
+ {
117
+ "hooks": {
118
+ "Stop": [
119
+ {
120
+ "url": "https://example.com/omx/hooks/stop",
121
+ "headers": {
122
+ "Authorization": "Bearer ${HOOK_TOKEN}"
123
+ },
124
+ "allowedEnvVars": ["HOOK_TOKEN"],
125
+ "timeout": 30
126
+ }
127
+ ]
128
+ }
129
+ }
130
+ ```
131
+
132
+ Minimal command hook script at `.omx/hooks/check-bash.mjs`:
133
+
134
+ ```js
135
+ let input = '';
136
+ process.stdin.setEncoding('utf8');
137
+ process.stdin.on('data', chunk => {
138
+ input += chunk;
139
+ });
140
+ process.stdin.on('end', () => {
141
+ const hook = JSON.parse(input);
142
+ if (hook.toolName === 'Bash') {
143
+ process.stdout.write(JSON.stringify({block: true, reason: 'Bash is blocked for this project'}));
144
+ }
145
+ });
146
+ ```
147
+
94
148
  External JavaScript tools live as `.js` or `.mjs` files directly inside `.omx/tools/` or `~/.omx/tools/`. User tools load first, then project tools, so project tools override same-named user tools. A default export without `name` uses the file name as the tool name. Use them only when the user needs a real executable tool, not just reusable instructions. If they only need guidance, recommend a skill instead. The minimal module shape is:
95
149
 
96
150
  ```js
@@ -108,4 +162,4 @@ export default {
108
162
  };
109
163
  ```
110
164
 
111
- When giving a recipe, include the exact file path and a complete minimal example. If the user asks you to create or update files, create parent directories as needed and keep the change narrow. End with a restart step after adding or changing MCP servers, skills, agents, workflows, or external tools, because discovery is initialized or cached by the running process. Include one short way to verify after restart: check slash command suggestions for skills, the workflow picker or settings for workflows, or tool availability for agents, MCP servers, and external tools.
165
+ When giving a recipe, include the exact file path and a complete minimal example. If the user asks you to create or update files, create parent directories as needed and keep the change narrow. End with a restart step after adding or changing MCP servers, skills, agents, workflows, hooks, or external tools, because discovery is initialized or cached by the running process. Include one short way to verify after restart: check slash command suggestions for skills, the workflow picker or settings for workflows, tool availability for agents, MCP servers, and external tools, or a harmless matching event for hooks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-context-cli",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "description": "Omx is a small, helpful, zero-telemetry coding assistant.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- import{ap as a,aq as p}from"./App-CM8Va3JQ.js";const s=(s,o)=>a.lang.round(p.parse(s)[o]);export{s as c};
@@ -1 +0,0 @@
1
- import{s as r,c as s,a as e,C as p}from"./chunk-B4BG7PRW-CU5TkBMe.js";import{_ as t}from"./App-CM8Va3JQ.js";import"./chunk-FMBD7UC4-ubTGnudB.js";import"./chunk-55IACEB6-j6kgk2Ub.js";import"./chunk-QN33PNHL-D5no8Jfp.js";import"./index-DPbcKIIg.js";import"./useAppearance-PXtz8423.js";var i={parser:e,get db(){return new p},renderer:s,styles:r,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
@@ -1 +0,0 @@
1
- import{s as r,c as s,a as e,C as p}from"./chunk-B4BG7PRW-CU5TkBMe.js";import{_ as t}from"./App-CM8Va3JQ.js";import"./chunk-FMBD7UC4-ubTGnudB.js";import"./chunk-55IACEB6-j6kgk2Ub.js";import"./chunk-QN33PNHL-D5no8Jfp.js";import"./index-DPbcKIIg.js";import"./useAppearance-PXtz8423.js";var i={parser:e,get db(){return new p},renderer:s,styles:r,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
@@ -1 +0,0 @@
1
- import{b as r}from"./graph-Cs6Qxtax.js";function o(o){return r(o,4)}export{o as c};
@@ -1 +0,0 @@
1
- import{s as r,b as s,a as e,S as t}from"./chunk-DI55MBZ5-B9PNM453.js";import{_ as p}from"./App-CM8Va3JQ.js";import"./chunk-55IACEB6-j6kgk2Ub.js";import"./chunk-QN33PNHL-D5no8Jfp.js";import"./index-DPbcKIIg.js";import"./useAppearance-PXtz8423.js";var i={parser:e,get db(){return new t(2)},renderer:s,styles:r,init:p(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};