pmx-canvas 0.9.3 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  2. package/.github/extensions/pmx-canvas/tools.json +9418 -2016
  3. package/CHANGELOG.md +54 -1
  4. package/dist/canvas/chunks/abnfDiagram-N423BO3Z-p8dtp6va.js +1 -0
  5. package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +1 -0
  6. package/dist/canvas/chunks/architectureDiagram-T3A2C74G-5jhmxrzf.js +36 -0
  7. package/dist/canvas/chunks/blockDiagram-VBNYF7ZC-pw1fa9yb.js +132 -0
  8. package/dist/canvas/chunks/c4Diagram-5PPSVZJV-x07nq0tt.js +10 -0
  9. package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +1 -0
  10. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +1 -0
  11. package/dist/canvas/chunks/cose-bilkent-JH36ORCC-nm39npq0.js +1 -0
  12. package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +1 -0
  13. package/dist/canvas/chunks/cynefinDiagram-MW4NZA55-vdxrwahz.js +62 -0
  14. package/dist/canvas/chunks/dagre-VZM6K2ZE-bqdm7wpd.js +4 -0
  15. package/dist/canvas/chunks/diagram-7IWD3JNH-gs5gpr93.js +30 -0
  16. package/dist/canvas/chunks/diagram-B4RE2ZJO-cgwjg47s.js +3 -0
  17. package/dist/canvas/chunks/diagram-LBJQPF4R-w3vahpav.js +24 -0
  18. package/dist/canvas/chunks/diagram-Q27KOJAE-42837z6h.js +24 -0
  19. package/dist/canvas/chunks/diagram-UB23O5K3-4fz83q59.js +41 -0
  20. package/dist/canvas/chunks/ebnfDiagram-BXEA7PRR-zphtgegj.js +1 -0
  21. package/dist/canvas/chunks/erDiagram-JOGREHBK-zvbbdxp4.js +85 -0
  22. package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +1 -0
  23. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +1 -0
  24. package/dist/canvas/chunks/ganttDiagram-PKOTCBZU-282jzycm.js +292 -0
  25. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +1 -0
  26. package/dist/canvas/chunks/gitGraphDiagram-DS77QQ5N-vqqy6p1b.js +106 -0
  27. package/dist/canvas/chunks/index-0rk4gp1g.js +2 -0
  28. package/dist/canvas/chunks/index-194m3hc3.js +2 -0
  29. package/dist/canvas/chunks/index-1r72hdzb.js +301 -0
  30. package/dist/canvas/chunks/index-353m7b0p.js +2 -0
  31. package/dist/canvas/chunks/index-3cy1bzwh.js +2 -0
  32. package/dist/canvas/chunks/index-5tv8v1hk.js +1 -0
  33. package/dist/canvas/chunks/index-6ceya556.js +332 -0
  34. package/dist/canvas/chunks/index-6qmsnxwy.js +4 -0
  35. package/dist/canvas/chunks/index-d3b3gqe9.js +2 -0
  36. package/dist/canvas/chunks/index-fjtdggjn.js +2 -0
  37. package/dist/canvas/chunks/index-g3pwnqeb.js +2 -0
  38. package/dist/canvas/chunks/index-gf4e0et4.js +2 -0
  39. package/dist/canvas/chunks/index-hj99nz1f.js +1 -0
  40. package/dist/canvas/chunks/index-nprm96xp.js +16 -0
  41. package/dist/canvas/chunks/index-qj8fxwsf.js +2 -0
  42. package/dist/canvas/chunks/index-r2fyc9w1.js +89 -0
  43. package/dist/canvas/chunks/index-rft2hcz5.js +2 -0
  44. package/dist/canvas/chunks/index-rh7nv68n.js +2 -0
  45. package/dist/canvas/chunks/index-s4j678gj.js +2 -0
  46. package/dist/canvas/chunks/index-tb1wf525.js +179 -0
  47. package/dist/canvas/chunks/index-vv56h019.js +2 -0
  48. package/dist/canvas/chunks/index-w2mra17t.js +207 -0
  49. package/dist/canvas/chunks/index-wgv7en21.js +232 -0
  50. package/dist/canvas/chunks/index-yw8h9vha.js +157 -0
  51. package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +1 -0
  52. package/dist/canvas/chunks/infoDiagram-6WML65LV-v1yvggqj.js +2 -0
  53. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +70 -0
  54. package/dist/canvas/chunks/journeyDiagram-NVQOT4AX-zjcffveh.js +139 -0
  55. package/dist/canvas/chunks/kanban-definition-27J2QSJJ-dakqtfp1.js +89 -0
  56. package/dist/canvas/chunks/katex-dmg8k4zm.js +257 -0
  57. package/dist/canvas/chunks/mermaid.core-j2geswrd.js +12 -0
  58. package/dist/canvas/chunks/mindmap-definition-FAOFIHXS-142xhr3k.js +96 -0
  59. package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +1 -0
  60. package/dist/canvas/chunks/pegDiagram-VL7TDLO6-5wvk7vsd.js +1 -0
  61. package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +1 -0
  62. package/dist/canvas/chunks/pieDiagram-7S7Q4E2Y-ztdhwycc.js +39 -0
  63. package/dist/canvas/chunks/quadrantDiagram-CIZ2JOQS-c5p9gmg6.js +7 -0
  64. package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +1 -0
  65. package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +1 -0
  66. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +1 -0
  67. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +1 -0
  68. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +1 -0
  69. package/dist/canvas/chunks/railroadDiagram-AXF67PYL-xkmqkjwf.js +1 -0
  70. package/dist/canvas/chunks/requirementDiagram-LRYGKXZP-9wm2dyaw.js +84 -0
  71. package/dist/canvas/chunks/sankeyDiagram-W5VNT64P-2w19etgb.js +40 -0
  72. package/dist/canvas/chunks/sequenceDiagram-SI44F4Z6-0jn0vwmz.js +162 -0
  73. package/dist/canvas/chunks/sizeCapture-X5ZJPWSS-x75epwdq.js +1 -0
  74. package/dist/canvas/chunks/stateDiagram-OKZ733FA-schjpy6d.js +1 -0
  75. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +1 -0
  76. package/dist/canvas/chunks/swimlanes-SLNWSIFB-gkw4xce3.js +1 -0
  77. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +8 -0
  78. package/dist/canvas/chunks/timeline-definition-Z64GVDOM-x7nkcy01.js +120 -0
  79. package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +1 -0
  80. package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +1 -0
  81. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +34 -0
  82. package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +1 -0
  83. package/dist/canvas/chunks/wardleyDiagram-T6FBY63Y-t1j52t9r.js +78 -0
  84. package/dist/canvas/chunks/xychartDiagram-ELKLHX3M-38t16pme.js +7 -0
  85. package/dist/canvas/global.css +389 -229
  86. package/dist/canvas/index.js +141 -211
  87. package/dist/canvas/mcp-app.html +4205 -554
  88. package/dist/canvas/mermaid-entry.js +338 -338
  89. package/dist/canvas/surface-theme.css +6 -6
  90. package/dist/json-render/index.css +1 -1
  91. package/dist/json-render/index.js +49 -49
  92. package/dist/types/client/canvas/BarHint.d.ts +5 -3
  93. package/dist/types/client/canvas/CanvasNode.d.ts +0 -11
  94. package/dist/types/client/canvas/EdgeLayer.d.ts +1 -2
  95. package/dist/types/client/canvas/auto-fit.d.ts +4 -5
  96. package/dist/types/client/mermaid-entry.d.ts +1 -2
  97. package/dist/types/client/mermaid-render.d.ts +1 -0
  98. package/dist/types/client/nodes/BoardNode.d.ts +1 -1
  99. package/dist/types/client/nodes/ExtAppFrame.d.ts +7 -90
  100. package/dist/types/client/nodes/McpAppNode.d.ts +1 -25
  101. package/dist/types/client/nodes/MermaidNode.d.ts +1 -8
  102. package/dist/types/client/nodes/ViewerFrame.d.ts +29 -0
  103. package/dist/types/client/nodes/ViewerHost.d.ts +6 -0
  104. package/dist/types/client/nodes/iframe-document-url.d.ts +3 -9
  105. package/dist/types/client/nodes/primitive-copy.d.ts +5 -0
  106. package/dist/types/client/nodes/use-iframe-content-height.d.ts +1 -1
  107. package/dist/types/client/nodes/use-surface-frame.d.ts +4 -6
  108. package/dist/types/client/nodes/viewer-runtime-state.d.ts +2 -1
  109. package/dist/types/client/state/canvas-store.d.ts +3 -1
  110. package/dist/types/client/state/intent-bridge.d.ts +1 -0
  111. package/dist/types/client/state/presentation.d.ts +17 -6
  112. package/dist/types/json-render/server.d.ts +2 -1
  113. package/dist/types/mcp/canvas-access.d.ts +1 -12
  114. package/dist/types/mcp/resource-subscriptions.d.ts +7 -0
  115. package/dist/types/mcp/server.d.ts +2 -0
  116. package/dist/types/server/ax-wait.d.ts +1 -0
  117. package/dist/types/server/canvas-operations.d.ts +1 -0
  118. package/dist/types/server/canvas-state.d.ts +2 -0
  119. package/dist/types/server/index.d.ts +11 -6
  120. package/dist/types/server/operations/http.d.ts +10 -0
  121. package/dist/types/server/operations/index.d.ts +2 -2
  122. package/dist/types/server/operations/invoker.d.ts +4 -3
  123. package/dist/types/server/operations/mcp-contracts.d.ts +20 -0
  124. package/dist/types/server/operations/mcp.d.ts +2 -0
  125. package/dist/types/server/operations/ops/batch.d.ts +1 -0
  126. package/dist/types/server/operations/ops/boards.d.ts +0 -1
  127. package/dist/types/server/operations/registry.d.ts +2 -2
  128. package/dist/types/server/operations/types.d.ts +12 -2
  129. package/dist/types/server/server.d.ts +2 -0
  130. package/dist/types/server/tour-control.d.ts +13 -3
  131. package/dist/types/server/webpage-node.d.ts +1 -0
  132. package/dist/types/shared/ax-surface-protocol.d.ts +0 -9
  133. package/dist/types/shared/tour.d.ts +8 -0
  134. package/docs/api-reference.md +2 -2
  135. package/docs/cli.md +1 -1
  136. package/docs/design/Chrome.dc.html +32 -6
  137. package/docs/design/Types1.dc.html +3 -2
  138. package/docs/design/Types2.dc.html +1 -1
  139. package/docs/design/Types3.dc.html +1 -1
  140. package/docs/design/Zoom.dc.html +37 -60
  141. package/docs/design/canvas.json +1 -1
  142. package/docs/design.md +169 -4
  143. package/docs/http-api.md +82 -1
  144. package/docs/mcp.md +101 -21
  145. package/docs/node-types.md +38 -3
  146. package/docs/plans/plan-009-tech-debt-backlog.md +2 -2
  147. package/docs/plans/plan-019-post-0.9-roadmap.md +402 -13
  148. package/docs/product-vision-2026-09.md +9 -0
  149. package/docs/sdk.md +5 -2
  150. package/package.json +2 -2
  151. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  152. package/plugins/pmx-canvas/plugin.json +1 -1
  153. package/plugins/pmx-canvas/runtime.json +1 -1
  154. package/plugins/pmx-canvas/tools.json +9418 -2016
  155. package/skills/pmx-canvas/SKILL.md +19 -21
  156. package/skills/pmx-canvas/references/full-reference.md +44 -6
  157. package/skills/pmx-canvas/references/installing-pmx-canvas.md +7 -7
  158. package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +3 -5
  159. package/src/client/canvas/BarHint.tsx +6 -3
  160. package/src/client/canvas/CanvasNode.tsx +34 -47
  161. package/src/client/canvas/CanvasViewport.tsx +6 -7
  162. package/src/client/canvas/ContextMenu.tsx +63 -3
  163. package/src/client/canvas/EdgeLayer.tsx +365 -169
  164. package/src/client/canvas/ExpandedNodeOverlay.tsx +1 -2
  165. package/src/client/canvas/Presentation.tsx +53 -3
  166. package/src/client/canvas/ToolRail.tsx +2 -0
  167. package/src/client/canvas/TopBar.tsx +24 -9
  168. package/src/client/canvas/auto-fit.ts +9 -11
  169. package/src/client/canvas/canvas-area.ts +1 -1
  170. package/src/client/canvas/use-focus-trap.ts +6 -1
  171. package/src/client/mermaid-entry.ts +6 -20
  172. package/src/client/mermaid-render.ts +39 -0
  173. package/src/client/nodes/AxStepControls.tsx +45 -69
  174. package/src/client/nodes/BoardNode.tsx +65 -9
  175. package/src/client/nodes/ContextNode.tsx +88 -396
  176. package/src/client/nodes/ExtAppFrame.tsx +283 -1462
  177. package/src/client/nodes/FileNode.tsx +92 -81
  178. package/src/client/nodes/HtmlNode.tsx +8 -36
  179. package/src/client/nodes/LedgerNode.tsx +31 -17
  180. package/src/client/nodes/MarkdownNode.tsx +8 -17
  181. package/src/client/nodes/McpAppNode.tsx +48 -154
  182. package/src/client/nodes/MermaidNode.tsx +80 -69
  183. package/src/client/nodes/PromptNode.tsx +12 -14
  184. package/src/client/nodes/ResponseNode.tsx +8 -6
  185. package/src/client/nodes/StatusNode.tsx +22 -7
  186. package/src/client/nodes/StatusSummary.tsx +5 -3
  187. package/src/client/nodes/TraceNode.tsx +8 -8
  188. package/src/client/nodes/ViewerFrame.tsx +262 -0
  189. package/src/client/nodes/ViewerHost.tsx +41 -0
  190. package/src/client/nodes/WebpageNode.tsx +22 -24
  191. package/src/client/nodes/iframe-document-url.ts +20 -27
  192. package/src/client/nodes/primitive-copy.ts +97 -0
  193. package/src/client/nodes/use-iframe-content-height.ts +34 -10
  194. package/src/client/nodes/use-surface-frame.ts +22 -11
  195. package/src/client/nodes/viewer-runtime-state.ts +41 -35
  196. package/src/client/state/canvas-store.ts +18 -12
  197. package/src/client/state/intent-bridge.ts +1 -0
  198. package/src/client/state/presentation.ts +135 -15
  199. package/src/client/state/sse-bridge.ts +18 -19
  200. package/src/client/theme/global.css +389 -229
  201. package/src/client/theme/surface-theme.css +6 -6
  202. package/src/json-render/charts/tufte-components.tsx +44 -2
  203. package/src/json-render/renderer/index.css +62 -2
  204. package/src/json-render/renderer/index.tsx +31 -7
  205. package/src/json-render/server.ts +3 -2
  206. package/src/mcp/canvas-access.ts +6 -47
  207. package/src/mcp/resource-subscriptions.ts +181 -0
  208. package/src/mcp/server.ts +185 -219
  209. package/src/server/ax-wait.ts +21 -6
  210. package/src/server/board-export.ts +35 -24
  211. package/src/server/canvas-geometry.ts +1 -0
  212. package/src/server/canvas-operations.ts +6 -2
  213. package/src/server/canvas-state.ts +5 -0
  214. package/src/server/demo-state.json +106 -100
  215. package/src/server/html-primitives.ts +3 -9
  216. package/src/server/html-surface.ts +8 -0
  217. package/src/server/index.ts +30 -12
  218. package/src/server/operations/http.ts +69 -21
  219. package/src/server/operations/index.ts +8 -1
  220. package/src/server/operations/invoker.ts +53 -5
  221. package/src/server/operations/mcp-contracts.ts +354 -0
  222. package/src/server/operations/mcp.ts +153 -18
  223. package/src/server/operations/ops/ax-await.ts +18 -10
  224. package/src/server/operations/ops/ax-read.ts +2 -0
  225. package/src/server/operations/ops/ax-timeline.ts +2 -2
  226. package/src/server/operations/ops/batch.ts +27 -8
  227. package/src/server/operations/ops/boards.ts +1 -3
  228. package/src/server/operations/ops/nodes.ts +18 -3
  229. package/src/server/operations/ops/viewport.ts +11 -9
  230. package/src/server/operations/registry.ts +24 -4
  231. package/src/server/operations/types.ts +16 -2
  232. package/src/server/server.ts +17 -59
  233. package/src/server/tour-control.ts +66 -6
  234. package/src/server/webpage-node.ts +9 -4
  235. package/src/shared/ax-surface-protocol.ts +0 -11
  236. package/src/shared/content-height-reporter.ts +4 -3
  237. package/src/shared/tour.ts +8 -0
