@sinm/kai 1.12.8 → 1.13.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 (144) hide show
  1. package/RELEASE_NOTES.md +160 -0
  2. package/dist-cli/kai-cli.js +144111 -149439
  3. package/dist-electron/renderer/assets/LICENSE-CRnx3_A4. +122 -0
  4. package/dist-electron/renderer/assets/NOTICE-VFih955g. +229 -0
  5. package/dist-electron/renderer/assets/README-BLVCeaHS.md +498 -0
  6. package/dist-electron/renderer/assets/{_baseUniq-D1YNIFcF.js → _baseUniq-IzQS5rpq.js} +1 -1
  7. package/dist-electron/renderer/assets/_commonjsHelpers-CCIqAdii.js +38 -0
  8. package/dist-electron/renderer/assets/{arc-Bm6fPazK.js → arc-0FUHmmYf.js} +23 -23
  9. package/dist-electron/renderer/assets/{architectureDiagram-Q4EWVU46-Cj7Ijbdx.js → architectureDiagram-Q4EWVU46-lERxZBZ3.js} +8 -5
  10. package/dist-electron/renderer/assets/assets-FW_AxgRe.js +172 -0
  11. package/dist-electron/renderer/assets/billboard-BSTFvQMm.js +24870 -0
  12. package/dist-electron/renderer/assets/{blockDiagram-DXYQGD6D-h_hfApKW.js → blockDiagram-DXYQGD6D-50KC-L6H.js} +10 -7
  13. package/dist-electron/renderer/assets/{c4Diagram-AHTNJAMY-Bc9WKYcR.js → c4Diagram-AHTNJAMY-CGUZg_Lb.js} +5 -2
  14. package/dist-electron/renderer/assets/{channel-rz5HhnUN.js → channel-BhiLrT8b.js} +1 -1
  15. package/dist-electron/renderer/assets/{chunk-4BX2VUAB-CSIA4CEs.js → chunk-4BX2VUAB-Dsk-FZLe.js} +1 -1
  16. package/dist-electron/renderer/assets/{chunk-4TB4RGXK-wmbLtxbh.js → chunk-4TB4RGXK-Cg08E4uS.js} +6 -5
  17. package/dist-electron/renderer/assets/{chunk-55IACEB6-CyTu0W4e.js → chunk-55IACEB6-CaY4ZtxG.js} +2 -1
  18. package/dist-electron/renderer/assets/{chunk-EDXVE4YY-BkuoJ9Rg.js → chunk-EDXVE4YY-D-vr_LVm.js} +1 -1
  19. package/dist-electron/renderer/assets/{chunk-FMBD7UC4-CXLzwK-p.js → chunk-FMBD7UC4-CgfLwyI0.js} +1 -1
  20. package/dist-electron/renderer/assets/{chunk-OYMX7WX6-89Cfdes5.js → chunk-OYMX7WX6-B2UNIH07.js} +3 -3
  21. package/dist-electron/renderer/assets/{chunk-QZHKN3VN-BP7yAqUC.js → chunk-QZHKN3VN-8pnIXhD9.js} +1 -1
  22. package/dist-electron/renderer/assets/{chunk-YZCP3GAM-DlXeY35D.js → chunk-YZCP3GAM-1OCqrydc.js} +2 -1
  23. package/dist-electron/renderer/assets/{classDiagram-v2-HSJHXN6E-BhvGIqCe.js → classDiagram-6PBFFD2Q-D6s4rntl.js} +9 -6
  24. package/dist-electron/renderer/assets/{classDiagram-6PBFFD2Q-BhvGIqCe.js → classDiagram-v2-HSJHXN6E-D6s4rntl.js} +9 -6
  25. package/dist-electron/renderer/assets/{clone-B0IYq2dM.js → clone-ONN7myYv.js} +1 -1
  26. package/dist-electron/renderer/assets/{cose-bilkent-S5V4N54A-CXkTOxYF.js → cose-bilkent-S5V4N54A-B4V7g-PN.js} +4 -1
  27. package/dist-electron/renderer/assets/{dagre-KV5264BT-CDhOvCqP.js → dagre-KV5264BT-BxdReG41.js} +9 -6
  28. package/dist-electron/renderer/assets/{defaultLocale-B2RvLBDe.js → defaultLocale-DCJjMHFj.js} +6 -3
  29. package/dist-electron/renderer/assets/{diagram-5BDNPKRD-BVi_bgHy.js → diagram-5BDNPKRD-BXmSoRSx.js} +9 -6
  30. package/dist-electron/renderer/assets/{diagram-G4DWMVQ6-rSfxvI7w.js → diagram-G4DWMVQ6-Cal8PS1h.js} +12 -335
  31. package/dist-electron/renderer/assets/{diagram-MMDJMWI5-CQyMbB4C.js → diagram-MMDJMWI5-BxRETzVk.js} +8 -5
  32. package/dist-electron/renderer/assets/{diagram-TYMM5635-CTtX0t8J.js → diagram-TYMM5635-cUUOAiip.js} +8 -5
  33. package/dist-electron/renderer/assets/docx-preview-D79uFTI3.js +6286 -0
  34. package/dist-electron/renderer/assets/{erDiagram-SMLLAGMA-OPI6814M.js → erDiagram-SMLLAGMA-DOKXfo5a.js} +7 -4
  35. package/dist-electron/renderer/assets/export-BB2y0kyx.js +17 -0
  36. package/dist-electron/renderer/assets/{flowDiagram-DWJPFMVM-zQ37QQ6j.js → flowDiagram-DWJPFMVM-DMeT6oIp.js} +9 -6
  37. package/dist-electron/renderer/assets/frame-cache-FJQQ95VR.mjs +731 -0
  38. package/dist-electron/renderer/assets/{ganttDiagram-T4ZO3ILL-SabGKVNy.js → ganttDiagram-T4ZO3ILL-BP29Llrv.js} +17 -1019
  39. package/dist-electron/renderer/assets/{gitGraphDiagram-UUTBAWPF-Cf76EqK-.js → gitGraphDiagram-UUTBAWPF-C7d6IjfR.js} +9 -6
  40. package/dist-electron/renderer/assets/{graph-XEjbXiT4.js → graph-PHPHiJJP.js} +2 -2
  41. package/dist-electron/renderer/assets/image-BPoy6OwY.js +256 -0
  42. package/dist-electron/renderer/assets/index-B3YxBY6K.js +2203 -0
  43. package/dist-electron/renderer/assets/index-B8e4CGoa.js +36 -0
  44. package/dist-electron/renderer/assets/index-BEeZTDSC.js +23 -0
  45. package/dist-electron/renderer/assets/index-BM3qXY96.js +22 -0
  46. package/dist-electron/renderer/assets/index-BW_kBMIl.js +336 -0
  47. package/dist-electron/renderer/assets/index-Bmnq51hA.js +22 -0
  48. package/dist-electron/renderer/assets/{index-CvNq2hZf.js → index-C1vtUg_s.js} +38843 -33243
  49. package/dist-electron/renderer/assets/{index-v7BYTcWh.css → index-CwhZMs_P.css} +11127 -8033
  50. package/dist-electron/renderer/assets/index-ZtFtJCDp.js +35 -0
  51. package/dist-electron/renderer/assets/index-t7Uht1Bm.js +823 -0
  52. package/dist-electron/renderer/assets/index.d-BlbVvgf5.ts +189 -0
  53. package/dist-electron/renderer/assets/index.es-eU8DIFZe.js +8641 -0
  54. package/dist-electron/renderer/assets/{infoDiagram-42DDH7IO-BwaUrrr6.js → infoDiagram-42DDH7IO-DX82xpv-.js} +7 -4
  55. package/dist-electron/renderer/assets/{ishikawaDiagram-UXIWVN3A-9ug8d1vP.js → ishikawaDiagram-UXIWVN3A-AgnLKWJ1.js} +4 -1
  56. package/dist-electron/renderer/assets/{journeyDiagram-VCZTEJTY-TD9rr0Yb.js → journeyDiagram-VCZTEJTY-DBoO0fyn.js} +11 -8
  57. package/dist-electron/renderer/assets/jszip.min-Ca5jExEq.js +2320 -0
  58. package/dist-electron/renderer/assets/{kanban-definition-6JOO6SKY-DbYJfuxU.js → kanban-definition-6JOO6SKY-Da9qGyC6.js} +5 -2
  59. package/dist-electron/renderer/assets/{layout-BhL6ZYG7.js → layout-CWvzTDIs.js} +4 -4
  60. package/dist-electron/renderer/assets/{linear-BgmkulGp.js → linear-iB_ZihXg.js} +7 -12
  61. package/dist-electron/renderer/assets/{min-Ux8OpRLr.js → min-Cy3zXhhU.js} +2 -2
  62. package/dist-electron/renderer/assets/{mindmap-definition-QFDTVHPH-hafJ1k0V.js → mindmap-definition-QFDTVHPH-DcbS1qdR.js} +6 -3
  63. package/dist-electron/renderer/assets/office-preview-J3VSY6Z8.js +234 -0
  64. package/dist-electron/renderer/assets/office-preview-dcvGW2k2.css +31 -0
  65. package/dist-electron/renderer/assets/options-SsS0Y_ki.js +14 -0
  66. package/dist-electron/renderer/assets/parser-DYEwxOAz.js +36438 -0
  67. package/dist-electron/renderer/assets/pdf-Cg5OXHy4.js +45988 -0
  68. package/dist-electron/renderer/assets/pdf.worker-BRVikHnI.js +63582 -0
  69. package/dist-electron/renderer/assets/pdfIdentityFontRepair-D1LMksnQ.js +19540 -0
  70. package/dist-electron/renderer/assets/pie-n6faJLD3.js +57 -0
  71. package/dist-electron/renderer/assets/{pieDiagram-DEJITSTG-Ds-EF9ih.js → pieDiagram-DEJITSTG-DoHeHbCw.js} +13 -62
  72. package/dist-electron/renderer/assets/ppt-font-cjk-DxgKpThH.otf +0 -0
  73. package/dist-electron/renderer/assets/ppt-kMUvGcTn.js +548 -0
  74. package/dist-electron/renderer/assets/ppt-native-FimRYTDZ.wasm +0 -0
  75. package/dist-electron/renderer/assets/pptx-Bc4I5s0W.js +1561 -0
  76. package/dist-electron/renderer/assets/pptx.worker-BB0HgzXA.js +9243 -0
  77. package/dist-electron/renderer/assets/pptx.worker-uagKfrvK.js +31 -0
  78. package/dist-electron/renderer/assets/preload-helper-DMSNAyVy.js +103 -0
  79. package/dist-electron/renderer/assets/printLayout-CIlG68Nj.js +75 -0
  80. package/dist-electron/renderer/assets/{quadrantDiagram-34T5L4WZ-w34cZgIo.js → quadrantDiagram-34T5L4WZ-B4eVOkpY.js} +7 -3
  81. package/dist-electron/renderer/assets/{requirementDiagram-MS252O5E-scA2ZKRK.js → requirementDiagram-MS252O5E-_X6prUEb.js} +6 -3
  82. package/dist-electron/renderer/assets/{sankeyDiagram-XADWPNL6-BAen7KsY.js → sankeyDiagram-XADWPNL6-Cwh5jd49.js} +4 -1
  83. package/dist-electron/renderer/assets/{sequenceDiagram-FGHM5R23-CTs2YiIq.js → sequenceDiagram-FGHM5R23-DuyO7VVc.js} +6 -3
  84. package/dist-electron/renderer/assets/spreadsheet-DGapha57.js +3835 -0
  85. package/dist-electron/renderer/assets/{stateDiagram-FHFEXIEX-Bh0sWvlc.js → stateDiagram-FHFEXIEX-CakMKYdt.js} +12 -9
  86. package/dist-electron/renderer/assets/{stateDiagram-v2-QKLJ7IA2-B2Hm2wBr.js → stateDiagram-v2-QKLJ7IA2-DzNdAqgI.js} +7 -4
  87. package/dist-electron/renderer/assets/time-Bll8bhEl.js +1053 -0
  88. package/dist-electron/renderer/assets/{timeline-definition-GMOUNBTQ-CbeMRmLK.js → timeline-definition-GMOUNBTQ-CZVCXf6-.js} +9 -6
  89. package/dist-electron/renderer/assets/transform-xbmqYlhd.js +3127 -0
  90. package/dist-electron/renderer/assets/{vennDiagram-DHZGUBPP-DJhwj_mO.js → vennDiagram-DHZGUBPP-C6K4wHQL.js} +4 -1
  91. package/dist-electron/renderer/assets/{wardley-RL74JXVD-DBLZJp8R.js → wardley-RL74JXVD-C-ecli15.js} +5 -3
  92. package/dist-electron/renderer/assets/{wardleyDiagram-NUSXRM2D-Cu85Zz7H.js → wardleyDiagram-NUSXRM2D-BQXEBLy4.js} +8 -5
  93. package/dist-electron/renderer/assets/wordDoc-sBzzGoFh.js +6553 -0
  94. package/dist-electron/renderer/assets/wordDocx-vtTbrlFg.js +567 -0
  95. package/dist-electron/renderer/assets/worker-C5LZNsKY.mjs +1650 -0
  96. package/dist-electron/renderer/assets/{xychartDiagram-5P7HB3ND-DF6f5m7g.js → xychartDiagram-5P7HB3ND-DwZWCBJI.js} +9 -5
  97. package/dist-electron/renderer/assets/zoom-jYhmkcQX.js +17 -0
  98. package/dist-electron/renderer/index.html +5 -2
  99. package/dist-electron/renderer/office-preview.html +19 -0
  100. package/package.json +15 -15
  101. package/dist-electron/renderer/assets/_baseUniq-D1YNIFcF.js.gz +0 -0
  102. package/dist-electron/renderer/assets/arc-Bm6fPazK.js.gz +0 -0
  103. package/dist-electron/renderer/assets/architectureDiagram-Q4EWVU46-Cj7Ijbdx.js.gz +0 -0
  104. package/dist-electron/renderer/assets/blockDiagram-DXYQGD6D-h_hfApKW.js.gz +0 -0
  105. package/dist-electron/renderer/assets/c4Diagram-AHTNJAMY-Bc9WKYcR.js.gz +0 -0
  106. package/dist-electron/renderer/assets/chunk-4TB4RGXK-wmbLtxbh.js.gz +0 -0
  107. package/dist-electron/renderer/assets/chunk-EDXVE4YY-BkuoJ9Rg.js.gz +0 -0
  108. package/dist-electron/renderer/assets/chunk-OYMX7WX6-89Cfdes5.js.gz +0 -0
  109. package/dist-electron/renderer/assets/chunk-YZCP3GAM-DlXeY35D.js.gz +0 -0
  110. package/dist-electron/renderer/assets/cose-bilkent-S5V4N54A-CXkTOxYF.js.gz +0 -0
  111. package/dist-electron/renderer/assets/cytoscape.esm-D6E6cAed.js.gz +0 -0
  112. package/dist-electron/renderer/assets/dagre-KV5264BT-CDhOvCqP.js.gz +0 -0
  113. package/dist-electron/renderer/assets/defaultLocale-B2RvLBDe.js.gz +0 -0
  114. package/dist-electron/renderer/assets/diagram-5BDNPKRD-BVi_bgHy.js.gz +0 -0
  115. package/dist-electron/renderer/assets/diagram-G4DWMVQ6-rSfxvI7w.js.gz +0 -0
  116. package/dist-electron/renderer/assets/diagram-MMDJMWI5-CQyMbB4C.js.gz +0 -0
  117. package/dist-electron/renderer/assets/diagram-TYMM5635-CTtX0t8J.js.gz +0 -0
  118. package/dist-electron/renderer/assets/erDiagram-SMLLAGMA-OPI6814M.js.gz +0 -0
  119. package/dist-electron/renderer/assets/flowDiagram-DWJPFMVM-zQ37QQ6j.js.gz +0 -0
  120. package/dist-electron/renderer/assets/ganttDiagram-T4ZO3ILL-SabGKVNy.js.gz +0 -0
  121. package/dist-electron/renderer/assets/gitGraphDiagram-UUTBAWPF-Cf76EqK-.js.gz +0 -0
  122. package/dist-electron/renderer/assets/graph-XEjbXiT4.js.gz +0 -0
  123. package/dist-electron/renderer/assets/index-CvNq2hZf.js.gz +0 -0
  124. package/dist-electron/renderer/assets/index-v7BYTcWh.css.gz +0 -0
  125. package/dist-electron/renderer/assets/ishikawaDiagram-UXIWVN3A-9ug8d1vP.js.gz +0 -0
  126. package/dist-electron/renderer/assets/journeyDiagram-VCZTEJTY-TD9rr0Yb.js.gz +0 -0
  127. package/dist-electron/renderer/assets/kanban-definition-6JOO6SKY-DbYJfuxU.js.gz +0 -0
  128. package/dist-electron/renderer/assets/katex-CYis69t2.js.gz +0 -0
  129. package/dist-electron/renderer/assets/layout-BhL6ZYG7.js.gz +0 -0
  130. package/dist-electron/renderer/assets/linear-BgmkulGp.js.gz +0 -0
  131. package/dist-electron/renderer/assets/min-Ux8OpRLr.js.gz +0 -0
  132. package/dist-electron/renderer/assets/mindmap-definition-QFDTVHPH-hafJ1k0V.js.gz +0 -0
  133. package/dist-electron/renderer/assets/ordinal-CxptdPJm.js.gz +0 -0
  134. package/dist-electron/renderer/assets/pieDiagram-DEJITSTG-Ds-EF9ih.js.gz +0 -0
  135. package/dist-electron/renderer/assets/quadrantDiagram-34T5L4WZ-w34cZgIo.js.gz +0 -0
  136. package/dist-electron/renderer/assets/requirementDiagram-MS252O5E-scA2ZKRK.js.gz +0 -0
  137. package/dist-electron/renderer/assets/sankeyDiagram-XADWPNL6-BAen7KsY.js.gz +0 -0
  138. package/dist-electron/renderer/assets/sequenceDiagram-FGHM5R23-CTs2YiIq.js.gz +0 -0
  139. package/dist-electron/renderer/assets/stateDiagram-FHFEXIEX-Bh0sWvlc.js.gz +0 -0
  140. package/dist-electron/renderer/assets/timeline-definition-GMOUNBTQ-CbeMRmLK.js.gz +0 -0
  141. package/dist-electron/renderer/assets/vennDiagram-DHZGUBPP-DJhwj_mO.js.gz +0 -0
  142. package/dist-electron/renderer/assets/wardley-RL74JXVD-DBLZJp8R.js.gz +0 -0
  143. package/dist-electron/renderer/assets/wardleyDiagram-NUSXRM2D-Cu85Zz7H.js.gz +0 -0
  144. package/dist-electron/renderer/assets/xychartDiagram-5P7HB3ND-DF6f5m7g.js.gz +0 -0