@@ -0,0 +1,106 @@
1
+ import{vt}from"./index-vv56h019.js";import{R}from"./index-353m7b0p.js";import{e,t,x,u,l,d,f,p,m,g,b,v,r,yr,n,Ci,E,h}from"./index-1r72hdzb.js";import"./index-6qmsnxwy.js";import{D}from"./index-tb1wf525.js";var G={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ce=x.gitGraph,J=e(()=>E({...Ce,...u().gitGraph}),"getConfig"),C=new vt(()=>{let a=J(),{mainBranchName:o,mainBranchOrder:s}=a;return{mainBranchName:o,commits:new Map,head:null,branchConfig:new Map([[o,{name:o,order:s}]]),branches:new Map([[o,null]]),currBranch:o,direction:"LR",seq:0,options:{}}});function ne(){return Ci({length:7})}e(ne,"getID");function pe(a,o){let s=Object.create(null);return a.reduce((y,w)=>{let k=o(w);if(!s[k])s[k]=!0,y.push(w);return y},[])}e(pe,"uniqBy");var ve=e(function(a){C.records.direction=a},"setDirection"),Ee=e(function(a){t.debug("options str",a),a=a?.trim(),a=a||"{}";try{C.records.options=JSON.parse(a)}catch(o){t.error("error while parsing gitGraph options",o.message)}},"setOptions"),Te=e(function(){return C.records.options},"getOptions"),Le=e(function(a){let{msg:o,id:s,type:y,tags:w}=a;t.info("commit",o,s,y,w),t.debug("Entering commit:",o,s,y,w);let k=J();s=l.sanitizeText(s,k),o=l.sanitizeText(o,k),w=w?.map((c)=>l.sanitizeText(c,k));let i={id:s?s:C.records.seq+"-"+ne(),message:o,seq:C.records.seq++,type:y??G.NORMAL,tags:w??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};if(C.records.head=i,t.info("main branch",k.mainBranchName),C.records.commits.has(i.id))t.warn(`Commit ID ${i.id} already exists`);C.records.commits.set(i.id,i),C.records.branches.set(C.records.currBranch,i.id),t.debug("in pushCommit "+i.id)},"commit"),Me=e(function(a){let{name:o,order:s}=a;if(o=l.sanitizeText(o,J()),C.records.branches.has(o))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${o}")`);C.records.branches.set(o,C.records.head!=null?C.records.head.id:null),C.records.branchConfig.set(o,{name:o,order:s}),ye(o),t.debug("in createBranch")},"branch"),Pe=e((a)=>{let{branch:o,id:s,type:y,tags:w}=a,k=J();if(o=l.sanitizeText(o,k),s)s=l.sanitizeText(s,k);let i=C.records.branches.get(C.records.currBranch),c=C.records.branches.get(o),T=i?C.records.commits.get(i):void 0,M=c?C.records.commits.get(c):void 0;if(T&&M&&T.branch===o)throw Error(`Cannot merge branch '${o}' into itself.`);if(C.records.currBranch===o){let B=Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw B.hash={text:`merge ${o}`,token:`merge ${o}`,expected:["branch abc"]},B}if(T===void 0||!T){let B=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw B.hash={text:`merge ${o}`,token:`merge ${o}`,expected:["commit"]},B}if(!C.records.branches.has(o)){let B=Error('Incorrect usage of "merge". Branch to be merged ('+o+") does not exist");throw B.hash={text:`merge ${o}`,token:`merge ${o}`,expected:[`branch ${o}`]},B}if(M===void 0||!M){let B=Error('Incorrect usage of "merge". Branch to be merged ('+o+") has no commits");throw B.hash={text:`merge ${o}`,token:`merge ${o}`,expected:['"commit"']},B}if(T===M){let B=Error('Incorrect usage of "merge". Both branches have same head');throw B.hash={text:`merge ${o}`,token:`merge ${o}`,expected:["branch abc"]},B}if(s&&C.records.commits.has(s)){let B=Error('Incorrect usage of "merge". Commit with id:'+s+" already exists, use different custom id");throw B.hash={text:`merge ${o} ${s} ${y} ${w?.join(" ")}`,token:`merge ${o} ${s} ${y} ${w?.join(" ")}`,expected:[`merge ${o} ${s}_UNIQUE ${y} ${w?.join(" ")}`]},B}let P=c?c:"",L={id:s||`${C.records.seq}-${ne()}`,message:`merged branch ${o} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,P],branch:C.records.currBranch,type:G.MERGE,customType:y,customId:s?!0:!1,tags:w??[]};C.records.head=L,C.records.commits.set(L.id,L),C.records.branches.set(C.records.currBranch,L.id),t.debug(C.records.branches),t.debug("in mergeBranch")},"merge"),Re=e(function(a){let{id:o,targetId:s,tags:y,parent:w}=a;t.debug("Entering cherryPick:",o,s,y);let k=J();if(o=l.sanitizeText(o,k),s=l.sanitizeText(s,k),y=y?.map((T)=>l.sanitizeText(T,k)),w=l.sanitizeText(w,k),!o||!C.records.commits.has(o)){let T=Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw T.hash={text:`cherryPick ${o} ${s}`,token:`cherryPick ${o} ${s}`,expected:["cherry-pick abc"]},T}let i=C.records.commits.get(o);if(i===void 0||!i)throw Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(w&&!(Array.isArray(i.parents)&&i.parents.includes(w)))throw Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");let c=i.branch;if(i.type===G.MERGE&&!w)throw Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!s||!C.records.commits.has(s)){if(c===C.records.currBranch){let L=Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw L.hash={text:`cherryPick ${o} ${s}`,token:`cherryPick ${o} ${s}`,expected:["cherry-pick abc"]},L}let T=C.records.branches.get(C.records.currBranch);if(T===void 0||!T){let L=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw L.hash={text:`cherryPick ${o} ${s}`,token:`cherryPick ${o} ${s}`,expected:["cherry-pick abc"]},L}let M=C.records.commits.get(T);if(M===void 0||!M){let L=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw L.hash={text:`cherryPick ${o} ${s}`,token:`cherryPick ${o} ${s}`,expected:["cherry-pick abc"]},L}let P={id:C.records.seq+"-"+ne(),message:`cherry-picked ${i?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,i.id],branch:C.records.currBranch,type:G.CHERRY_PICK,tags:y?y.filter(Boolean):[`cherry-pick:${i.id}${i.type===G.MERGE?`|parent:${w}`:""}`]};C.records.head=P,C.records.commits.set(P.id,P),C.records.branches.set(C.records.currBranch,P.id),t.debug(C.records.branches),t.debug("in cherryPick")}},"cherryPick"),ye=e(function(a){if(a=l.sanitizeText(a,J()),!C.records.branches.has(a)){let o=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${a}")`);throw o.hash={text:`checkout ${a}`,token:`checkout ${a}`,expected:[`branch ${a}`]},o}else{C.records.currBranch=a;let o=C.records.branches.get(C.records.currBranch);if(o===void 0||!o)C.records.head=null;else C.records.head=C.records.commits.get(o)??null}},"checkout");function he(a,o,s){let y=a.indexOf(o);if(y===-1)a.push(s);else a.splice(y,1,s)}e(he,"upsert");function me(a){let o=a.reduce((w,k)=>{if(w.seq>k.seq)return w;return k},a[0]),s="";a.forEach(function(w){if(w===o)s+="\t*";else s+="\t|"});let y=[s,o.id,o.seq];for(let w in C.records.branches)if(C.records.branches.get(w)===o.id)y.push(w);if(t.debug(y.join(" ")),o.parents&&o.parents.length==2&&o.parents[0]&&o.parents[1]){let w=C.records.commits.get(o.parents[0]);if(he(a,o,w),o.parents[1])a.push(C.records.commits.get(o.parents[1]))}else if(o.parents.length==0)return;else if(o.parents[0]){let w=C.records.commits.get(o.parents[0]);he(a,o,w)}a=pe(a,(w)=>w.id),me(a)}e(me,"prettyPrintCommitHistory");var Oe=e(function(){t.debug(C.records.commits);let a=xe()[0];me([a])},"prettyPrint"),Ie=e(function(){C.reset(),d()},"clear"),_e=e(function(){return[...C.records.branchConfig.values()].map((o,s)=>{if(o.order!==null&&o.order!==void 0)return o;return{...o,order:parseFloat(`0.${s}`)}}).sort((o,s)=>(o.order??0)-(s.order??0)).map(({name:o})=>({name:o}))},"getBranchesAsObjArray"),Ge=e(function(){return C.records.branches},"getBranches"),De=e(function(){return C.records.commits},"getCommits"),xe=e(function(){let a=[...C.records.commits.values()];return a.forEach(function(o){t.debug(o.id)}),a.sort((o,s)=>o.seq-s.seq),a},"getCommitsArray"),We=e(function(){return C.records.currBranch},"getCurrentBranch"),qe=e(function(){return C.records.direction},"getDirection"),Ae=e(function(){return C.records.head},"getHead"),ue={commitType:G,getConfig:J,setDirection:ve,setOptions:Ee,getOptions:Te,commit:Le,branch:Me,merge:Pe,cherryPick:Re,checkout:ye,prettyPrint:Oe,clear:Ie,getBranchesAsObjArray:_e,getBranches:Ge,getCommits:De,getCommitsArray:xe,getCurrentBranch:We,getDirection:qe,getHead:Ae,setAccTitle:f,getAccTitle:p,getAccDescription:g,setAccDescription:m,setDiagramTitle:b,getDiagramTitle:v},He=e((a,o)=>{if(R(a,o),a.dir)o.setDirection(a.dir);for(let s of a.statements)Se(s,o)},"populate"),Se=e((a,o)=>{let y={Commit:e((w)=>o.commit(Ne(w)),"Commit"),Branch:e((w)=>o.branch(Fe(w)),"Branch"),Merge:e((w)=>o.merge(ze(w)),"Merge"),Checkout:e((w)=>o.checkout(Ye(w)),"Checkout"),CherryPicking:e((w)=>o.cherryPick(je(w)),"CherryPicking")}[a.$type];if(y)y(a);else t.error(`Unknown statement type: ${a.$type}`)},"parseStatement"),Ne=e((a)=>({id:a.id,msg:a.message??"",type:a.type!==void 0?G[a.type]:G.NORMAL,tags:a.tags??void 0}),"parseCommit"),Fe=e((a)=>({name:a.name,order:a.order??0}),"parseBranch"),ze=e((a)=>({branch:a.branch,id:a.id??"",type:a.type!==void 0?G[a.type]:void 0,tags:a.tags??void 0}),"parseMerge"),Ye=e((a)=>a.branch,"parseCheckout"),je=e((a)=>({id:a.id,targetId:"",tags:a.tags?.length===0?void 0:a.tags,parent:a.parent}),"parseCherryPicking"),Ke={parse:e(async(a)=>{let o=await D("gitGraph",a);t.debug(o),He(o,ue)},"parse")},U=10,V=40,z=4,j=2,Z=8,ce=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),le=12,ge=new Set(["redux-color","redux-dark-color"]),Ue=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),X=e((a,o,s=!1)=>{if(s&&a>0)return(a-1)%(o-1)+1;return a%o},"calcColorIndex"),S=new Map,N=new Map,oe=30,te=new Map,se=[],K=0,I="LR",Ve=e(()=>{S.clear(),N.clear(),te.clear(),K=0,se=[],I="LR"},"clear"),be=e((a)=>{let o=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof a==="string"?a.split(/\\n|\n|<br\s*\/?>/gi):a).forEach((y)=>{let w=document.createElementNS("http://www.w3.org/2000/svg","tspan");w.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),w.setAttribute("dy","1em"),w.setAttribute("x","0"),w.setAttribute("class","row"),w.textContent=y.trim(),o.appendChild(w)}),o},"drawText"),we=e((a)=>{let o,s,y;if(I==="BT")s=e((w,k)=>w<=k,"comparisonFunc"),y=1/0;else s=e((w,k)=>w>=k,"comparisonFunc"),y=0;return a.forEach((w)=>{let k=I==="TB"||I=="BT"?N.get(w)?.y:N.get(w)?.x;if(k!==void 0&&s(k,y))o=w,y=k}),o},"findClosestParent"),Ze=e((a)=>{let o="",s=1/0;return a.forEach((y)=>{let w=N.get(y).y;if(w<=s)o=y,s=w}),o||void 0},"findClosestParentBT"),Xe=e((a,o,s)=>{let y=s,w=s,k=[];a.forEach((i)=>{let c=o.get(i);if(!c)throw Error(`Commit not found for key ${i}`);if(c.parents.length)y=Qe(c),w=Math.max(y,w);else k.push(c);et(c,y)}),y=w,k.forEach((i)=>{tt(i,y,s)}),a.forEach((i)=>{let c=o.get(i);if(c?.parents.length){let T=Ze(c.parents);if(y=N.get(T).y-V,y<=w)w=y;let M=S.get(c.branch).pos,P=y-U;N.set(c.id,{x:M,y:P})}})},"setParallelBTPos"),Je=e((a)=>{let o=we(a.parents.filter((y)=>y!==null));if(!o)throw Error(`Closest parent not found for commit ${a.id}`);let s=N.get(o)?.y;if(s===void 0)throw Error(`Closest parent position not found for commit ${a.id}`);return s},"findClosestParentPos"),Qe=e((a)=>Je(a)+V,"calculateCommitPosition"),et=e((a,o)=>{let s=S.get(a.branch);if(!s)throw Error(`Branch not found for commit ${a.id}`);let y=s.pos,w=o+U;return N.set(a.id,{x:y,y:w}),{x:y,y:w}},"setCommitPosition"),tt=e((a,o,s)=>{let y=S.get(a.branch);if(!y)throw Error(`Branch not found for commit ${a.id}`);let w=o+s,k=y.pos;N.set(a.id,{x:k,y:w})},"setRootPosition"),rt=e((a,o,s,y,w,k)=>{let{theme:i}=r(),c=ce.has(i??""),T=ge.has(i??""),M=Ue.has(i??"");if(k===G.HIGHLIGHT)a.append("rect").attr("x",s.x-10+(c?3:0)).attr("y",s.y-10+(c?3:0)).attr("width",c?14:20).attr("height",c?14:20).attr("class",`commit ${o.id} commit-highlight${X(w,Z,T)} ${y}-outer`),a.append("rect").attr("x",s.x-6+(c?2:0)).attr("y",s.y-6+(c?2:0)).attr("width",c?8:12).attr("height",c?8:12).attr("class",`commit ${o.id} commit${X(w,Z,T)} ${y}-inner`);else if(k===G.CHERRY_PICK)a.append("circle").attr("cx",s.x).attr("cy",s.y).attr("r",c?7:10).attr("class",`commit ${o.id} ${y}`),a.append("circle").attr("cx",s.x-3).attr("cy",s.y+2).attr("r",c?2.5:2.75).attr("fill",M?"#000000":"#fff").attr("class",`commit ${o.id} ${y}`),a.append("circle").attr("cx",s.x+3).attr("cy",s.y+2).attr("r",c?2.5:2.75).attr("fill",M?"#000000":"#fff").attr("class",`commit ${o.id} ${y}`),a.append("line").attr("x1",s.x+3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke",M?"#000000":"#fff").attr("class",`commit ${o.id} ${y}`),a.append("line").attr("x1",s.x-3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke",M?"#000000":"#fff").attr("class",`commit ${o.id} ${y}`);else{let P=a.append("circle");if(P.attr("cx",s.x),P.attr("cy",s.y),P.attr("r",c?7:10),P.attr("class",`commit ${o.id} commit${X(w,Z,T)}`),k===G.MERGE){let L=a.append("circle");L.attr("cx",s.x),L.attr("cy",s.y),L.attr("r",c?5:6),L.attr("class",`commit ${y} ${o.id} commit${X(w,Z,T)}`)}if(k===G.REVERSE){let L=a.append("path"),B=c?4:5;L.attr("d",`M ${s.x-B},${s.y-B}L${s.x+B},${s.y+B}M${s.x-B},${s.y+B}L${s.x+B},${s.y-B}`).attr("class",`commit ${y} ${o.id} commit${X(w,Z,T)}`)}}},"drawCommitBullet"),at=e((a,o,s,y,w)=>{if(o.type!==G.CHERRY_PICK&&(o.customId&&o.type===G.MERGE||o.type!==G.MERGE)&&w.showCommitLabel){let k=a.append("g"),i=k.insert("rect").attr("class","commit-label-bkg"),c=k.append("text").attr("x",y).attr("y",s.y+25).attr("class","commit-label").text(o.id),T=c.node()?.getBBox();if(T){if(i.attr("x",s.posWithOffset-T.width/2-j).attr("y",s.y+13.5).attr("width",T.width+2*j).attr("height",T.height+2*j),I==="TB"||I==="BT")i.attr("x",s.x-(T.width+4*z+5)).attr("y",s.y-12),c.attr("x",s.x-(T.width+4*z)).attr("y",s.y+T.height-12);else c.attr("x",s.posWithOffset-T.width/2);if(w.rotateCommitLabel)if(I==="TB"||I==="BT")c.attr("transform","rotate(-45, "+s.x+", "+s.y+")"),i.attr("transform","rotate(-45, "+s.x+", "+s.y+")");else{let M=-7.5-(T.width+10)/25*9.5,P=10+T.width/25*8.5;k.attr("transform","translate("+M+", "+P+") rotate(-45, "+y+", "+s.y+")")}}}},"drawCommitLabel"),ot=e((a,o,s,y)=>{if(o.tags.length>0){let w=0,k=0,i=0,c=[];for(let T of o.tags.reverse()){let M=a.insert("polygon"),P=a.append("circle"),L=a.append("text").attr("y",s.y-16-w).attr("class","tag-label").text(T),B=L.node()?.getBBox();if(!B)throw Error("Tag bbox not found");k=Math.max(k,B.width),i=Math.max(i,B.height),L.attr("x",s.posWithOffset-B.width/2),c.push({tag:L,hole:P,rect:M,yOffset:w}),w+=20}for(let{tag:T,hole:M,rect:P,yOffset:L}of c){let B=i/2,_=s.y-19.2-L;if(P.attr("class","tag-label-bkg").attr("points",`
2
+ ${y-k/2-z/2},${_+j}
3
+ ${y-k/2-z/2},${_-j}
4
+ ${s.posWithOffset-k/2-z},${_-B-j}
5
+ ${s.posWithOffset+k/2+z},${_-B-j}
6
+ ${s.posWithOffset+k/2+z},${_+B+j}
7
+ ${s.posWithOffset-k/2-z},${_+B+j}`),M.attr("cy",_).attr("cx",y-k/2+z/2).attr("r",1.5).attr("class","tag-hole"),I==="TB"||I==="BT"){let O=y+L;P.attr("class","tag-label-bkg").attr("points",`
8
+ ${s.x},${O+2}
9
+ ${s.x},${O-2}
10
+ ${s.x+U},${O-B-2}
11
+ ${s.x+U+k+4},${O-B-2}
12
+ ${s.x+U+k+4},${O+B+2}
13
+ ${s.x+U},${O+B+2}`).attr("transform","translate(12,12) rotate(45, "+s.x+","+y+")"),M.attr("cx",s.x+z/2).attr("cy",O).attr("transform","translate(12,12) rotate(45, "+s.x+","+y+")"),T.attr("x",s.x+5).attr("y",O+3).attr("transform","translate(14,14) rotate(45, "+s.x+","+y+")")}}}},"drawCommitTags"),st=e((a)=>{switch(a.customType??a.type){case G.NORMAL:return"commit-normal";case G.REVERSE:return"commit-reverse";case G.HIGHLIGHT:return"commit-highlight";case G.MERGE:return"commit-merge";case G.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),nt=e((a,o,s,y)=>{let w={x:0,y:0};if(a.parents.length>0){let k=we(a.parents);if(k){let i=y.get(k)??w;if(o==="TB")return i.y+V;else if(o==="BT")return(y.get(a.id)??w).y-V;else return i.x+V}}else if(o==="TB")return oe;else if(o==="BT")return(y.get(a.id)??w).y-V;else return 0;return 0},"calculatePosition"),ct=e((a,o,s)=>{let y=I==="BT"&&s?o:o+U,w=S.get(a.branch)?.pos,k=I==="TB"||I==="BT"?S.get(a.branch)?.pos:y;if(k===void 0||w===void 0)throw Error(`Position were undefined for commit ${a.id}`);let i=ce.has(r().theme??""),c=I==="TB"||I==="BT"?y:w+(i?le/2+1:-2);return{x:k,y:c,posWithOffset:y}},"getCommitPosition"),$e=e((a,o,s,y)=>{let w=a.append("g").attr("class","commit-bullets"),k=a.append("g").attr("class","commit-labels"),i=I==="TB"||I==="BT"?oe:0,c=[...o.keys()],T=y.parallelCommits??!1,M=e((L,B)=>{let _=o.get(L)?.seq,O=o.get(B)?.seq;return _!==void 0&&O!==void 0?_-O:0},"sortKeys"),P=c.sort(M);if(I==="BT"){if(T)Xe(P,o,i);P=P.reverse()}P.forEach((L)=>{let B=o.get(L);if(!B)throw Error(`Commit not found for key ${L}`);if(T)i=nt(B,I,i,N);let _=ct(B,i,T);if(s){let O=st(B),W=B.customType??B.type,q=S.get(B.branch)?.index??0;rt(w,B,_,O,q,W),at(k,B,_,i,y),ot(k,B,_,i)}if(I==="TB"||I==="BT")N.set(B.id,{x:_.x,y:_.posWithOffset});else N.set(B.id,{x:_.posWithOffset,y:_.y});if(i=I==="BT"&&T?i+V:i+V+U,i>K)K=i})},"drawCommits"),it=e((a,o,s,y,w)=>{let i=(I==="TB"||I==="BT"?s.x<y.x:s.y<y.y)?o.branch:a.branch,c=e((M)=>M.branch===i,"isOnBranchToGetCurve"),T=e((M)=>M.seq>a.seq&&M.seq<o.seq,"isBetweenCommits");return[...w.values()].some((M)=>T(M)&&c(M))},"shouldRerouteArrow"),re=e((a,o,s=0)=>{let y=a+Math.abs(a-o)/2;if(s>5)return y;if(se.every((i)=>Math.abs(i-y)>=10))return se.push(y),y;let k=Math.abs(a-o);return re(a,o-k/5,s+1)},"findLane"),dt=e((a,o,s,y)=>{let{theme:w}=r(),k=ge.has(w??""),i=N.get(o.id),c=N.get(s.id);if(i===void 0||c===void 0)throw Error(`Commit positions not found for commits ${o.id} and ${s.id}`);let T=it(o,s,i,c,y),M="",P="",L=0,B=0,_=S.get(s.branch)?.index;if(s.type===G.MERGE&&o.id!==s.parents[0])_=S.get(o.branch)?.index;let O;if(T){M="A 10 10, 0, 0, 0,",P="A 10 10, 0, 0, 1,",L=10,B=10;let W=i.y<c.y?re(i.y,c.y):re(c.y,i.y),q=i.x<c.x?re(i.x,c.x):re(c.x,i.x);if(I==="TB")if(i.x<c.x)O=`M ${i.x} ${i.y} L ${q-L} ${i.y} ${P} ${q} ${i.y+B} L ${q} ${c.y-L} ${M} ${q+B} ${c.y} L ${c.x} ${c.y}`;else _=S.get(o.branch)?.index,O=`M ${i.x} ${i.y} L ${q+L} ${i.y} ${M} ${q} ${i.y+B} L ${q} ${c.y-L} ${P} ${q-B} ${c.y} L ${c.x} ${c.y}`;else if(I==="BT")if(i.x<c.x)O=`M ${i.x} ${i.y} L ${q-L} ${i.y} ${M} ${q} ${i.y-B} L ${q} ${c.y+L} ${P} ${q+B} ${c.y} L ${c.x} ${c.y}`;else _=S.get(o.branch)?.index,O=`M ${i.x} ${i.y} L ${q+L} ${i.y} ${P} ${q} ${i.y-B} L ${q} ${c.y+L} ${M} ${q-B} ${c.y} L ${c.x} ${c.y}`;else if(i.y<c.y)O=`M ${i.x} ${i.y} L ${i.x} ${W-L} ${M} ${i.x+B} ${W} L ${c.x-L} ${W} ${P} ${c.x} ${W+B} L ${c.x} ${c.y}`;else _=S.get(o.branch)?.index,O=`M ${i.x} ${i.y} L ${i.x} ${W+L} ${P} ${i.x+B} ${W} L ${c.x-L} ${W} ${M} ${c.x} ${W-B} L ${c.x} ${c.y}`}else if(M="A 20 20, 0, 0, 0,",P="A 20 20, 0, 0, 1,",L=20,B=20,I==="TB"){if(i.x<c.x)if(s.type===G.MERGE&&o.id!==s.parents[0])O=`M ${i.x} ${i.y} L ${i.x} ${c.y-L} ${M} ${i.x+B} ${c.y} L ${c.x} ${c.y}`;else O=`M ${i.x} ${i.y} L ${c.x-L} ${i.y} ${P} ${c.x} ${i.y+B} L ${c.x} ${c.y}`;if(i.x>c.x)if(M="A 20 20, 0, 0, 0,",P="A 20 20, 0, 0, 1,",L=20,B=20,s.type===G.MERGE&&o.id!==s.parents[0])O=`M ${i.x} ${i.y} L ${i.x} ${c.y-L} ${P} ${i.x-B} ${c.y} L ${c.x} ${c.y}`;else O=`M ${i.x} ${i.y} L ${c.x+L} ${i.y} ${M} ${c.x} ${i.y+B} L ${c.x} ${c.y}`;if(i.x===c.x)O=`M ${i.x} ${i.y} L ${c.x} ${c.y}`}else if(I==="BT"){if(i.x<c.x)if(s.type===G.MERGE&&o.id!==s.parents[0])O=`M ${i.x} ${i.y} L ${i.x} ${c.y+L} ${P} ${i.x+B} ${c.y} L ${c.x} ${c.y}`;else O=`M ${i.x} ${i.y} L ${c.x-L} ${i.y} ${M} ${c.x} ${i.y-B} L ${c.x} ${c.y}`;if(i.x>c.x)if(M="A 20 20, 0, 0, 0,",P="A 20 20, 0, 0, 1,",L=20,B=20,s.type===G.MERGE&&o.id!==s.parents[0])O=`M ${i.x} ${i.y} L ${i.x} ${c.y+L} ${M} ${i.x-B} ${c.y} L ${c.x} ${c.y}`;else O=`M ${i.x} ${i.y} L ${c.x+L} ${i.y} ${P} ${c.x} ${i.y-B} L ${c.x} ${c.y}`;if(i.x===c.x)O=`M ${i.x} ${i.y} L ${c.x} ${c.y}`}else{if(i.y<c.y)if(s.type===G.MERGE&&o.id!==s.parents[0])O=`M ${i.x} ${i.y} L ${c.x-L} ${i.y} ${P} ${c.x} ${i.y+B} L ${c.x} ${c.y}`;else O=`M ${i.x} ${i.y} L ${i.x} ${c.y-L} ${M} ${i.x+B} ${c.y} L ${c.x} ${c.y}`;if(i.y>c.y)if(s.type===G.MERGE&&o.id!==s.parents[0])O=`M ${i.x} ${i.y} L ${c.x-L} ${i.y} ${M} ${c.x} ${i.y-B} L ${c.x} ${c.y}`;else O=`M ${i.x} ${i.y} L ${i.x} ${c.y+L} ${P} ${i.x+B} ${c.y} L ${c.x} ${c.y}`;if(i.y===c.y)O=`M ${i.x} ${i.y} L ${c.x} ${c.y}`}if(O===void 0)throw Error("Line definition not found");a.append("path").attr("d",O).attr("class","arrow arrow"+X(_,Z,k))},"drawArrow"),ht=e((a,o)=>{let s=a.append("g").attr("class","commit-arrows");[...o.keys()].forEach((y)=>{let w=o.get(y);if(w.parents&&w.parents.length>0)w.parents.forEach((k)=>{dt(s,o.get(k),w,o)})})},"drawArrows"),lt=e((a,o,s,y)=>{let{look:w,theme:k,themeVariables:i}=r(),{dropShadow:c,THEME_COLOR_LIMIT:T}=i,M=ce.has(k??""),P=ge.has(k??""),L=a.append("g");o.forEach((B,_)=>{let O=X(_,M?T:Z,P),W=S.get(B.name)?.pos;if(W===void 0)throw Error(`Position not found for branch ${B.name}`);let q=I==="TB"||I==="BT"?W:M?W+le/2+1:W-2,A=L.append("line");if(A.attr("x1",0),A.attr("y1",q),A.attr("x2",K),A.attr("y2",q),A.attr("class","branch branch"+O),I==="TB")A.attr("y1",oe),A.attr("x1",W),A.attr("y2",K),A.attr("x2",W);else if(I==="BT")A.attr("y1",K),A.attr("x1",W),A.attr("y2",oe),A.attr("x2",W);se.push(q);let ie=B.name,ee=be(ie),F=L.insert("rect"),Y=L.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+O);Y.node().appendChild(ee);let H=ee.getBBox(),fe=M?0:4,ae=M?16:0,Q=M?le:0;if(w==="neo")F.attr("data-look","neo");if(F.attr("class","branchLabelBkg label"+O).attr("style",w==="neo"?`filter:${M?`url(#${y}-drop-shadow)`:c}`:"").attr("rx",fe).attr("ry",fe).attr("x",-H.width-4-(s.rotateCommitLabel===!0?30:0)).attr("y",-H.height/2+10).attr("width",H.width+18+ae).attr("height",H.height+4+Q),Y.attr("transform","translate("+(-H.width-14-(s.rotateCommitLabel===!0?30:0)+ae/2)+", "+(q-H.height/2-2)+")"),I==="TB"){if(F.attr("x",W-H.width/2-10).attr("y",0),Y.attr("transform","translate("+(W-H.width/2-5)+", 0)"),M)F.attr("transform",`translate(${-ae/2-3}, ${-Q-10})`),Y.attr("transform","translate("+(W-H.width/2-5)+", "+(-Q*2+7)+")")}else if(I==="BT"){if(F.attr("x",W-H.width/2-10).attr("y",K),Y.attr("transform","translate("+(W-H.width/2-5)+", "+K+")"),M)F.attr("transform",`translate(${-ae/2-3}, ${Q+10})`),Y.attr("transform","translate("+(W-H.width/2-5)+", "+(K+Q*2+4)+")")}else F.attr("transform","translate(-19, "+(q-12-Q/2)+")")})},"drawBranches"),mt=e(function(a,o,s,y,w){return S.set(a,{pos:o,index:s}),o+=50+(w?40:0)+(I==="TB"||I==="BT"?y.width/2:0),o},"setBranchPosition"),gt=e(function(a,o,s,y){Ve(),t.debug("in gitgraph renderer",a+`
14
+ `,"id:",o,s);let w=y.db;if(!w.getConfig){t.error("getConfig method is not available on db");return}let k=w.getConfig(),i=k.rotateCommitLabel??!1;te=w.getCommits();let c=w.getBranchesAsObjArray();I=w.getDirection();let T=n(`[id="${o}"]`),{look:M,theme:P,themeVariables:L}=r(),{useGradient:B,gradientStart:_,gradientStop:O,filterColor:W}=L;if(B){let A=T.append("defs").append("linearGradient").attr("id",o+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",_).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",O).attr("stop-opacity",1)}if(M==="neo"&&ce.has(P??""))T.append("defs").append("filter").attr("id",o+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",W);let q=0;if(c.forEach((A,ie)=>{let ee=be(A.name),F=T.append("g"),de=F.insert("g").attr("class","branchLabel"),Y=de.insert("g").attr("class","label branch-label");Y.node()?.appendChild(ee);let H=ee.getBBox();q=mt(A.name,q,ie,H,i),Y.remove(),de.remove(),F.remove()}),$e(T,te,!1,k),k.showBranches)lt(T,c,k,o);ht(T,te),$e(T,te,!0,k),h.insertTitle(T,"gitTitleText",k.titleTopMargin??0,w.getDiagramTitle()),yr(void 0,T,k.diagramPadding,k.useMaxWidth)},"draw"),ft={draw:gt},Be=8,ke=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),$t=new Set(["redux-color","redux-dark-color"]),pt=new Set(["neo","neo-dark"]),yt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),xt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),ut=e((a)=>{let{svgId:o}=a,s="";if(a.useGradient&&o)for(let y=0;y<a.THEME_COLOR_LIMIT;y++)s+=`
15
+ .label${y} { fill: ${a.mainBkg}; stroke: url(${o}-gradient); stroke-width: ${a.strokeWidth};}
16
+ `;return s},"genGitGraphGradient"),bt=e((a)=>{let o=u(),{theme:s,themeVariables:y}=o,{borderColorArray:w}=y,k=ke.has(s);if(pt.has(s)){let i="";for(let c=0;c<a.THEME_COLOR_LIMIT;c++)if(c===0)i+=`
17
+ .branch-label${c} { fill: ${a.nodeBorder};}
18
+ .commit${c} { stroke: ${a.nodeBorder}; }
19
+ .commit-highlight${c} { stroke: ${a.nodeBorder}; fill: ${a.nodeBorder}; }
20
+ .arrow${c} { stroke: ${a.nodeBorder}; }
21
+ .commit-bullets { fill: ${a.nodeBorder}; }
22
+ .commit-cherry-pick${c} { stroke: ${a.nodeBorder}; }
23
+ ${ut(a)}`;else{let T=c%Be;i+=`
24
+ .branch-label${c} { fill: ${a["gitBranchLabel"+T]}; }
25
+ .commit${c} { stroke: ${a["git"+T]}; fill: ${a["git"+T]}; }
26
+ .commit-highlight${c} { stroke: ${a["gitInv"+T]}; fill: ${a["gitInv"+T]}; }
27
+ .arrow${c} { stroke: ${a["git"+T]}; }
28
+ `}return i}else if(!$t.has(s)){let i="";for(let c=0;c<a.THEME_COLOR_LIMIT;c++)i+=`
29
+ .branch-label${c} { fill: ${a.nodeBorder}; ${k?`font-weight:${a.noteFontWeight}`:""} }
30
+ .commit${c} { stroke: ${a.nodeBorder}; }
31
+ .commit-highlight${c} { stroke: ${a.nodeBorder}; fill: ${a.nodeBorder}; }
32
+ .label${c} { fill: ${a.mainBkg}; stroke: ${a.nodeBorder}; stroke-width: ${a.strokeWidth}; ${k?`font-weight:${a.noteFontWeight}`:""}}
33
+ .arrow${c} { stroke: ${a.nodeBorder}; }
34
+ .commit-bullets { fill: ${a.nodeBorder}; }
35
+ .commit-cherry-pick${c} { stroke: ${a.nodeBorder}; }
36
+ `;return i}else{let i="";for(let c=0;c<a.THEME_COLOR_LIMIT;c++)if(c===0)i+=`
37
+ .branch-label${c} { fill: ${a.nodeBorder}; ${k?`font-weight:${a.noteFontWeight}`:""} }
38
+ .commit${c} { stroke: ${a.nodeBorder}; }
39
+ .commit-highlight${c} { stroke: ${a.nodeBorder}; fill: ${a.mainBkg}; }
40
+ .label${c} { fill: ${a.mainBkg}; stroke: ${a.nodeBorder}; stroke-width: ${a.strokeWidth}; ${k?`font-weight:${a.noteFontWeight}`:""} }
41
+ .arrow${c} { stroke: ${a.nodeBorder}; }
42
+ .commit-bullets { fill: ${a.nodeBorder}; }
43
+ `;else{let T=c%w.length;i+=`
44
+ .branch-label${c} { fill: ${a.nodeBorder}; ${k?`font-weight:${a.noteFontWeight}`:""} }
45
+ .commit${c} { stroke: ${w[T]}; fill: ${w[T]}; }
46
+ .commit-highlight${c} { stroke: ${w[T]}; fill: ${w[T]}; }
47
+ .label${c} { fill: ${yt.has(s)?a.mainBkg:w[T]}; stroke: ${w[T]}; stroke-width: ${a.strokeWidth}; }
48
+ .arrow${c} { stroke: ${w[T]}; }
49
+ `}return i}},"genColor"),wt=e((a)=>`${Array.from({length:a.THEME_COLOR_LIMIT},(o,s)=>s).map((o)=>{let s=o%Be;return`
50
+ .branch-label${o} { fill: ${a["gitBranchLabel"+s]}; }
51
+ .commit${o} { stroke: ${a["git"+s]}; fill: ${a["git"+s]}; }
52
+ .commit-highlight${o} { stroke: ${a["gitInv"+s]}; fill: ${a["gitInv"+s]}; }
53
+ .label${o} { fill: ${a["git"+s]}; }
54
+ .arrow${o} { stroke: ${a["git"+s]}; }
55
+ `}).join(`
56
+ `)}`,"normalTheme"),Bt=e((a)=>{let o=u(),{theme:s}=o,y=xt.has(s);return`
57
+ .commit-id,
58
+ .commit-msg,
59
+ .branch-label {
60
+ fill: lightgrey;
61
+ color: lightgrey;
62
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
63
+ font-family: var(--mermaid-font-family);
64
+ }
65
+
66
+ ${y?bt(a):wt(a)}
67
+
68
+ .branch {
69
+ stroke-width: ${a.strokeWidth};
70
+ stroke: ${a.commitLineColor??a.lineColor};
71
+ stroke-dasharray: ${y?"4 2":"2"};
72
+ }
73
+ .commit-label { font-size: ${a.commitLabelFontSize}; fill: ${y?a.nodeBorder:a.commitLabelColor}; ${y?`font-weight:${a.noteFontWeight};`:""}}
74
+ .commit-label-bkg { font-size: ${a.commitLabelFontSize}; fill: ${y?"transparent":a.commitLabelBackground}; opacity: ${y?"":0.5}; }
75
+ .tag-label { font-size: ${a.tagLabelFontSize}; fill: ${a.tagLabelColor};}
76
+ .tag-label-bkg { fill: ${y?a.mainBkg:a.tagLabelBackground}; stroke: ${y?a.nodeBorder:a.tagLabelBorder}; ${y?`filter:${a.dropShadow}`:""} }
77
+ .tag-hole { fill: ${a.textColor}; }
78
+
79
+ .commit-merge {
80
+ stroke: ${y?a.mainBkg:a.primaryColor};
81
+ fill: ${y?a.mainBkg:a.primaryColor};
82
+ }
83
+ .commit-reverse {
84
+ stroke: ${y?a.mainBkg:a.primaryColor};
85
+ fill: ${y?a.mainBkg:a.primaryColor};
86
+ stroke-width: ${y?a.strokeWidth:3};
87
+ }
88
+ .commit-highlight-outer {
89
+ }
90
+ .commit-highlight-inner {
91
+ stroke: ${y?a.mainBkg:a.primaryColor};
92
+ fill: ${y?a.mainBkg:a.primaryColor};
93
+ }
94
+
95
+ .arrow {
96
+ /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
97
+ stroke-width: ${ke.has(s)?a.strokeWidth:8};
98
+ stroke-linecap: round;
99
+ fill: none
100
+ }
101
+ .gitTitleText {
102
+ text-anchor: middle;
103
+ font-size: 18px;
104
+ fill: ${a.textColor};
105
+ }
106
+ `},"getStyles"),kt=Bt,It={parser:Ke,db:ue,renderer:ft,styles:kt};export{It as diagram};
@@ -0,0 +1,2 @@
1
+ import{e,t}from"./index-1r72hdzb.js";import{B,L}from"./index-fjtdggjn.js";import{Or,O}from"./index-d3b3gqe9.js";var X=4;function A(n){return Or(n,X)}var D=A;function qe(n){var i={options:{directed:n.isDirected(),multigraph:n.isMultigraph(),compound:n.isCompound()},nodes:k(n),edges:J(n)};if(!B(n.graph()))i.value=D(n.graph());return i}function k(n){return O(n.nodes(),function(i){var r=n.node(i),o=n.parent(i),s={v:i};if(!B(r))s.value=r;if(!B(o))s.parent=o;return s})}function J(n){return O(n.edges(),function(i){var r=n.edge(i),o={v:i.v,w:i.w};if(!B(i.name))o.name=i.name;if(!B(r))o.value=r;return o})}var _=new Map,d=new Map,E=new Map,Dr=e(()=>{d.clear(),E.clear(),_.clear()},"clear"),v=e((n,i)=>{let r=d.get(i)||[];return t.trace("In isDescendant",i," ",n," = ",r.includes(n)),r.includes(n)},"isDescendant"),M=e((n,i)=>{let r=d.get(i)||[];if(t.info("Descendants of ",i," is ",r),t.info("Edge is ",n),n.v===i||n.w===i)return!1;if(!r)return t.debug("Tilt, ",i,",not in descendants"),!1;return r.includes(n.v)||v(n.v,i)||v(n.w,i)||r.includes(n.w)},"edgeInCluster"),m=e((n,i,r,o)=>{t.warn("Copying children of ",n,"root",o,"data",i.node(n),o);let s=i.children(n)||[];if(n!==o)s.push(n);t.warn("Copying (nodes) clusterId",n,"nodes",s),s.forEach((a)=>{if(i.children(a).length>0)m(a,i,r,o);else{let l=i.node(a);if(t.info("cp ",a," to ",o," with parent ",n),r.setNode(a,l),o!==i.parent(a))t.warn("Setting parent",a,i.parent(a)),r.setParent(a,i.parent(a));if(n!==o&&a!==n)t.debug("Setting parent",a,n),r.setParent(a,n);else t.info("In copy ",n,"root",o,"data",i.node(n),o),t.debug("Not Setting parent for node=",a,"cluster!==rootId",n!==o,"node!==clusterId",a!==n);let u=i.edges(a);t.debug("Copying Edges",u),u.forEach((c)=>{t.info("Edge",c);let f=i.edge(c.v,c.w,c.name);t.info("Edge data",f,o);try{if(M(c,o)){let w=d.get(o)||[],g=w.includes(c.v)||v(c.v,o)||c.v===o,C=w.includes(c.w)||v(c.w,o)||c.w===o;if(g&&C)t.info("Copying as ",c.v,c.w,f,c.name),r.setEdge(c.v,c.w,f,c.name),t.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{let b=g?o:c.v,h=C?o:c.w;t.info("Rebinding cross-boundary edge as ",b,h,f,c.name),i.setEdge(b,h,f,c.name)}}else t.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",o," clusterId:",n)}catch(w){t.error(w)}})}t.debug("Removing node",a),i.removeNode(a)})},"copy"),N=e((n,i)=>{let r=i.children(n),o=[...r];for(let s of r)E.set(s,n),o=[...o,...N(s,i)];return o},"extractDescendants"),P=e((n,i,r)=>{let o=n.edges().filter((c)=>c.v===i||c.w===i),s=n.edges().filter((c)=>c.v===r||c.w===r),a=o.map((c)=>({v:c.v===i?r:c.v,w:c.w===i?i:c.w})),l=s.map((c)=>({v:c.v,w:c.w}));return a.filter((c)=>l.some((f)=>c.v===f.v&&c.w===f.w))},"findCommonEdges"),zt=e((n,i,r)=>{let o=i.children(n);if(t.trace("Searching children of id ",n,o),o.length<1)return n;let s;for(let a of o){let l=zt(a,i,r),u=P(i,r,l);if(l)if(u.length>0)s=l;else return l}return s},"findNonClusterChild"),x=e((n)=>{if(!_.has(n))return n;if(!_.get(n).externalConnections)return n;if(_.has(n))return _.get(n).id;return n},"getAnchorId"),Ii=e((n,i)=>{if(!n||i>10){t.debug("Opting out, no graph ");return}else t.debug("Opting in, graph ");n.nodes().forEach(function(r){if(n.children(r).length>0)t.warn("Cluster identified",r," Replacement id in edges: ",zt(r,n,r)),d.set(r,N(r,n)),_.set(r,{id:zt(r,n,r),clusterData:n.node(r)})}),n.nodes().forEach(function(r){let o=n.children(r),s=n.edges();if(o.length>0)t.debug("Cluster identified",r,d),s.forEach((a)=>{let l=v(a.v,r),u=v(a.w,r);if(l^u)t.warn("Edge: ",a," leaves cluster ",r),t.warn("Descendants of XXX ",r,": ",d.get(r)),_.get(r).externalConnections=!0});else t.debug("Not a cluster ",r,d)});for(let r of _.keys()){let o=_.get(r).id,s=n.parent(o);if(s!==r&&_.has(s)&&!_.get(s).externalConnections)_.get(r).id=s;let a=n.edges().some((l)=>l.v===r);if(o&&_.get(r)?.externalConnections&&a&&S(n,o,r)){let l=R(n,r,n.parent(o));if(l)_.get(r).id=l}}n.edges().forEach(function(r){let o=n.edge(r);t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(n.edge(r)));let{v:s,w:a}=r;if(t.warn("Fix XXX",_,"ids:",r.v,r.w,"Translating: ",_.get(r.v)," --- ",_.get(r.w)),_.get(r.v)||_.get(r.w)){if(t.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),s=x(r.v),a=x(r.w),n.removeEdge(r.v,r.w,r.name),s!==r.v){let l=n.parent(s);_.get(l).externalConnections=!0,o.fromCluster=r.v}if(a!==r.w){let l=n.parent(a);_.get(l).externalConnections=!0,o.toCluster=r.w}t.warn("Fix Replacing with XXX",s,a,r.name),n.setEdge(s,a,o,r.name)}}),t.warn("Adjusted Graph",qe(n)),p(n,0),t.trace(_)},"adjustClustersAndEdges"),p=e((n,i)=>{if(t.warn("extractor - ",i,qe(n),n.children("D")),i>10){t.error("Bailing out");return}let r=n.nodes(),o=!1;for(let s of r){let a=n.children(s);o=o||a.length>0}if(!o){t.debug("Done, no node has children",n.nodes());return}t.debug("Nodes = ",r,i);for(let s of r)if(t.debug("Extracting node",s,_,_.has(s)&&!_.get(s).externalConnections,!n.parent(s),n.node(s),n.children("D")," Depth ",i),!_.has(s))t.debug("Not a cluster",s,i);else if(_.get(s)?.clusterData?.explicitDir&&n.children(s)&&n.children(s).length>0){t.warn("Cluster with explicit dir, creating subgraph for children",s,i);let a=_.get(s).clusterData.dir,l=new L({multigraph:!0,compound:!0}).setGraph({rankdir:a,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});m(s,n,l,s);let u=n.node(s)||{};n.setNode(s,{...u,clusterNode:!0,id:s,clusterData:_.get(s).clusterData,label:_.get(s).label,graph:l}),t.warn("Subgraph for cluster with explicit dir created:",s,qe(l))}else if(!_.get(s).externalConnections&&n.children(s)&&n.children(s).length>0){t.warn("Cluster without external connections, without a parent and with children",s,i);let l=n.graph().rankdir==="TB"?"LR":"TB";if(_.get(s)?.clusterData?.dir)l=_.get(s).clusterData.dir,t.warn("Fixing dir",_.get(s).clusterData.dir,l);let u=new L({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});m(s,n,u,s);let c=n.node(s)||{};n.setNode(s,{...c,clusterNode:!0,id:s,clusterData:_.get(s).clusterData,label:_.get(s).label,graph:u}),t.debug("Old graph after copy",qe(n))}else t.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!_.get(s).externalConnections," no parent: ",!n.parent(s)," children ",n.children(s)&&n.children(s).length>0,n.children("D"),i),t.debug(_);r=n.nodes(),t.warn("New list of nodes",r);for(let s of r){let a=n.node(s);if(t.warn(" Now next level",s,a),a?.clusterNode)p(a.graph,i+1)}},"extractor"),y=e((n,i)=>{if(i.length===0)return[];let r=Object.assign([],i);return i.forEach((o)=>{let s=n.children(o),a=y(n,s);r=[...r,...a]}),r},"sorter"),Li=e((n)=>y(n,n.children()),"sortNodesByHierarchy"),S=e((n,i,r)=>{let o=n.parent(i);while(o&&o!==r){let s=_.get(o);if(s&&!s.externalConnections)return!0;o=n.parent(o)}return!1},"isNodeInExtractableCluster"),R=e((n,i,r)=>{let o=n.children(i)??[];for(let s of o){if(s===r||v(s,r))continue;let a=zt(s,n,i);if(!a)continue;if(!S(n,a,i))return a}return null},"findSafeAnchorNode");
2
+ export{qe,_,Dr,zt,Ii,Li};
@@ -0,0 +1,2 @@
1
+ import{He,bt,We,un}from"./index-5tv8v1hk.js";import{Ue}from"./index-hj99nz1f.js";import{Xe,br,Wt,ie,xr}from"./index-1r72hdzb.js";function s(r,n){return r==null||n==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function x(r,n){return r==null||n==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function tr(r){let n,e,t;if(r.length!==2)n=s,e=(f,c)=>s(r(f),c),t=(f,c)=>r(f)-c;else n=r===s||r===x?r:O,e=r,t=r;function o(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<0)i=l+1;else p=l}while(i<p)}return i}function a(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<=0)i=l+1;else p=l}while(i<p)}return i}function u(f,c,i=0,p=f.length){let l=o(f,c,i,p-1);return l>i&&t(f[l-1],c)>-t(f[l],c)?l-1:l}return{left:o,center:u,right:a}}function O(){return 0}function y(r){return r===null?NaN:+r}var V=tr(s),{right:T,left:or}=V,ur=tr(y).center,z=T;var E=Math.sqrt(50),G=Math.sqrt(10),H=Math.sqrt(2);function g(r,n,e){let t=(n-r)/Math.max(0,e),o=Math.floor(Math.log10(t)),a=t/Math.pow(10,o),u=a>=E?10:a>=G?5:a>=H?2:1,f,c,i;if(o<0){if(i=Math.pow(10,-o)/u,f=Math.round(r*i),c=Math.round(n*i),f/i<r)++f;if(c/i>n)--c;i=-i}else{if(i=Math.pow(10,o)*u,f=Math.round(r/i),c=Math.round(n/i),f*i<r)++f;if(c*i>n)--c}if(c<f&&0.5<=e&&e<2)return g(r,n,e*2);return[f,c,i]}function v(r,n,e){if(n=+n,r=+r,e=+e,!(e>0))return[];if(r===n)return[r];let t=n<r,[o,a,u]=t?g(n,r,e):g(r,n,e);if(!(a>=o))return[];let f=a-o+1,c=Array(f);if(t)if(u<0)for(let i=0;i<f;++i)c[i]=(a-i)/-u;else for(let i=0;i<f;++i)c[i]=(a-i)*u;else if(u<0)for(let i=0;i<f;++i)c[i]=(o+i)/-u;else for(let i=0;i<f;++i)c[i]=(o+i)*u;return c}function M(r,n,e){return n=+n,r=+r,e=+e,g(r,n,e)[2]}function Mr(r,n,e){n=+n,r=+r,e=+e;let t=n<r,o=t?M(n,r,e):M(r,n,e);return(t?-1:1)*(o<0?1/-o:o)}function N(r,n){if(!n)n=[];var e=r?Math.min(n.length,r.length):0,t=n.slice(),o;return function(a){for(o=0;o<e;++o)t[o]=r[o]*(1-a)+n[o]*a;return t}}function B(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function P(r,n){var e=n?n.length:0,t=r?Math.min(e,r.length):0,o=Array(t),a=Array(e),u;for(u=0;u<t;++u)o[u]=h(r[u],n[u]);for(;u<e;++u)a[u]=n[u];return function(f){for(u=0;u<t;++u)a[u]=o[u](f);return a}}function w(r,n){var e=new Date;return r=+r,n=+n,function(t){return e.setTime(r*(1-t)+n*t),e}}function k(r,n){var e={},t={},o;if(r===null||typeof r!=="object")r={};if(n===null||typeof n!=="object")n={};for(o in n)if(o in r)e[o]=h(r[o],n[o]);else t[o]=n[o];return function(a){for(o in e)t[o]=e[o](a);return t}}function h(r,n){var e=typeof n,t;return n==null||e==="boolean"?br(n):(e==="number"?ie:e==="string"?(t=Xe(n))?(n=t,Wt):xr:n instanceof Xe?Wt:n instanceof Date?w:B(n)?N:Array.isArray(n)?P:typeof n.valueOf!=="function"&&typeof n.toString!=="function"||isNaN(n)?k:ie)(r,n)}function A(r,n){return r=+r,n=+n,function(e){return Math.round(r*(1-e)+n*e)}}function R(r){return Math.max(0,-He(Math.abs(r)))}function S(r,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(He(n)/3)))*3-He(Math.abs(r)))}function j(r,n){return r=Math.abs(r),n=Math.abs(n)-r,Math.max(0,He(n)-He(r))+1}function F(r){return function(){return r}}function q(r){return+r}var C=[0,1];function d(r){return r}function D(r,n){return(n-=r=+r)?function(e){return(e-r)/n}:F(isNaN(n)?NaN:0.5)}function J(r,n){var e;if(r>n)e=r,r=n,n=e;return function(t){return Math.max(r,Math.min(n,t))}}function K(r,n,e){var t=r[0],o=r[1],a=n[0],u=n[1];if(o<t)t=D(o,t),a=e(u,a);else t=D(t,o),a=e(a,u);return function(f){return a(t(f))}}function Q(r,n,e){var t=Math.min(r.length,n.length)-1,o=Array(t),a=Array(t),u=-1;if(r[t]<r[0])r=r.slice().reverse(),n=n.slice().reverse();while(++u<t)o[u]=D(r[u],r[u+1]),a[u]=e(n[u],n[u+1]);return function(f){var c=z(r,f,1,t)-1;return a[c](o[c](f))}}function cn(r,n){return n.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function U(){var r=C,n=C,e=h,t,o,a,u=d,f,c,i;function p(){var m=Math.min(r.length,n.length);if(u!==d)u=J(r[0],r[m-1]);return f=m>2?Q:K,c=i=null,l}function l(m){return m==null||isNaN(m=+m)?a:(c||(c=f(r.map(t),n,e)))(t(u(m)))}return l.invert=function(m){return u(o((i||(i=f(n,r.map(t),ie)))(m)))},l.domain=function(m){return arguments.length?(r=Array.from(m,q),p()):r.slice()},l.range=function(m){return arguments.length?(n=Array.from(m),p()):n.slice()},l.rangeRound=function(m){return n=Array.from(m),e=A,p()},l.clamp=function(m){return arguments.length?(u=m?!0:d,p()):u!==d},l.interpolate=function(m){return arguments.length?(e=m,p()):e},l.unknown=function(m){return arguments.length?(a=m,l):a},function(m,L){return t=m,o=L,p()}}function Nr(){return U()(d,d)}function I(r,n,e,t){var o=Mr(r,n,e),a;switch(t=bt(t==null?",f":t),t.type){case"s":{var u=Math.max(Math.abs(r),Math.abs(n));if(t.precision==null&&!isNaN(a=S(o,u)))t.precision=a;return un(t,u)}case"":case"e":case"g":case"p":case"r":{if(t.precision==null&&!isNaN(a=j(o,Math.max(Math.abs(r),Math.abs(n)))))t.precision=a-(t.type==="e");break}case"f":case"%":{if(t.precision==null&&!isNaN(a=R(o)))t.precision=a-(t.type==="%")*2;break}}return We(t)}function W(r){var n=r.domain;return r.ticks=function(e){var t=n();return v(t[0],t[t.length-1],e==null?10:e)},r.tickFormat=function(e,t){var o=n();return I(o[0],o[o.length-1],e==null?10:e,t)},r.nice=function(e){if(e==null)e=10;var t=n(),o=0,a=t.length-1,u=t[o],f=t[a],c,i,p=10;if(f<u)i=u,u=f,f=i,i=o,o=a,a=i;while(p-- >0){if(i=M(u,f,e),i===c)return t[o]=u,t[a]=f,n(t);else if(i>0)u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i;else if(i<0)u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i;else break;c=i}return r},r}function Oe(){var r=Nr();return r.copy=function(){return cn(r,Oe())},Ue.apply(r,arguments),W(r)}
2
+ export{tr,Mr,cn,Nr,Oe};