@@ -0,0 +1,3127 @@
1
+ var noop$1 = { value: () => {
2
+ } };
3
+ function dispatch() {
4
+ for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
5
+ if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
6
+ _[t] = [];
7
+ }
8
+ return new Dispatch(_);
9
+ }
10
+ function Dispatch(_) {
11
+ this._ = _;
12
+ }
13
+ function parseTypenames$1(typenames, types) {
14
+ return typenames.trim().split(/^|\s+/).map(function(t) {
15
+ var name = "", i = t.indexOf(".");
16
+ if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
17
+ if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
18
+ return { type: t, name };
19
+ });
20
+ }
21
+ Dispatch.prototype = dispatch.prototype = {
22
+ constructor: Dispatch,
23
+ on: function(typename, callback) {
24
+ var _ = this._, T = parseTypenames$1(typename + "", _), t, i = -1, n = T.length;
25
+ if (arguments.length < 2) {
26
+ while (++i < n) if ((t = (typename = T[i]).type) && (t = get$1(_[t], typename.name))) return t;
27
+ return;
28
+ }
29
+ if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
30
+ while (++i < n) {
31
+ if (t = (typename = T[i]).type) _[t] = set$1(_[t], typename.name, callback);
32
+ else if (callback == null) for (t in _) _[t] = set$1(_[t], typename.name, null);
33
+ }
34
+ return this;
35
+ },
36
+ copy: function() {
37
+ var copy = {}, _ = this._;
38
+ for (var t in _) copy[t] = _[t].slice();
39
+ return new Dispatch(copy);
40
+ },
41
+ call: function(type, that) {
42
+ if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
43
+ if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
44
+ for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
45
+ },
46
+ apply: function(type, that, args) {
47
+ if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
48
+ for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
49
+ }
50
+ };
51
+ function get$1(type, name) {
52
+ for (var i = 0, n = type.length, c; i < n; ++i) {
53
+ if ((c = type[i]).name === name) {
54
+ return c.value;
55
+ }
56
+ }
57
+ }
58
+ function set$1(type, name, callback) {
59
+ for (var i = 0, n = type.length; i < n; ++i) {
60
+ if (type[i].name === name) {
61
+ type[i] = noop$1, type = type.slice(0, i).concat(type.slice(i + 1));
62
+ break;
63
+ }
64
+ }
65
+ if (callback != null) type.push({ name, value: callback });
66
+ return type;
67
+ }
68
+ var xhtml = "http://www.w3.org/1999/xhtml";
69
+ const namespaces = {
70
+ svg: "http://www.w3.org/2000/svg",
71
+ xhtml,
72
+ xlink: "http://www.w3.org/1999/xlink",
73
+ xml: "http://www.w3.org/XML/1998/namespace",
74
+ xmlns: "http://www.w3.org/2000/xmlns/"
75
+ };
76
+ function namespace(name) {
77
+ var prefix = name += "", i = prefix.indexOf(":");
78
+ if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
79
+ return namespaces.hasOwnProperty(prefix) ? { space: namespaces[prefix], local: name } : name;
80
+ }
81
+ function creatorInherit(name) {
82
+ return function() {
83
+ var document2 = this.ownerDocument, uri = this.namespaceURI;
84
+ return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
85
+ };
86
+ }
87
+ function creatorFixed(fullname) {
88
+ return function() {
89
+ return this.ownerDocument.createElementNS(fullname.space, fullname.local);
90
+ };
91
+ }
92
+ function creator(name) {
93
+ var fullname = namespace(name);
94
+ return (fullname.local ? creatorFixed : creatorInherit)(fullname);
95
+ }
96
+ function none() {
97
+ }
98
+ function selector(selector2) {
99
+ return selector2 == null ? none : function() {
100
+ return this.querySelector(selector2);
101
+ };
102
+ }
103
+ function selection_select(select2) {
104
+ if (typeof select2 !== "function") select2 = selector(select2);
105
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
106
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
107
+ if ((node = group[i]) && (subnode = select2.call(node, node.__data__, i, group))) {
108
+ if ("__data__" in node) subnode.__data__ = node.__data__;
109
+ subgroup[i] = subnode;
110
+ }
111
+ }
112
+ }
113
+ return new Selection$1(subgroups, this._parents);
114
+ }
115
+ function array$1(x2) {
116
+ return x2 == null ? [] : Array.isArray(x2) ? x2 : Array.from(x2);
117
+ }
118
+ function empty() {
119
+ return [];
120
+ }
121
+ function selectorAll(selector2) {
122
+ return selector2 == null ? empty : function() {
123
+ return this.querySelectorAll(selector2);
124
+ };
125
+ }
126
+ function arrayAll(select2) {
127
+ return function() {
128
+ return array$1(select2.apply(this, arguments));
129
+ };
130
+ }
131
+ function selection_selectAll(select2) {
132
+ if (typeof select2 === "function") select2 = arrayAll(select2);
133
+ else select2 = selectorAll(select2);
134
+ for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
135
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
136
+ if (node = group[i]) {
137
+ subgroups.push(select2.call(node, node.__data__, i, group));
138
+ parents.push(node);
139
+ }
140
+ }
141
+ }
142
+ return new Selection$1(subgroups, parents);
143
+ }
144
+ function matcher(selector2) {
145
+ return function() {
146
+ return this.matches(selector2);
147
+ };
148
+ }
149
+ function childMatcher(selector2) {
150
+ return function(node) {
151
+ return node.matches(selector2);
152
+ };
153
+ }
154
+ var find = Array.prototype.find;
155
+ function childFind(match) {
156
+ return function() {
157
+ return find.call(this.children, match);
158
+ };
159
+ }
160
+ function childFirst() {
161
+ return this.firstElementChild;
162
+ }
163
+ function selection_selectChild(match) {
164
+ return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
165
+ }
166
+ var filter = Array.prototype.filter;
167
+ function children() {
168
+ return Array.from(this.children);
169
+ }
170
+ function childrenFilter(match) {
171
+ return function() {
172
+ return filter.call(this.children, match);
173
+ };
174
+ }
175
+ function selection_selectChildren(match) {
176
+ return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
177
+ }
178
+ function selection_filter(match) {
179
+ if (typeof match !== "function") match = matcher(match);
180
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
181
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
182
+ if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
183
+ subgroup.push(node);
184
+ }
185
+ }
186
+ }
187
+ return new Selection$1(subgroups, this._parents);
188
+ }
189
+ function sparse(update) {
190
+ return new Array(update.length);
191
+ }
192
+ function selection_enter() {
193
+ return new Selection$1(this._enter || this._groups.map(sparse), this._parents);
194
+ }
195
+ function EnterNode(parent, datum2) {
196
+ this.ownerDocument = parent.ownerDocument;
197
+ this.namespaceURI = parent.namespaceURI;
198
+ this._next = null;
199
+ this._parent = parent;
200
+ this.__data__ = datum2;
201
+ }
202
+ EnterNode.prototype = {
203
+ constructor: EnterNode,
204
+ appendChild: function(child) {
205
+ return this._parent.insertBefore(child, this._next);
206
+ },
207
+ insertBefore: function(child, next) {
208
+ return this._parent.insertBefore(child, next);
209
+ },
210
+ querySelector: function(selector2) {
211
+ return this._parent.querySelector(selector2);
212
+ },
213
+ querySelectorAll: function(selector2) {
214
+ return this._parent.querySelectorAll(selector2);
215
+ }
216
+ };
217
+ function constant$2(x2) {
218
+ return function() {
219
+ return x2;
220
+ };
221
+ }
222
+ function bindIndex(parent, group, enter, update, exit, data) {
223
+ var i = 0, node, groupLength = group.length, dataLength = data.length;
224
+ for (; i < dataLength; ++i) {
225
+ if (node = group[i]) {
226
+ node.__data__ = data[i];
227
+ update[i] = node;
228
+ } else {
229
+ enter[i] = new EnterNode(parent, data[i]);
230
+ }
231
+ }
232
+ for (; i < groupLength; ++i) {
233
+ if (node = group[i]) {
234
+ exit[i] = node;
235
+ }
236
+ }
237
+ }
238
+ function bindKey(parent, group, enter, update, exit, data, key) {
239
+ var i, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
240
+ for (i = 0; i < groupLength; ++i) {
241
+ if (node = group[i]) {
242
+ keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
243
+ if (nodeByKeyValue.has(keyValue)) {
244
+ exit[i] = node;
245
+ } else {
246
+ nodeByKeyValue.set(keyValue, node);
247
+ }
248
+ }
249
+ }
250
+ for (i = 0; i < dataLength; ++i) {
251
+ keyValue = key.call(parent, data[i], i, data) + "";
252
+ if (node = nodeByKeyValue.get(keyValue)) {
253
+ update[i] = node;
254
+ node.__data__ = data[i];
255
+ nodeByKeyValue.delete(keyValue);
256
+ } else {
257
+ enter[i] = new EnterNode(parent, data[i]);
258
+ }
259
+ }
260
+ for (i = 0; i < groupLength; ++i) {
261
+ if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) {
262
+ exit[i] = node;
263
+ }
264
+ }
265
+ }
266
+ function datum(node) {
267
+ return node.__data__;
268
+ }
269
+ function selection_data(value, key) {
270
+ if (!arguments.length) return Array.from(this, datum);
271
+ var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
272
+ if (typeof value !== "function") value = constant$2(value);
273
+ for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
274
+ var parent = parents[j], group = groups[j], groupLength = group.length, data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength);
275
+ bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
276
+ for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
277
+ if (previous = enterGroup[i0]) {
278
+ if (i0 >= i1) i1 = i0 + 1;
279
+ while (!(next = updateGroup[i1]) && ++i1 < dataLength) ;
280
+ previous._next = next || null;
281
+ }
282
+ }
283
+ }
284
+ update = new Selection$1(update, parents);
285
+ update._enter = enter;
286
+ update._exit = exit;
287
+ return update;
288
+ }
289
+ function arraylike(data) {
290
+ return typeof data === "object" && "length" in data ? data : Array.from(data);
291
+ }
292
+ function selection_exit() {
293
+ return new Selection$1(this._exit || this._groups.map(sparse), this._parents);
294
+ }
295
+ function selection_join(onenter, onupdate, onexit) {
296
+ var enter = this.enter(), update = this, exit = this.exit();
297
+ if (typeof onenter === "function") {
298
+ enter = onenter(enter);
299
+ if (enter) enter = enter.selection();
300
+ } else {
301
+ enter = enter.append(onenter + "");
302
+ }
303
+ if (onupdate != null) {
304
+ update = onupdate(update);
305
+ if (update) update = update.selection();
306
+ }
307
+ if (onexit == null) exit.remove();
308
+ else onexit(exit);
309
+ return enter && update ? enter.merge(update).order() : update;
310
+ }
311
+ function selection_merge(context) {
312
+ var selection2 = context.selection ? context.selection() : context;
313
+ for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
314
+ for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
315
+ if (node = group0[i] || group1[i]) {
316
+ merge[i] = node;
317
+ }
318
+ }
319
+ }
320
+ for (; j < m0; ++j) {
321
+ merges[j] = groups0[j];
322
+ }
323
+ return new Selection$1(merges, this._parents);
324
+ }
325
+ function selection_order() {
326
+ for (var groups = this._groups, j = -1, m = groups.length; ++j < m; ) {
327
+ for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
328
+ if (node = group[i]) {
329
+ if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
330
+ next = node;
331
+ }
332
+ }
333
+ }
334
+ return this;
335
+ }
336
+ function selection_sort(compare) {
337
+ if (!compare) compare = ascending;
338
+ function compareNode(a, b) {
339
+ return a && b ? compare(a.__data__, b.__data__) : !a - !b;
340
+ }
341
+ for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
342
+ for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
343
+ if (node = group[i]) {
344
+ sortgroup[i] = node;
345
+ }
346
+ }
347
+ sortgroup.sort(compareNode);
348
+ }
349
+ return new Selection$1(sortgroups, this._parents).order();
350
+ }
351
+ function ascending(a, b) {
352
+ return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
353
+ }
354
+ function selection_call() {
355
+ var callback = arguments[0];
356
+ arguments[0] = this;
357
+ callback.apply(null, arguments);
358
+ return this;
359
+ }
360
+ function selection_nodes() {
361
+ return Array.from(this);
362
+ }
363
+ function selection_node() {
364
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
365
+ for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
366
+ var node = group[i];
367
+ if (node) return node;
368
+ }
369
+ }
370
+ return null;
371
+ }
372
+ function selection_size() {
373
+ let size = 0;
374
+ for (const node of this) ++size;
375
+ return size;
376
+ }
377
+ function selection_empty() {
378
+ return !this.node();
379
+ }
380
+ function selection_each(callback) {
381
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
382
+ for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
383
+ if (node = group[i]) callback.call(node, node.__data__, i, group);
384
+ }
385
+ }
386
+ return this;
387
+ }
388
+ function attrRemove$1(name) {
389
+ return function() {
390
+ this.removeAttribute(name);
391
+ };
392
+ }
393
+ function attrRemoveNS$1(fullname) {
394
+ return function() {
395
+ this.removeAttributeNS(fullname.space, fullname.local);
396
+ };
397
+ }
398
+ function attrConstant$1(name, value) {
399
+ return function() {
400
+ this.setAttribute(name, value);
401
+ };
402
+ }
403
+ function attrConstantNS$1(fullname, value) {
404
+ return function() {
405
+ this.setAttributeNS(fullname.space, fullname.local, value);
406
+ };
407
+ }
408
+ function attrFunction$1(name, value) {
409
+ return function() {
410
+ var v = value.apply(this, arguments);
411
+ if (v == null) this.removeAttribute(name);
412
+ else this.setAttribute(name, v);
413
+ };
414
+ }
415
+ function attrFunctionNS$1(fullname, value) {
416
+ return function() {
417
+ var v = value.apply(this, arguments);
418
+ if (v == null) this.removeAttributeNS(fullname.space, fullname.local);
419
+ else this.setAttributeNS(fullname.space, fullname.local, v);
420
+ };
421
+ }
422
+ function selection_attr(name, value) {
423
+ var fullname = namespace(name);
424
+ if (arguments.length < 2) {
425
+ var node = this.node();
426
+ return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
427
+ }
428
+ return this.each((value == null ? fullname.local ? attrRemoveNS$1 : attrRemove$1 : typeof value === "function" ? fullname.local ? attrFunctionNS$1 : attrFunction$1 : fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, value));
429
+ }
430
+ function defaultView(node) {
431
+ return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
432
+ }
433
+ function styleRemove$1(name) {
434
+ return function() {
435
+ this.style.removeProperty(name);
436
+ };
437
+ }
438
+ function styleConstant$1(name, value, priority) {
439
+ return function() {
440
+ this.style.setProperty(name, value, priority);
441
+ };
442
+ }
443
+ function styleFunction$1(name, value, priority) {
444
+ return function() {
445
+ var v = value.apply(this, arguments);
446
+ if (v == null) this.style.removeProperty(name);
447
+ else this.style.setProperty(name, v, priority);
448
+ };
449
+ }
450
+ function selection_style(name, value, priority) {
451
+ return arguments.length > 1 ? this.each((value == null ? styleRemove$1 : typeof value === "function" ? styleFunction$1 : styleConstant$1)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
452
+ }
453
+ function styleValue(node, name) {
454
+ return node.style.getPropertyValue(name) || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
455
+ }
456
+ function propertyRemove(name) {
457
+ return function() {
458
+ delete this[name];
459
+ };
460
+ }
461
+ function propertyConstant(name, value) {
462
+ return function() {
463
+ this[name] = value;
464
+ };
465
+ }
466
+ function propertyFunction(name, value) {
467
+ return function() {
468
+ var v = value.apply(this, arguments);
469
+ if (v == null) delete this[name];
470
+ else this[name] = v;
471
+ };
472
+ }
473
+ function selection_property(name, value) {
474
+ return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
475
+ }
476
+ function classArray(string) {
477
+ return string.trim().split(/^|\s+/);
478
+ }
479
+ function classList(node) {
480
+ return node.classList || new ClassList(node);
481
+ }
482
+ function ClassList(node) {
483
+ this._node = node;
484
+ this._names = classArray(node.getAttribute("class") || "");
485
+ }
486
+ ClassList.prototype = {
487
+ add: function(name) {
488
+ var i = this._names.indexOf(name);
489
+ if (i < 0) {
490
+ this._names.push(name);
491
+ this._node.setAttribute("class", this._names.join(" "));
492
+ }
493
+ },
494
+ remove: function(name) {
495
+ var i = this._names.indexOf(name);
496
+ if (i >= 0) {
497
+ this._names.splice(i, 1);
498
+ this._node.setAttribute("class", this._names.join(" "));
499
+ }
500
+ },
501
+ contains: function(name) {
502
+ return this._names.indexOf(name) >= 0;
503
+ }
504
+ };
505
+ function classedAdd(node, names) {
506
+ var list = classList(node), i = -1, n = names.length;
507
+ while (++i < n) list.add(names[i]);
508
+ }
509
+ function classedRemove(node, names) {
510
+ var list = classList(node), i = -1, n = names.length;
511
+ while (++i < n) list.remove(names[i]);
512
+ }
513
+ function classedTrue(names) {
514
+ return function() {
515
+ classedAdd(this, names);
516
+ };
517
+ }
518
+ function classedFalse(names) {
519
+ return function() {
520
+ classedRemove(this, names);
521
+ };
522
+ }
523
+ function classedFunction(names, value) {
524
+ return function() {
525
+ (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
526
+ };
527
+ }
528
+ function selection_classed(name, value) {
529
+ var names = classArray(name + "");
530
+ if (arguments.length < 2) {
531
+ var list = classList(this.node()), i = -1, n = names.length;
532
+ while (++i < n) if (!list.contains(names[i])) return false;
533
+ return true;
534
+ }
535
+ return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
536
+ }
537
+ function textRemove() {
538
+ this.textContent = "";
539
+ }
540
+ function textConstant$1(value) {
541
+ return function() {
542
+ this.textContent = value;
543
+ };
544
+ }
545
+ function textFunction$1(value) {
546
+ return function() {
547
+ var v = value.apply(this, arguments);
548
+ this.textContent = v == null ? "" : v;
549
+ };
550
+ }
551
+ function selection_text(value) {
552
+ return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction$1 : textConstant$1)(value)) : this.node().textContent;
553
+ }
554
+ function htmlRemove() {
555
+ this.innerHTML = "";
556
+ }
557
+ function htmlConstant(value) {
558
+ return function() {
559
+ this.innerHTML = value;
560
+ };
561
+ }
562
+ function htmlFunction(value) {
563
+ return function() {
564
+ var v = value.apply(this, arguments);
565
+ this.innerHTML = v == null ? "" : v;
566
+ };
567
+ }
568
+ function selection_html(value) {
569
+ return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
570
+ }
571
+ function raise() {
572
+ if (this.nextSibling) this.parentNode.appendChild(this);
573
+ }
574
+ function selection_raise() {
575
+ return this.each(raise);
576
+ }
577
+ function lower() {
578
+ if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
579
+ }
580
+ function selection_lower() {
581
+ return this.each(lower);
582
+ }
583
+ function selection_append(name) {
584
+ var create2 = typeof name === "function" ? name : creator(name);
585
+ return this.select(function() {
586
+ return this.appendChild(create2.apply(this, arguments));
587
+ });
588
+ }
589
+ function constantNull() {
590
+ return null;
591
+ }
592
+ function selection_insert(name, before) {
593
+ var create2 = typeof name === "function" ? name : creator(name), select2 = before == null ? constantNull : typeof before === "function" ? before : selector(before);
594
+ return this.select(function() {
595
+ return this.insertBefore(create2.apply(this, arguments), select2.apply(this, arguments) || null);
596
+ });
597
+ }
598
+ function remove() {
599
+ var parent = this.parentNode;
600
+ if (parent) parent.removeChild(this);
601
+ }
602
+ function selection_remove() {
603
+ return this.each(remove);
604
+ }
605
+ function selection_cloneShallow() {
606
+ var clone = this.cloneNode(false), parent = this.parentNode;
607
+ return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
608
+ }
609
+ function selection_cloneDeep() {
610
+ var clone = this.cloneNode(true), parent = this.parentNode;
611
+ return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
612
+ }
613
+ function selection_clone(deep) {
614
+ return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
615
+ }
616
+ function selection_datum(value) {
617
+ return arguments.length ? this.property("__data__", value) : this.node().__data__;
618
+ }
619
+ function contextListener(listener) {
620
+ return function(event) {
621
+ listener.call(this, event, this.__data__);
622
+ };
623
+ }
624
+ function parseTypenames(typenames) {
625
+ return typenames.trim().split(/^|\s+/).map(function(t) {
626
+ var name = "", i = t.indexOf(".");
627
+ if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
628
+ return { type: t, name };
629
+ });
630
+ }
631
+ function onRemove(typename) {
632
+ return function() {
633
+ var on = this.__on;
634
+ if (!on) return;
635
+ for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
636
+ if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
637
+ this.removeEventListener(o.type, o.listener, o.options);
638
+ } else {
639
+ on[++i] = o;
640
+ }
641
+ }
642
+ if (++i) on.length = i;
643
+ else delete this.__on;
644
+ };
645
+ }
646
+ function onAdd(typename, value, options) {
647
+ return function() {
648
+ var on = this.__on, o, listener = contextListener(value);
649
+ if (on) for (var j = 0, m = on.length; j < m; ++j) {
650
+ if ((o = on[j]).type === typename.type && o.name === typename.name) {
651
+ this.removeEventListener(o.type, o.listener, o.options);
652
+ this.addEventListener(o.type, o.listener = listener, o.options = options);
653
+ o.value = value;
654
+ return;
655
+ }
656
+ }
657
+ this.addEventListener(typename.type, listener, options);
658
+ o = { type: typename.type, name: typename.name, value, listener, options };
659
+ if (!on) this.__on = [o];
660
+ else on.push(o);
661
+ };
662
+ }
663
+ function selection_on(typename, value, options) {
664
+ var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
665
+ if (arguments.length < 2) {
666
+ var on = this.node().__on;
667
+ if (on) for (var j = 0, m = on.length, o; j < m; ++j) {
668
+ for (i = 0, o = on[j]; i < n; ++i) {
669
+ if ((t = typenames[i]).type === o.type && t.name === o.name) {
670
+ return o.value;
671
+ }
672
+ }
673
+ }
674
+ return;
675
+ }
676
+ on = value ? onAdd : onRemove;
677
+ for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));
678
+ return this;
679
+ }
680
+ function dispatchEvent(node, type, params) {
681
+ var window2 = defaultView(node), event = window2.CustomEvent;
682
+ if (typeof event === "function") {
683
+ event = new event(type, params);
684
+ } else {
685
+ event = window2.document.createEvent("Event");
686
+ if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
687
+ else event.initEvent(type, false, false);
688
+ }
689
+ node.dispatchEvent(event);
690
+ }
691
+ function dispatchConstant(type, params) {
692
+ return function() {
693
+ return dispatchEvent(this, type, params);
694
+ };
695
+ }
696
+ function dispatchFunction(type, params) {
697
+ return function() {
698
+ return dispatchEvent(this, type, params.apply(this, arguments));
699
+ };
700
+ }
701
+ function selection_dispatch(type, params) {
702
+ return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params));
703
+ }
704
+ function* selection_iterator() {
705
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
706
+ for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
707
+ if (node = group[i]) yield node;
708
+ }
709
+ }
710
+ }
711
+ var root = [null];
712
+ function Selection$1(groups, parents) {
713
+ this._groups = groups;
714
+ this._parents = parents;
715
+ }
716
+ function selection() {
717
+ return new Selection$1([[document.documentElement]], root);
718
+ }
719
+ function selection_selection() {
720
+ return this;
721
+ }
722
+ Selection$1.prototype = selection.prototype = {
723
+ constructor: Selection$1,
724
+ select: selection_select,
725
+ selectAll: selection_selectAll,
726
+ selectChild: selection_selectChild,
727
+ selectChildren: selection_selectChildren,
728
+ filter: selection_filter,
729
+ data: selection_data,
730
+ enter: selection_enter,
731
+ exit: selection_exit,
732
+ join: selection_join,
733
+ merge: selection_merge,
734
+ selection: selection_selection,
735
+ order: selection_order,
736
+ sort: selection_sort,
737
+ call: selection_call,
738
+ nodes: selection_nodes,
739
+ node: selection_node,
740
+ size: selection_size,
741
+ empty: selection_empty,
742
+ each: selection_each,
743
+ attr: selection_attr,
744
+ style: selection_style,
745
+ property: selection_property,
746
+ classed: selection_classed,
747
+ text: selection_text,
748
+ html: selection_html,
749
+ raise: selection_raise,
750
+ lower: selection_lower,
751
+ append: selection_append,
752
+ insert: selection_insert,
753
+ remove: selection_remove,
754
+ clone: selection_clone,
755
+ datum: selection_datum,
756
+ on: selection_on,
757
+ dispatch: selection_dispatch,
758
+ [Symbol.iterator]: selection_iterator
759
+ };
760
+ function select(selector2) {
761
+ return typeof selector2 === "string" ? new Selection$1([[document.querySelector(selector2)]], [document.documentElement]) : new Selection$1([[selector2]], root);
762
+ }
763
+ function define(constructor, factory, prototype) {
764
+ constructor.prototype = factory.prototype = prototype;
765
+ prototype.constructor = constructor;
766
+ }
767
+ function extend(parent, definition) {
768
+ var prototype = Object.create(parent.prototype);
769
+ for (var key in definition) prototype[key] = definition[key];
770
+ return prototype;
771
+ }
772
+ function Color() {
773
+ }
774
+ var darker = 0.7;
775
+ var brighter = 1 / darker;
776
+ var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
777
+ var named = {
778
+ aliceblue: 15792383,
779
+ antiquewhite: 16444375,
780
+ aqua: 65535,
781
+ aquamarine: 8388564,
782
+ azure: 15794175,
783
+ beige: 16119260,
784
+ bisque: 16770244,
785
+ black: 0,
786
+ blanchedalmond: 16772045,
787
+ blue: 255,
788
+ blueviolet: 9055202,
789
+ brown: 10824234,
790
+ burlywood: 14596231,
791
+ cadetblue: 6266528,
792
+ chartreuse: 8388352,
793
+ chocolate: 13789470,
794
+ coral: 16744272,
795
+ cornflowerblue: 6591981,
796
+ cornsilk: 16775388,
797
+ crimson: 14423100,
798
+ cyan: 65535,
799
+ darkblue: 139,
800
+ darkcyan: 35723,
801
+ darkgoldenrod: 12092939,
802
+ darkgray: 11119017,
803
+ darkgreen: 25600,
804
+ darkgrey: 11119017,
805
+ darkkhaki: 12433259,
806
+ darkmagenta: 9109643,
807
+ darkolivegreen: 5597999,
808
+ darkorange: 16747520,
809
+ darkorchid: 10040012,
810
+ darkred: 9109504,
811
+ darksalmon: 15308410,
812
+ darkseagreen: 9419919,
813
+ darkslateblue: 4734347,
814
+ darkslategray: 3100495,
815
+ darkslategrey: 3100495,
816
+ darkturquoise: 52945,
817
+ darkviolet: 9699539,
818
+ deeppink: 16716947,
819
+ deepskyblue: 49151,
820
+ dimgray: 6908265,
821
+ dimgrey: 6908265,
822
+ dodgerblue: 2003199,
823
+ firebrick: 11674146,
824
+ floralwhite: 16775920,
825
+ forestgreen: 2263842,
826
+ fuchsia: 16711935,
827
+ gainsboro: 14474460,
828
+ ghostwhite: 16316671,
829
+ gold: 16766720,
830
+ goldenrod: 14329120,
831
+ gray: 8421504,
832
+ green: 32768,
833
+ greenyellow: 11403055,
834
+ grey: 8421504,
835
+ honeydew: 15794160,
836
+ hotpink: 16738740,
837
+ indianred: 13458524,
838
+ indigo: 4915330,
839
+ ivory: 16777200,
840
+ khaki: 15787660,
841
+ lavender: 15132410,
842
+ lavenderblush: 16773365,
843
+ lawngreen: 8190976,
844
+ lemonchiffon: 16775885,
845
+ lightblue: 11393254,
846
+ lightcoral: 15761536,
847
+ lightcyan: 14745599,
848
+ lightgoldenrodyellow: 16448210,
849
+ lightgray: 13882323,
850
+ lightgreen: 9498256,
851
+ lightgrey: 13882323,
852
+ lightpink: 16758465,
853
+ lightsalmon: 16752762,
854
+ lightseagreen: 2142890,
855
+ lightskyblue: 8900346,
856
+ lightslategray: 7833753,
857
+ lightslategrey: 7833753,
858
+ lightsteelblue: 11584734,
859
+ lightyellow: 16777184,
860
+ lime: 65280,
861
+ limegreen: 3329330,
862
+ linen: 16445670,
863
+ magenta: 16711935,
864
+ maroon: 8388608,
865
+ mediumaquamarine: 6737322,
866
+ mediumblue: 205,
867
+ mediumorchid: 12211667,
868
+ mediumpurple: 9662683,
869
+ mediumseagreen: 3978097,
870
+ mediumslateblue: 8087790,
871
+ mediumspringgreen: 64154,
872
+ mediumturquoise: 4772300,
873
+ mediumvioletred: 13047173,
874
+ midnightblue: 1644912,
875
+ mintcream: 16121850,
876
+ mistyrose: 16770273,
877
+ moccasin: 16770229,
878
+ navajowhite: 16768685,
879
+ navy: 128,
880
+ oldlace: 16643558,
881
+ olive: 8421376,
882
+ olivedrab: 7048739,
883
+ orange: 16753920,
884
+ orangered: 16729344,
885
+ orchid: 14315734,
886
+ palegoldenrod: 15657130,
887
+ palegreen: 10025880,
888
+ paleturquoise: 11529966,
889
+ palevioletred: 14381203,
890
+ papayawhip: 16773077,
891
+ peachpuff: 16767673,
892
+ peru: 13468991,
893
+ pink: 16761035,
894
+ plum: 14524637,
895
+ powderblue: 11591910,
896
+ purple: 8388736,
897
+ rebeccapurple: 6697881,
898
+ red: 16711680,
899
+ rosybrown: 12357519,
900
+ royalblue: 4286945,
901
+ saddlebrown: 9127187,
902
+ salmon: 16416882,
903
+ sandybrown: 16032864,
904
+ seagreen: 3050327,
905
+ seashell: 16774638,
906
+ sienna: 10506797,
907
+ silver: 12632256,
908
+ skyblue: 8900331,
909
+ slateblue: 6970061,
910
+ slategray: 7372944,
911
+ slategrey: 7372944,
912
+ snow: 16775930,
913
+ springgreen: 65407,
914
+ steelblue: 4620980,
915
+ tan: 13808780,
916
+ teal: 32896,
917
+ thistle: 14204888,
918
+ tomato: 16737095,
919
+ turquoise: 4251856,
920
+ violet: 15631086,
921
+ wheat: 16113331,
922
+ white: 16777215,
923
+ whitesmoke: 16119285,
924
+ yellow: 16776960,
925
+ yellowgreen: 10145074
926
+ };
927
+ define(Color, color, {
928
+ copy(channels) {
929
+ return Object.assign(new this.constructor(), this, channels);
930
+ },
931
+ displayable() {
932
+ return this.rgb().displayable();
933
+ },
934
+ hex: color_formatHex,
935
+ // Deprecated! Use color.formatHex.
936
+ formatHex: color_formatHex,
937
+ formatHex8: color_formatHex8,
938
+ formatHsl: color_formatHsl,
939
+ formatRgb: color_formatRgb,
940
+ toString: color_formatRgb
941
+ });
942
+ function color_formatHex() {
943
+ return this.rgb().formatHex();
944
+ }
945
+ function color_formatHex8() {
946
+ return this.rgb().formatHex8();
947
+ }
948
+ function color_formatHsl() {
949
+ return hslConvert(this).formatHsl();
950
+ }
951
+ function color_formatRgb() {
952
+ return this.rgb().formatRgb();
953
+ }
954
+ function color(format) {
955
+ var m, l;
956
+ format = (format + "").trim().toLowerCase();
957
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
958
+ }
959
+ function rgbn(n) {
960
+ return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
961
+ }
962
+ function rgba(r, g, b, a) {
963
+ if (a <= 0) r = g = b = NaN;
964
+ return new Rgb(r, g, b, a);
965
+ }
966
+ function rgbConvert(o) {
967
+ if (!(o instanceof Color)) o = color(o);
968
+ if (!o) return new Rgb();
969
+ o = o.rgb();
970
+ return new Rgb(o.r, o.g, o.b, o.opacity);
971
+ }
972
+ function rgb(r, g, b, opacity) {
973
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
974
+ }
975
+ function Rgb(r, g, b, opacity) {
976
+ this.r = +r;
977
+ this.g = +g;
978
+ this.b = +b;
979
+ this.opacity = +opacity;
980
+ }
981
+ define(Rgb, rgb, extend(Color, {
982
+ brighter(k) {
983
+ k = k == null ? brighter : Math.pow(brighter, k);
984
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
985
+ },
986
+ darker(k) {
987
+ k = k == null ? darker : Math.pow(darker, k);
988
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
989
+ },
990
+ rgb() {
991
+ return this;
992
+ },
993
+ clamp() {
994
+ return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
995
+ },
996
+ displayable() {
997
+ return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
998
+ },
999
+ hex: rgb_formatHex,
1000
+ // Deprecated! Use color.formatHex.
1001
+ formatHex: rgb_formatHex,
1002
+ formatHex8: rgb_formatHex8,
1003
+ formatRgb: rgb_formatRgb,
1004
+ toString: rgb_formatRgb
1005
+ }));
1006
+ function rgb_formatHex() {
1007
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
1008
+ }
1009
+ function rgb_formatHex8() {
1010
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1011
+ }
1012
+ function rgb_formatRgb() {
1013
+ const a = clampa(this.opacity);
1014
+ return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
1015
+ }
1016
+ function clampa(opacity) {
1017
+ return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
1018
+ }
1019
+ function clampi(value) {
1020
+ return Math.max(0, Math.min(255, Math.round(value) || 0));
1021
+ }
1022
+ function hex(value) {
1023
+ value = clampi(value);
1024
+ return (value < 16 ? "0" : "") + value.toString(16);
1025
+ }
1026
+ function hsla(h, s, l, a) {
1027
+ if (a <= 0) h = s = l = NaN;
1028
+ else if (l <= 0 || l >= 1) h = s = NaN;
1029
+ else if (s <= 0) h = NaN;
1030
+ return new Hsl(h, s, l, a);
1031
+ }
1032
+ function hslConvert(o) {
1033
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
1034
+ if (!(o instanceof Color)) o = color(o);
1035
+ if (!o) return new Hsl();
1036
+ if (o instanceof Hsl) return o;
1037
+ o = o.rgb();
1038
+ var r = o.r / 255, g = o.g / 255, b = o.b / 255, min2 = Math.min(r, g, b), max2 = Math.max(r, g, b), h = NaN, s = max2 - min2, l = (max2 + min2) / 2;
1039
+ if (s) {
1040
+ if (r === max2) h = (g - b) / s + (g < b) * 6;
1041
+ else if (g === max2) h = (b - r) / s + 2;
1042
+ else h = (r - g) / s + 4;
1043
+ s /= l < 0.5 ? max2 + min2 : 2 - max2 - min2;
1044
+ h *= 60;
1045
+ } else {
1046
+ s = l > 0 && l < 1 ? 0 : h;
1047
+ }
1048
+ return new Hsl(h, s, l, o.opacity);
1049
+ }
1050
+ function hsl(h, s, l, opacity) {
1051
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
1052
+ }
1053
+ function Hsl(h, s, l, opacity) {
1054
+ this.h = +h;
1055
+ this.s = +s;
1056
+ this.l = +l;
1057
+ this.opacity = +opacity;
1058
+ }
1059
+ define(Hsl, hsl, extend(Color, {
1060
+ brighter(k) {
1061
+ k = k == null ? brighter : Math.pow(brighter, k);
1062
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
1063
+ },
1064
+ darker(k) {
1065
+ k = k == null ? darker : Math.pow(darker, k);
1066
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
1067
+ },
1068
+ rgb() {
1069
+ var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
1070
+ return new Rgb(
1071
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
1072
+ hsl2rgb(h, m1, m2),
1073
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
1074
+ this.opacity
1075
+ );
1076
+ },
1077
+ clamp() {
1078
+ return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
1079
+ },
1080
+ displayable() {
1081
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
1082
+ },
1083
+ formatHsl() {
1084
+ const a = clampa(this.opacity);
1085
+ return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
1086
+ }
1087
+ }));
1088
+ function clamph(value) {
1089
+ value = (value || 0) % 360;
1090
+ return value < 0 ? value + 360 : value;
1091
+ }
1092
+ function clampt(value) {
1093
+ return Math.max(0, Math.min(1, value || 0));
1094
+ }
1095
+ function hsl2rgb(h, m1, m2) {
1096
+ return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
1097
+ }
1098
+ const constant$1 = (x2) => () => x2;
1099
+ function linear(a, d) {
1100
+ return function(t) {
1101
+ return a + t * d;
1102
+ };
1103
+ }
1104
+ function exponential(a, b, y2) {
1105
+ return a = Math.pow(a, y2), b = Math.pow(b, y2) - a, y2 = 1 / y2, function(t) {
1106
+ return Math.pow(a + t * b, y2);
1107
+ };
1108
+ }
1109
+ function hue(a, b) {
1110
+ var d = b - a;
1111
+ return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant$1(isNaN(a) ? b : a);
1112
+ }
1113
+ function gamma(y2) {
1114
+ return (y2 = +y2) === 1 ? nogamma : function(a, b) {
1115
+ return b - a ? exponential(a, b, y2) : constant$1(isNaN(a) ? b : a);
1116
+ };
1117
+ }
1118
+ function nogamma(a, b) {
1119
+ var d = b - a;
1120
+ return d ? linear(a, d) : constant$1(isNaN(a) ? b : a);
1121
+ }
1122
+ const interpolateRgb = (function rgbGamma(y2) {
1123
+ var color2 = gamma(y2);
1124
+ function rgb$1(start2, end) {
1125
+ var r = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
1126
+ return function(t) {
1127
+ start2.r = r(t);
1128
+ start2.g = g(t);
1129
+ start2.b = b(t);
1130
+ start2.opacity = opacity(t);
1131
+ return start2 + "";
1132
+ };
1133
+ }
1134
+ rgb$1.gamma = rgbGamma;
1135
+ return rgb$1;
1136
+ })(1);
1137
+ function interpolateNumber(a, b) {
1138
+ return a = +a, b = +b, function(t) {
1139
+ return a * (1 - t) + b * t;
1140
+ };
1141
+ }
1142
+ var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
1143
+ function zero(b) {
1144
+ return function() {
1145
+ return b;
1146
+ };
1147
+ }
1148
+ function one(b) {
1149
+ return function(t) {
1150
+ return b(t) + "";
1151
+ };
1152
+ }
1153
+ function interpolateString(a, b) {
1154
+ var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
1155
+ a = a + "", b = b + "";
1156
+ while ((am = reA.exec(a)) && (bm = reB.exec(b))) {
1157
+ if ((bs = bm.index) > bi) {
1158
+ bs = b.slice(bi, bs);
1159
+ if (s[i]) s[i] += bs;
1160
+ else s[++i] = bs;
1161
+ }
1162
+ if ((am = am[0]) === (bm = bm[0])) {
1163
+ if (s[i]) s[i] += bm;
1164
+ else s[++i] = bm;
1165
+ } else {
1166
+ s[++i] = null;
1167
+ q.push({ i, x: interpolateNumber(am, bm) });
1168
+ }
1169
+ bi = reB.lastIndex;
1170
+ }
1171
+ if (bi < b.length) {
1172
+ bs = b.slice(bi);
1173
+ if (s[i]) s[i] += bs;
1174
+ else s[++i] = bs;
1175
+ }
1176
+ return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
1177
+ for (var i2 = 0, o; i2 < b; ++i2) s[(o = q[i2]).i] = o.x(t);
1178
+ return s.join("");
1179
+ });
1180
+ }
1181
+ var degrees = 180 / Math.PI;
1182
+ var identity$1 = {
1183
+ translateX: 0,
1184
+ translateY: 0,
1185
+ rotate: 0,
1186
+ skewX: 0,
1187
+ scaleX: 1,
1188
+ scaleY: 1
1189
+ };
1190
+ function decompose(a, b, c, d, e, f) {
1191
+ var scaleX, scaleY, skewX;
1192
+ if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
1193
+ if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
1194
+ if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
1195
+ if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
1196
+ return {
1197
+ translateX: e,
1198
+ translateY: f,
1199
+ rotate: Math.atan2(b, a) * degrees,
1200
+ skewX: Math.atan(skewX) * degrees,
1201
+ scaleX,
1202
+ scaleY
1203
+ };
1204
+ }
1205
+ var svgNode;
1206
+ function parseCss(value) {
1207
+ const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
1208
+ return m.isIdentity ? identity$1 : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
1209
+ }
1210
+ function parseSvg(value) {
1211
+ if (value == null) return identity$1;
1212
+ if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
1213
+ svgNode.setAttribute("transform", value);
1214
+ if (!(value = svgNode.transform.baseVal.consolidate())) return identity$1;
1215
+ value = value.matrix;
1216
+ return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
1217
+ }
1218
+ function interpolateTransform(parse, pxComma, pxParen, degParen) {
1219
+ function pop(s) {
1220
+ return s.length ? s.pop() + " " : "";
1221
+ }
1222
+ function translate(xa, ya, xb, yb, s, q) {
1223
+ if (xa !== xb || ya !== yb) {
1224
+ var i = s.push("translate(", null, pxComma, null, pxParen);
1225
+ q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
1226
+ } else if (xb || yb) {
1227
+ s.push("translate(" + xb + pxComma + yb + pxParen);
1228
+ }
1229
+ }
1230
+ function rotate(a, b, s, q) {
1231
+ if (a !== b) {
1232
+ if (a - b > 180) b += 360;
1233
+ else if (b - a > 180) a += 360;
1234
+ q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) });
1235
+ } else if (b) {
1236
+ s.push(pop(s) + "rotate(" + b + degParen);
1237
+ }
1238
+ }
1239
+ function skewX(a, b, s, q) {
1240
+ if (a !== b) {
1241
+ q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) });
1242
+ } else if (b) {
1243
+ s.push(pop(s) + "skewX(" + b + degParen);
1244
+ }
1245
+ }
1246
+ function scale(xa, ya, xb, yb, s, q) {
1247
+ if (xa !== xb || ya !== yb) {
1248
+ var i = s.push(pop(s) + "scale(", null, ",", null, ")");
1249
+ q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
1250
+ } else if (xb !== 1 || yb !== 1) {
1251
+ s.push(pop(s) + "scale(" + xb + "," + yb + ")");
1252
+ }
1253
+ }
1254
+ return function(a, b) {
1255
+ var s = [], q = [];
1256
+ a = parse(a), b = parse(b);
1257
+ translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
1258
+ rotate(a.rotate, b.rotate, s, q);
1259
+ skewX(a.skewX, b.skewX, s, q);
1260
+ scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
1261
+ a = b = null;
1262
+ return function(t) {
1263
+ var i = -1, n = q.length, o;
1264
+ while (++i < n) s[(o = q[i]).i] = o.x(t);
1265
+ return s.join("");
1266
+ };
1267
+ };
1268
+ }
1269
+ var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
1270
+ var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
1271
+ var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance === "object" && performance.now ? performance : Date, setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
1272
+ setTimeout(f, 17);
1273
+ };
1274
+ function now() {
1275
+ return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
1276
+ }
1277
+ function clearNow() {
1278
+ clockNow = 0;
1279
+ }
1280
+ function Timer() {
1281
+ this._call = this._time = this._next = null;
1282
+ }
1283
+ Timer.prototype = timer.prototype = {
1284
+ constructor: Timer,
1285
+ restart: function(callback, delay, time) {
1286
+ if (typeof callback !== "function") throw new TypeError("callback is not a function");
1287
+ time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
1288
+ if (!this._next && taskTail !== this) {
1289
+ if (taskTail) taskTail._next = this;
1290
+ else taskHead = this;
1291
+ taskTail = this;
1292
+ }
1293
+ this._call = callback;
1294
+ this._time = time;
1295
+ sleep();
1296
+ },
1297
+ stop: function() {
1298
+ if (this._call) {
1299
+ this._call = null;
1300
+ this._time = Infinity;
1301
+ sleep();
1302
+ }
1303
+ }
1304
+ };
1305
+ function timer(callback, delay, time) {
1306
+ var t = new Timer();
1307
+ t.restart(callback, delay, time);
1308
+ return t;
1309
+ }
1310
+ function timerFlush() {
1311
+ now();
1312
+ ++frame;
1313
+ var t = taskHead, e;
1314
+ while (t) {
1315
+ if ((e = clockNow - t._time) >= 0) t._call.call(void 0, e);
1316
+ t = t._next;
1317
+ }
1318
+ --frame;
1319
+ }
1320
+ function wake() {
1321
+ clockNow = (clockLast = clock.now()) + clockSkew;
1322
+ frame = timeout$1 = 0;
1323
+ try {
1324
+ timerFlush();
1325
+ } finally {
1326
+ frame = 0;
1327
+ nap();
1328
+ clockNow = 0;
1329
+ }
1330
+ }
1331
+ function poke() {
1332
+ var now2 = clock.now(), delay = now2 - clockLast;
1333
+ if (delay > pokeDelay) clockSkew -= delay, clockLast = now2;
1334
+ }
1335
+ function nap() {
1336
+ var t0, t1 = taskHead, t2, time = Infinity;
1337
+ while (t1) {
1338
+ if (t1._call) {
1339
+ if (time > t1._time) time = t1._time;
1340
+ t0 = t1, t1 = t1._next;
1341
+ } else {
1342
+ t2 = t1._next, t1._next = null;
1343
+ t1 = t0 ? t0._next = t2 : taskHead = t2;
1344
+ }
1345
+ }
1346
+ taskTail = t0;
1347
+ sleep(time);
1348
+ }
1349
+ function sleep(time) {
1350
+ if (frame) return;
1351
+ if (timeout$1) timeout$1 = clearTimeout(timeout$1);
1352
+ var delay = time - clockNow;
1353
+ if (delay > 24) {
1354
+ if (time < Infinity) timeout$1 = setTimeout(wake, time - clock.now() - clockSkew);
1355
+ if (interval) interval = clearInterval(interval);
1356
+ } else {
1357
+ if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
1358
+ frame = 1, setFrame(wake);
1359
+ }
1360
+ }
1361
+ function timeout(callback, delay, time) {
1362
+ var t = new Timer();
1363
+ delay = delay == null ? 0 : +delay;
1364
+ t.restart((elapsed) => {
1365
+ t.stop();
1366
+ callback(elapsed + delay);
1367
+ }, delay, time);
1368
+ return t;
1369
+ }
1370
+ var emptyOn = dispatch("start", "end", "cancel", "interrupt");
1371
+ var emptyTween = [];
1372
+ var CREATED = 0;
1373
+ var SCHEDULED = 1;
1374
+ var STARTING = 2;
1375
+ var STARTED = 3;
1376
+ var RUNNING = 4;
1377
+ var ENDING = 5;
1378
+ var ENDED = 6;
1379
+ function schedule(node, name, id2, index, group, timing) {
1380
+ var schedules = node.__transition;
1381
+ if (!schedules) node.__transition = {};
1382
+ else if (id2 in schedules) return;
1383
+ create(node, id2, {
1384
+ name,
1385
+ index,
1386
+ // For context during callback.
1387
+ group,
1388
+ // For context during callback.
1389
+ on: emptyOn,
1390
+ tween: emptyTween,
1391
+ time: timing.time,
1392
+ delay: timing.delay,
1393
+ duration: timing.duration,
1394
+ ease: timing.ease,
1395
+ timer: null,
1396
+ state: CREATED
1397
+ });
1398
+ }
1399
+ function init(node, id2) {
1400
+ var schedule2 = get(node, id2);
1401
+ if (schedule2.state > CREATED) throw new Error("too late; already scheduled");
1402
+ return schedule2;
1403
+ }
1404
+ function set(node, id2) {
1405
+ var schedule2 = get(node, id2);
1406
+ if (schedule2.state > STARTED) throw new Error("too late; already running");
1407
+ return schedule2;
1408
+ }
1409
+ function get(node, id2) {
1410
+ var schedule2 = node.__transition;
1411
+ if (!schedule2 || !(schedule2 = schedule2[id2])) throw new Error("transition not found");
1412
+ return schedule2;
1413
+ }
1414
+ function create(node, id2, self) {
1415
+ var schedules = node.__transition, tween;
1416
+ schedules[id2] = self;
1417
+ self.timer = timer(schedule2, 0, self.time);
1418
+ function schedule2(elapsed) {
1419
+ self.state = SCHEDULED;
1420
+ self.timer.restart(start2, self.delay, self.time);
1421
+ if (self.delay <= elapsed) start2(elapsed - self.delay);
1422
+ }
1423
+ function start2(elapsed) {
1424
+ var i, j, n, o;
1425
+ if (self.state !== SCHEDULED) return stop();
1426
+ for (i in schedules) {
1427
+ o = schedules[i];
1428
+ if (o.name !== self.name) continue;
1429
+ if (o.state === STARTED) return timeout(start2);
1430
+ if (o.state === RUNNING) {
1431
+ o.state = ENDED;
1432
+ o.timer.stop();
1433
+ o.on.call("interrupt", node, node.__data__, o.index, o.group);
1434
+ delete schedules[i];
1435
+ } else if (+i < id2) {
1436
+ o.state = ENDED;
1437
+ o.timer.stop();
1438
+ o.on.call("cancel", node, node.__data__, o.index, o.group);
1439
+ delete schedules[i];
1440
+ }
1441
+ }
1442
+ timeout(function() {
1443
+ if (self.state === STARTED) {
1444
+ self.state = RUNNING;
1445
+ self.timer.restart(tick, self.delay, self.time);
1446
+ tick(elapsed);
1447
+ }
1448
+ });
1449
+ self.state = STARTING;
1450
+ self.on.call("start", node, node.__data__, self.index, self.group);
1451
+ if (self.state !== STARTING) return;
1452
+ self.state = STARTED;
1453
+ tween = new Array(n = self.tween.length);
1454
+ for (i = 0, j = -1; i < n; ++i) {
1455
+ if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
1456
+ tween[++j] = o;
1457
+ }
1458
+ }
1459
+ tween.length = j + 1;
1460
+ }
1461
+ function tick(elapsed) {
1462
+ var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), i = -1, n = tween.length;
1463
+ while (++i < n) {
1464
+ tween[i].call(node, t);
1465
+ }
1466
+ if (self.state === ENDING) {
1467
+ self.on.call("end", node, node.__data__, self.index, self.group);
1468
+ stop();
1469
+ }
1470
+ }
1471
+ function stop() {
1472
+ self.state = ENDED;
1473
+ self.timer.stop();
1474
+ delete schedules[id2];
1475
+ for (var i in schedules) return;
1476
+ delete node.__transition;
1477
+ }
1478
+ }
1479
+ function interrupt(node, name) {
1480
+ var schedules = node.__transition, schedule2, active, empty2 = true, i;
1481
+ if (!schedules) return;
1482
+ name = name == null ? null : name + "";
1483
+ for (i in schedules) {
1484
+ if ((schedule2 = schedules[i]).name !== name) {
1485
+ empty2 = false;
1486
+ continue;
1487
+ }
1488
+ active = schedule2.state > STARTING && schedule2.state < ENDING;
1489
+ schedule2.state = ENDED;
1490
+ schedule2.timer.stop();
1491
+ schedule2.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule2.index, schedule2.group);
1492
+ delete schedules[i];
1493
+ }
1494
+ if (empty2) delete node.__transition;
1495
+ }
1496
+ function selection_interrupt(name) {
1497
+ return this.each(function() {
1498
+ interrupt(this, name);
1499
+ });
1500
+ }
1501
+ function tweenRemove(id2, name) {
1502
+ var tween0, tween1;
1503
+ return function() {
1504
+ var schedule2 = set(this, id2), tween = schedule2.tween;
1505
+ if (tween !== tween0) {
1506
+ tween1 = tween0 = tween;
1507
+ for (var i = 0, n = tween1.length; i < n; ++i) {
1508
+ if (tween1[i].name === name) {
1509
+ tween1 = tween1.slice();
1510
+ tween1.splice(i, 1);
1511
+ break;
1512
+ }
1513
+ }
1514
+ }
1515
+ schedule2.tween = tween1;
1516
+ };
1517
+ }
1518
+ function tweenFunction(id2, name, value) {
1519
+ var tween0, tween1;
1520
+ if (typeof value !== "function") throw new Error();
1521
+ return function() {
1522
+ var schedule2 = set(this, id2), tween = schedule2.tween;
1523
+ if (tween !== tween0) {
1524
+ tween1 = (tween0 = tween).slice();
1525
+ for (var t = { name, value }, i = 0, n = tween1.length; i < n; ++i) {
1526
+ if (tween1[i].name === name) {
1527
+ tween1[i] = t;
1528
+ break;
1529
+ }
1530
+ }
1531
+ if (i === n) tween1.push(t);
1532
+ }
1533
+ schedule2.tween = tween1;
1534
+ };
1535
+ }
1536
+ function transition_tween(name, value) {
1537
+ var id2 = this._id;
1538
+ name += "";
1539
+ if (arguments.length < 2) {
1540
+ var tween = get(this.node(), id2).tween;
1541
+ for (var i = 0, n = tween.length, t; i < n; ++i) {
1542
+ if ((t = tween[i]).name === name) {
1543
+ return t.value;
1544
+ }
1545
+ }
1546
+ return null;
1547
+ }
1548
+ return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
1549
+ }
1550
+ function tweenValue(transition2, name, value) {
1551
+ var id2 = transition2._id;
1552
+ transition2.each(function() {
1553
+ var schedule2 = set(this, id2);
1554
+ (schedule2.value || (schedule2.value = {}))[name] = value.apply(this, arguments);
1555
+ });
1556
+ return function(node) {
1557
+ return get(node, id2).value[name];
1558
+ };
1559
+ }
1560
+ function interpolate(a, b) {
1561
+ var c;
1562
+ return (typeof b === "number" ? interpolateNumber : b instanceof color ? interpolateRgb : (c = color(b)) ? (b = c, interpolateRgb) : interpolateString)(a, b);
1563
+ }
1564
+ function attrRemove(name) {
1565
+ return function() {
1566
+ this.removeAttribute(name);
1567
+ };
1568
+ }
1569
+ function attrRemoveNS(fullname) {
1570
+ return function() {
1571
+ this.removeAttributeNS(fullname.space, fullname.local);
1572
+ };
1573
+ }
1574
+ function attrConstant(name, interpolate2, value1) {
1575
+ var string00, string1 = value1 + "", interpolate0;
1576
+ return function() {
1577
+ var string0 = this.getAttribute(name);
1578
+ return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
1579
+ };
1580
+ }
1581
+ function attrConstantNS(fullname, interpolate2, value1) {
1582
+ var string00, string1 = value1 + "", interpolate0;
1583
+ return function() {
1584
+ var string0 = this.getAttributeNS(fullname.space, fullname.local);
1585
+ return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
1586
+ };
1587
+ }
1588
+ function attrFunction(name, interpolate2, value) {
1589
+ var string00, string10, interpolate0;
1590
+ return function() {
1591
+ var string0, value1 = value(this), string1;
1592
+ if (value1 == null) return void this.removeAttribute(name);
1593
+ string0 = this.getAttribute(name);
1594
+ string1 = value1 + "";
1595
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
1596
+ };
1597
+ }
1598
+ function attrFunctionNS(fullname, interpolate2, value) {
1599
+ var string00, string10, interpolate0;
1600
+ return function() {
1601
+ var string0, value1 = value(this), string1;
1602
+ if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
1603
+ string0 = this.getAttributeNS(fullname.space, fullname.local);
1604
+ string1 = value1 + "";
1605
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
1606
+ };
1607
+ }
1608
+ function transition_attr(name, value) {
1609
+ var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
1610
+ return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));
1611
+ }
1612
+ function attrInterpolate(name, i) {
1613
+ return function(t) {
1614
+ this.setAttribute(name, i.call(this, t));
1615
+ };
1616
+ }
1617
+ function attrInterpolateNS(fullname, i) {
1618
+ return function(t) {
1619
+ this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
1620
+ };
1621
+ }
1622
+ function attrTweenNS(fullname, value) {
1623
+ var t0, i0;
1624
+ function tween() {
1625
+ var i = value.apply(this, arguments);
1626
+ if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
1627
+ return t0;
1628
+ }
1629
+ tween._value = value;
1630
+ return tween;
1631
+ }
1632
+ function attrTween(name, value) {
1633
+ var t0, i0;
1634
+ function tween() {
1635
+ var i = value.apply(this, arguments);
1636
+ if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
1637
+ return t0;
1638
+ }
1639
+ tween._value = value;
1640
+ return tween;
1641
+ }
1642
+ function transition_attrTween(name, value) {
1643
+ var key = "attr." + name;
1644
+ if (arguments.length < 2) return (key = this.tween(key)) && key._value;
1645
+ if (value == null) return this.tween(key, null);
1646
+ if (typeof value !== "function") throw new Error();
1647
+ var fullname = namespace(name);
1648
+ return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
1649
+ }
1650
+ function delayFunction(id2, value) {
1651
+ return function() {
1652
+ init(this, id2).delay = +value.apply(this, arguments);
1653
+ };
1654
+ }
1655
+ function delayConstant(id2, value) {
1656
+ return value = +value, function() {
1657
+ init(this, id2).delay = value;
1658
+ };
1659
+ }
1660
+ function transition_delay(value) {
1661
+ var id2 = this._id;
1662
+ return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get(this.node(), id2).delay;
1663
+ }
1664
+ function durationFunction(id2, value) {
1665
+ return function() {
1666
+ set(this, id2).duration = +value.apply(this, arguments);
1667
+ };
1668
+ }
1669
+ function durationConstant(id2, value) {
1670
+ return value = +value, function() {
1671
+ set(this, id2).duration = value;
1672
+ };
1673
+ }
1674
+ function transition_duration(value) {
1675
+ var id2 = this._id;
1676
+ return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get(this.node(), id2).duration;
1677
+ }
1678
+ function easeConstant(id2, value) {
1679
+ if (typeof value !== "function") throw new Error();
1680
+ return function() {
1681
+ set(this, id2).ease = value;
1682
+ };
1683
+ }
1684
+ function transition_ease(value) {
1685
+ var id2 = this._id;
1686
+ return arguments.length ? this.each(easeConstant(id2, value)) : get(this.node(), id2).ease;
1687
+ }
1688
+ function easeVarying(id2, value) {
1689
+ return function() {
1690
+ var v = value.apply(this, arguments);
1691
+ if (typeof v !== "function") throw new Error();
1692
+ set(this, id2).ease = v;
1693
+ };
1694
+ }
1695
+ function transition_easeVarying(value) {
1696
+ if (typeof value !== "function") throw new Error();
1697
+ return this.each(easeVarying(this._id, value));
1698
+ }
1699
+ function transition_filter(match) {
1700
+ if (typeof match !== "function") match = matcher(match);
1701
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
1702
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
1703
+ if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
1704
+ subgroup.push(node);
1705
+ }
1706
+ }
1707
+ }
1708
+ return new Transition(subgroups, this._parents, this._name, this._id);
1709
+ }
1710
+ function transition_merge(transition2) {
1711
+ if (transition2._id !== this._id) throw new Error();
1712
+ for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
1713
+ for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
1714
+ if (node = group0[i] || group1[i]) {
1715
+ merge[i] = node;
1716
+ }
1717
+ }
1718
+ }
1719
+ for (; j < m0; ++j) {
1720
+ merges[j] = groups0[j];
1721
+ }
1722
+ return new Transition(merges, this._parents, this._name, this._id);
1723
+ }
1724
+ function start(name) {
1725
+ return (name + "").trim().split(/^|\s+/).every(function(t) {
1726
+ var i = t.indexOf(".");
1727
+ if (i >= 0) t = t.slice(0, i);
1728
+ return !t || t === "start";
1729
+ });
1730
+ }
1731
+ function onFunction(id2, name, listener) {
1732
+ var on0, on1, sit = start(name) ? init : set;
1733
+ return function() {
1734
+ var schedule2 = sit(this, id2), on = schedule2.on;
1735
+ if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
1736
+ schedule2.on = on1;
1737
+ };
1738
+ }
1739
+ function transition_on(name, listener) {
1740
+ var id2 = this._id;
1741
+ return arguments.length < 2 ? get(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
1742
+ }
1743
+ function removeFunction(id2) {
1744
+ return function() {
1745
+ var parent = this.parentNode;
1746
+ for (var i in this.__transition) if (+i !== id2) return;
1747
+ if (parent) parent.removeChild(this);
1748
+ };
1749
+ }
1750
+ function transition_remove() {
1751
+ return this.on("end.remove", removeFunction(this._id));
1752
+ }
1753
+ function transition_select(select2) {
1754
+ var name = this._name, id2 = this._id;
1755
+ if (typeof select2 !== "function") select2 = selector(select2);
1756
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
1757
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
1758
+ if ((node = group[i]) && (subnode = select2.call(node, node.__data__, i, group))) {
1759
+ if ("__data__" in node) subnode.__data__ = node.__data__;
1760
+ subgroup[i] = subnode;
1761
+ schedule(subgroup[i], name, id2, i, subgroup, get(node, id2));
1762
+ }
1763
+ }
1764
+ }
1765
+ return new Transition(subgroups, this._parents, name, id2);
1766
+ }
1767
+ function transition_selectAll(select2) {
1768
+ var name = this._name, id2 = this._id;
1769
+ if (typeof select2 !== "function") select2 = selectorAll(select2);
1770
+ for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
1771
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
1772
+ if (node = group[i]) {
1773
+ for (var children2 = select2.call(node, node.__data__, i, group), child, inherit2 = get(node, id2), k = 0, l = children2.length; k < l; ++k) {
1774
+ if (child = children2[k]) {
1775
+ schedule(child, name, id2, k, children2, inherit2);
1776
+ }
1777
+ }
1778
+ subgroups.push(children2);
1779
+ parents.push(node);
1780
+ }
1781
+ }
1782
+ }
1783
+ return new Transition(subgroups, parents, name, id2);
1784
+ }
1785
+ var Selection = selection.prototype.constructor;
1786
+ function transition_selection() {
1787
+ return new Selection(this._groups, this._parents);
1788
+ }
1789
+ function styleNull(name, interpolate2) {
1790
+ var string00, string10, interpolate0;
1791
+ return function() {
1792
+ var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
1793
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, string10 = string1);
1794
+ };
1795
+ }
1796
+ function styleRemove(name) {
1797
+ return function() {
1798
+ this.style.removeProperty(name);
1799
+ };
1800
+ }
1801
+ function styleConstant(name, interpolate2, value1) {
1802
+ var string00, string1 = value1 + "", interpolate0;
1803
+ return function() {
1804
+ var string0 = styleValue(this, name);
1805
+ return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
1806
+ };
1807
+ }
1808
+ function styleFunction(name, interpolate2, value) {
1809
+ var string00, string10, interpolate0;
1810
+ return function() {
1811
+ var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
1812
+ if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
1813
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
1814
+ };
1815
+ }
1816
+ function styleMaybeRemove(id2, name) {
1817
+ var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
1818
+ return function() {
1819
+ var schedule2 = set(this, id2), on = schedule2.on, listener = schedule2.value[key] == null ? remove2 || (remove2 = styleRemove(name)) : void 0;
1820
+ if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);
1821
+ schedule2.on = on1;
1822
+ };
1823
+ }
1824
+ function transition_style(name, value, priority) {
1825
+ var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
1826
+ return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove(name)) : typeof value === "function" ? this.styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant(name, i, value), priority).on("end.style." + name, null);
1827
+ }
1828
+ function styleInterpolate(name, i, priority) {
1829
+ return function(t) {
1830
+ this.style.setProperty(name, i.call(this, t), priority);
1831
+ };
1832
+ }
1833
+ function styleTween(name, value, priority) {
1834
+ var t, i0;
1835
+ function tween() {
1836
+ var i = value.apply(this, arguments);
1837
+ if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);
1838
+ return t;
1839
+ }
1840
+ tween._value = value;
1841
+ return tween;
1842
+ }
1843
+ function transition_styleTween(name, value, priority) {
1844
+ var key = "style." + (name += "");
1845
+ if (arguments.length < 2) return (key = this.tween(key)) && key._value;
1846
+ if (value == null) return this.tween(key, null);
1847
+ if (typeof value !== "function") throw new Error();
1848
+ return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
1849
+ }
1850
+ function textConstant(value) {
1851
+ return function() {
1852
+ this.textContent = value;
1853
+ };
1854
+ }
1855
+ function textFunction(value) {
1856
+ return function() {
1857
+ var value1 = value(this);
1858
+ this.textContent = value1 == null ? "" : value1;
1859
+ };
1860
+ }
1861
+ function transition_text(value) {
1862
+ return this.tween("text", typeof value === "function" ? textFunction(tweenValue(this, "text", value)) : textConstant(value == null ? "" : value + ""));
1863
+ }
1864
+ function textInterpolate(i) {
1865
+ return function(t) {
1866
+ this.textContent = i.call(this, t);
1867
+ };
1868
+ }
1869
+ function textTween(value) {
1870
+ var t0, i0;
1871
+ function tween() {
1872
+ var i = value.apply(this, arguments);
1873
+ if (i !== i0) t0 = (i0 = i) && textInterpolate(i);
1874
+ return t0;
1875
+ }
1876
+ tween._value = value;
1877
+ return tween;
1878
+ }
1879
+ function transition_textTween(value) {
1880
+ var key = "text";
1881
+ if (arguments.length < 1) return (key = this.tween(key)) && key._value;
1882
+ if (value == null) return this.tween(key, null);
1883
+ if (typeof value !== "function") throw new Error();
1884
+ return this.tween(key, textTween(value));
1885
+ }
1886
+ function transition_transition() {
1887
+ var name = this._name, id0 = this._id, id1 = newId();
1888
+ for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
1889
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
1890
+ if (node = group[i]) {
1891
+ var inherit2 = get(node, id0);
1892
+ schedule(node, name, id1, i, group, {
1893
+ time: inherit2.time + inherit2.delay + inherit2.duration,
1894
+ delay: 0,
1895
+ duration: inherit2.duration,
1896
+ ease: inherit2.ease
1897
+ });
1898
+ }
1899
+ }
1900
+ }
1901
+ return new Transition(groups, this._parents, name, id1);
1902
+ }
1903
+ function transition_end() {
1904
+ var on0, on1, that = this, id2 = that._id, size = that.size();
1905
+ return new Promise(function(resolve, reject) {
1906
+ var cancel = { value: reject }, end = { value: function() {
1907
+ if (--size === 0) resolve();
1908
+ } };
1909
+ that.each(function() {
1910
+ var schedule2 = set(this, id2), on = schedule2.on;
1911
+ if (on !== on0) {
1912
+ on1 = (on0 = on).copy();
1913
+ on1._.cancel.push(cancel);
1914
+ on1._.interrupt.push(cancel);
1915
+ on1._.end.push(end);
1916
+ }
1917
+ schedule2.on = on1;
1918
+ });
1919
+ if (size === 0) resolve();
1920
+ });
1921
+ }
1922
+ var id = 0;
1923
+ function Transition(groups, parents, name, id2) {
1924
+ this._groups = groups;
1925
+ this._parents = parents;
1926
+ this._name = name;
1927
+ this._id = id2;
1928
+ }
1929
+ function transition(name) {
1930
+ return selection().transition(name);
1931
+ }
1932
+ function newId() {
1933
+ return ++id;
1934
+ }
1935
+ var selection_prototype = selection.prototype;
1936
+ Transition.prototype = transition.prototype = {
1937
+ constructor: Transition,
1938
+ select: transition_select,
1939
+ selectAll: transition_selectAll,
1940
+ selectChild: selection_prototype.selectChild,
1941
+ selectChildren: selection_prototype.selectChildren,
1942
+ filter: transition_filter,
1943
+ merge: transition_merge,
1944
+ selection: transition_selection,
1945
+ transition: transition_transition,
1946
+ call: selection_prototype.call,
1947
+ nodes: selection_prototype.nodes,
1948
+ node: selection_prototype.node,
1949
+ size: selection_prototype.size,
1950
+ empty: selection_prototype.empty,
1951
+ each: selection_prototype.each,
1952
+ on: transition_on,
1953
+ attr: transition_attr,
1954
+ attrTween: transition_attrTween,
1955
+ style: transition_style,
1956
+ styleTween: transition_styleTween,
1957
+ text: transition_text,
1958
+ textTween: transition_textTween,
1959
+ remove: transition_remove,
1960
+ tween: transition_tween,
1961
+ delay: transition_delay,
1962
+ duration: transition_duration,
1963
+ ease: transition_ease,
1964
+ easeVarying: transition_easeVarying,
1965
+ end: transition_end,
1966
+ [Symbol.iterator]: selection_prototype[Symbol.iterator]
1967
+ };
1968
+ function cubicInOut(t) {
1969
+ return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
1970
+ }
1971
+ var defaultTiming = {
1972
+ time: null,
1973
+ // Set on use.
1974
+ delay: 0,
1975
+ duration: 250,
1976
+ ease: cubicInOut
1977
+ };
1978
+ function inherit(node, id2) {
1979
+ var timing;
1980
+ while (!(timing = node.__transition) || !(timing = timing[id2])) {
1981
+ if (!(node = node.parentNode)) {
1982
+ throw new Error(`transition ${id2} not found`);
1983
+ }
1984
+ }
1985
+ return timing;
1986
+ }
1987
+ function selection_transition(name) {
1988
+ var id2, timing;
1989
+ if (name instanceof Transition) {
1990
+ id2 = name._id, name = name._name;
1991
+ } else {
1992
+ id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
1993
+ }
1994
+ for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
1995
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
1996
+ if (node = group[i]) {
1997
+ schedule(node, name, id2, i, group, timing || inherit(node, id2));
1998
+ }
1999
+ }
2000
+ }
2001
+ return new Transition(groups, this._parents, name, id2);
2002
+ }
2003
+ selection.prototype.interrupt = selection_interrupt;
2004
+ selection.prototype.transition = selection_transition;
2005
+ const pi$1 = Math.PI, tau$1 = 2 * pi$1, epsilon$1 = 1e-6, tauEpsilon = tau$1 - epsilon$1;
2006
+ function append(strings) {
2007
+ this._ += strings[0];
2008
+ for (let i = 1, n = strings.length; i < n; ++i) {
2009
+ this._ += arguments[i] + strings[i];
2010
+ }
2011
+ }
2012
+ function appendRound(digits) {
2013
+ let d = Math.floor(digits);
2014
+ if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);
2015
+ if (d > 15) return append;
2016
+ const k = 10 ** d;
2017
+ return function(strings) {
2018
+ this._ += strings[0];
2019
+ for (let i = 1, n = strings.length; i < n; ++i) {
2020
+ this._ += Math.round(arguments[i] * k) / k + strings[i];
2021
+ }
2022
+ };
2023
+ }
2024
+ class Path {
2025
+ constructor(digits) {
2026
+ this._x0 = this._y0 = // start of current subpath
2027
+ this._x1 = this._y1 = null;
2028
+ this._ = "";
2029
+ this._append = digits == null ? append : appendRound(digits);
2030
+ }
2031
+ moveTo(x2, y2) {
2032
+ this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`;
2033
+ }
2034
+ closePath() {
2035
+ if (this._x1 !== null) {
2036
+ this._x1 = this._x0, this._y1 = this._y0;
2037
+ this._append`Z`;
2038
+ }
2039
+ }
2040
+ lineTo(x2, y2) {
2041
+ this._append`L${this._x1 = +x2},${this._y1 = +y2}`;
2042
+ }
2043
+ quadraticCurveTo(x1, y1, x2, y2) {
2044
+ this._append`Q${+x1},${+y1},${this._x1 = +x2},${this._y1 = +y2}`;
2045
+ }
2046
+ bezierCurveTo(x1, y1, x2, y2, x3, y3) {
2047
+ this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`;
2048
+ }
2049
+ arcTo(x1, y1, x2, y2, r) {
2050
+ x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
2051
+ if (r < 0) throw new Error(`negative radius: ${r}`);
2052
+ let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
2053
+ if (this._x1 === null) {
2054
+ this._append`M${this._x1 = x1},${this._y1 = y1}`;
2055
+ } else if (!(l01_2 > epsilon$1)) ;
2056
+ else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$1) || !r) {
2057
+ this._append`L${this._x1 = x1},${this._y1 = y1}`;
2058
+ } else {
2059
+ let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi$1 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
2060
+ if (Math.abs(t01 - 1) > epsilon$1) {
2061
+ this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
2062
+ }
2063
+ this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
2064
+ }
2065
+ }
2066
+ arc(x2, y2, r, a0, a1, ccw) {
2067
+ x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw;
2068
+ if (r < 0) throw new Error(`negative radius: ${r}`);
2069
+ let dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
2070
+ if (this._x1 === null) {
2071
+ this._append`M${x0},${y0}`;
2072
+ } else if (Math.abs(this._x1 - x0) > epsilon$1 || Math.abs(this._y1 - y0) > epsilon$1) {
2073
+ this._append`L${x0},${y0}`;
2074
+ }
2075
+ if (!r) return;
2076
+ if (da < 0) da = da % tau$1 + tau$1;
2077
+ if (da > tauEpsilon) {
2078
+ this._append`A${r},${r},0,1,${cw},${x2 - dx},${y2 - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
2079
+ } else if (da > epsilon$1) {
2080
+ this._append`A${r},${r},0,${+(da >= pi$1)},${cw},${this._x1 = x2 + r * Math.cos(a1)},${this._y1 = y2 + r * Math.sin(a1)}`;
2081
+ }
2082
+ }
2083
+ rect(x2, y2, w, h) {
2084
+ this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w = +w}v${+h}h${-w}Z`;
2085
+ }
2086
+ toString() {
2087
+ return this._;
2088
+ }
2089
+ }
2090
+ function constant(x2) {
2091
+ return function constant2() {
2092
+ return x2;
2093
+ };
2094
+ }
2095
+ const abs = Math.abs;
2096
+ const atan2 = Math.atan2;
2097
+ const cos = Math.cos;
2098
+ const max = Math.max;
2099
+ const min = Math.min;
2100
+ const sin = Math.sin;
2101
+ const sqrt = Math.sqrt;
2102
+ const epsilon = 1e-12;
2103
+ const pi = Math.PI;
2104
+ const halfPi = pi / 2;
2105
+ const tau = 2 * pi;
2106
+ function acos(x2) {
2107
+ return x2 > 1 ? 0 : x2 < -1 ? pi : Math.acos(x2);
2108
+ }
2109
+ function asin(x2) {
2110
+ return x2 >= 1 ? halfPi : x2 <= -1 ? -halfPi : Math.asin(x2);
2111
+ }
2112
+ function withPath(shape) {
2113
+ let digits = 3;
2114
+ shape.digits = function(_) {
2115
+ if (!arguments.length) return digits;
2116
+ if (_ == null) {
2117
+ digits = null;
2118
+ } else {
2119
+ const d = Math.floor(_);
2120
+ if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
2121
+ digits = d;
2122
+ }
2123
+ return shape;
2124
+ };
2125
+ return () => new Path(digits);
2126
+ }
2127
+ function array(x2) {
2128
+ return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2);
2129
+ }
2130
+ function Linear(context) {
2131
+ this._context = context;
2132
+ }
2133
+ Linear.prototype = {
2134
+ areaStart: function() {
2135
+ this._line = 0;
2136
+ },
2137
+ areaEnd: function() {
2138
+ this._line = NaN;
2139
+ },
2140
+ lineStart: function() {
2141
+ this._point = 0;
2142
+ },
2143
+ lineEnd: function() {
2144
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
2145
+ this._line = 1 - this._line;
2146
+ },
2147
+ point: function(x2, y2) {
2148
+ x2 = +x2, y2 = +y2;
2149
+ switch (this._point) {
2150
+ case 0:
2151
+ this._point = 1;
2152
+ this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
2153
+ break;
2154
+ case 1:
2155
+ this._point = 2;
2156
+ // falls through
2157
+ default:
2158
+ this._context.lineTo(x2, y2);
2159
+ break;
2160
+ }
2161
+ }
2162
+ };
2163
+ function curveLinear(context) {
2164
+ return new Linear(context);
2165
+ }
2166
+ function x(p) {
2167
+ return p[0];
2168
+ }
2169
+ function y(p) {
2170
+ return p[1];
2171
+ }
2172
+ function line$1(x$1, y$1) {
2173
+ var defined = constant(true), context = null, curve = curveLinear, output = null, path = withPath(line);
2174
+ x$1 = typeof x$1 === "function" ? x$1 : x$1 === void 0 ? x : constant(x$1);
2175
+ y$1 = typeof y$1 === "function" ? y$1 : y$1 === void 0 ? y : constant(y$1);
2176
+ function line(data) {
2177
+ var i, n = (data = array(data)).length, d, defined0 = false, buffer;
2178
+ if (context == null) output = curve(buffer = path());
2179
+ for (i = 0; i <= n; ++i) {
2180
+ if (!(i < n && defined(d = data[i], i, data)) === defined0) {
2181
+ if (defined0 = !defined0) output.lineStart();
2182
+ else output.lineEnd();
2183
+ }
2184
+ if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data));
2185
+ }
2186
+ if (buffer) return output = null, buffer + "" || null;
2187
+ }
2188
+ line.x = function(_) {
2189
+ return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1;
2190
+ };
2191
+ line.y = function(_) {
2192
+ return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1;
2193
+ };
2194
+ line.defined = function(_) {
2195
+ return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined;
2196
+ };
2197
+ line.curve = function(_) {
2198
+ return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
2199
+ };
2200
+ line.context = function(_) {
2201
+ return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
2202
+ };
2203
+ return line;
2204
+ }
2205
+ function noop() {
2206
+ }
2207
+ function point$3(that, x2, y2) {
2208
+ that._context.bezierCurveTo(
2209
+ (2 * that._x0 + that._x1) / 3,
2210
+ (2 * that._y0 + that._y1) / 3,
2211
+ (that._x0 + 2 * that._x1) / 3,
2212
+ (that._y0 + 2 * that._y1) / 3,
2213
+ (that._x0 + 4 * that._x1 + x2) / 6,
2214
+ (that._y0 + 4 * that._y1 + y2) / 6
2215
+ );
2216
+ }
2217
+ function Basis(context) {
2218
+ this._context = context;
2219
+ }
2220
+ Basis.prototype = {
2221
+ areaStart: function() {
2222
+ this._line = 0;
2223
+ },
2224
+ areaEnd: function() {
2225
+ this._line = NaN;
2226
+ },
2227
+ lineStart: function() {
2228
+ this._x0 = this._x1 = this._y0 = this._y1 = NaN;
2229
+ this._point = 0;
2230
+ },
2231
+ lineEnd: function() {
2232
+ switch (this._point) {
2233
+ case 3:
2234
+ point$3(this, this._x1, this._y1);
2235
+ // falls through
2236
+ case 2:
2237
+ this._context.lineTo(this._x1, this._y1);
2238
+ break;
2239
+ }
2240
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
2241
+ this._line = 1 - this._line;
2242
+ },
2243
+ point: function(x2, y2) {
2244
+ x2 = +x2, y2 = +y2;
2245
+ switch (this._point) {
2246
+ case 0:
2247
+ this._point = 1;
2248
+ this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
2249
+ break;
2250
+ case 1:
2251
+ this._point = 2;
2252
+ break;
2253
+ case 2:
2254
+ this._point = 3;
2255
+ this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
2256
+ // falls through
2257
+ default:
2258
+ point$3(this, x2, y2);
2259
+ break;
2260
+ }
2261
+ this._x0 = this._x1, this._x1 = x2;
2262
+ this._y0 = this._y1, this._y1 = y2;
2263
+ }
2264
+ };
2265
+ function curveBasis(context) {
2266
+ return new Basis(context);
2267
+ }
2268
+ function BasisClosed(context) {
2269
+ this._context = context;
2270
+ }
2271
+ BasisClosed.prototype = {
2272
+ areaStart: noop,
2273
+ areaEnd: noop,
2274
+ lineStart: function() {
2275
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
2276
+ this._point = 0;
2277
+ },
2278
+ lineEnd: function() {
2279
+ switch (this._point) {
2280
+ case 1: {
2281
+ this._context.moveTo(this._x2, this._y2);
2282
+ this._context.closePath();
2283
+ break;
2284
+ }
2285
+ case 2: {
2286
+ this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
2287
+ this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
2288
+ this._context.closePath();
2289
+ break;
2290
+ }
2291
+ case 3: {
2292
+ this.point(this._x2, this._y2);
2293
+ this.point(this._x3, this._y3);
2294
+ this.point(this._x4, this._y4);
2295
+ break;
2296
+ }
2297
+ }
2298
+ },
2299
+ point: function(x2, y2) {
2300
+ x2 = +x2, y2 = +y2;
2301
+ switch (this._point) {
2302
+ case 0:
2303
+ this._point = 1;
2304
+ this._x2 = x2, this._y2 = y2;
2305
+ break;
2306
+ case 1:
2307
+ this._point = 2;
2308
+ this._x3 = x2, this._y3 = y2;
2309
+ break;
2310
+ case 2:
2311
+ this._point = 3;
2312
+ this._x4 = x2, this._y4 = y2;
2313
+ this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6);
2314
+ break;
2315
+ default:
2316
+ point$3(this, x2, y2);
2317
+ break;
2318
+ }
2319
+ this._x0 = this._x1, this._x1 = x2;
2320
+ this._y0 = this._y1, this._y1 = y2;
2321
+ }
2322
+ };
2323
+ function curveBasisClosed(context) {
2324
+ return new BasisClosed(context);
2325
+ }
2326
+ function BasisOpen(context) {
2327
+ this._context = context;
2328
+ }
2329
+ BasisOpen.prototype = {
2330
+ areaStart: function() {
2331
+ this._line = 0;
2332
+ },
2333
+ areaEnd: function() {
2334
+ this._line = NaN;
2335
+ },
2336
+ lineStart: function() {
2337
+ this._x0 = this._x1 = this._y0 = this._y1 = NaN;
2338
+ this._point = 0;
2339
+ },
2340
+ lineEnd: function() {
2341
+ if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
2342
+ this._line = 1 - this._line;
2343
+ },
2344
+ point: function(x2, y2) {
2345
+ x2 = +x2, y2 = +y2;
2346
+ switch (this._point) {
2347
+ case 0:
2348
+ this._point = 1;
2349
+ break;
2350
+ case 1:
2351
+ this._point = 2;
2352
+ break;
2353
+ case 2:
2354
+ this._point = 3;
2355
+ var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6;
2356
+ this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
2357
+ break;
2358
+ case 3:
2359
+ this._point = 4;
2360
+ // falls through
2361
+ default:
2362
+ point$3(this, x2, y2);
2363
+ break;
2364
+ }
2365
+ this._x0 = this._x1, this._x1 = x2;
2366
+ this._y0 = this._y1, this._y1 = y2;
2367
+ }
2368
+ };
2369
+ function curveBasisOpen(context) {
2370
+ return new BasisOpen(context);
2371
+ }
2372
+ function Bundle(context, beta) {
2373
+ this._basis = new Basis(context);
2374
+ this._beta = beta;
2375
+ }
2376
+ Bundle.prototype = {
2377
+ lineStart: function() {
2378
+ this._x = [];
2379
+ this._y = [];
2380
+ this._basis.lineStart();
2381
+ },
2382
+ lineEnd: function() {
2383
+ var x2 = this._x, y2 = this._y, j = x2.length - 1;
2384
+ if (j > 0) {
2385
+ var x0 = x2[0], y0 = y2[0], dx = x2[j] - x0, dy = y2[j] - y0, i = -1, t;
2386
+ while (++i <= j) {
2387
+ t = i / j;
2388
+ this._basis.point(
2389
+ this._beta * x2[i] + (1 - this._beta) * (x0 + t * dx),
2390
+ this._beta * y2[i] + (1 - this._beta) * (y0 + t * dy)
2391
+ );
2392
+ }
2393
+ }
2394
+ this._x = this._y = null;
2395
+ this._basis.lineEnd();
2396
+ },
2397
+ point: function(x2, y2) {
2398
+ this._x.push(+x2);
2399
+ this._y.push(+y2);
2400
+ }
2401
+ };
2402
+ const curveBundle = (function custom(beta) {
2403
+ function bundle(context) {
2404
+ return beta === 1 ? new Basis(context) : new Bundle(context, beta);
2405
+ }
2406
+ bundle.beta = function(beta2) {
2407
+ return custom(+beta2);
2408
+ };
2409
+ return bundle;
2410
+ })(0.85);
2411
+ function point$2(that, x2, y2) {
2412
+ that._context.bezierCurveTo(
2413
+ that._x1 + that._k * (that._x2 - that._x0),
2414
+ that._y1 + that._k * (that._y2 - that._y0),
2415
+ that._x2 + that._k * (that._x1 - x2),
2416
+ that._y2 + that._k * (that._y1 - y2),
2417
+ that._x2,
2418
+ that._y2
2419
+ );
2420
+ }
2421
+ function Cardinal(context, tension) {
2422
+ this._context = context;
2423
+ this._k = (1 - tension) / 6;
2424
+ }
2425
+ Cardinal.prototype = {
2426
+ areaStart: function() {
2427
+ this._line = 0;
2428
+ },
2429
+ areaEnd: function() {
2430
+ this._line = NaN;
2431
+ },
2432
+ lineStart: function() {
2433
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
2434
+ this._point = 0;
2435
+ },
2436
+ lineEnd: function() {
2437
+ switch (this._point) {
2438
+ case 2:
2439
+ this._context.lineTo(this._x2, this._y2);
2440
+ break;
2441
+ case 3:
2442
+ point$2(this, this._x1, this._y1);
2443
+ break;
2444
+ }
2445
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
2446
+ this._line = 1 - this._line;
2447
+ },
2448
+ point: function(x2, y2) {
2449
+ x2 = +x2, y2 = +y2;
2450
+ switch (this._point) {
2451
+ case 0:
2452
+ this._point = 1;
2453
+ this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
2454
+ break;
2455
+ case 1:
2456
+ this._point = 2;
2457
+ this._x1 = x2, this._y1 = y2;
2458
+ break;
2459
+ case 2:
2460
+ this._point = 3;
2461
+ // falls through
2462
+ default:
2463
+ point$2(this, x2, y2);
2464
+ break;
2465
+ }
2466
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
2467
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
2468
+ }
2469
+ };
2470
+ const curveCardinal = (function custom2(tension) {
2471
+ function cardinal(context) {
2472
+ return new Cardinal(context, tension);
2473
+ }
2474
+ cardinal.tension = function(tension2) {
2475
+ return custom2(+tension2);
2476
+ };
2477
+ return cardinal;
2478
+ })(0);
2479
+ function CardinalClosed(context, tension) {
2480
+ this._context = context;
2481
+ this._k = (1 - tension) / 6;
2482
+ }
2483
+ CardinalClosed.prototype = {
2484
+ areaStart: noop,
2485
+ areaEnd: noop,
2486
+ lineStart: function() {
2487
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
2488
+ this._point = 0;
2489
+ },
2490
+ lineEnd: function() {
2491
+ switch (this._point) {
2492
+ case 1: {
2493
+ this._context.moveTo(this._x3, this._y3);
2494
+ this._context.closePath();
2495
+ break;
2496
+ }
2497
+ case 2: {
2498
+ this._context.lineTo(this._x3, this._y3);
2499
+ this._context.closePath();
2500
+ break;
2501
+ }
2502
+ case 3: {
2503
+ this.point(this._x3, this._y3);
2504
+ this.point(this._x4, this._y4);
2505
+ this.point(this._x5, this._y5);
2506
+ break;
2507
+ }
2508
+ }
2509
+ },
2510
+ point: function(x2, y2) {
2511
+ x2 = +x2, y2 = +y2;
2512
+ switch (this._point) {
2513
+ case 0:
2514
+ this._point = 1;
2515
+ this._x3 = x2, this._y3 = y2;
2516
+ break;
2517
+ case 1:
2518
+ this._point = 2;
2519
+ this._context.moveTo(this._x4 = x2, this._y4 = y2);
2520
+ break;
2521
+ case 2:
2522
+ this._point = 3;
2523
+ this._x5 = x2, this._y5 = y2;
2524
+ break;
2525
+ default:
2526
+ point$2(this, x2, y2);
2527
+ break;
2528
+ }
2529
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
2530
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
2531
+ }
2532
+ };
2533
+ const curveCardinalClosed = (function custom3(tension) {
2534
+ function cardinal(context) {
2535
+ return new CardinalClosed(context, tension);
2536
+ }
2537
+ cardinal.tension = function(tension2) {
2538
+ return custom3(+tension2);
2539
+ };
2540
+ return cardinal;
2541
+ })(0);
2542
+ function CardinalOpen(context, tension) {
2543
+ this._context = context;
2544
+ this._k = (1 - tension) / 6;
2545
+ }
2546
+ CardinalOpen.prototype = {
2547
+ areaStart: function() {
2548
+ this._line = 0;
2549
+ },
2550
+ areaEnd: function() {
2551
+ this._line = NaN;
2552
+ },
2553
+ lineStart: function() {
2554
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
2555
+ this._point = 0;
2556
+ },
2557
+ lineEnd: function() {
2558
+ if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
2559
+ this._line = 1 - this._line;
2560
+ },
2561
+ point: function(x2, y2) {
2562
+ x2 = +x2, y2 = +y2;
2563
+ switch (this._point) {
2564
+ case 0:
2565
+ this._point = 1;
2566
+ break;
2567
+ case 1:
2568
+ this._point = 2;
2569
+ break;
2570
+ case 2:
2571
+ this._point = 3;
2572
+ this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
2573
+ break;
2574
+ case 3:
2575
+ this._point = 4;
2576
+ // falls through
2577
+ default:
2578
+ point$2(this, x2, y2);
2579
+ break;
2580
+ }
2581
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
2582
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
2583
+ }
2584
+ };
2585
+ const curveCardinalOpen = (function custom4(tension) {
2586
+ function cardinal(context) {
2587
+ return new CardinalOpen(context, tension);
2588
+ }
2589
+ cardinal.tension = function(tension2) {
2590
+ return custom4(+tension2);
2591
+ };
2592
+ return cardinal;
2593
+ })(0);
2594
+ function point$1(that, x2, y2) {
2595
+ var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2;
2596
+ if (that._l01_a > epsilon) {
2597
+ var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a);
2598
+ x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
2599
+ y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
2600
+ }
2601
+ if (that._l23_a > epsilon) {
2602
+ var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a);
2603
+ x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m;
2604
+ y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m;
2605
+ }
2606
+ that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2);
2607
+ }
2608
+ function CatmullRom(context, alpha) {
2609
+ this._context = context;
2610
+ this._alpha = alpha;
2611
+ }
2612
+ CatmullRom.prototype = {
2613
+ areaStart: function() {
2614
+ this._line = 0;
2615
+ },
2616
+ areaEnd: function() {
2617
+ this._line = NaN;
2618
+ },
2619
+ lineStart: function() {
2620
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
2621
+ this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
2622
+ },
2623
+ lineEnd: function() {
2624
+ switch (this._point) {
2625
+ case 2:
2626
+ this._context.lineTo(this._x2, this._y2);
2627
+ break;
2628
+ case 3:
2629
+ this.point(this._x2, this._y2);
2630
+ break;
2631
+ }
2632
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
2633
+ this._line = 1 - this._line;
2634
+ },
2635
+ point: function(x2, y2) {
2636
+ x2 = +x2, y2 = +y2;
2637
+ if (this._point) {
2638
+ var x23 = this._x2 - x2, y23 = this._y2 - y2;
2639
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
2640
+ }
2641
+ switch (this._point) {
2642
+ case 0:
2643
+ this._point = 1;
2644
+ this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
2645
+ break;
2646
+ case 1:
2647
+ this._point = 2;
2648
+ break;
2649
+ case 2:
2650
+ this._point = 3;
2651
+ // falls through
2652
+ default:
2653
+ point$1(this, x2, y2);
2654
+ break;
2655
+ }
2656
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
2657
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
2658
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
2659
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
2660
+ }
2661
+ };
2662
+ const curveCatmullRom = (function custom5(alpha) {
2663
+ function catmullRom(context) {
2664
+ return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
2665
+ }
2666
+ catmullRom.alpha = function(alpha2) {
2667
+ return custom5(+alpha2);
2668
+ };
2669
+ return catmullRom;
2670
+ })(0.5);
2671
+ function CatmullRomClosed(context, alpha) {
2672
+ this._context = context;
2673
+ this._alpha = alpha;
2674
+ }
2675
+ CatmullRomClosed.prototype = {
2676
+ areaStart: noop,
2677
+ areaEnd: noop,
2678
+ lineStart: function() {
2679
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
2680
+ this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
2681
+ },
2682
+ lineEnd: function() {
2683
+ switch (this._point) {
2684
+ case 1: {
2685
+ this._context.moveTo(this._x3, this._y3);
2686
+ this._context.closePath();
2687
+ break;
2688
+ }
2689
+ case 2: {
2690
+ this._context.lineTo(this._x3, this._y3);
2691
+ this._context.closePath();
2692
+ break;
2693
+ }
2694
+ case 3: {
2695
+ this.point(this._x3, this._y3);
2696
+ this.point(this._x4, this._y4);
2697
+ this.point(this._x5, this._y5);
2698
+ break;
2699
+ }
2700
+ }
2701
+ },
2702
+ point: function(x2, y2) {
2703
+ x2 = +x2, y2 = +y2;
2704
+ if (this._point) {
2705
+ var x23 = this._x2 - x2, y23 = this._y2 - y2;
2706
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
2707
+ }
2708
+ switch (this._point) {
2709
+ case 0:
2710
+ this._point = 1;
2711
+ this._x3 = x2, this._y3 = y2;
2712
+ break;
2713
+ case 1:
2714
+ this._point = 2;
2715
+ this._context.moveTo(this._x4 = x2, this._y4 = y2);
2716
+ break;
2717
+ case 2:
2718
+ this._point = 3;
2719
+ this._x5 = x2, this._y5 = y2;
2720
+ break;
2721
+ default:
2722
+ point$1(this, x2, y2);
2723
+ break;
2724
+ }
2725
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
2726
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
2727
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
2728
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
2729
+ }
2730
+ };
2731
+ const curveCatmullRomClosed = (function custom6(alpha) {
2732
+ function catmullRom(context) {
2733
+ return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
2734
+ }
2735
+ catmullRom.alpha = function(alpha2) {
2736
+ return custom6(+alpha2);
2737
+ };
2738
+ return catmullRom;
2739
+ })(0.5);
2740
+ function CatmullRomOpen(context, alpha) {
2741
+ this._context = context;
2742
+ this._alpha = alpha;
2743
+ }
2744
+ CatmullRomOpen.prototype = {
2745
+ areaStart: function() {
2746
+ this._line = 0;
2747
+ },
2748
+ areaEnd: function() {
2749
+ this._line = NaN;
2750
+ },
2751
+ lineStart: function() {
2752
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
2753
+ this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
2754
+ },
2755
+ lineEnd: function() {
2756
+ if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
2757
+ this._line = 1 - this._line;
2758
+ },
2759
+ point: function(x2, y2) {
2760
+ x2 = +x2, y2 = +y2;
2761
+ if (this._point) {
2762
+ var x23 = this._x2 - x2, y23 = this._y2 - y2;
2763
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
2764
+ }
2765
+ switch (this._point) {
2766
+ case 0:
2767
+ this._point = 1;
2768
+ break;
2769
+ case 1:
2770
+ this._point = 2;
2771
+ break;
2772
+ case 2:
2773
+ this._point = 3;
2774
+ this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
2775
+ break;
2776
+ case 3:
2777
+ this._point = 4;
2778
+ // falls through
2779
+ default:
2780
+ point$1(this, x2, y2);
2781
+ break;
2782
+ }
2783
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
2784
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
2785
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
2786
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
2787
+ }
2788
+ };
2789
+ const curveCatmullRomOpen = (function custom7(alpha) {
2790
+ function catmullRom(context) {
2791
+ return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
2792
+ }
2793
+ catmullRom.alpha = function(alpha2) {
2794
+ return custom7(+alpha2);
2795
+ };
2796
+ return catmullRom;
2797
+ })(0.5);
2798
+ function LinearClosed(context) {
2799
+ this._context = context;
2800
+ }
2801
+ LinearClosed.prototype = {
2802
+ areaStart: noop,
2803
+ areaEnd: noop,
2804
+ lineStart: function() {
2805
+ this._point = 0;
2806
+ },
2807
+ lineEnd: function() {
2808
+ if (this._point) this._context.closePath();
2809
+ },
2810
+ point: function(x2, y2) {
2811
+ x2 = +x2, y2 = +y2;
2812
+ if (this._point) this._context.lineTo(x2, y2);
2813
+ else this._point = 1, this._context.moveTo(x2, y2);
2814
+ }
2815
+ };
2816
+ function curveLinearClosed(context) {
2817
+ return new LinearClosed(context);
2818
+ }
2819
+ function sign(x2) {
2820
+ return x2 < 0 ? -1 : 1;
2821
+ }
2822
+ function slope3(that, x2, y2) {
2823
+ var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1);
2824
+ return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
2825
+ }
2826
+ function slope2(that, t) {
2827
+ var h = that._x1 - that._x0;
2828
+ return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
2829
+ }
2830
+ function point(that, t0, t1) {
2831
+ var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3;
2832
+ that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
2833
+ }
2834
+ function MonotoneX(context) {
2835
+ this._context = context;
2836
+ }
2837
+ MonotoneX.prototype = {
2838
+ areaStart: function() {
2839
+ this._line = 0;
2840
+ },
2841
+ areaEnd: function() {
2842
+ this._line = NaN;
2843
+ },
2844
+ lineStart: function() {
2845
+ this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
2846
+ this._point = 0;
2847
+ },
2848
+ lineEnd: function() {
2849
+ switch (this._point) {
2850
+ case 2:
2851
+ this._context.lineTo(this._x1, this._y1);
2852
+ break;
2853
+ case 3:
2854
+ point(this, this._t0, slope2(this, this._t0));
2855
+ break;
2856
+ }
2857
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
2858
+ this._line = 1 - this._line;
2859
+ },
2860
+ point: function(x2, y2) {
2861
+ var t1 = NaN;
2862
+ x2 = +x2, y2 = +y2;
2863
+ if (x2 === this._x1 && y2 === this._y1) return;
2864
+ switch (this._point) {
2865
+ case 0:
2866
+ this._point = 1;
2867
+ this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
2868
+ break;
2869
+ case 1:
2870
+ this._point = 2;
2871
+ break;
2872
+ case 2:
2873
+ this._point = 3;
2874
+ point(this, slope2(this, t1 = slope3(this, x2, y2)), t1);
2875
+ break;
2876
+ default:
2877
+ point(this, this._t0, t1 = slope3(this, x2, y2));
2878
+ break;
2879
+ }
2880
+ this._x0 = this._x1, this._x1 = x2;
2881
+ this._y0 = this._y1, this._y1 = y2;
2882
+ this._t0 = t1;
2883
+ }
2884
+ };
2885
+ function MonotoneY(context) {
2886
+ this._context = new ReflectContext(context);
2887
+ }
2888
+ (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) {
2889
+ MonotoneX.prototype.point.call(this, y2, x2);
2890
+ };
2891
+ function ReflectContext(context) {
2892
+ this._context = context;
2893
+ }
2894
+ ReflectContext.prototype = {
2895
+ moveTo: function(x2, y2) {
2896
+ this._context.moveTo(y2, x2);
2897
+ },
2898
+ closePath: function() {
2899
+ this._context.closePath();
2900
+ },
2901
+ lineTo: function(x2, y2) {
2902
+ this._context.lineTo(y2, x2);
2903
+ },
2904
+ bezierCurveTo: function(x1, y1, x2, y2, x3, y3) {
2905
+ this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3);
2906
+ }
2907
+ };
2908
+ function monotoneX(context) {
2909
+ return new MonotoneX(context);
2910
+ }
2911
+ function monotoneY(context) {
2912
+ return new MonotoneY(context);
2913
+ }
2914
+ function Natural(context) {
2915
+ this._context = context;
2916
+ }
2917
+ Natural.prototype = {
2918
+ areaStart: function() {
2919
+ this._line = 0;
2920
+ },
2921
+ areaEnd: function() {
2922
+ this._line = NaN;
2923
+ },
2924
+ lineStart: function() {
2925
+ this._x = [];
2926
+ this._y = [];
2927
+ },
2928
+ lineEnd: function() {
2929
+ var x2 = this._x, y2 = this._y, n = x2.length;
2930
+ if (n) {
2931
+ this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]);
2932
+ if (n === 2) {
2933
+ this._context.lineTo(x2[1], y2[1]);
2934
+ } else {
2935
+ var px = controlPoints(x2), py = controlPoints(y2);
2936
+ for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
2937
+ this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]);
2938
+ }
2939
+ }
2940
+ }
2941
+ if (this._line || this._line !== 0 && n === 1) this._context.closePath();
2942
+ this._line = 1 - this._line;
2943
+ this._x = this._y = null;
2944
+ },
2945
+ point: function(x2, y2) {
2946
+ this._x.push(+x2);
2947
+ this._y.push(+y2);
2948
+ }
2949
+ };
2950
+ function controlPoints(x2) {
2951
+ var i, n = x2.length - 1, m, a = new Array(n), b = new Array(n), r = new Array(n);
2952
+ a[0] = 0, b[0] = 2, r[0] = x2[0] + 2 * x2[1];
2953
+ for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x2[i] + 2 * x2[i + 1];
2954
+ a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x2[n - 1] + x2[n];
2955
+ for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
2956
+ a[n - 1] = r[n - 1] / b[n - 1];
2957
+ for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];
2958
+ b[n - 1] = (x2[n] + a[n - 1]) / 2;
2959
+ for (i = 0; i < n - 1; ++i) b[i] = 2 * x2[i + 1] - a[i + 1];
2960
+ return [a, b];
2961
+ }
2962
+ function curveNatural(context) {
2963
+ return new Natural(context);
2964
+ }
2965
+ function Step(context, t) {
2966
+ this._context = context;
2967
+ this._t = t;
2968
+ }
2969
+ Step.prototype = {
2970
+ areaStart: function() {
2971
+ this._line = 0;
2972
+ },
2973
+ areaEnd: function() {
2974
+ this._line = NaN;
2975
+ },
2976
+ lineStart: function() {
2977
+ this._x = this._y = NaN;
2978
+ this._point = 0;
2979
+ },
2980
+ lineEnd: function() {
2981
+ if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
2982
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
2983
+ if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
2984
+ },
2985
+ point: function(x2, y2) {
2986
+ x2 = +x2, y2 = +y2;
2987
+ switch (this._point) {
2988
+ case 0:
2989
+ this._point = 1;
2990
+ this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
2991
+ break;
2992
+ case 1:
2993
+ this._point = 2;
2994
+ // falls through
2995
+ default: {
2996
+ if (this._t <= 0) {
2997
+ this._context.lineTo(this._x, y2);
2998
+ this._context.lineTo(x2, y2);
2999
+ } else {
3000
+ var x1 = this._x * (1 - this._t) + x2 * this._t;
3001
+ this._context.lineTo(x1, this._y);
3002
+ this._context.lineTo(x1, y2);
3003
+ }
3004
+ break;
3005
+ }
3006
+ }
3007
+ this._x = x2, this._y = y2;
3008
+ }
3009
+ };
3010
+ function curveStep(context) {
3011
+ return new Step(context, 0.5);
3012
+ }
3013
+ function stepBefore(context) {
3014
+ return new Step(context, 0);
3015
+ }
3016
+ function stepAfter(context) {
3017
+ return new Step(context, 1);
3018
+ }
3019
+ function Transform(k, x2, y2) {
3020
+ this.k = k;
3021
+ this.x = x2;
3022
+ this.y = y2;
3023
+ }
3024
+ Transform.prototype = {
3025
+ constructor: Transform,
3026
+ scale: function(k) {
3027
+ return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
3028
+ },
3029
+ translate: function(x2, y2) {
3030
+ return x2 === 0 & y2 === 0 ? this : new Transform(this.k, this.x + this.k * x2, this.y + this.k * y2);
3031
+ },
3032
+ apply: function(point2) {
3033
+ return [point2[0] * this.k + this.x, point2[1] * this.k + this.y];
3034
+ },
3035
+ applyX: function(x2) {
3036
+ return x2 * this.k + this.x;
3037
+ },
3038
+ applyY: function(y2) {
3039
+ return y2 * this.k + this.y;
3040
+ },
3041
+ invert: function(location) {
3042
+ return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
3043
+ },
3044
+ invertX: function(x2) {
3045
+ return (x2 - this.x) / this.k;
3046
+ },
3047
+ invertY: function(y2) {
3048
+ return (y2 - this.y) / this.k;
3049
+ },
3050
+ rescaleX: function(x2) {
3051
+ return x2.copy().domain(x2.range().map(this.invertX, this).map(x2.invert, x2));
3052
+ },
3053
+ rescaleY: function(y2) {
3054
+ return y2.copy().domain(y2.range().map(this.invertY, this).map(y2.invert, y2));
3055
+ },
3056
+ toString: function() {
3057
+ return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
3058
+ }
3059
+ };
3060
+ var identity = new Transform(1, 0, 0);
3061
+ transform.prototype = Transform.prototype;
3062
+ function transform(node) {
3063
+ while (!node.__zoom) if (!(node = node.parentNode)) return identity;
3064
+ return node.__zoom;
3065
+ }
3066
+ export {
3067
+ curveCardinalOpen as $,
3068
+ extend as A,
3069
+ nogamma as B,
3070
+ Color as C,
3071
+ hue as D,
3072
+ root as E,
3073
+ array$1 as F,
3074
+ dispatch as G,
3075
+ interrupt as H,
3076
+ curveLinear as I,
3077
+ x as J,
3078
+ y as K,
3079
+ identity as L,
3080
+ namespaces as M,
3081
+ transition as N,
3082
+ stepBefore as O,
3083
+ stepAfter as P,
3084
+ curveStep as Q,
3085
+ Rgb as R,
3086
+ Selection$1 as S,
3087
+ Transform as T,
3088
+ curveLinearClosed as U,
3089
+ curveNatural as V,
3090
+ monotoneY as W,
3091
+ monotoneX as X,
3092
+ curveCatmullRomOpen as Y,
3093
+ curveCatmullRomClosed as Z,
3094
+ curveCatmullRom as _,
3095
+ cos as a,
3096
+ curveCardinalClosed as a0,
3097
+ curveCardinal as a1,
3098
+ curveBundle as a2,
3099
+ curveBasisOpen as a3,
3100
+ curveBasisClosed as a4,
3101
+ transform as a5,
3102
+ sin as b,
3103
+ curveBasis as c,
3104
+ abs as d,
3105
+ epsilon as e,
3106
+ sqrt as f,
3107
+ atan2 as g,
3108
+ halfPi as h,
3109
+ constant as i,
3110
+ asin as j,
3111
+ acos as k,
3112
+ line$1 as l,
3113
+ min as m,
3114
+ max as n,
3115
+ array as o,
3116
+ pi as p,
3117
+ constant$1 as q,
3118
+ interpolateNumber as r,
3119
+ select as s,
3120
+ tau as t,
3121
+ color as u,
3122
+ interpolateRgb as v,
3123
+ withPath as w,
3124
+ interpolateString as x,
3125
+ rgbConvert as y,
3126
+ define as z
3127
+ };