@8btc/xcanvas 0.0.1

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 (121) hide show
  1. package/README.md +70 -0
  2. package/dist/Tableau10-BqnYsPR6.js +9 -0
  3. package/dist/XCanvas-BxdLBkBz.js +27732 -0
  4. package/dist/_commonjs-dynamic-modules-TGKdzP3c.js +6 -0
  5. package/dist/ar-SA-G6X2FPQ2-DjqDLLYL.js +41 -0
  6. package/dist/arc-D1qX5GFf.js +132 -0
  7. package/dist/array-DgktLKBx.js +6 -0
  8. package/dist/az-AZ-76LH7QW2-D7LOsF3_.js +32 -0
  9. package/dist/bg-BG-XCXSNQG7-WI4tFn23.js +36 -0
  10. package/dist/blockDiagram-38ab4fdb-DtemKfEh.js +1811 -0
  11. package/dist/bn-BD-2XOGV67Q-Bugx_8fy.js +36 -0
  12. package/dist/c4Diagram-3d4e48cf-Byd2vU9K.js +2463 -0
  13. package/dist/ca-ES-6MX7JW3Y-6rFwKGsQ.js +39 -0
  14. package/dist/channel-BT_3Ze-Y.js +7 -0
  15. package/dist/chunk-EIO257PC-C7qD7hGu.js +1641 -0
  16. package/dist/classDiagram-70f12bd4-CwfYadk-.js +354 -0
  17. package/dist/classDiagram-v2-f2320105-B28MuM8f.js +284 -0
  18. package/dist/clone-D2FUK8WY.js +8 -0
  19. package/dist/createText-2e5e7dd3-Ca1JfQaJ.js +4914 -0
  20. package/dist/cs-CZ-2BRQDIVT-Dhd8XszK.js +42 -0
  21. package/dist/da-DK-5WZEPLOC-BhL87sSs.js +36 -0
  22. package/dist/de-DE-XR44H4JA-xSrZSV0J.js +39 -0
  23. package/dist/directory-open-01563666-XowynPwH.js +14 -0
  24. package/dist/directory-open-4ed118d0-BwYbu9dw.js +55 -0
  25. package/dist/edges-e0da2a9e-9VbVapWU.js +1840 -0
  26. package/dist/el-GR-BZB4AONW-DQORZ_pY.js +41 -0
  27. package/dist/en-B4ZKOASM-D2BVbEdz.js +39 -0
  28. package/dist/erDiagram-9861fffd-D4S9QDes.js +1318 -0
  29. package/dist/es-ES-U4NZUMDT-C0Q89-0V.js +40 -0
  30. package/dist/eu-ES-A7QVB2H4-BwBW3cEw.js +42 -0
  31. package/dist/fa-IR-HGAKTJCU-DtZ74rm4.js +39 -0
  32. package/dist/fi-FI-Z5N7JZ37-QvQan48z.js +37 -0
  33. package/dist/file-open-002ab408-BNIYSKAV.js +18 -0
  34. package/dist/file-open-7c801643-B_l1UXdI.js +15 -0
  35. package/dist/file-save-3189631c-vzijizFw.js +23 -0
  36. package/dist/file-save-745eba88-B5-wM56X.js +25 -0
  37. package/dist/flowDb-956e92f1-S6T8ppJw.js +1713 -0
  38. package/dist/flowDiagram-66a62f08-C6TTwS5_.js +1264 -0
  39. package/dist/flowDiagram-v2-96b9c2cf-CzfeUNGP.js +24 -0
  40. package/dist/flowchart-elk-definition-4a651766-CRv1kWtk.js +92922 -0
  41. package/dist/fr-FR-RHASNOE6-CZFiweNU.js +40 -0
  42. package/dist/ganttDiagram-c361ad54-CAnfd8Sw.js +3420 -0
  43. package/dist/gitGraphDiagram-72cf32ee-CSGI-xRI.js +1790 -0
  44. package/dist/gl-ES-HMX3MZ6V-Bqv2xL-V.js +41 -0
  45. package/dist/graph-Ct2tKpKj.js +1253 -0
  46. package/dist/he-IL-6SHJWFNN-kso30jhn.js +41 -0
  47. package/dist/hi-IN-IWLTKZ5I-Busk5oaa.js +35 -0
  48. package/dist/hu-HU-A5ZG7DT2-xSR2C2H0.js +38 -0
  49. package/dist/id-ID-SAP4L64H-BQQZYm1L.js +41 -0
  50. package/dist/image-EDRW2JGV-Cx7o2kxD.js +6 -0
  51. package/dist/image-blob-reduce.esm-BKPqMdie.js +2396 -0
  52. package/dist/index-3862675e-B3j3w-v_.js +663 -0
  53. package/dist/index-CLOU2Ikr.js +14364 -0
  54. package/dist/index.css +450 -0
  55. package/dist/index.d.ts +40 -0
  56. package/dist/index.js +7 -0
  57. package/dist/index.umd.cjs +235477 -0
  58. package/dist/infoDiagram-f8f76790-NqA75uBo.js +510 -0
  59. package/dist/init-ZxktEp_H.js +16 -0
  60. package/dist/it-IT-JPQ66NNP-CAMVZrYt.js +42 -0
  61. package/dist/ja-JP-DBVTYXUO-CAX8A_Uj.js +39 -0
  62. package/dist/journeyDiagram-49397b02-By5oBzsZ.js +1182 -0
  63. package/dist/kaa-6HZHGXH3-4-o94cPY.js +32 -0
  64. package/dist/kab-KAB-ZGHBKWFO-CgyjjBvZ.js +39 -0
  65. package/dist/katex-C-jAQc2m.js +14516 -0
  66. package/dist/kk-KZ-P5N5QNE5-BEqZcwLA.js +32 -0
  67. package/dist/km-KH-HSX4SM5Z-DvKDbeH4.js +42 -0
  68. package/dist/ko-KR-MTYHY66A-DKCuAbKE.js +40 -0
  69. package/dist/ku-TR-6OUDTVRD-CNUs4cCe.js +40 -0
  70. package/dist/layout-AJxYKqQV.js +2292 -0
  71. package/dist/line-DJIf5OM8.js +45 -0
  72. package/dist/linear-Cfj4s4vI.js +539 -0
  73. package/dist/lt-LT-XHIRWOB4-gouzGdoW.js +34 -0
  74. package/dist/lv-LV-5QDEKY6T-CTvg1XFv.js +38 -0
  75. package/dist/mindmap-definition-fc14e90a-CBlwH_UF.js +35283 -0
  76. package/dist/mr-IN-CRQNXWMA-QeYm06Kq.js +44 -0
  77. package/dist/my-MM-5M5IBNSE-DG3k9ORf.js +32 -0
  78. package/dist/nb-NO-T6EIAALU-Cj995Nmg.js +41 -0
  79. package/dist/nl-NL-IS3SIHDZ-B-2H7xey.js +39 -0
  80. package/dist/nn-NO-6E72VCQL-DrAwKKTN.js +39 -0
  81. package/dist/oc-FR-POXYY2M6-CeyJD7tq.js +39 -0
  82. package/dist/ordinal-DSZU4PqD.js +76 -0
  83. package/dist/pa-IN-N4M65BXN-DHzi6mjo.js +35 -0
  84. package/dist/path-Cp2qmpkd.js +109 -0
  85. package/dist/percentages-BXMCSKIN-CDYsTuua.js +6 -0
  86. package/dist/pica-CzzcRNRD.js +1702 -0
  87. package/dist/pieDiagram-8a3498a8-DueGoZOh.js +768 -0
  88. package/dist/pl-PL-T2D74RX3-BBNEV2c6.js +40 -0
  89. package/dist/pt-BR-5N22H2LF-D2cTx_F0.js +40 -0
  90. package/dist/pt-PT-UZXXM6DQ-BddvLLsF.js +40 -0
  91. package/dist/quadrantDiagram-120e2f19-Tb6_oGIn.js +1198 -0
  92. package/dist/requirementDiagram-deff3bca-CEeg0ep-.js +1089 -0
  93. package/dist/ro-RO-JPDTUUEW-DynuW50i.js +42 -0
  94. package/dist/roundRect-CjfubgrN.js +152 -0
  95. package/dist/ru-RU-B4JR7IUQ-B5Hecrew.js +40 -0
  96. package/dist/sankeyDiagram-04a897e0-CGTLQ8Gm.js +1172 -0
  97. package/dist/sequenceDiagram-704730f1-CZ72D-Nd.js +3336 -0
  98. package/dist/si-LK-N5RQ5JYF-BGMa93tc.js +32 -0
  99. package/dist/sk-SK-C5VTKIMK-BttCAlBm.js +37 -0
  100. package/dist/sl-SI-NN7IZMDC-DTC59nzG.js +37 -0
  101. package/dist/stateDiagram-587899a1-XISZzz_f.js +451 -0
  102. package/dist/stateDiagram-v2-d93cdb3a-DbCcmzTc.js +319 -0
  103. package/dist/styles-6aaf32cf-CyfdkEib.js +1363 -0
  104. package/dist/styles-9a916d00-zQ92RrTB.js +1483 -0
  105. package/dist/styles-c10674c1-BWmkigmR.js +571 -0
  106. package/dist/subset-shared.chunk-BuFt2PpZ.js +8 -0
  107. package/dist/subset-worker.chunk-CgaFXU4O.js +14 -0
  108. package/dist/sv-SE-XGPEYMSR-BPDlPxC1.js +41 -0
  109. package/dist/svgDrawCommon-08f97a94-CJ0lufOi.js +100 -0
  110. package/dist/ta-IN-2NMHFXQM-CI1ZsNk9.js +40 -0
  111. package/dist/th-TH-HPSO5L25-CUM-w2Qt.js +33 -0
  112. package/dist/timeline-definition-85554ec2-DV6084Gl.js +1210 -0
  113. package/dist/tr-TR-DEFEU3FU-CGpyf_vD.js +38 -0
  114. package/dist/uk-UA-QMV73CPH-Bg15Mv3J.js +37 -0
  115. package/dist/vi-VN-M7AON7JQ-AYmca9so.js +36 -0
  116. package/dist/vite.svg +1 -0
  117. package/dist/xychartDiagram-e933f94c-P1e6EEaH.js +1796 -0
  118. package/dist/zh-CN-LNUGB5OW-Dem2Cc-c.js +41 -0
  119. package/dist/zh-HK-E62DVLB3-BjsDyiLI.js +32 -0
  120. package/dist/zh-TW-RAJ6MFWO-IDAsc9Pz.js +40 -0
  121. package/package.json +52 -0
@@ -0,0 +1,3420 @@
1
+ import { ae as Rgb, af as rgbConvert, ag as define, ah as extend, ai as Color, aj as nogamma, ak as hue, a as getAccDescription, s as setAccDescription, o as getDiagramTitle, p as setDiagramTitle, b as getAccTitle, c as setAccTitle, g as getConfig, d as select, e as configureSvgSize, al as dayjs, l as log$1, k as common$1, j as distExports, r as clear$1, u as utils } from "./index-CLOU2Ikr.js";
2
+ import { J as getDefaultExportFromCjs } from "./XCanvas-BxdLBkBz.js";
3
+ import { b as bisector, t as tickStep, c as continuous, a as copy, l as linear } from "./linear-Cfj4s4vI.js";
4
+ import { i as initRange } from "./init-ZxktEp_H.js";
5
+ function max(values, valueof) {
6
+ let max2;
7
+ if (valueof === void 0) {
8
+ for (const value of values) {
9
+ if (value != null && (max2 < value || max2 === void 0 && value >= value)) {
10
+ max2 = value;
11
+ }
12
+ }
13
+ } else {
14
+ let index = -1;
15
+ for (let value of values) {
16
+ if ((value = valueof(value, ++index, values)) != null && (max2 < value || max2 === void 0 && value >= value)) {
17
+ max2 = value;
18
+ }
19
+ }
20
+ }
21
+ return max2;
22
+ }
23
+ function min(values, valueof) {
24
+ let min2;
25
+ if (valueof === void 0) {
26
+ for (const value of values) {
27
+ if (value != null && (min2 > value || min2 === void 0 && value >= value)) {
28
+ min2 = value;
29
+ }
30
+ }
31
+ } else {
32
+ let index = -1;
33
+ for (let value of values) {
34
+ if ((value = valueof(value, ++index, values)) != null && (min2 > value || min2 === void 0 && value >= value)) {
35
+ min2 = value;
36
+ }
37
+ }
38
+ }
39
+ return min2;
40
+ }
41
+ function identity(x) {
42
+ return x;
43
+ }
44
+ var top = 1, right = 2, bottom = 3, left = 4, epsilon = 1e-6;
45
+ function translateX(x) {
46
+ return "translate(" + x + ",0)";
47
+ }
48
+ function translateY(y) {
49
+ return "translate(0," + y + ")";
50
+ }
51
+ function number$1(scale) {
52
+ return (d) => +scale(d);
53
+ }
54
+ function center(scale, offset) {
55
+ offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;
56
+ if (scale.round()) offset = Math.round(offset);
57
+ return (d) => +scale(d) + offset;
58
+ }
59
+ function entering() {
60
+ return !this.__axis;
61
+ }
62
+ function axis(orient, scale) {
63
+ var tickArguments = [], tickValues = null, tickFormat = null, tickSizeInner = 6, tickSizeOuter = 6, tickPadding = 3, offset = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : 0.5, k = orient === top || orient === left ? -1 : 1, x = orient === left || orient === right ? "x" : "y", transform = orient === top || orient === bottom ? translateX : translateY;
64
+ function axis2(context) {
65
+ var values = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues, format = tickFormat == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity : tickFormat, spacing = Math.max(tickSizeInner, 0) + tickPadding, range = scale.range(), range0 = +range[0] + offset, range1 = +range[range.length - 1] + offset, position = (scale.bandwidth ? center : number$1)(scale.copy(), offset), selection = context.selection ? context.selection() : context, path = selection.selectAll(".domain").data([null]), tick = selection.selectAll(".tick").data(values, scale).order(), tickExit = tick.exit(), tickEnter = tick.enter().append("g").attr("class", "tick"), line = tick.select("line"), text = tick.select("text");
66
+ path = path.merge(path.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor"));
67
+ tick = tick.merge(tickEnter);
68
+ line = line.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x + "2", k * tickSizeInner));
69
+ text = text.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x, k * spacing).attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
70
+ if (context !== selection) {
71
+ path = path.transition(context);
72
+ tick = tick.transition(context);
73
+ line = line.transition(context);
74
+ text = text.transition(context);
75
+ tickExit = tickExit.transition(context).attr("opacity", epsilon).attr("transform", function(d) {
76
+ return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute("transform");
77
+ });
78
+ tickEnter.attr("opacity", epsilon).attr("transform", function(d) {
79
+ var p = this.parentNode.__axis;
80
+ return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset);
81
+ });
82
+ }
83
+ tickExit.remove();
84
+ path.attr("d", orient === left || orient === right ? tickSizeOuter ? "M" + k * tickSizeOuter + "," + range0 + "H" + offset + "V" + range1 + "H" + k * tickSizeOuter : "M" + offset + "," + range0 + "V" + range1 : tickSizeOuter ? "M" + range0 + "," + k * tickSizeOuter + "V" + offset + "H" + range1 + "V" + k * tickSizeOuter : "M" + range0 + "," + offset + "H" + range1);
85
+ tick.attr("opacity", 1).attr("transform", function(d) {
86
+ return transform(position(d) + offset);
87
+ });
88
+ line.attr(x + "2", k * tickSizeInner);
89
+ text.attr(x, k * spacing).text(format);
90
+ selection.filter(entering).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
91
+ selection.each(function() {
92
+ this.__axis = position;
93
+ });
94
+ }
95
+ axis2.scale = function(_) {
96
+ return arguments.length ? (scale = _, axis2) : scale;
97
+ };
98
+ axis2.ticks = function() {
99
+ return tickArguments = Array.from(arguments), axis2;
100
+ };
101
+ axis2.tickArguments = function(_) {
102
+ return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis2) : tickArguments.slice();
103
+ };
104
+ axis2.tickValues = function(_) {
105
+ return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis2) : tickValues && tickValues.slice();
106
+ };
107
+ axis2.tickFormat = function(_) {
108
+ return arguments.length ? (tickFormat = _, axis2) : tickFormat;
109
+ };
110
+ axis2.tickSize = function(_) {
111
+ return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis2) : tickSizeInner;
112
+ };
113
+ axis2.tickSizeInner = function(_) {
114
+ return arguments.length ? (tickSizeInner = +_, axis2) : tickSizeInner;
115
+ };
116
+ axis2.tickSizeOuter = function(_) {
117
+ return arguments.length ? (tickSizeOuter = +_, axis2) : tickSizeOuter;
118
+ };
119
+ axis2.tickPadding = function(_) {
120
+ return arguments.length ? (tickPadding = +_, axis2) : tickPadding;
121
+ };
122
+ axis2.offset = function(_) {
123
+ return arguments.length ? (offset = +_, axis2) : offset;
124
+ };
125
+ return axis2;
126
+ }
127
+ function axisTop(scale) {
128
+ return axis(top, scale);
129
+ }
130
+ function axisBottom(scale) {
131
+ return axis(bottom, scale);
132
+ }
133
+ const radians = Math.PI / 180;
134
+ const degrees = 180 / Math.PI;
135
+ const K = 18, Xn = 0.96422, Yn = 1, Zn = 0.82521, t0$1 = 4 / 29, t1$1 = 6 / 29, t2 = 3 * t1$1 * t1$1, t3 = t1$1 * t1$1 * t1$1;
136
+ function labConvert(o) {
137
+ if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
138
+ if (o instanceof Hcl) return hcl2lab(o);
139
+ if (!(o instanceof Rgb)) o = rgbConvert(o);
140
+ var r = rgb2lrgb(o.r), g = rgb2lrgb(o.g), b = rgb2lrgb(o.b), y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
141
+ if (r === g && g === b) x = z = y;
142
+ else {
143
+ x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
144
+ z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
145
+ }
146
+ return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
147
+ }
148
+ function lab(l, a, b, opacity) {
149
+ return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
150
+ }
151
+ function Lab(l, a, b, opacity) {
152
+ this.l = +l;
153
+ this.a = +a;
154
+ this.b = +b;
155
+ this.opacity = +opacity;
156
+ }
157
+ define(Lab, lab, extend(Color, {
158
+ brighter(k) {
159
+ return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
160
+ },
161
+ darker(k) {
162
+ return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
163
+ },
164
+ rgb() {
165
+ var y = (this.l + 16) / 116, x = isNaN(this.a) ? y : y + this.a / 500, z = isNaN(this.b) ? y : y - this.b / 200;
166
+ x = Xn * lab2xyz(x);
167
+ y = Yn * lab2xyz(y);
168
+ z = Zn * lab2xyz(z);
169
+ return new Rgb(
170
+ lrgb2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
171
+ lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.033454 * z),
172
+ lrgb2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
173
+ this.opacity
174
+ );
175
+ }
176
+ }));
177
+ function xyz2lab(t) {
178
+ return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0$1;
179
+ }
180
+ function lab2xyz(t) {
181
+ return t > t1$1 ? t * t * t : t2 * (t - t0$1);
182
+ }
183
+ function lrgb2rgb(x) {
184
+ return 255 * (x <= 31308e-7 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
185
+ }
186
+ function rgb2lrgb(x) {
187
+ return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
188
+ }
189
+ function hclConvert(o) {
190
+ if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
191
+ if (!(o instanceof Lab)) o = labConvert(o);
192
+ if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
193
+ var h = Math.atan2(o.b, o.a) * degrees;
194
+ return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
195
+ }
196
+ function hcl$1(h, c, l, opacity) {
197
+ return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
198
+ }
199
+ function Hcl(h, c, l, opacity) {
200
+ this.h = +h;
201
+ this.c = +c;
202
+ this.l = +l;
203
+ this.opacity = +opacity;
204
+ }
205
+ function hcl2lab(o) {
206
+ if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
207
+ var h = o.h * radians;
208
+ return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
209
+ }
210
+ define(Hcl, hcl$1, extend(Color, {
211
+ brighter(k) {
212
+ return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
213
+ },
214
+ darker(k) {
215
+ return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
216
+ },
217
+ rgb() {
218
+ return hcl2lab(this).rgb();
219
+ }
220
+ }));
221
+ function hcl(hue2) {
222
+ return function(start, end) {
223
+ var h = hue2((start = hcl$1(start)).h, (end = hcl$1(end)).h), c = nogamma(start.c, end.c), l = nogamma(start.l, end.l), opacity = nogamma(start.opacity, end.opacity);
224
+ return function(t) {
225
+ start.h = h(t);
226
+ start.c = c(t);
227
+ start.l = l(t);
228
+ start.opacity = opacity(t);
229
+ return start + "";
230
+ };
231
+ };
232
+ }
233
+ const interpolateHcl = hcl(hue);
234
+ function nice(domain, interval) {
235
+ domain = domain.slice();
236
+ var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t;
237
+ if (x1 < x0) {
238
+ t = i0, i0 = i1, i1 = t;
239
+ t = x0, x0 = x1, x1 = t;
240
+ }
241
+ domain[i0] = interval.floor(x0);
242
+ domain[i1] = interval.ceil(x1);
243
+ return domain;
244
+ }
245
+ const t0 = /* @__PURE__ */ new Date(), t1 = /* @__PURE__ */ new Date();
246
+ function timeInterval(floori, offseti, count, field) {
247
+ function interval(date2) {
248
+ return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
249
+ }
250
+ interval.floor = (date2) => {
251
+ return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
252
+ };
253
+ interval.ceil = (date2) => {
254
+ return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
255
+ };
256
+ interval.round = (date2) => {
257
+ const d0 = interval(date2), d1 = interval.ceil(date2);
258
+ return date2 - d0 < d1 - date2 ? d0 : d1;
259
+ };
260
+ interval.offset = (date2, step) => {
261
+ return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2;
262
+ };
263
+ interval.range = (start, stop, step) => {
264
+ const range = [];
265
+ start = interval.ceil(start);
266
+ step = step == null ? 1 : Math.floor(step);
267
+ if (!(start < stop) || !(step > 0)) return range;
268
+ let previous;
269
+ do
270
+ range.push(previous = /* @__PURE__ */ new Date(+start)), offseti(start, step), floori(start);
271
+ while (previous < start && start < stop);
272
+ return range;
273
+ };
274
+ interval.filter = (test) => {
275
+ return timeInterval((date2) => {
276
+ if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1);
277
+ }, (date2, step) => {
278
+ if (date2 >= date2) {
279
+ if (step < 0) while (++step <= 0) {
280
+ while (offseti(date2, -1), !test(date2)) {
281
+ }
282
+ }
283
+ else while (--step >= 0) {
284
+ while (offseti(date2, 1), !test(date2)) {
285
+ }
286
+ }
287
+ }
288
+ });
289
+ };
290
+ if (count) {
291
+ interval.count = (start, end) => {
292
+ t0.setTime(+start), t1.setTime(+end);
293
+ floori(t0), floori(t1);
294
+ return Math.floor(count(t0, t1));
295
+ };
296
+ interval.every = (step) => {
297
+ step = Math.floor(step);
298
+ return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field ? (d) => field(d) % step === 0 : (d) => interval.count(0, d) % step === 0);
299
+ };
300
+ }
301
+ return interval;
302
+ }
303
+ const millisecond = timeInterval(() => {
304
+ }, (date2, step) => {
305
+ date2.setTime(+date2 + step);
306
+ }, (start, end) => {
307
+ return end - start;
308
+ });
309
+ millisecond.every = (k) => {
310
+ k = Math.floor(k);
311
+ if (!isFinite(k) || !(k > 0)) return null;
312
+ if (!(k > 1)) return millisecond;
313
+ return timeInterval((date2) => {
314
+ date2.setTime(Math.floor(date2 / k) * k);
315
+ }, (date2, step) => {
316
+ date2.setTime(+date2 + step * k);
317
+ }, (start, end) => {
318
+ return (end - start) / k;
319
+ });
320
+ };
321
+ millisecond.range;
322
+ const durationSecond = 1e3;
323
+ const durationMinute = durationSecond * 60;
324
+ const durationHour = durationMinute * 60;
325
+ const durationDay = durationHour * 24;
326
+ const durationWeek = durationDay * 7;
327
+ const durationMonth = durationDay * 30;
328
+ const durationYear = durationDay * 365;
329
+ const second = timeInterval((date2) => {
330
+ date2.setTime(date2 - date2.getMilliseconds());
331
+ }, (date2, step) => {
332
+ date2.setTime(+date2 + step * durationSecond);
333
+ }, (start, end) => {
334
+ return (end - start) / durationSecond;
335
+ }, (date2) => {
336
+ return date2.getUTCSeconds();
337
+ });
338
+ second.range;
339
+ const timeMinute = timeInterval((date2) => {
340
+ date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond);
341
+ }, (date2, step) => {
342
+ date2.setTime(+date2 + step * durationMinute);
343
+ }, (start, end) => {
344
+ return (end - start) / durationMinute;
345
+ }, (date2) => {
346
+ return date2.getMinutes();
347
+ });
348
+ timeMinute.range;
349
+ const utcMinute = timeInterval((date2) => {
350
+ date2.setUTCSeconds(0, 0);
351
+ }, (date2, step) => {
352
+ date2.setTime(+date2 + step * durationMinute);
353
+ }, (start, end) => {
354
+ return (end - start) / durationMinute;
355
+ }, (date2) => {
356
+ return date2.getUTCMinutes();
357
+ });
358
+ utcMinute.range;
359
+ const timeHour = timeInterval((date2) => {
360
+ date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute);
361
+ }, (date2, step) => {
362
+ date2.setTime(+date2 + step * durationHour);
363
+ }, (start, end) => {
364
+ return (end - start) / durationHour;
365
+ }, (date2) => {
366
+ return date2.getHours();
367
+ });
368
+ timeHour.range;
369
+ const utcHour = timeInterval((date2) => {
370
+ date2.setUTCMinutes(0, 0, 0);
371
+ }, (date2, step) => {
372
+ date2.setTime(+date2 + step * durationHour);
373
+ }, (start, end) => {
374
+ return (end - start) / durationHour;
375
+ }, (date2) => {
376
+ return date2.getUTCHours();
377
+ });
378
+ utcHour.range;
379
+ const timeDay = timeInterval(
380
+ (date2) => date2.setHours(0, 0, 0, 0),
381
+ (date2, step) => date2.setDate(date2.getDate() + step),
382
+ (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
383
+ (date2) => date2.getDate() - 1
384
+ );
385
+ timeDay.range;
386
+ const utcDay = timeInterval((date2) => {
387
+ date2.setUTCHours(0, 0, 0, 0);
388
+ }, (date2, step) => {
389
+ date2.setUTCDate(date2.getUTCDate() + step);
390
+ }, (start, end) => {
391
+ return (end - start) / durationDay;
392
+ }, (date2) => {
393
+ return date2.getUTCDate() - 1;
394
+ });
395
+ utcDay.range;
396
+ const unixDay = timeInterval((date2) => {
397
+ date2.setUTCHours(0, 0, 0, 0);
398
+ }, (date2, step) => {
399
+ date2.setUTCDate(date2.getUTCDate() + step);
400
+ }, (start, end) => {
401
+ return (end - start) / durationDay;
402
+ }, (date2) => {
403
+ return Math.floor(date2 / durationDay);
404
+ });
405
+ unixDay.range;
406
+ function timeWeekday(i) {
407
+ return timeInterval((date2) => {
408
+ date2.setDate(date2.getDate() - (date2.getDay() + 7 - i) % 7);
409
+ date2.setHours(0, 0, 0, 0);
410
+ }, (date2, step) => {
411
+ date2.setDate(date2.getDate() + step * 7);
412
+ }, (start, end) => {
413
+ return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
414
+ });
415
+ }
416
+ const timeSunday = timeWeekday(0);
417
+ const timeMonday = timeWeekday(1);
418
+ const timeTuesday = timeWeekday(2);
419
+ const timeWednesday = timeWeekday(3);
420
+ const timeThursday = timeWeekday(4);
421
+ const timeFriday = timeWeekday(5);
422
+ const timeSaturday = timeWeekday(6);
423
+ timeSunday.range;
424
+ timeMonday.range;
425
+ timeTuesday.range;
426
+ timeWednesday.range;
427
+ timeThursday.range;
428
+ timeFriday.range;
429
+ timeSaturday.range;
430
+ function utcWeekday(i) {
431
+ return timeInterval((date2) => {
432
+ date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i) % 7);
433
+ date2.setUTCHours(0, 0, 0, 0);
434
+ }, (date2, step) => {
435
+ date2.setUTCDate(date2.getUTCDate() + step * 7);
436
+ }, (start, end) => {
437
+ return (end - start) / durationWeek;
438
+ });
439
+ }
440
+ const utcSunday = utcWeekday(0);
441
+ const utcMonday = utcWeekday(1);
442
+ const utcTuesday = utcWeekday(2);
443
+ const utcWednesday = utcWeekday(3);
444
+ const utcThursday = utcWeekday(4);
445
+ const utcFriday = utcWeekday(5);
446
+ const utcSaturday = utcWeekday(6);
447
+ utcSunday.range;
448
+ utcMonday.range;
449
+ utcTuesday.range;
450
+ utcWednesday.range;
451
+ utcThursday.range;
452
+ utcFriday.range;
453
+ utcSaturday.range;
454
+ const timeMonth = timeInterval((date2) => {
455
+ date2.setDate(1);
456
+ date2.setHours(0, 0, 0, 0);
457
+ }, (date2, step) => {
458
+ date2.setMonth(date2.getMonth() + step);
459
+ }, (start, end) => {
460
+ return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
461
+ }, (date2) => {
462
+ return date2.getMonth();
463
+ });
464
+ timeMonth.range;
465
+ const utcMonth = timeInterval((date2) => {
466
+ date2.setUTCDate(1);
467
+ date2.setUTCHours(0, 0, 0, 0);
468
+ }, (date2, step) => {
469
+ date2.setUTCMonth(date2.getUTCMonth() + step);
470
+ }, (start, end) => {
471
+ return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
472
+ }, (date2) => {
473
+ return date2.getUTCMonth();
474
+ });
475
+ utcMonth.range;
476
+ const timeYear = timeInterval((date2) => {
477
+ date2.setMonth(0, 1);
478
+ date2.setHours(0, 0, 0, 0);
479
+ }, (date2, step) => {
480
+ date2.setFullYear(date2.getFullYear() + step);
481
+ }, (start, end) => {
482
+ return end.getFullYear() - start.getFullYear();
483
+ }, (date2) => {
484
+ return date2.getFullYear();
485
+ });
486
+ timeYear.every = (k) => {
487
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date2) => {
488
+ date2.setFullYear(Math.floor(date2.getFullYear() / k) * k);
489
+ date2.setMonth(0, 1);
490
+ date2.setHours(0, 0, 0, 0);
491
+ }, (date2, step) => {
492
+ date2.setFullYear(date2.getFullYear() + step * k);
493
+ });
494
+ };
495
+ timeYear.range;
496
+ const utcYear = timeInterval((date2) => {
497
+ date2.setUTCMonth(0, 1);
498
+ date2.setUTCHours(0, 0, 0, 0);
499
+ }, (date2, step) => {
500
+ date2.setUTCFullYear(date2.getUTCFullYear() + step);
501
+ }, (start, end) => {
502
+ return end.getUTCFullYear() - start.getUTCFullYear();
503
+ }, (date2) => {
504
+ return date2.getUTCFullYear();
505
+ });
506
+ utcYear.every = (k) => {
507
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date2) => {
508
+ date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k) * k);
509
+ date2.setUTCMonth(0, 1);
510
+ date2.setUTCHours(0, 0, 0, 0);
511
+ }, (date2, step) => {
512
+ date2.setUTCFullYear(date2.getUTCFullYear() + step * k);
513
+ });
514
+ };
515
+ utcYear.range;
516
+ function ticker(year, month, week, day, hour, minute) {
517
+ const tickIntervals = [
518
+ [second, 1, durationSecond],
519
+ [second, 5, 5 * durationSecond],
520
+ [second, 15, 15 * durationSecond],
521
+ [second, 30, 30 * durationSecond],
522
+ [minute, 1, durationMinute],
523
+ [minute, 5, 5 * durationMinute],
524
+ [minute, 15, 15 * durationMinute],
525
+ [minute, 30, 30 * durationMinute],
526
+ [hour, 1, durationHour],
527
+ [hour, 3, 3 * durationHour],
528
+ [hour, 6, 6 * durationHour],
529
+ [hour, 12, 12 * durationHour],
530
+ [day, 1, durationDay],
531
+ [day, 2, 2 * durationDay],
532
+ [week, 1, durationWeek],
533
+ [month, 1, durationMonth],
534
+ [month, 3, 3 * durationMonth],
535
+ [year, 1, durationYear]
536
+ ];
537
+ function ticks(start, stop, count) {
538
+ const reverse = stop < start;
539
+ if (reverse) [start, stop] = [stop, start];
540
+ const interval = count && typeof count.range === "function" ? count : tickInterval2(start, stop, count);
541
+ const ticks2 = interval ? interval.range(start, +stop + 1) : [];
542
+ return reverse ? ticks2.reverse() : ticks2;
543
+ }
544
+ function tickInterval2(start, stop, count) {
545
+ const target = Math.abs(stop - start) / count;
546
+ const i = bisector(([, , step2]) => step2).right(tickIntervals, target);
547
+ if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
548
+ if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));
549
+ const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
550
+ return t.every(step);
551
+ }
552
+ return [ticks, tickInterval2];
553
+ }
554
+ const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);
555
+ function localDate(d) {
556
+ if (0 <= d.y && d.y < 100) {
557
+ var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
558
+ date2.setFullYear(d.y);
559
+ return date2;
560
+ }
561
+ return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
562
+ }
563
+ function utcDate(d) {
564
+ if (0 <= d.y && d.y < 100) {
565
+ var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
566
+ date2.setUTCFullYear(d.y);
567
+ return date2;
568
+ }
569
+ return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
570
+ }
571
+ function newDate(y, m, d) {
572
+ return { y, m, d, H: 0, M: 0, S: 0, L: 0 };
573
+ }
574
+ function formatLocale(locale2) {
575
+ var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths;
576
+ var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
577
+ var formats = {
578
+ "a": formatShortWeekday,
579
+ "A": formatWeekday,
580
+ "b": formatShortMonth,
581
+ "B": formatMonth,
582
+ "c": null,
583
+ "d": formatDayOfMonth,
584
+ "e": formatDayOfMonth,
585
+ "f": formatMicroseconds,
586
+ "g": formatYearISO,
587
+ "G": formatFullYearISO,
588
+ "H": formatHour24,
589
+ "I": formatHour12,
590
+ "j": formatDayOfYear,
591
+ "L": formatMilliseconds,
592
+ "m": formatMonthNumber,
593
+ "M": formatMinutes,
594
+ "p": formatPeriod,
595
+ "q": formatQuarter,
596
+ "Q": formatUnixTimestamp,
597
+ "s": formatUnixTimestampSeconds,
598
+ "S": formatSeconds,
599
+ "u": formatWeekdayNumberMonday,
600
+ "U": formatWeekNumberSunday,
601
+ "V": formatWeekNumberISO,
602
+ "w": formatWeekdayNumberSunday,
603
+ "W": formatWeekNumberMonday,
604
+ "x": null,
605
+ "X": null,
606
+ "y": formatYear,
607
+ "Y": formatFullYear,
608
+ "Z": formatZone,
609
+ "%": formatLiteralPercent
610
+ };
611
+ var utcFormats = {
612
+ "a": formatUTCShortWeekday,
613
+ "A": formatUTCWeekday,
614
+ "b": formatUTCShortMonth,
615
+ "B": formatUTCMonth,
616
+ "c": null,
617
+ "d": formatUTCDayOfMonth,
618
+ "e": formatUTCDayOfMonth,
619
+ "f": formatUTCMicroseconds,
620
+ "g": formatUTCYearISO,
621
+ "G": formatUTCFullYearISO,
622
+ "H": formatUTCHour24,
623
+ "I": formatUTCHour12,
624
+ "j": formatUTCDayOfYear,
625
+ "L": formatUTCMilliseconds,
626
+ "m": formatUTCMonthNumber,
627
+ "M": formatUTCMinutes,
628
+ "p": formatUTCPeriod,
629
+ "q": formatUTCQuarter,
630
+ "Q": formatUnixTimestamp,
631
+ "s": formatUnixTimestampSeconds,
632
+ "S": formatUTCSeconds,
633
+ "u": formatUTCWeekdayNumberMonday,
634
+ "U": formatUTCWeekNumberSunday,
635
+ "V": formatUTCWeekNumberISO,
636
+ "w": formatUTCWeekdayNumberSunday,
637
+ "W": formatUTCWeekNumberMonday,
638
+ "x": null,
639
+ "X": null,
640
+ "y": formatUTCYear,
641
+ "Y": formatUTCFullYear,
642
+ "Z": formatUTCZone,
643
+ "%": formatLiteralPercent
644
+ };
645
+ var parses = {
646
+ "a": parseShortWeekday,
647
+ "A": parseWeekday,
648
+ "b": parseShortMonth,
649
+ "B": parseMonth,
650
+ "c": parseLocaleDateTime,
651
+ "d": parseDayOfMonth,
652
+ "e": parseDayOfMonth,
653
+ "f": parseMicroseconds,
654
+ "g": parseYear,
655
+ "G": parseFullYear,
656
+ "H": parseHour24,
657
+ "I": parseHour24,
658
+ "j": parseDayOfYear,
659
+ "L": parseMilliseconds,
660
+ "m": parseMonthNumber,
661
+ "M": parseMinutes,
662
+ "p": parsePeriod,
663
+ "q": parseQuarter,
664
+ "Q": parseUnixTimestamp,
665
+ "s": parseUnixTimestampSeconds,
666
+ "S": parseSeconds,
667
+ "u": parseWeekdayNumberMonday,
668
+ "U": parseWeekNumberSunday,
669
+ "V": parseWeekNumberISO,
670
+ "w": parseWeekdayNumberSunday,
671
+ "W": parseWeekNumberMonday,
672
+ "x": parseLocaleDate,
673
+ "X": parseLocaleTime,
674
+ "y": parseYear,
675
+ "Y": parseFullYear,
676
+ "Z": parseZone,
677
+ "%": parseLiteralPercent
678
+ };
679
+ formats.x = newFormat(locale_date, formats);
680
+ formats.X = newFormat(locale_time, formats);
681
+ formats.c = newFormat(locale_dateTime, formats);
682
+ utcFormats.x = newFormat(locale_date, utcFormats);
683
+ utcFormats.X = newFormat(locale_time, utcFormats);
684
+ utcFormats.c = newFormat(locale_dateTime, utcFormats);
685
+ function newFormat(specifier, formats2) {
686
+ return function(date2) {
687
+ var string = [], i = -1, j = 0, n = specifier.length, c, pad2, format;
688
+ if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2);
689
+ while (++i < n) {
690
+ if (specifier.charCodeAt(i) === 37) {
691
+ string.push(specifier.slice(j, i));
692
+ if ((pad2 = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
693
+ else pad2 = c === "e" ? " " : "0";
694
+ if (format = formats2[c]) c = format(date2, pad2);
695
+ string.push(c);
696
+ j = i + 1;
697
+ }
698
+ }
699
+ string.push(specifier.slice(j, i));
700
+ return string.join("");
701
+ };
702
+ }
703
+ function newParse(specifier, Z) {
704
+ return function(string) {
705
+ var d = newDate(1900, void 0, 1), i = parseSpecifier(d, specifier, string += "", 0), week, day;
706
+ if (i != string.length) return null;
707
+ if ("Q" in d) return new Date(d.Q);
708
+ if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
709
+ if (Z && !("Z" in d)) d.Z = 0;
710
+ if ("p" in d) d.H = d.H % 12 + d.p * 12;
711
+ if (d.m === void 0) d.m = "q" in d ? d.q : 0;
712
+ if ("V" in d) {
713
+ if (d.V < 1 || d.V > 53) return null;
714
+ if (!("w" in d)) d.w = 1;
715
+ if ("Z" in d) {
716
+ week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
717
+ week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
718
+ week = utcDay.offset(week, (d.V - 1) * 7);
719
+ d.y = week.getUTCFullYear();
720
+ d.m = week.getUTCMonth();
721
+ d.d = week.getUTCDate() + (d.w + 6) % 7;
722
+ } else {
723
+ week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
724
+ week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
725
+ week = timeDay.offset(week, (d.V - 1) * 7);
726
+ d.y = week.getFullYear();
727
+ d.m = week.getMonth();
728
+ d.d = week.getDate() + (d.w + 6) % 7;
729
+ }
730
+ } else if ("W" in d || "U" in d) {
731
+ if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
732
+ day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
733
+ d.m = 0;
734
+ d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
735
+ }
736
+ if ("Z" in d) {
737
+ d.H += d.Z / 100 | 0;
738
+ d.M += d.Z % 100;
739
+ return utcDate(d);
740
+ }
741
+ return localDate(d);
742
+ };
743
+ }
744
+ function parseSpecifier(d, specifier, string, j) {
745
+ var i = 0, n = specifier.length, m = string.length, c, parse;
746
+ while (i < n) {
747
+ if (j >= m) return -1;
748
+ c = specifier.charCodeAt(i++);
749
+ if (c === 37) {
750
+ c = specifier.charAt(i++);
751
+ parse = parses[c in pads ? specifier.charAt(i++) : c];
752
+ if (!parse || (j = parse(d, string, j)) < 0) return -1;
753
+ } else if (c != string.charCodeAt(j++)) {
754
+ return -1;
755
+ }
756
+ }
757
+ return j;
758
+ }
759
+ function parsePeriod(d, string, i) {
760
+ var n = periodRe.exec(string.slice(i));
761
+ return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
762
+ }
763
+ function parseShortWeekday(d, string, i) {
764
+ var n = shortWeekdayRe.exec(string.slice(i));
765
+ return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
766
+ }
767
+ function parseWeekday(d, string, i) {
768
+ var n = weekdayRe.exec(string.slice(i));
769
+ return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
770
+ }
771
+ function parseShortMonth(d, string, i) {
772
+ var n = shortMonthRe.exec(string.slice(i));
773
+ return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
774
+ }
775
+ function parseMonth(d, string, i) {
776
+ var n = monthRe.exec(string.slice(i));
777
+ return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
778
+ }
779
+ function parseLocaleDateTime(d, string, i) {
780
+ return parseSpecifier(d, locale_dateTime, string, i);
781
+ }
782
+ function parseLocaleDate(d, string, i) {
783
+ return parseSpecifier(d, locale_date, string, i);
784
+ }
785
+ function parseLocaleTime(d, string, i) {
786
+ return parseSpecifier(d, locale_time, string, i);
787
+ }
788
+ function formatShortWeekday(d) {
789
+ return locale_shortWeekdays[d.getDay()];
790
+ }
791
+ function formatWeekday(d) {
792
+ return locale_weekdays[d.getDay()];
793
+ }
794
+ function formatShortMonth(d) {
795
+ return locale_shortMonths[d.getMonth()];
796
+ }
797
+ function formatMonth(d) {
798
+ return locale_months[d.getMonth()];
799
+ }
800
+ function formatPeriod(d) {
801
+ return locale_periods[+(d.getHours() >= 12)];
802
+ }
803
+ function formatQuarter(d) {
804
+ return 1 + ~~(d.getMonth() / 3);
805
+ }
806
+ function formatUTCShortWeekday(d) {
807
+ return locale_shortWeekdays[d.getUTCDay()];
808
+ }
809
+ function formatUTCWeekday(d) {
810
+ return locale_weekdays[d.getUTCDay()];
811
+ }
812
+ function formatUTCShortMonth(d) {
813
+ return locale_shortMonths[d.getUTCMonth()];
814
+ }
815
+ function formatUTCMonth(d) {
816
+ return locale_months[d.getUTCMonth()];
817
+ }
818
+ function formatUTCPeriod(d) {
819
+ return locale_periods[+(d.getUTCHours() >= 12)];
820
+ }
821
+ function formatUTCQuarter(d) {
822
+ return 1 + ~~(d.getUTCMonth() / 3);
823
+ }
824
+ return {
825
+ format: function(specifier) {
826
+ var f = newFormat(specifier += "", formats);
827
+ f.toString = function() {
828
+ return specifier;
829
+ };
830
+ return f;
831
+ },
832
+ parse: function(specifier) {
833
+ var p = newParse(specifier += "", false);
834
+ p.toString = function() {
835
+ return specifier;
836
+ };
837
+ return p;
838
+ },
839
+ utcFormat: function(specifier) {
840
+ var f = newFormat(specifier += "", utcFormats);
841
+ f.toString = function() {
842
+ return specifier;
843
+ };
844
+ return f;
845
+ },
846
+ utcParse: function(specifier) {
847
+ var p = newParse(specifier += "", true);
848
+ p.toString = function() {
849
+ return specifier;
850
+ };
851
+ return p;
852
+ }
853
+ };
854
+ }
855
+ var pads = { "-": "", "_": " ", "0": "0" }, numberRe = /^\s*\d+/, percentRe = /^%/, requoteRe = /[\\^$*+?|[\]().{}]/g;
856
+ function pad(value, fill, width) {
857
+ var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
858
+ return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
859
+ }
860
+ function requote(s) {
861
+ return s.replace(requoteRe, "\\$&");
862
+ }
863
+ function formatRe(names) {
864
+ return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
865
+ }
866
+ function formatLookup(names) {
867
+ return new Map(names.map((name, i) => [name.toLowerCase(), i]));
868
+ }
869
+ function parseWeekdayNumberSunday(d, string, i) {
870
+ var n = numberRe.exec(string.slice(i, i + 1));
871
+ return n ? (d.w = +n[0], i + n[0].length) : -1;
872
+ }
873
+ function parseWeekdayNumberMonday(d, string, i) {
874
+ var n = numberRe.exec(string.slice(i, i + 1));
875
+ return n ? (d.u = +n[0], i + n[0].length) : -1;
876
+ }
877
+ function parseWeekNumberSunday(d, string, i) {
878
+ var n = numberRe.exec(string.slice(i, i + 2));
879
+ return n ? (d.U = +n[0], i + n[0].length) : -1;
880
+ }
881
+ function parseWeekNumberISO(d, string, i) {
882
+ var n = numberRe.exec(string.slice(i, i + 2));
883
+ return n ? (d.V = +n[0], i + n[0].length) : -1;
884
+ }
885
+ function parseWeekNumberMonday(d, string, i) {
886
+ var n = numberRe.exec(string.slice(i, i + 2));
887
+ return n ? (d.W = +n[0], i + n[0].length) : -1;
888
+ }
889
+ function parseFullYear(d, string, i) {
890
+ var n = numberRe.exec(string.slice(i, i + 4));
891
+ return n ? (d.y = +n[0], i + n[0].length) : -1;
892
+ }
893
+ function parseYear(d, string, i) {
894
+ var n = numberRe.exec(string.slice(i, i + 2));
895
+ return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1;
896
+ }
897
+ function parseZone(d, string, i) {
898
+ var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
899
+ return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
900
+ }
901
+ function parseQuarter(d, string, i) {
902
+ var n = numberRe.exec(string.slice(i, i + 1));
903
+ return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
904
+ }
905
+ function parseMonthNumber(d, string, i) {
906
+ var n = numberRe.exec(string.slice(i, i + 2));
907
+ return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
908
+ }
909
+ function parseDayOfMonth(d, string, i) {
910
+ var n = numberRe.exec(string.slice(i, i + 2));
911
+ return n ? (d.d = +n[0], i + n[0].length) : -1;
912
+ }
913
+ function parseDayOfYear(d, string, i) {
914
+ var n = numberRe.exec(string.slice(i, i + 3));
915
+ return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
916
+ }
917
+ function parseHour24(d, string, i) {
918
+ var n = numberRe.exec(string.slice(i, i + 2));
919
+ return n ? (d.H = +n[0], i + n[0].length) : -1;
920
+ }
921
+ function parseMinutes(d, string, i) {
922
+ var n = numberRe.exec(string.slice(i, i + 2));
923
+ return n ? (d.M = +n[0], i + n[0].length) : -1;
924
+ }
925
+ function parseSeconds(d, string, i) {
926
+ var n = numberRe.exec(string.slice(i, i + 2));
927
+ return n ? (d.S = +n[0], i + n[0].length) : -1;
928
+ }
929
+ function parseMilliseconds(d, string, i) {
930
+ var n = numberRe.exec(string.slice(i, i + 3));
931
+ return n ? (d.L = +n[0], i + n[0].length) : -1;
932
+ }
933
+ function parseMicroseconds(d, string, i) {
934
+ var n = numberRe.exec(string.slice(i, i + 6));
935
+ return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1;
936
+ }
937
+ function parseLiteralPercent(d, string, i) {
938
+ var n = percentRe.exec(string.slice(i, i + 1));
939
+ return n ? i + n[0].length : -1;
940
+ }
941
+ function parseUnixTimestamp(d, string, i) {
942
+ var n = numberRe.exec(string.slice(i));
943
+ return n ? (d.Q = +n[0], i + n[0].length) : -1;
944
+ }
945
+ function parseUnixTimestampSeconds(d, string, i) {
946
+ var n = numberRe.exec(string.slice(i));
947
+ return n ? (d.s = +n[0], i + n[0].length) : -1;
948
+ }
949
+ function formatDayOfMonth(d, p) {
950
+ return pad(d.getDate(), p, 2);
951
+ }
952
+ function formatHour24(d, p) {
953
+ return pad(d.getHours(), p, 2);
954
+ }
955
+ function formatHour12(d, p) {
956
+ return pad(d.getHours() % 12 || 12, p, 2);
957
+ }
958
+ function formatDayOfYear(d, p) {
959
+ return pad(1 + timeDay.count(timeYear(d), d), p, 3);
960
+ }
961
+ function formatMilliseconds(d, p) {
962
+ return pad(d.getMilliseconds(), p, 3);
963
+ }
964
+ function formatMicroseconds(d, p) {
965
+ return formatMilliseconds(d, p) + "000";
966
+ }
967
+ function formatMonthNumber(d, p) {
968
+ return pad(d.getMonth() + 1, p, 2);
969
+ }
970
+ function formatMinutes(d, p) {
971
+ return pad(d.getMinutes(), p, 2);
972
+ }
973
+ function formatSeconds(d, p) {
974
+ return pad(d.getSeconds(), p, 2);
975
+ }
976
+ function formatWeekdayNumberMonday(d) {
977
+ var day = d.getDay();
978
+ return day === 0 ? 7 : day;
979
+ }
980
+ function formatWeekNumberSunday(d, p) {
981
+ return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);
982
+ }
983
+ function dISO(d) {
984
+ var day = d.getDay();
985
+ return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
986
+ }
987
+ function formatWeekNumberISO(d, p) {
988
+ d = dISO(d);
989
+ return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
990
+ }
991
+ function formatWeekdayNumberSunday(d) {
992
+ return d.getDay();
993
+ }
994
+ function formatWeekNumberMonday(d, p) {
995
+ return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);
996
+ }
997
+ function formatYear(d, p) {
998
+ return pad(d.getFullYear() % 100, p, 2);
999
+ }
1000
+ function formatYearISO(d, p) {
1001
+ d = dISO(d);
1002
+ return pad(d.getFullYear() % 100, p, 2);
1003
+ }
1004
+ function formatFullYear(d, p) {
1005
+ return pad(d.getFullYear() % 1e4, p, 4);
1006
+ }
1007
+ function formatFullYearISO(d, p) {
1008
+ var day = d.getDay();
1009
+ d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
1010
+ return pad(d.getFullYear() % 1e4, p, 4);
1011
+ }
1012
+ function formatZone(d) {
1013
+ var z = d.getTimezoneOffset();
1014
+ return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2);
1015
+ }
1016
+ function formatUTCDayOfMonth(d, p) {
1017
+ return pad(d.getUTCDate(), p, 2);
1018
+ }
1019
+ function formatUTCHour24(d, p) {
1020
+ return pad(d.getUTCHours(), p, 2);
1021
+ }
1022
+ function formatUTCHour12(d, p) {
1023
+ return pad(d.getUTCHours() % 12 || 12, p, 2);
1024
+ }
1025
+ function formatUTCDayOfYear(d, p) {
1026
+ return pad(1 + utcDay.count(utcYear(d), d), p, 3);
1027
+ }
1028
+ function formatUTCMilliseconds(d, p) {
1029
+ return pad(d.getUTCMilliseconds(), p, 3);
1030
+ }
1031
+ function formatUTCMicroseconds(d, p) {
1032
+ return formatUTCMilliseconds(d, p) + "000";
1033
+ }
1034
+ function formatUTCMonthNumber(d, p) {
1035
+ return pad(d.getUTCMonth() + 1, p, 2);
1036
+ }
1037
+ function formatUTCMinutes(d, p) {
1038
+ return pad(d.getUTCMinutes(), p, 2);
1039
+ }
1040
+ function formatUTCSeconds(d, p) {
1041
+ return pad(d.getUTCSeconds(), p, 2);
1042
+ }
1043
+ function formatUTCWeekdayNumberMonday(d) {
1044
+ var dow = d.getUTCDay();
1045
+ return dow === 0 ? 7 : dow;
1046
+ }
1047
+ function formatUTCWeekNumberSunday(d, p) {
1048
+ return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
1049
+ }
1050
+ function UTCdISO(d) {
1051
+ var day = d.getUTCDay();
1052
+ return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
1053
+ }
1054
+ function formatUTCWeekNumberISO(d, p) {
1055
+ d = UTCdISO(d);
1056
+ return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
1057
+ }
1058
+ function formatUTCWeekdayNumberSunday(d) {
1059
+ return d.getUTCDay();
1060
+ }
1061
+ function formatUTCWeekNumberMonday(d, p) {
1062
+ return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
1063
+ }
1064
+ function formatUTCYear(d, p) {
1065
+ return pad(d.getUTCFullYear() % 100, p, 2);
1066
+ }
1067
+ function formatUTCYearISO(d, p) {
1068
+ d = UTCdISO(d);
1069
+ return pad(d.getUTCFullYear() % 100, p, 2);
1070
+ }
1071
+ function formatUTCFullYear(d, p) {
1072
+ return pad(d.getUTCFullYear() % 1e4, p, 4);
1073
+ }
1074
+ function formatUTCFullYearISO(d, p) {
1075
+ var day = d.getUTCDay();
1076
+ d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
1077
+ return pad(d.getUTCFullYear() % 1e4, p, 4);
1078
+ }
1079
+ function formatUTCZone() {
1080
+ return "+0000";
1081
+ }
1082
+ function formatLiteralPercent() {
1083
+ return "%";
1084
+ }
1085
+ function formatUnixTimestamp(d) {
1086
+ return +d;
1087
+ }
1088
+ function formatUnixTimestampSeconds(d) {
1089
+ return Math.floor(+d / 1e3);
1090
+ }
1091
+ var locale;
1092
+ var timeFormat;
1093
+ defaultLocale({
1094
+ dateTime: "%x, %X",
1095
+ date: "%-m/%-d/%Y",
1096
+ time: "%-I:%M:%S %p",
1097
+ periods: ["AM", "PM"],
1098
+ days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
1099
+ shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1100
+ months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
1101
+ shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
1102
+ });
1103
+ function defaultLocale(definition) {
1104
+ locale = formatLocale(definition);
1105
+ timeFormat = locale.format;
1106
+ locale.parse;
1107
+ locale.utcFormat;
1108
+ locale.utcParse;
1109
+ return locale;
1110
+ }
1111
+ function date(t) {
1112
+ return new Date(t);
1113
+ }
1114
+ function number(t) {
1115
+ return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);
1116
+ }
1117
+ function calendar(ticks, tickInterval2, year, month, week, day, hour, minute, second2, format) {
1118
+ var scale = continuous(), invert = scale.invert, domain = scale.domain;
1119
+ var formatMillisecond = format(".%L"), formatSecond = format(":%S"), formatMinute = format("%I:%M"), formatHour = format("%I %p"), formatDay = format("%a %d"), formatWeek = format("%b %d"), formatMonth = format("%B"), formatYear2 = format("%Y");
1120
+ function tickFormat(date2) {
1121
+ return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2);
1122
+ }
1123
+ scale.invert = function(y) {
1124
+ return new Date(invert(y));
1125
+ };
1126
+ scale.domain = function(_) {
1127
+ return arguments.length ? domain(Array.from(_, number)) : domain().map(date);
1128
+ };
1129
+ scale.ticks = function(interval) {
1130
+ var d = domain();
1131
+ return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
1132
+ };
1133
+ scale.tickFormat = function(count, specifier) {
1134
+ return specifier == null ? tickFormat : format(specifier);
1135
+ };
1136
+ scale.nice = function(interval) {
1137
+ var d = domain();
1138
+ if (!interval || typeof interval.range !== "function") interval = tickInterval2(d[0], d[d.length - 1], interval == null ? 10 : interval);
1139
+ return interval ? domain(nice(d, interval)) : scale;
1140
+ };
1141
+ scale.copy = function() {
1142
+ return copy(scale, calendar(ticks, tickInterval2, year, month, week, day, hour, minute, second2, format));
1143
+ };
1144
+ return scale;
1145
+ }
1146
+ function time() {
1147
+ return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
1148
+ }
1149
+ var isoWeek$1 = { exports: {} };
1150
+ var isoWeek = isoWeek$1.exports;
1151
+ var hasRequiredIsoWeek;
1152
+ function requireIsoWeek() {
1153
+ if (hasRequiredIsoWeek) return isoWeek$1.exports;
1154
+ hasRequiredIsoWeek = 1;
1155
+ (function(module, exports) {
1156
+ !(function(e, t) {
1157
+ module.exports = t();
1158
+ })(isoWeek, (function() {
1159
+ var e = "day";
1160
+ return function(t, i, s) {
1161
+ var a = function(t4) {
1162
+ return t4.add(4 - t4.isoWeekday(), e);
1163
+ }, d = i.prototype;
1164
+ d.isoWeekYear = function() {
1165
+ return a(this).year();
1166
+ }, d.isoWeek = function(t4) {
1167
+ if (!this.$utils().u(t4)) return this.add(7 * (t4 - this.isoWeek()), e);
1168
+ var i2, d2, n2, o, r = a(this), u = (i2 = this.isoWeekYear(), d2 = this.$u, n2 = (d2 ? s.utc : s)().year(i2).startOf("year"), o = 4 - n2.isoWeekday(), n2.isoWeekday() > 4 && (o += 7), n2.add(o, e));
1169
+ return r.diff(u, "week") + 1;
1170
+ }, d.isoWeekday = function(e2) {
1171
+ return this.$utils().u(e2) ? this.day() || 7 : this.day(this.day() % 7 ? e2 : e2 - 7);
1172
+ };
1173
+ var n = d.startOf;
1174
+ d.startOf = function(e2, t4) {
1175
+ var i2 = this.$utils(), s2 = !!i2.u(t4) || t4;
1176
+ return "isoweek" === i2.p(e2) ? s2 ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : n.bind(this)(e2, t4);
1177
+ };
1178
+ };
1179
+ }));
1180
+ })(isoWeek$1);
1181
+ return isoWeek$1.exports;
1182
+ }
1183
+ var isoWeekExports = requireIsoWeek();
1184
+ const dayjsIsoWeek = /* @__PURE__ */ getDefaultExportFromCjs(isoWeekExports);
1185
+ var customParseFormat$1 = { exports: {} };
1186
+ var customParseFormat = customParseFormat$1.exports;
1187
+ var hasRequiredCustomParseFormat;
1188
+ function requireCustomParseFormat() {
1189
+ if (hasRequiredCustomParseFormat) return customParseFormat$1.exports;
1190
+ hasRequiredCustomParseFormat = 1;
1191
+ (function(module, exports) {
1192
+ !(function(e, t) {
1193
+ module.exports = t();
1194
+ })(customParseFormat, (function() {
1195
+ var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
1196
+ return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
1197
+ };
1198
+ var f = function(e2) {
1199
+ return function(t4) {
1200
+ this[e2] = +t4;
1201
+ };
1202
+ }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
1203
+ (this.zone || (this.zone = {})).offset = (function(e3) {
1204
+ if (!e3) return 0;
1205
+ if ("Z" === e3) return 0;
1206
+ var t4 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t4[1] + (+t4[2] || 0);
1207
+ return 0 === n2 ? 0 : "+" === t4[0] ? -n2 : n2;
1208
+ })(e2);
1209
+ }], u = function(e2) {
1210
+ var t4 = s[e2];
1211
+ return t4 && (t4.indexOf ? t4 : t4.s.concat(t4.f));
1212
+ }, d = function(e2, t4) {
1213
+ var n2, r2 = s.meridiem;
1214
+ if (r2) {
1215
+ for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t4)) > -1) {
1216
+ n2 = i2 > 12;
1217
+ break;
1218
+ }
1219
+ } else n2 = e2 === (t4 ? "pm" : "PM");
1220
+ return n2;
1221
+ }, c = { A: [o, function(e2) {
1222
+ this.afternoon = d(e2, false);
1223
+ }], a: [o, function(e2) {
1224
+ this.afternoon = d(e2, true);
1225
+ }], Q: [n, function(e2) {
1226
+ this.month = 3 * (e2 - 1) + 1;
1227
+ }], S: [n, function(e2) {
1228
+ this.milliseconds = 100 * +e2;
1229
+ }], SS: [r, function(e2) {
1230
+ this.milliseconds = 10 * +e2;
1231
+ }], SSS: [/\d{3}/, function(e2) {
1232
+ this.milliseconds = +e2;
1233
+ }], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
1234
+ var t4 = s.ordinal, n2 = e2.match(/\d+/);
1235
+ if (this.day = n2[0], t4) for (var r2 = 1; r2 <= 31; r2 += 1) t4(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
1236
+ }], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
1237
+ var t4 = u("months"), n2 = (u("monthsShort") || t4.map((function(e3) {
1238
+ return e3.slice(0, 3);
1239
+ }))).indexOf(e2) + 1;
1240
+ if (n2 < 1) throw new Error();
1241
+ this.month = n2 % 12 || n2;
1242
+ }], MMMM: [o, function(e2) {
1243
+ var t4 = u("months").indexOf(e2) + 1;
1244
+ if (t4 < 1) throw new Error();
1245
+ this.month = t4 % 12 || t4;
1246
+ }], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
1247
+ this.year = a(e2);
1248
+ }], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
1249
+ function l(n2) {
1250
+ var r2, i2;
1251
+ r2 = n2, i2 = s && s.formats;
1252
+ for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t4, n3, r3) {
1253
+ var o3 = r3 && r3.toUpperCase();
1254
+ return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t5, n4) {
1255
+ return t5 || n4.slice(1);
1256
+ }));
1257
+ }))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
1258
+ var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
1259
+ o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
1260
+ }
1261
+ return function(e2) {
1262
+ for (var t4 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
1263
+ var i3 = o2[n3];
1264
+ if ("string" == typeof i3) r3 += i3.length;
1265
+ else {
1266
+ var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
1267
+ f3.call(t4, u3), e2 = e2.replace(u3, "");
1268
+ }
1269
+ }
1270
+ return (function(e3) {
1271
+ var t5 = e3.afternoon;
1272
+ if (void 0 !== t5) {
1273
+ var n4 = e3.hours;
1274
+ t5 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
1275
+ }
1276
+ })(t4), t4;
1277
+ };
1278
+ }
1279
+ return function(e2, t4, n2) {
1280
+ n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
1281
+ var r2 = t4.prototype, i2 = r2.parse;
1282
+ r2.parse = function(e3) {
1283
+ var t5 = e3.date, r3 = e3.utc, o2 = e3.args;
1284
+ this.$u = r3;
1285
+ var a2 = o2[1];
1286
+ if ("string" == typeof a2) {
1287
+ var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
1288
+ h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t6, n3, r4) {
1289
+ try {
1290
+ if (["x", "X"].indexOf(t6) > -1) return new Date(("X" === t6 ? 1e3 : 1) * e4);
1291
+ var i3 = l(t6)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
1292
+ o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
1293
+ var D, w2 = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
1294
+ return c3 ? new Date(Date.UTC(p, v, Y, w2, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w2, g, y, L)) : (D = new Date(p, v, Y, w2, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
1295
+ } catch (e5) {
1296
+ return /* @__PURE__ */ new Date("");
1297
+ }
1298
+ })(t5, a2, r3, n2), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t5 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
1299
+ } else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
1300
+ o2[1] = a2[m - 1];
1301
+ var M = n2.apply(this, o2);
1302
+ if (M.isValid()) {
1303
+ this.$d = M.$d, this.$L = M.$L, this.init();
1304
+ break;
1305
+ }
1306
+ m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
1307
+ }
1308
+ else i2.call(this, e3);
1309
+ };
1310
+ };
1311
+ }));
1312
+ })(customParseFormat$1);
1313
+ return customParseFormat$1.exports;
1314
+ }
1315
+ var customParseFormatExports = requireCustomParseFormat();
1316
+ const dayjsCustomParseFormat = /* @__PURE__ */ getDefaultExportFromCjs(customParseFormatExports);
1317
+ var advancedFormat$1 = { exports: {} };
1318
+ var advancedFormat = advancedFormat$1.exports;
1319
+ var hasRequiredAdvancedFormat;
1320
+ function requireAdvancedFormat() {
1321
+ if (hasRequiredAdvancedFormat) return advancedFormat$1.exports;
1322
+ hasRequiredAdvancedFormat = 1;
1323
+ (function(module, exports) {
1324
+ !(function(e, t) {
1325
+ module.exports = t();
1326
+ })(advancedFormat, (function() {
1327
+ return function(e, t) {
1328
+ var r = t.prototype, n = r.format;
1329
+ r.format = function(e2) {
1330
+ var t4 = this, r2 = this.$locale();
1331
+ if (!this.isValid()) return n.bind(this)(e2);
1332
+ var s = this.$utils(), a = (e2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e3) {
1333
+ switch (e3) {
1334
+ case "Q":
1335
+ return Math.ceil((t4.$M + 1) / 3);
1336
+ case "Do":
1337
+ return r2.ordinal(t4.$D);
1338
+ case "gggg":
1339
+ return t4.weekYear();
1340
+ case "GGGG":
1341
+ return t4.isoWeekYear();
1342
+ case "wo":
1343
+ return r2.ordinal(t4.week(), "W");
1344
+ case "w":
1345
+ case "ww":
1346
+ return s.s(t4.week(), "w" === e3 ? 1 : 2, "0");
1347
+ case "W":
1348
+ case "WW":
1349
+ return s.s(t4.isoWeek(), "W" === e3 ? 1 : 2, "0");
1350
+ case "k":
1351
+ case "kk":
1352
+ return s.s(String(0 === t4.$H ? 24 : t4.$H), "k" === e3 ? 1 : 2, "0");
1353
+ case "X":
1354
+ return Math.floor(t4.$d.getTime() / 1e3);
1355
+ case "x":
1356
+ return t4.$d.getTime();
1357
+ case "z":
1358
+ return "[" + t4.offsetName() + "]";
1359
+ case "zzz":
1360
+ return "[" + t4.offsetName("long") + "]";
1361
+ default:
1362
+ return e3;
1363
+ }
1364
+ }));
1365
+ return n.bind(this)(a);
1366
+ };
1367
+ };
1368
+ }));
1369
+ })(advancedFormat$1);
1370
+ return advancedFormat$1.exports;
1371
+ }
1372
+ var advancedFormatExports = requireAdvancedFormat();
1373
+ const dayjsAdvancedFormat = /* @__PURE__ */ getDefaultExportFromCjs(advancedFormatExports);
1374
+ var parser = (function() {
1375
+ var o = function(k, v, o2, l) {
1376
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
1377
+ ;
1378
+ return o2;
1379
+ }, $V0 = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 32, 33, 35, 37], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 29], $V6 = [1, 30], $V7 = [1, 31], $V8 = [1, 9], $V9 = [1, 10], $Va = [1, 11], $Vb = [1, 12], $Vc = [1, 13], $Vd = [1, 14], $Ve = [1, 15], $Vf = [1, 16], $Vg = [1, 18], $Vh = [1, 19], $Vi = [1, 20], $Vj = [1, 21], $Vk = [1, 22], $Vl = [1, 24], $Vm = [1, 32];
1380
+ var parser2 = {
1381
+ trace: function trace() {
1382
+ },
1383
+ yy: {},
1384
+ symbols_: { "error": 2, "start": 3, "gantt": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NL": 10, "weekday": 11, "weekday_monday": 12, "weekday_tuesday": 13, "weekday_wednesday": 14, "weekday_thursday": 15, "weekday_friday": 16, "weekday_saturday": 17, "weekday_sunday": 18, "dateFormat": 19, "inclusiveEndDates": 20, "topAxis": 21, "axisFormat": 22, "tickInterval": 23, "excludes": 24, "includes": 25, "todayMarker": 26, "title": 27, "acc_title": 28, "acc_title_value": 29, "acc_descr": 30, "acc_descr_value": 31, "acc_descr_multiline_value": 32, "section": 33, "clickStatement": 34, "taskTxt": 35, "taskData": 36, "click": 37, "callbackname": 38, "callbackargs": 39, "href": 40, "clickStatementDebug": 41, "$accept": 0, "$end": 1 },
1385
+ terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 12: "weekday_monday", 13: "weekday_tuesday", 14: "weekday_wednesday", 15: "weekday_thursday", 16: "weekday_friday", 17: "weekday_saturday", 18: "weekday_sunday", 19: "dateFormat", 20: "inclusiveEndDates", 21: "topAxis", 22: "axisFormat", 23: "tickInterval", 24: "excludes", 25: "includes", 26: "todayMarker", 27: "title", 28: "acc_title", 29: "acc_title_value", 30: "acc_descr", 31: "acc_descr_value", 32: "acc_descr_multiline_value", 33: "section", 35: "taskTxt", 36: "taskData", 37: "click", 38: "callbackname", 39: "callbackargs", 40: "href" },
1386
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 2], [34, 2], [34, 3], [34, 3], [34, 4], [34, 3], [34, 4], [34, 2], [41, 2], [41, 3], [41, 3], [41, 4], [41, 3], [41, 4], [41, 2]],
1387
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
1388
+ var $0 = $$.length - 1;
1389
+ switch (yystate) {
1390
+ case 1:
1391
+ return $$[$0 - 1];
1392
+ case 2:
1393
+ this.$ = [];
1394
+ break;
1395
+ case 3:
1396
+ $$[$0 - 1].push($$[$0]);
1397
+ this.$ = $$[$0 - 1];
1398
+ break;
1399
+ case 4:
1400
+ case 5:
1401
+ this.$ = $$[$0];
1402
+ break;
1403
+ case 6:
1404
+ case 7:
1405
+ this.$ = [];
1406
+ break;
1407
+ case 8:
1408
+ yy.setWeekday("monday");
1409
+ break;
1410
+ case 9:
1411
+ yy.setWeekday("tuesday");
1412
+ break;
1413
+ case 10:
1414
+ yy.setWeekday("wednesday");
1415
+ break;
1416
+ case 11:
1417
+ yy.setWeekday("thursday");
1418
+ break;
1419
+ case 12:
1420
+ yy.setWeekday("friday");
1421
+ break;
1422
+ case 13:
1423
+ yy.setWeekday("saturday");
1424
+ break;
1425
+ case 14:
1426
+ yy.setWeekday("sunday");
1427
+ break;
1428
+ case 15:
1429
+ yy.setDateFormat($$[$0].substr(11));
1430
+ this.$ = $$[$0].substr(11);
1431
+ break;
1432
+ case 16:
1433
+ yy.enableInclusiveEndDates();
1434
+ this.$ = $$[$0].substr(18);
1435
+ break;
1436
+ case 17:
1437
+ yy.TopAxis();
1438
+ this.$ = $$[$0].substr(8);
1439
+ break;
1440
+ case 18:
1441
+ yy.setAxisFormat($$[$0].substr(11));
1442
+ this.$ = $$[$0].substr(11);
1443
+ break;
1444
+ case 19:
1445
+ yy.setTickInterval($$[$0].substr(13));
1446
+ this.$ = $$[$0].substr(13);
1447
+ break;
1448
+ case 20:
1449
+ yy.setExcludes($$[$0].substr(9));
1450
+ this.$ = $$[$0].substr(9);
1451
+ break;
1452
+ case 21:
1453
+ yy.setIncludes($$[$0].substr(9));
1454
+ this.$ = $$[$0].substr(9);
1455
+ break;
1456
+ case 22:
1457
+ yy.setTodayMarker($$[$0].substr(12));
1458
+ this.$ = $$[$0].substr(12);
1459
+ break;
1460
+ case 24:
1461
+ yy.setDiagramTitle($$[$0].substr(6));
1462
+ this.$ = $$[$0].substr(6);
1463
+ break;
1464
+ case 25:
1465
+ this.$ = $$[$0].trim();
1466
+ yy.setAccTitle(this.$);
1467
+ break;
1468
+ case 26:
1469
+ case 27:
1470
+ this.$ = $$[$0].trim();
1471
+ yy.setAccDescription(this.$);
1472
+ break;
1473
+ case 28:
1474
+ yy.addSection($$[$0].substr(8));
1475
+ this.$ = $$[$0].substr(8);
1476
+ break;
1477
+ case 30:
1478
+ yy.addTask($$[$0 - 1], $$[$0]);
1479
+ this.$ = "task";
1480
+ break;
1481
+ case 31:
1482
+ this.$ = $$[$0 - 1];
1483
+ yy.setClickEvent($$[$0 - 1], $$[$0], null);
1484
+ break;
1485
+ case 32:
1486
+ this.$ = $$[$0 - 2];
1487
+ yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]);
1488
+ break;
1489
+ case 33:
1490
+ this.$ = $$[$0 - 2];
1491
+ yy.setClickEvent($$[$0 - 2], $$[$0 - 1], null);
1492
+ yy.setLink($$[$0 - 2], $$[$0]);
1493
+ break;
1494
+ case 34:
1495
+ this.$ = $$[$0 - 3];
1496
+ yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]);
1497
+ yy.setLink($$[$0 - 3], $$[$0]);
1498
+ break;
1499
+ case 35:
1500
+ this.$ = $$[$0 - 2];
1501
+ yy.setClickEvent($$[$0 - 2], $$[$0], null);
1502
+ yy.setLink($$[$0 - 2], $$[$0 - 1]);
1503
+ break;
1504
+ case 36:
1505
+ this.$ = $$[$0 - 3];
1506
+ yy.setClickEvent($$[$0 - 3], $$[$0 - 1], $$[$0]);
1507
+ yy.setLink($$[$0 - 3], $$[$0 - 2]);
1508
+ break;
1509
+ case 37:
1510
+ this.$ = $$[$0 - 1];
1511
+ yy.setLink($$[$0 - 1], $$[$0]);
1512
+ break;
1513
+ case 38:
1514
+ case 44:
1515
+ this.$ = $$[$0 - 1] + " " + $$[$0];
1516
+ break;
1517
+ case 39:
1518
+ case 40:
1519
+ case 42:
1520
+ this.$ = $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0];
1521
+ break;
1522
+ case 41:
1523
+ case 43:
1524
+ this.$ = $$[$0 - 3] + " " + $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0];
1525
+ break;
1526
+ }
1527
+ },
1528
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 17, 12: $V1, 13: $V2, 14: $V3, 15: $V4, 16: $V5, 17: $V6, 18: $V7, 19: $V8, 20: $V9, 21: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 28: $Vh, 30: $Vi, 32: $Vj, 33: $Vk, 34: 23, 35: $Vl, 37: $Vm }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 33, 11: 17, 12: $V1, 13: $V2, 14: $V3, 15: $V4, 16: $V5, 17: $V6, 18: $V7, 19: $V8, 20: $V9, 21: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 28: $Vh, 30: $Vi, 32: $Vj, 33: $Vk, 34: 23, 35: $Vl, 37: $Vm }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), o($V0, [2, 18]), o($V0, [2, 19]), o($V0, [2, 20]), o($V0, [2, 21]), o($V0, [2, 22]), o($V0, [2, 23]), o($V0, [2, 24]), { 29: [1, 34] }, { 31: [1, 35] }, o($V0, [2, 27]), o($V0, [2, 28]), o($V0, [2, 29]), { 36: [1, 36] }, o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), o($V0, [2, 11]), o($V0, [2, 12]), o($V0, [2, 13]), o($V0, [2, 14]), { 38: [1, 37], 40: [1, 38] }, o($V0, [2, 4]), o($V0, [2, 25]), o($V0, [2, 26]), o($V0, [2, 30]), o($V0, [2, 31], { 39: [1, 39], 40: [1, 40] }), o($V0, [2, 37], { 38: [1, 41] }), o($V0, [2, 32], { 40: [1, 42] }), o($V0, [2, 33]), o($V0, [2, 35], { 39: [1, 43] }), o($V0, [2, 34]), o($V0, [2, 36])],
1529
+ defaultActions: {},
1530
+ parseError: function parseError(str, hash) {
1531
+ if (hash.recoverable) {
1532
+ this.trace(str);
1533
+ } else {
1534
+ var error = new Error(str);
1535
+ error.hash = hash;
1536
+ throw error;
1537
+ }
1538
+ },
1539
+ parse: function parse(input) {
1540
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
1541
+ var args = lstack.slice.call(arguments, 1);
1542
+ var lexer2 = Object.create(this.lexer);
1543
+ var sharedState = { yy: {} };
1544
+ for (var k in this.yy) {
1545
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
1546
+ sharedState.yy[k] = this.yy[k];
1547
+ }
1548
+ }
1549
+ lexer2.setInput(input, sharedState.yy);
1550
+ sharedState.yy.lexer = lexer2;
1551
+ sharedState.yy.parser = this;
1552
+ if (typeof lexer2.yylloc == "undefined") {
1553
+ lexer2.yylloc = {};
1554
+ }
1555
+ var yyloc = lexer2.yylloc;
1556
+ lstack.push(yyloc);
1557
+ var ranges = lexer2.options && lexer2.options.ranges;
1558
+ if (typeof sharedState.yy.parseError === "function") {
1559
+ this.parseError = sharedState.yy.parseError;
1560
+ } else {
1561
+ this.parseError = Object.getPrototypeOf(this).parseError;
1562
+ }
1563
+ function lex() {
1564
+ var token;
1565
+ token = tstack.pop() || lexer2.lex() || EOF;
1566
+ if (typeof token !== "number") {
1567
+ if (token instanceof Array) {
1568
+ tstack = token;
1569
+ token = tstack.pop();
1570
+ }
1571
+ token = self.symbols_[token] || token;
1572
+ }
1573
+ return token;
1574
+ }
1575
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
1576
+ while (true) {
1577
+ state = stack[stack.length - 1];
1578
+ if (this.defaultActions[state]) {
1579
+ action = this.defaultActions[state];
1580
+ } else {
1581
+ if (symbol === null || typeof symbol == "undefined") {
1582
+ symbol = lex();
1583
+ }
1584
+ action = table[state] && table[state][symbol];
1585
+ }
1586
+ if (typeof action === "undefined" || !action.length || !action[0]) {
1587
+ var errStr = "";
1588
+ expected = [];
1589
+ for (p in table[state]) {
1590
+ if (this.terminals_[p] && p > TERROR) {
1591
+ expected.push("'" + this.terminals_[p] + "'");
1592
+ }
1593
+ }
1594
+ if (lexer2.showPosition) {
1595
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
1596
+ } else {
1597
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
1598
+ }
1599
+ this.parseError(errStr, {
1600
+ text: lexer2.match,
1601
+ token: this.terminals_[symbol] || symbol,
1602
+ line: lexer2.yylineno,
1603
+ loc: yyloc,
1604
+ expected
1605
+ });
1606
+ }
1607
+ if (action[0] instanceof Array && action.length > 1) {
1608
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1609
+ }
1610
+ switch (action[0]) {
1611
+ case 1:
1612
+ stack.push(symbol);
1613
+ vstack.push(lexer2.yytext);
1614
+ lstack.push(lexer2.yylloc);
1615
+ stack.push(action[1]);
1616
+ symbol = null;
1617
+ {
1618
+ yyleng = lexer2.yyleng;
1619
+ yytext = lexer2.yytext;
1620
+ yylineno = lexer2.yylineno;
1621
+ yyloc = lexer2.yylloc;
1622
+ }
1623
+ break;
1624
+ case 2:
1625
+ len = this.productions_[action[1]][1];
1626
+ yyval.$ = vstack[vstack.length - len];
1627
+ yyval._$ = {
1628
+ first_line: lstack[lstack.length - (len || 1)].first_line,
1629
+ last_line: lstack[lstack.length - 1].last_line,
1630
+ first_column: lstack[lstack.length - (len || 1)].first_column,
1631
+ last_column: lstack[lstack.length - 1].last_column
1632
+ };
1633
+ if (ranges) {
1634
+ yyval._$.range = [
1635
+ lstack[lstack.length - (len || 1)].range[0],
1636
+ lstack[lstack.length - 1].range[1]
1637
+ ];
1638
+ }
1639
+ r = this.performAction.apply(yyval, [
1640
+ yytext,
1641
+ yyleng,
1642
+ yylineno,
1643
+ sharedState.yy,
1644
+ action[1],
1645
+ vstack,
1646
+ lstack
1647
+ ].concat(args));
1648
+ if (typeof r !== "undefined") {
1649
+ return r;
1650
+ }
1651
+ if (len) {
1652
+ stack = stack.slice(0, -1 * len * 2);
1653
+ vstack = vstack.slice(0, -1 * len);
1654
+ lstack = lstack.slice(0, -1 * len);
1655
+ }
1656
+ stack.push(this.productions_[action[1]][0]);
1657
+ vstack.push(yyval.$);
1658
+ lstack.push(yyval._$);
1659
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1660
+ stack.push(newState);
1661
+ break;
1662
+ case 3:
1663
+ return true;
1664
+ }
1665
+ }
1666
+ return true;
1667
+ }
1668
+ };
1669
+ var lexer = /* @__PURE__ */ (function() {
1670
+ var lexer2 = {
1671
+ EOF: 1,
1672
+ parseError: function parseError(str, hash) {
1673
+ if (this.yy.parser) {
1674
+ this.yy.parser.parseError(str, hash);
1675
+ } else {
1676
+ throw new Error(str);
1677
+ }
1678
+ },
1679
+ // resets the lexer, sets new input
1680
+ setInput: function(input, yy) {
1681
+ this.yy = yy || this.yy || {};
1682
+ this._input = input;
1683
+ this._more = this._backtrack = this.done = false;
1684
+ this.yylineno = this.yyleng = 0;
1685
+ this.yytext = this.matched = this.match = "";
1686
+ this.conditionStack = ["INITIAL"];
1687
+ this.yylloc = {
1688
+ first_line: 1,
1689
+ first_column: 0,
1690
+ last_line: 1,
1691
+ last_column: 0
1692
+ };
1693
+ if (this.options.ranges) {
1694
+ this.yylloc.range = [0, 0];
1695
+ }
1696
+ this.offset = 0;
1697
+ return this;
1698
+ },
1699
+ // consumes and returns one char from the input
1700
+ input: function() {
1701
+ var ch = this._input[0];
1702
+ this.yytext += ch;
1703
+ this.yyleng++;
1704
+ this.offset++;
1705
+ this.match += ch;
1706
+ this.matched += ch;
1707
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
1708
+ if (lines) {
1709
+ this.yylineno++;
1710
+ this.yylloc.last_line++;
1711
+ } else {
1712
+ this.yylloc.last_column++;
1713
+ }
1714
+ if (this.options.ranges) {
1715
+ this.yylloc.range[1]++;
1716
+ }
1717
+ this._input = this._input.slice(1);
1718
+ return ch;
1719
+ },
1720
+ // unshifts one char (or a string) into the input
1721
+ unput: function(ch) {
1722
+ var len = ch.length;
1723
+ var lines = ch.split(/(?:\r\n?|\n)/g);
1724
+ this._input = ch + this._input;
1725
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
1726
+ this.offset -= len;
1727
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1728
+ this.match = this.match.substr(0, this.match.length - 1);
1729
+ this.matched = this.matched.substr(0, this.matched.length - 1);
1730
+ if (lines.length - 1) {
1731
+ this.yylineno -= lines.length - 1;
1732
+ }
1733
+ var r = this.yylloc.range;
1734
+ this.yylloc = {
1735
+ first_line: this.yylloc.first_line,
1736
+ last_line: this.yylineno + 1,
1737
+ first_column: this.yylloc.first_column,
1738
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
1739
+ };
1740
+ if (this.options.ranges) {
1741
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1742
+ }
1743
+ this.yyleng = this.yytext.length;
1744
+ return this;
1745
+ },
1746
+ // When called from action, caches matched text and appends it on next action
1747
+ more: function() {
1748
+ this._more = true;
1749
+ return this;
1750
+ },
1751
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
1752
+ reject: function() {
1753
+ if (this.options.backtrack_lexer) {
1754
+ this._backtrack = true;
1755
+ } else {
1756
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
1757
+ text: "",
1758
+ token: null,
1759
+ line: this.yylineno
1760
+ });
1761
+ }
1762
+ return this;
1763
+ },
1764
+ // retain first n characters of the match
1765
+ less: function(n) {
1766
+ this.unput(this.match.slice(n));
1767
+ },
1768
+ // displays already matched input, i.e. for error messages
1769
+ pastInput: function() {
1770
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
1771
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
1772
+ },
1773
+ // displays upcoming input, i.e. for error messages
1774
+ upcomingInput: function() {
1775
+ var next = this.match;
1776
+ if (next.length < 20) {
1777
+ next += this._input.substr(0, 20 - next.length);
1778
+ }
1779
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
1780
+ },
1781
+ // displays the character position where the lexing error occurred, i.e. for error messages
1782
+ showPosition: function() {
1783
+ var pre = this.pastInput();
1784
+ var c = new Array(pre.length + 1).join("-");
1785
+ return pre + this.upcomingInput() + "\n" + c + "^";
1786
+ },
1787
+ // test the lexed token: return FALSE when not a match, otherwise return token
1788
+ test_match: function(match, indexed_rule) {
1789
+ var token, lines, backup;
1790
+ if (this.options.backtrack_lexer) {
1791
+ backup = {
1792
+ yylineno: this.yylineno,
1793
+ yylloc: {
1794
+ first_line: this.yylloc.first_line,
1795
+ last_line: this.last_line,
1796
+ first_column: this.yylloc.first_column,
1797
+ last_column: this.yylloc.last_column
1798
+ },
1799
+ yytext: this.yytext,
1800
+ match: this.match,
1801
+ matches: this.matches,
1802
+ matched: this.matched,
1803
+ yyleng: this.yyleng,
1804
+ offset: this.offset,
1805
+ _more: this._more,
1806
+ _input: this._input,
1807
+ yy: this.yy,
1808
+ conditionStack: this.conditionStack.slice(0),
1809
+ done: this.done
1810
+ };
1811
+ if (this.options.ranges) {
1812
+ backup.yylloc.range = this.yylloc.range.slice(0);
1813
+ }
1814
+ }
1815
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
1816
+ if (lines) {
1817
+ this.yylineno += lines.length;
1818
+ }
1819
+ this.yylloc = {
1820
+ first_line: this.yylloc.last_line,
1821
+ last_line: this.yylineno + 1,
1822
+ first_column: this.yylloc.last_column,
1823
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
1824
+ };
1825
+ this.yytext += match[0];
1826
+ this.match += match[0];
1827
+ this.matches = match;
1828
+ this.yyleng = this.yytext.length;
1829
+ if (this.options.ranges) {
1830
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
1831
+ }
1832
+ this._more = false;
1833
+ this._backtrack = false;
1834
+ this._input = this._input.slice(match[0].length);
1835
+ this.matched += match[0];
1836
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1837
+ if (this.done && this._input) {
1838
+ this.done = false;
1839
+ }
1840
+ if (token) {
1841
+ return token;
1842
+ } else if (this._backtrack) {
1843
+ for (var k in backup) {
1844
+ this[k] = backup[k];
1845
+ }
1846
+ return false;
1847
+ }
1848
+ return false;
1849
+ },
1850
+ // return next match in input
1851
+ next: function() {
1852
+ if (this.done) {
1853
+ return this.EOF;
1854
+ }
1855
+ if (!this._input) {
1856
+ this.done = true;
1857
+ }
1858
+ var token, match, tempMatch, index;
1859
+ if (!this._more) {
1860
+ this.yytext = "";
1861
+ this.match = "";
1862
+ }
1863
+ var rules = this._currentRules();
1864
+ for (var i = 0; i < rules.length; i++) {
1865
+ tempMatch = this._input.match(this.rules[rules[i]]);
1866
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1867
+ match = tempMatch;
1868
+ index = i;
1869
+ if (this.options.backtrack_lexer) {
1870
+ token = this.test_match(tempMatch, rules[i]);
1871
+ if (token !== false) {
1872
+ return token;
1873
+ } else if (this._backtrack) {
1874
+ match = false;
1875
+ continue;
1876
+ } else {
1877
+ return false;
1878
+ }
1879
+ } else if (!this.options.flex) {
1880
+ break;
1881
+ }
1882
+ }
1883
+ }
1884
+ if (match) {
1885
+ token = this.test_match(match, rules[index]);
1886
+ if (token !== false) {
1887
+ return token;
1888
+ }
1889
+ return false;
1890
+ }
1891
+ if (this._input === "") {
1892
+ return this.EOF;
1893
+ } else {
1894
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1895
+ text: "",
1896
+ token: null,
1897
+ line: this.yylineno
1898
+ });
1899
+ }
1900
+ },
1901
+ // return next match that has a token
1902
+ lex: function lex() {
1903
+ var r = this.next();
1904
+ if (r) {
1905
+ return r;
1906
+ } else {
1907
+ return this.lex();
1908
+ }
1909
+ },
1910
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1911
+ begin: function begin(condition) {
1912
+ this.conditionStack.push(condition);
1913
+ },
1914
+ // pop the previously active lexer condition state off the condition stack
1915
+ popState: function popState() {
1916
+ var n = this.conditionStack.length - 1;
1917
+ if (n > 0) {
1918
+ return this.conditionStack.pop();
1919
+ } else {
1920
+ return this.conditionStack[0];
1921
+ }
1922
+ },
1923
+ // produce the lexer rule set which is active for the currently active lexer condition state
1924
+ _currentRules: function _currentRules() {
1925
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1926
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1927
+ } else {
1928
+ return this.conditions["INITIAL"].rules;
1929
+ }
1930
+ },
1931
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1932
+ topState: function topState(n) {
1933
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1934
+ if (n >= 0) {
1935
+ return this.conditionStack[n];
1936
+ } else {
1937
+ return "INITIAL";
1938
+ }
1939
+ },
1940
+ // alias for begin(condition)
1941
+ pushState: function pushState(condition) {
1942
+ this.begin(condition);
1943
+ },
1944
+ // return the number of states currently on the stack
1945
+ stateStackSize: function stateStackSize() {
1946
+ return this.conditionStack.length;
1947
+ },
1948
+ options: { "case-insensitive": true },
1949
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1950
+ switch ($avoiding_name_collisions) {
1951
+ case 0:
1952
+ this.begin("open_directive");
1953
+ return "open_directive";
1954
+ case 1:
1955
+ this.begin("acc_title");
1956
+ return 28;
1957
+ case 2:
1958
+ this.popState();
1959
+ return "acc_title_value";
1960
+ case 3:
1961
+ this.begin("acc_descr");
1962
+ return 30;
1963
+ case 4:
1964
+ this.popState();
1965
+ return "acc_descr_value";
1966
+ case 5:
1967
+ this.begin("acc_descr_multiline");
1968
+ break;
1969
+ case 6:
1970
+ this.popState();
1971
+ break;
1972
+ case 7:
1973
+ return "acc_descr_multiline_value";
1974
+ case 8:
1975
+ break;
1976
+ case 9:
1977
+ break;
1978
+ case 10:
1979
+ break;
1980
+ case 11:
1981
+ return 10;
1982
+ case 12:
1983
+ break;
1984
+ case 13:
1985
+ break;
1986
+ case 14:
1987
+ this.begin("href");
1988
+ break;
1989
+ case 15:
1990
+ this.popState();
1991
+ break;
1992
+ case 16:
1993
+ return 40;
1994
+ case 17:
1995
+ this.begin("callbackname");
1996
+ break;
1997
+ case 18:
1998
+ this.popState();
1999
+ break;
2000
+ case 19:
2001
+ this.popState();
2002
+ this.begin("callbackargs");
2003
+ break;
2004
+ case 20:
2005
+ return 38;
2006
+ case 21:
2007
+ this.popState();
2008
+ break;
2009
+ case 22:
2010
+ return 39;
2011
+ case 23:
2012
+ this.begin("click");
2013
+ break;
2014
+ case 24:
2015
+ this.popState();
2016
+ break;
2017
+ case 25:
2018
+ return 37;
2019
+ case 26:
2020
+ return 4;
2021
+ case 27:
2022
+ return 19;
2023
+ case 28:
2024
+ return 20;
2025
+ case 29:
2026
+ return 21;
2027
+ case 30:
2028
+ return 22;
2029
+ case 31:
2030
+ return 23;
2031
+ case 32:
2032
+ return 25;
2033
+ case 33:
2034
+ return 24;
2035
+ case 34:
2036
+ return 26;
2037
+ case 35:
2038
+ return 12;
2039
+ case 36:
2040
+ return 13;
2041
+ case 37:
2042
+ return 14;
2043
+ case 38:
2044
+ return 15;
2045
+ case 39:
2046
+ return 16;
2047
+ case 40:
2048
+ return 17;
2049
+ case 41:
2050
+ return 18;
2051
+ case 42:
2052
+ return "date";
2053
+ case 43:
2054
+ return 27;
2055
+ case 44:
2056
+ return "accDescription";
2057
+ case 45:
2058
+ return 33;
2059
+ case 46:
2060
+ return 35;
2061
+ case 47:
2062
+ return 36;
2063
+ case 48:
2064
+ return ":";
2065
+ case 49:
2066
+ return 6;
2067
+ case 50:
2068
+ return "INVALID";
2069
+ }
2070
+ },
2071
+ rules: [/^(?:%%\{)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%(?!\{)*[^\n]*)/i, /^(?:[^\}]%%*[^\n]*)/i, /^(?:%%*[^\n]*[\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:%[^\n]*)/i, /^(?:href[\s]+["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:call[\s]+)/i, /^(?:\([\s]*\))/i, /^(?:\()/i, /^(?:[^(]*)/i, /^(?:\))/i, /^(?:[^)]*)/i, /^(?:click[\s]+)/i, /^(?:[\s\n])/i, /^(?:[^\s\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:inclusiveEndDates\b)/i, /^(?:topAxis\b)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:tickInterval\s[^#\n;]+)/i, /^(?:includes\s[^#\n;]+)/i, /^(?:excludes\s[^#\n;]+)/i, /^(?:todayMarker\s[^\n;]+)/i, /^(?:weekday\s+monday\b)/i, /^(?:weekday\s+tuesday\b)/i, /^(?:weekday\s+wednesday\b)/i, /^(?:weekday\s+thursday\b)/i, /^(?:weekday\s+friday\b)/i, /^(?:weekday\s+saturday\b)/i, /^(?:weekday\s+sunday\b)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accDescription\s[^#\n;]+)/i, /^(?:section\s[^\n]+)/i, /^(?:[^:\n]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
2072
+ conditions: { "acc_descr_multiline": { "rules": [6, 7], "inclusive": false }, "acc_descr": { "rules": [4], "inclusive": false }, "acc_title": { "rules": [2], "inclusive": false }, "callbackargs": { "rules": [21, 22], "inclusive": false }, "callbackname": { "rules": [18, 19, 20], "inclusive": false }, "href": { "rules": [15, 16], "inclusive": false }, "click": { "rules": [24, 25], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 17, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "inclusive": true } }
2073
+ };
2074
+ return lexer2;
2075
+ })();
2076
+ parser2.lexer = lexer;
2077
+ function Parser() {
2078
+ this.yy = {};
2079
+ }
2080
+ Parser.prototype = parser2;
2081
+ parser2.Parser = Parser;
2082
+ return new Parser();
2083
+ })();
2084
+ parser.parser = parser;
2085
+ const ganttParser = parser;
2086
+ dayjs.extend(dayjsIsoWeek);
2087
+ dayjs.extend(dayjsCustomParseFormat);
2088
+ dayjs.extend(dayjsAdvancedFormat);
2089
+ let dateFormat = "";
2090
+ let axisFormat = "";
2091
+ let tickInterval = void 0;
2092
+ let todayMarker = "";
2093
+ let includes = [];
2094
+ let excludes = [];
2095
+ let links = {};
2096
+ let sections = [];
2097
+ let tasks = [];
2098
+ let currentSection = "";
2099
+ let displayMode = "";
2100
+ const tags = ["active", "done", "crit", "milestone"];
2101
+ let funs = [];
2102
+ let inclusiveEndDates = false;
2103
+ let topAxis = false;
2104
+ let weekday = "sunday";
2105
+ let lastOrder = 0;
2106
+ const clear = function() {
2107
+ sections = [];
2108
+ tasks = [];
2109
+ currentSection = "";
2110
+ funs = [];
2111
+ taskCnt = 0;
2112
+ lastTask = void 0;
2113
+ lastTaskID = void 0;
2114
+ rawTasks = [];
2115
+ dateFormat = "";
2116
+ axisFormat = "";
2117
+ displayMode = "";
2118
+ tickInterval = void 0;
2119
+ todayMarker = "";
2120
+ includes = [];
2121
+ excludes = [];
2122
+ inclusiveEndDates = false;
2123
+ topAxis = false;
2124
+ lastOrder = 0;
2125
+ links = {};
2126
+ clear$1();
2127
+ weekday = "sunday";
2128
+ };
2129
+ const setAxisFormat = function(txt) {
2130
+ axisFormat = txt;
2131
+ };
2132
+ const getAxisFormat = function() {
2133
+ return axisFormat;
2134
+ };
2135
+ const setTickInterval = function(txt) {
2136
+ tickInterval = txt;
2137
+ };
2138
+ const getTickInterval = function() {
2139
+ return tickInterval;
2140
+ };
2141
+ const setTodayMarker = function(txt) {
2142
+ todayMarker = txt;
2143
+ };
2144
+ const getTodayMarker = function() {
2145
+ return todayMarker;
2146
+ };
2147
+ const setDateFormat = function(txt) {
2148
+ dateFormat = txt;
2149
+ };
2150
+ const enableInclusiveEndDates = function() {
2151
+ inclusiveEndDates = true;
2152
+ };
2153
+ const endDatesAreInclusive = function() {
2154
+ return inclusiveEndDates;
2155
+ };
2156
+ const enableTopAxis = function() {
2157
+ topAxis = true;
2158
+ };
2159
+ const topAxisEnabled = function() {
2160
+ return topAxis;
2161
+ };
2162
+ const setDisplayMode = function(txt) {
2163
+ displayMode = txt;
2164
+ };
2165
+ const getDisplayMode = function() {
2166
+ return displayMode;
2167
+ };
2168
+ const getDateFormat = function() {
2169
+ return dateFormat;
2170
+ };
2171
+ const setIncludes = function(txt) {
2172
+ includes = txt.toLowerCase().split(/[\s,]+/);
2173
+ };
2174
+ const getIncludes = function() {
2175
+ return includes;
2176
+ };
2177
+ const setExcludes = function(txt) {
2178
+ excludes = txt.toLowerCase().split(/[\s,]+/);
2179
+ };
2180
+ const getExcludes = function() {
2181
+ return excludes;
2182
+ };
2183
+ const getLinks = function() {
2184
+ return links;
2185
+ };
2186
+ const addSection = function(txt) {
2187
+ currentSection = txt;
2188
+ sections.push(txt);
2189
+ };
2190
+ const getSections = function() {
2191
+ return sections;
2192
+ };
2193
+ const getTasks = function() {
2194
+ let allItemsProcessed = compileTasks();
2195
+ const maxDepth = 10;
2196
+ let iterationCount = 0;
2197
+ while (!allItemsProcessed && iterationCount < maxDepth) {
2198
+ allItemsProcessed = compileTasks();
2199
+ iterationCount++;
2200
+ }
2201
+ tasks = rawTasks;
2202
+ return tasks;
2203
+ };
2204
+ const isInvalidDate = function(date2, dateFormat2, excludes2, includes2) {
2205
+ if (includes2.includes(date2.format(dateFormat2.trim()))) {
2206
+ return false;
2207
+ }
2208
+ if (date2.isoWeekday() >= 6 && excludes2.includes("weekends")) {
2209
+ return true;
2210
+ }
2211
+ if (excludes2.includes(date2.format("dddd").toLowerCase())) {
2212
+ return true;
2213
+ }
2214
+ return excludes2.includes(date2.format(dateFormat2.trim()));
2215
+ };
2216
+ const setWeekday = function(txt) {
2217
+ weekday = txt;
2218
+ };
2219
+ const getWeekday = function() {
2220
+ return weekday;
2221
+ };
2222
+ const checkTaskDates = function(task, dateFormat2, excludes2, includes2) {
2223
+ if (!excludes2.length || task.manualEndTime) {
2224
+ return;
2225
+ }
2226
+ let startTime;
2227
+ if (task.startTime instanceof Date) {
2228
+ startTime = dayjs(task.startTime);
2229
+ } else {
2230
+ startTime = dayjs(task.startTime, dateFormat2, true);
2231
+ }
2232
+ startTime = startTime.add(1, "d");
2233
+ let originalEndTime;
2234
+ if (task.endTime instanceof Date) {
2235
+ originalEndTime = dayjs(task.endTime);
2236
+ } else {
2237
+ originalEndTime = dayjs(task.endTime, dateFormat2, true);
2238
+ }
2239
+ const [fixedEndTime, renderEndTime] = fixTaskDates(
2240
+ startTime,
2241
+ originalEndTime,
2242
+ dateFormat2,
2243
+ excludes2,
2244
+ includes2
2245
+ );
2246
+ task.endTime = fixedEndTime.toDate();
2247
+ task.renderEndTime = renderEndTime;
2248
+ };
2249
+ const fixTaskDates = function(startTime, endTime, dateFormat2, excludes2, includes2) {
2250
+ let invalid = false;
2251
+ let renderEndTime = null;
2252
+ while (startTime <= endTime) {
2253
+ if (!invalid) {
2254
+ renderEndTime = endTime.toDate();
2255
+ }
2256
+ invalid = isInvalidDate(startTime, dateFormat2, excludes2, includes2);
2257
+ if (invalid) {
2258
+ endTime = endTime.add(1, "d");
2259
+ }
2260
+ startTime = startTime.add(1, "d");
2261
+ }
2262
+ return [endTime, renderEndTime];
2263
+ };
2264
+ const getStartDate = function(prevTime, dateFormat2, str) {
2265
+ str = str.trim();
2266
+ const afterRePattern = /^after\s+(?<ids>[\d\w- ]+)/;
2267
+ const afterStatement = afterRePattern.exec(str);
2268
+ if (afterStatement !== null) {
2269
+ let latestTask = null;
2270
+ for (const id of afterStatement.groups.ids.split(" ")) {
2271
+ let task = findTaskById(id);
2272
+ if (task !== void 0 && (!latestTask || task.endTime > latestTask.endTime)) {
2273
+ latestTask = task;
2274
+ }
2275
+ }
2276
+ if (latestTask) {
2277
+ return latestTask.endTime;
2278
+ }
2279
+ const today = /* @__PURE__ */ new Date();
2280
+ today.setHours(0, 0, 0, 0);
2281
+ return today;
2282
+ }
2283
+ let mDate = dayjs(str, dateFormat2.trim(), true);
2284
+ if (mDate.isValid()) {
2285
+ return mDate.toDate();
2286
+ } else {
2287
+ log$1.debug("Invalid date:" + str);
2288
+ log$1.debug("With date format:" + dateFormat2.trim());
2289
+ const d = new Date(str);
2290
+ if (d === void 0 || isNaN(d.getTime()) || // WebKit browsers can mis-parse invalid dates to be ridiculously
2291
+ // huge numbers, e.g. new Date('202304') gets parsed as January 1, 202304.
2292
+ // This can cause virtually infinite loops while rendering, so for the
2293
+ // purposes of Gantt charts we'll just treat any date beyond 10,000 AD/BC as
2294
+ // invalid.
2295
+ d.getFullYear() < -1e4 || d.getFullYear() > 1e4) {
2296
+ throw new Error("Invalid date:" + str);
2297
+ }
2298
+ return d;
2299
+ }
2300
+ };
2301
+ const parseDuration = function(str) {
2302
+ const statement = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(str.trim());
2303
+ if (statement !== null) {
2304
+ return [Number.parseFloat(statement[1]), statement[2]];
2305
+ }
2306
+ return [NaN, "ms"];
2307
+ };
2308
+ const getEndDate = function(prevTime, dateFormat2, str, inclusive = false) {
2309
+ str = str.trim();
2310
+ const untilRePattern = /^until\s+(?<ids>[\d\w- ]+)/;
2311
+ const untilStatement = untilRePattern.exec(str);
2312
+ if (untilStatement !== null) {
2313
+ let earliestTask = null;
2314
+ for (const id of untilStatement.groups.ids.split(" ")) {
2315
+ let task = findTaskById(id);
2316
+ if (task !== void 0 && (!earliestTask || task.startTime < earliestTask.startTime)) {
2317
+ earliestTask = task;
2318
+ }
2319
+ }
2320
+ if (earliestTask) {
2321
+ return earliestTask.startTime;
2322
+ }
2323
+ const today = /* @__PURE__ */ new Date();
2324
+ today.setHours(0, 0, 0, 0);
2325
+ return today;
2326
+ }
2327
+ let parsedDate = dayjs(str, dateFormat2.trim(), true);
2328
+ if (parsedDate.isValid()) {
2329
+ if (inclusive) {
2330
+ parsedDate = parsedDate.add(1, "d");
2331
+ }
2332
+ return parsedDate.toDate();
2333
+ }
2334
+ let endTime = dayjs(prevTime);
2335
+ const [durationValue, durationUnit] = parseDuration(str);
2336
+ if (!Number.isNaN(durationValue)) {
2337
+ const newEndTime = endTime.add(durationValue, durationUnit);
2338
+ if (newEndTime.isValid()) {
2339
+ endTime = newEndTime;
2340
+ }
2341
+ }
2342
+ return endTime.toDate();
2343
+ };
2344
+ let taskCnt = 0;
2345
+ const parseId = function(idStr) {
2346
+ if (idStr === void 0) {
2347
+ taskCnt = taskCnt + 1;
2348
+ return "task" + taskCnt;
2349
+ }
2350
+ return idStr;
2351
+ };
2352
+ const compileData = function(prevTask, dataStr) {
2353
+ let ds;
2354
+ if (dataStr.substr(0, 1) === ":") {
2355
+ ds = dataStr.substr(1, dataStr.length);
2356
+ } else {
2357
+ ds = dataStr;
2358
+ }
2359
+ const data = ds.split(",");
2360
+ const task = {};
2361
+ getTaskTags(data, task, tags);
2362
+ for (let i = 0; i < data.length; i++) {
2363
+ data[i] = data[i].trim();
2364
+ }
2365
+ let endTimeData = "";
2366
+ switch (data.length) {
2367
+ case 1:
2368
+ task.id = parseId();
2369
+ task.startTime = prevTask.endTime;
2370
+ endTimeData = data[0];
2371
+ break;
2372
+ case 2:
2373
+ task.id = parseId();
2374
+ task.startTime = getStartDate(void 0, dateFormat, data[0]);
2375
+ endTimeData = data[1];
2376
+ break;
2377
+ case 3:
2378
+ task.id = parseId(data[0]);
2379
+ task.startTime = getStartDate(void 0, dateFormat, data[1]);
2380
+ endTimeData = data[2];
2381
+ break;
2382
+ }
2383
+ if (endTimeData) {
2384
+ task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates);
2385
+ task.manualEndTime = dayjs(endTimeData, "YYYY-MM-DD", true).isValid();
2386
+ checkTaskDates(task, dateFormat, excludes, includes);
2387
+ }
2388
+ return task;
2389
+ };
2390
+ const parseData = function(prevTaskId, dataStr) {
2391
+ let ds;
2392
+ if (dataStr.substr(0, 1) === ":") {
2393
+ ds = dataStr.substr(1, dataStr.length);
2394
+ } else {
2395
+ ds = dataStr;
2396
+ }
2397
+ const data = ds.split(",");
2398
+ const task = {};
2399
+ getTaskTags(data, task, tags);
2400
+ for (let i = 0; i < data.length; i++) {
2401
+ data[i] = data[i].trim();
2402
+ }
2403
+ switch (data.length) {
2404
+ case 1:
2405
+ task.id = parseId();
2406
+ task.startTime = {
2407
+ type: "prevTaskEnd",
2408
+ id: prevTaskId
2409
+ };
2410
+ task.endTime = {
2411
+ data: data[0]
2412
+ };
2413
+ break;
2414
+ case 2:
2415
+ task.id = parseId();
2416
+ task.startTime = {
2417
+ type: "getStartDate",
2418
+ startData: data[0]
2419
+ };
2420
+ task.endTime = {
2421
+ data: data[1]
2422
+ };
2423
+ break;
2424
+ case 3:
2425
+ task.id = parseId(data[0]);
2426
+ task.startTime = {
2427
+ type: "getStartDate",
2428
+ startData: data[1]
2429
+ };
2430
+ task.endTime = {
2431
+ data: data[2]
2432
+ };
2433
+ break;
2434
+ }
2435
+ return task;
2436
+ };
2437
+ let lastTask;
2438
+ let lastTaskID;
2439
+ let rawTasks = [];
2440
+ const taskDb = {};
2441
+ const addTask = function(descr, data) {
2442
+ const rawTask = {
2443
+ section: currentSection,
2444
+ type: currentSection,
2445
+ processed: false,
2446
+ manualEndTime: false,
2447
+ renderEndTime: null,
2448
+ raw: { data },
2449
+ task: descr,
2450
+ classes: []
2451
+ };
2452
+ const taskInfo = parseData(lastTaskID, data);
2453
+ rawTask.raw.startTime = taskInfo.startTime;
2454
+ rawTask.raw.endTime = taskInfo.endTime;
2455
+ rawTask.id = taskInfo.id;
2456
+ rawTask.prevTaskId = lastTaskID;
2457
+ rawTask.active = taskInfo.active;
2458
+ rawTask.done = taskInfo.done;
2459
+ rawTask.crit = taskInfo.crit;
2460
+ rawTask.milestone = taskInfo.milestone;
2461
+ rawTask.order = lastOrder;
2462
+ lastOrder++;
2463
+ const pos = rawTasks.push(rawTask);
2464
+ lastTaskID = rawTask.id;
2465
+ taskDb[rawTask.id] = pos - 1;
2466
+ };
2467
+ const findTaskById = function(id) {
2468
+ const pos = taskDb[id];
2469
+ return rawTasks[pos];
2470
+ };
2471
+ const addTaskOrg = function(descr, data) {
2472
+ const newTask = {
2473
+ section: currentSection,
2474
+ type: currentSection,
2475
+ description: descr,
2476
+ task: descr,
2477
+ classes: []
2478
+ };
2479
+ const taskInfo = compileData(lastTask, data);
2480
+ newTask.startTime = taskInfo.startTime;
2481
+ newTask.endTime = taskInfo.endTime;
2482
+ newTask.id = taskInfo.id;
2483
+ newTask.active = taskInfo.active;
2484
+ newTask.done = taskInfo.done;
2485
+ newTask.crit = taskInfo.crit;
2486
+ newTask.milestone = taskInfo.milestone;
2487
+ lastTask = newTask;
2488
+ tasks.push(newTask);
2489
+ };
2490
+ const compileTasks = function() {
2491
+ const compileTask = function(pos) {
2492
+ const task = rawTasks[pos];
2493
+ let startTime = "";
2494
+ switch (rawTasks[pos].raw.startTime.type) {
2495
+ case "prevTaskEnd": {
2496
+ const prevTask = findTaskById(task.prevTaskId);
2497
+ task.startTime = prevTask.endTime;
2498
+ break;
2499
+ }
2500
+ case "getStartDate":
2501
+ startTime = getStartDate(void 0, dateFormat, rawTasks[pos].raw.startTime.startData);
2502
+ if (startTime) {
2503
+ rawTasks[pos].startTime = startTime;
2504
+ }
2505
+ break;
2506
+ }
2507
+ if (rawTasks[pos].startTime) {
2508
+ rawTasks[pos].endTime = getEndDate(
2509
+ rawTasks[pos].startTime,
2510
+ dateFormat,
2511
+ rawTasks[pos].raw.endTime.data,
2512
+ inclusiveEndDates
2513
+ );
2514
+ if (rawTasks[pos].endTime) {
2515
+ rawTasks[pos].processed = true;
2516
+ rawTasks[pos].manualEndTime = dayjs(
2517
+ rawTasks[pos].raw.endTime.data,
2518
+ "YYYY-MM-DD",
2519
+ true
2520
+ ).isValid();
2521
+ checkTaskDates(rawTasks[pos], dateFormat, excludes, includes);
2522
+ }
2523
+ }
2524
+ return rawTasks[pos].processed;
2525
+ };
2526
+ let allProcessed = true;
2527
+ for (const [i, rawTask] of rawTasks.entries()) {
2528
+ compileTask(i);
2529
+ allProcessed = allProcessed && rawTask.processed;
2530
+ }
2531
+ return allProcessed;
2532
+ };
2533
+ const setLink = function(ids, _linkStr) {
2534
+ let linkStr = _linkStr;
2535
+ if (getConfig().securityLevel !== "loose") {
2536
+ linkStr = distExports.sanitizeUrl(_linkStr);
2537
+ }
2538
+ ids.split(",").forEach(function(id) {
2539
+ let rawTask = findTaskById(id);
2540
+ if (rawTask !== void 0) {
2541
+ pushFun(id, () => {
2542
+ window.open(linkStr, "_self");
2543
+ });
2544
+ links[id] = linkStr;
2545
+ }
2546
+ });
2547
+ setClass(ids, "clickable");
2548
+ };
2549
+ const setClass = function(ids, className) {
2550
+ ids.split(",").forEach(function(id) {
2551
+ let rawTask = findTaskById(id);
2552
+ if (rawTask !== void 0) {
2553
+ rawTask.classes.push(className);
2554
+ }
2555
+ });
2556
+ };
2557
+ const setClickFun = function(id, functionName, functionArgs) {
2558
+ if (getConfig().securityLevel !== "loose") {
2559
+ return;
2560
+ }
2561
+ if (functionName === void 0) {
2562
+ return;
2563
+ }
2564
+ let argList = [];
2565
+ if (typeof functionArgs === "string") {
2566
+ argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
2567
+ for (let i = 0; i < argList.length; i++) {
2568
+ let item = argList[i].trim();
2569
+ if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') {
2570
+ item = item.substr(1, item.length - 2);
2571
+ }
2572
+ argList[i] = item;
2573
+ }
2574
+ }
2575
+ if (argList.length === 0) {
2576
+ argList.push(id);
2577
+ }
2578
+ let rawTask = findTaskById(id);
2579
+ if (rawTask !== void 0) {
2580
+ pushFun(id, () => {
2581
+ utils.runFunc(functionName, ...argList);
2582
+ });
2583
+ }
2584
+ };
2585
+ const pushFun = function(id, callbackFunction) {
2586
+ funs.push(
2587
+ function() {
2588
+ const elem = document.querySelector(`[id="${id}"]`);
2589
+ if (elem !== null) {
2590
+ elem.addEventListener("click", function() {
2591
+ callbackFunction();
2592
+ });
2593
+ }
2594
+ },
2595
+ function() {
2596
+ const elem = document.querySelector(`[id="${id}-text"]`);
2597
+ if (elem !== null) {
2598
+ elem.addEventListener("click", function() {
2599
+ callbackFunction();
2600
+ });
2601
+ }
2602
+ }
2603
+ );
2604
+ };
2605
+ const setClickEvent = function(ids, functionName, functionArgs) {
2606
+ ids.split(",").forEach(function(id) {
2607
+ setClickFun(id, functionName, functionArgs);
2608
+ });
2609
+ setClass(ids, "clickable");
2610
+ };
2611
+ const bindFunctions = function(element) {
2612
+ funs.forEach(function(fun) {
2613
+ fun(element);
2614
+ });
2615
+ };
2616
+ const ganttDb = {
2617
+ getConfig: () => getConfig().gantt,
2618
+ clear,
2619
+ setDateFormat,
2620
+ getDateFormat,
2621
+ enableInclusiveEndDates,
2622
+ endDatesAreInclusive,
2623
+ enableTopAxis,
2624
+ topAxisEnabled,
2625
+ setAxisFormat,
2626
+ getAxisFormat,
2627
+ setTickInterval,
2628
+ getTickInterval,
2629
+ setTodayMarker,
2630
+ getTodayMarker,
2631
+ setAccTitle,
2632
+ getAccTitle,
2633
+ setDiagramTitle,
2634
+ getDiagramTitle,
2635
+ setDisplayMode,
2636
+ getDisplayMode,
2637
+ setAccDescription,
2638
+ getAccDescription,
2639
+ addSection,
2640
+ getSections,
2641
+ getTasks,
2642
+ addTask,
2643
+ findTaskById,
2644
+ addTaskOrg,
2645
+ setIncludes,
2646
+ getIncludes,
2647
+ setExcludes,
2648
+ getExcludes,
2649
+ setClickEvent,
2650
+ setLink,
2651
+ getLinks,
2652
+ bindFunctions,
2653
+ parseDuration,
2654
+ isInvalidDate,
2655
+ setWeekday,
2656
+ getWeekday
2657
+ };
2658
+ function getTaskTags(data, task, tags2) {
2659
+ let matchFound = true;
2660
+ while (matchFound) {
2661
+ matchFound = false;
2662
+ tags2.forEach(function(t) {
2663
+ const pattern = "^\\s*" + t + "\\s*$";
2664
+ const regex = new RegExp(pattern);
2665
+ if (data[0].match(regex)) {
2666
+ task[t] = true;
2667
+ data.shift(1);
2668
+ matchFound = true;
2669
+ }
2670
+ });
2671
+ }
2672
+ }
2673
+ const setConf = function() {
2674
+ log$1.debug("Something is calling, setConf, remove the call");
2675
+ };
2676
+ const mapWeekdayToTimeFunction = {
2677
+ monday: timeMonday,
2678
+ tuesday: timeTuesday,
2679
+ wednesday: timeWednesday,
2680
+ thursday: timeThursday,
2681
+ friday: timeFriday,
2682
+ saturday: timeSaturday,
2683
+ sunday: timeSunday
2684
+ };
2685
+ const getMaxIntersections = (tasks2, orderOffset) => {
2686
+ let timeline = [...tasks2].map(() => -Infinity);
2687
+ let sorted = [...tasks2].sort((a, b) => a.startTime - b.startTime || a.order - b.order);
2688
+ let maxIntersections = 0;
2689
+ for (const element of sorted) {
2690
+ for (let j = 0; j < timeline.length; j++) {
2691
+ if (element.startTime >= timeline[j]) {
2692
+ timeline[j] = element.endTime;
2693
+ element.order = j + orderOffset;
2694
+ if (j > maxIntersections) {
2695
+ maxIntersections = j;
2696
+ }
2697
+ break;
2698
+ }
2699
+ }
2700
+ }
2701
+ return maxIntersections;
2702
+ };
2703
+ let w;
2704
+ const draw = function(text, id, version, diagObj) {
2705
+ const conf = getConfig().gantt;
2706
+ const securityLevel = getConfig().securityLevel;
2707
+ let sandboxElement;
2708
+ if (securityLevel === "sandbox") {
2709
+ sandboxElement = select("#i" + id);
2710
+ }
2711
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
2712
+ const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
2713
+ const elem = doc.getElementById(id);
2714
+ w = elem.parentElement.offsetWidth;
2715
+ if (w === void 0) {
2716
+ w = 1200;
2717
+ }
2718
+ if (conf.useWidth !== void 0) {
2719
+ w = conf.useWidth;
2720
+ }
2721
+ const taskArray = diagObj.db.getTasks();
2722
+ let categories = [];
2723
+ for (const element of taskArray) {
2724
+ categories.push(element.type);
2725
+ }
2726
+ categories = checkUnique(categories);
2727
+ const categoryHeights = {};
2728
+ let h = 2 * conf.topPadding;
2729
+ if (diagObj.db.getDisplayMode() === "compact" || conf.displayMode === "compact") {
2730
+ const categoryElements = {};
2731
+ for (const element of taskArray) {
2732
+ if (categoryElements[element.section] === void 0) {
2733
+ categoryElements[element.section] = [element];
2734
+ } else {
2735
+ categoryElements[element.section].push(element);
2736
+ }
2737
+ }
2738
+ let intersections = 0;
2739
+ for (const category of Object.keys(categoryElements)) {
2740
+ const categoryHeight = getMaxIntersections(categoryElements[category], intersections) + 1;
2741
+ intersections += categoryHeight;
2742
+ h += categoryHeight * (conf.barHeight + conf.barGap);
2743
+ categoryHeights[category] = categoryHeight;
2744
+ }
2745
+ } else {
2746
+ h += taskArray.length * (conf.barHeight + conf.barGap);
2747
+ for (const category of categories) {
2748
+ categoryHeights[category] = taskArray.filter((task) => task.type === category).length;
2749
+ }
2750
+ }
2751
+ elem.setAttribute("viewBox", "0 0 " + w + " " + h);
2752
+ const svg = root.select(`[id="${id}"]`);
2753
+ const timeScale = time().domain([
2754
+ min(taskArray, function(d) {
2755
+ return d.startTime;
2756
+ }),
2757
+ max(taskArray, function(d) {
2758
+ return d.endTime;
2759
+ })
2760
+ ]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]);
2761
+ function taskCompare(a, b) {
2762
+ const taskA = a.startTime;
2763
+ const taskB = b.startTime;
2764
+ let result = 0;
2765
+ if (taskA > taskB) {
2766
+ result = 1;
2767
+ } else if (taskA < taskB) {
2768
+ result = -1;
2769
+ }
2770
+ return result;
2771
+ }
2772
+ taskArray.sort(taskCompare);
2773
+ makeGantt(taskArray, w, h);
2774
+ configureSvgSize(svg, h, w, conf.useMaxWidth);
2775
+ svg.append("text").text(diagObj.db.getDiagramTitle()).attr("x", w / 2).attr("y", conf.titleTopMargin).attr("class", "titleText");
2776
+ function makeGantt(tasks2, pageWidth, pageHeight) {
2777
+ const barHeight = conf.barHeight;
2778
+ const gap = barHeight + conf.barGap;
2779
+ const topPadding = conf.topPadding;
2780
+ const leftPadding = conf.leftPadding;
2781
+ const colorScale = linear().domain([0, categories.length]).range(["#00B9FA", "#F95002"]).interpolate(interpolateHcl);
2782
+ drawExcludeDays(
2783
+ gap,
2784
+ topPadding,
2785
+ leftPadding,
2786
+ pageWidth,
2787
+ pageHeight,
2788
+ tasks2,
2789
+ diagObj.db.getExcludes(),
2790
+ diagObj.db.getIncludes()
2791
+ );
2792
+ makeGrid(leftPadding, topPadding, pageWidth, pageHeight);
2793
+ drawRects(tasks2, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth);
2794
+ vertLabels(gap, topPadding);
2795
+ drawToday(leftPadding, topPadding, pageWidth, pageHeight);
2796
+ }
2797
+ function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w2) {
2798
+ const uniqueTaskOrderIds = [...new Set(theArray.map((item) => item.order))];
2799
+ const uniqueTasks = uniqueTaskOrderIds.map((id2) => theArray.find((item) => item.order === id2));
2800
+ svg.append("g").selectAll("rect").data(uniqueTasks).enter().append("rect").attr("x", 0).attr("y", function(d, i) {
2801
+ i = d.order;
2802
+ return i * theGap + theTopPad - 2;
2803
+ }).attr("width", function() {
2804
+ return w2 - conf.rightPadding / 2;
2805
+ }).attr("height", theGap).attr("class", function(d) {
2806
+ for (const [i, category] of categories.entries()) {
2807
+ if (d.type === category) {
2808
+ return "section section" + i % conf.numberSectionStyles;
2809
+ }
2810
+ }
2811
+ return "section section0";
2812
+ });
2813
+ const rectangles = svg.append("g").selectAll("rect").data(theArray).enter();
2814
+ const links2 = diagObj.db.getLinks();
2815
+ rectangles.append("rect").attr("id", function(d) {
2816
+ return d.id;
2817
+ }).attr("rx", 3).attr("ry", 3).attr("x", function(d) {
2818
+ if (d.milestone) {
2819
+ return timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
2820
+ }
2821
+ return timeScale(d.startTime) + theSidePad;
2822
+ }).attr("y", function(d, i) {
2823
+ i = d.order;
2824
+ return i * theGap + theTopPad;
2825
+ }).attr("width", function(d) {
2826
+ if (d.milestone) {
2827
+ return theBarHeight;
2828
+ }
2829
+ return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
2830
+ }).attr("height", theBarHeight).attr("transform-origin", function(d, i) {
2831
+ i = d.order;
2832
+ return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + "px " + (i * theGap + theTopPad + 0.5 * theBarHeight).toString() + "px";
2833
+ }).attr("class", function(d) {
2834
+ const res = "task";
2835
+ let classStr = "";
2836
+ if (d.classes.length > 0) {
2837
+ classStr = d.classes.join(" ");
2838
+ }
2839
+ let secNum = 0;
2840
+ for (const [i, category] of categories.entries()) {
2841
+ if (d.type === category) {
2842
+ secNum = i % conf.numberSectionStyles;
2843
+ }
2844
+ }
2845
+ let taskClass = "";
2846
+ if (d.active) {
2847
+ if (d.crit) {
2848
+ taskClass += " activeCrit";
2849
+ } else {
2850
+ taskClass = " active";
2851
+ }
2852
+ } else if (d.done) {
2853
+ if (d.crit) {
2854
+ taskClass = " doneCrit";
2855
+ } else {
2856
+ taskClass = " done";
2857
+ }
2858
+ } else {
2859
+ if (d.crit) {
2860
+ taskClass += " crit";
2861
+ }
2862
+ }
2863
+ if (taskClass.length === 0) {
2864
+ taskClass = " task";
2865
+ }
2866
+ if (d.milestone) {
2867
+ taskClass = " milestone " + taskClass;
2868
+ }
2869
+ taskClass += secNum;
2870
+ taskClass += " " + classStr;
2871
+ return res + taskClass;
2872
+ });
2873
+ rectangles.append("text").attr("id", function(d) {
2874
+ return d.id + "-text";
2875
+ }).text(function(d) {
2876
+ return d.task;
2877
+ }).attr("font-size", conf.fontSize).attr("x", function(d) {
2878
+ let startX = timeScale(d.startTime);
2879
+ let endX = timeScale(d.renderEndTime || d.endTime);
2880
+ if (d.milestone) {
2881
+ startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
2882
+ }
2883
+ if (d.milestone) {
2884
+ endX = startX + theBarHeight;
2885
+ }
2886
+ const textWidth = this.getBBox().width;
2887
+ if (textWidth > endX - startX) {
2888
+ if (endX + textWidth + 1.5 * conf.leftPadding > w2) {
2889
+ return startX + theSidePad - 5;
2890
+ } else {
2891
+ return endX + theSidePad + 5;
2892
+ }
2893
+ } else {
2894
+ return (endX - startX) / 2 + startX + theSidePad;
2895
+ }
2896
+ }).attr("y", function(d, i) {
2897
+ i = d.order;
2898
+ return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
2899
+ }).attr("text-height", theBarHeight).attr("class", function(d) {
2900
+ const startX = timeScale(d.startTime);
2901
+ let endX = timeScale(d.endTime);
2902
+ if (d.milestone) {
2903
+ endX = startX + theBarHeight;
2904
+ }
2905
+ const textWidth = this.getBBox().width;
2906
+ let classStr = "";
2907
+ if (d.classes.length > 0) {
2908
+ classStr = d.classes.join(" ");
2909
+ }
2910
+ let secNum = 0;
2911
+ for (const [i, category] of categories.entries()) {
2912
+ if (d.type === category) {
2913
+ secNum = i % conf.numberSectionStyles;
2914
+ }
2915
+ }
2916
+ let taskType = "";
2917
+ if (d.active) {
2918
+ if (d.crit) {
2919
+ taskType = "activeCritText" + secNum;
2920
+ } else {
2921
+ taskType = "activeText" + secNum;
2922
+ }
2923
+ }
2924
+ if (d.done) {
2925
+ if (d.crit) {
2926
+ taskType = taskType + " doneCritText" + secNum;
2927
+ } else {
2928
+ taskType = taskType + " doneText" + secNum;
2929
+ }
2930
+ } else {
2931
+ if (d.crit) {
2932
+ taskType = taskType + " critText" + secNum;
2933
+ }
2934
+ }
2935
+ if (d.milestone) {
2936
+ taskType += " milestoneText";
2937
+ }
2938
+ if (textWidth > endX - startX) {
2939
+ if (endX + textWidth + 1.5 * conf.leftPadding > w2) {
2940
+ return classStr + " taskTextOutsideLeft taskTextOutside" + secNum + " " + taskType;
2941
+ } else {
2942
+ return classStr + " taskTextOutsideRight taskTextOutside" + secNum + " " + taskType + " width-" + textWidth;
2943
+ }
2944
+ } else {
2945
+ return classStr + " taskText taskText" + secNum + " " + taskType + " width-" + textWidth;
2946
+ }
2947
+ });
2948
+ const securityLevel2 = getConfig().securityLevel;
2949
+ if (securityLevel2 === "sandbox") {
2950
+ let sandboxElement2;
2951
+ sandboxElement2 = select("#i" + id);
2952
+ const doc2 = sandboxElement2.nodes()[0].contentDocument;
2953
+ rectangles.filter(function(d) {
2954
+ return links2[d.id] !== void 0;
2955
+ }).each(function(o) {
2956
+ var taskRect = doc2.querySelector("#" + o.id);
2957
+ var taskText = doc2.querySelector("#" + o.id + "-text");
2958
+ const oldParent = taskRect.parentNode;
2959
+ var Link = doc2.createElement("a");
2960
+ Link.setAttribute("xlink:href", links2[o.id]);
2961
+ Link.setAttribute("target", "_top");
2962
+ oldParent.appendChild(Link);
2963
+ Link.appendChild(taskRect);
2964
+ Link.appendChild(taskText);
2965
+ });
2966
+ }
2967
+ }
2968
+ function drawExcludeDays(theGap, theTopPad, theSidePad, w2, h2, tasks2, excludes2, includes2) {
2969
+ if (excludes2.length === 0 && includes2.length === 0) {
2970
+ return;
2971
+ }
2972
+ let minTime;
2973
+ let maxTime;
2974
+ for (const { startTime, endTime } of tasks2) {
2975
+ if (minTime === void 0 || startTime < minTime) {
2976
+ minTime = startTime;
2977
+ }
2978
+ if (maxTime === void 0 || endTime > maxTime) {
2979
+ maxTime = endTime;
2980
+ }
2981
+ }
2982
+ if (!minTime || !maxTime) {
2983
+ return;
2984
+ }
2985
+ if (dayjs(maxTime).diff(dayjs(minTime), "year") > 5) {
2986
+ log$1.warn(
2987
+ "The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days."
2988
+ );
2989
+ return;
2990
+ }
2991
+ const dateFormat2 = diagObj.db.getDateFormat();
2992
+ const excludeRanges = [];
2993
+ let range = null;
2994
+ let d = dayjs(minTime);
2995
+ while (d.valueOf() <= maxTime) {
2996
+ if (diagObj.db.isInvalidDate(d, dateFormat2, excludes2, includes2)) {
2997
+ if (!range) {
2998
+ range = {
2999
+ start: d,
3000
+ end: d
3001
+ };
3002
+ } else {
3003
+ range.end = d;
3004
+ }
3005
+ } else {
3006
+ if (range) {
3007
+ excludeRanges.push(range);
3008
+ range = null;
3009
+ }
3010
+ }
3011
+ d = d.add(1, "d");
3012
+ }
3013
+ const rectangles = svg.append("g").selectAll("rect").data(excludeRanges).enter();
3014
+ rectangles.append("rect").attr("id", function(d2) {
3015
+ return "exclude-" + d2.start.format("YYYY-MM-DD");
3016
+ }).attr("x", function(d2) {
3017
+ return timeScale(d2.start) + theSidePad;
3018
+ }).attr("y", conf.gridLineStartPadding).attr("width", function(d2) {
3019
+ const renderEnd = d2.end.add(1, "day");
3020
+ return timeScale(renderEnd) - timeScale(d2.start);
3021
+ }).attr("height", h2 - theTopPad - conf.gridLineStartPadding).attr("transform-origin", function(d2, i) {
3022
+ return (timeScale(d2.start) + theSidePad + 0.5 * (timeScale(d2.end) - timeScale(d2.start))).toString() + "px " + (i * theGap + 0.5 * h2).toString() + "px";
3023
+ }).attr("class", "exclude-range");
3024
+ }
3025
+ function makeGrid(theSidePad, theTopPad, w2, h2) {
3026
+ let bottomXAxis = axisBottom(timeScale).tickSize(-h2 + theTopPad + conf.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf.axisFormat || "%Y-%m-%d"));
3027
+ const reTickInterval = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/;
3028
+ const resultTickInterval = reTickInterval.exec(
3029
+ diagObj.db.getTickInterval() || conf.tickInterval
3030
+ );
3031
+ if (resultTickInterval !== null) {
3032
+ const every = resultTickInterval[1];
3033
+ const interval = resultTickInterval[2];
3034
+ const weekday2 = diagObj.db.getWeekday() || conf.weekday;
3035
+ switch (interval) {
3036
+ case "millisecond":
3037
+ bottomXAxis.ticks(millisecond.every(every));
3038
+ break;
3039
+ case "second":
3040
+ bottomXAxis.ticks(second.every(every));
3041
+ break;
3042
+ case "minute":
3043
+ bottomXAxis.ticks(timeMinute.every(every));
3044
+ break;
3045
+ case "hour":
3046
+ bottomXAxis.ticks(timeHour.every(every));
3047
+ break;
3048
+ case "day":
3049
+ bottomXAxis.ticks(timeDay.every(every));
3050
+ break;
3051
+ case "week":
3052
+ bottomXAxis.ticks(mapWeekdayToTimeFunction[weekday2].every(every));
3053
+ break;
3054
+ case "month":
3055
+ bottomXAxis.ticks(timeMonth.every(every));
3056
+ break;
3057
+ }
3058
+ }
3059
+ svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + (h2 - 50) + ")").call(bottomXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em");
3060
+ if (diagObj.db.topAxisEnabled() || conf.topAxis) {
3061
+ let topXAxis = axisTop(timeScale).tickSize(-h2 + theTopPad + conf.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf.axisFormat || "%Y-%m-%d"));
3062
+ if (resultTickInterval !== null) {
3063
+ const every = resultTickInterval[1];
3064
+ const interval = resultTickInterval[2];
3065
+ const weekday2 = diagObj.db.getWeekday() || conf.weekday;
3066
+ switch (interval) {
3067
+ case "millisecond":
3068
+ topXAxis.ticks(millisecond.every(every));
3069
+ break;
3070
+ case "second":
3071
+ topXAxis.ticks(second.every(every));
3072
+ break;
3073
+ case "minute":
3074
+ topXAxis.ticks(timeMinute.every(every));
3075
+ break;
3076
+ case "hour":
3077
+ topXAxis.ticks(timeHour.every(every));
3078
+ break;
3079
+ case "day":
3080
+ topXAxis.ticks(timeDay.every(every));
3081
+ break;
3082
+ case "week":
3083
+ topXAxis.ticks(mapWeekdayToTimeFunction[weekday2].every(every));
3084
+ break;
3085
+ case "month":
3086
+ topXAxis.ticks(timeMonth.every(every));
3087
+ break;
3088
+ }
3089
+ }
3090
+ svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + theTopPad + ")").call(topXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
3091
+ }
3092
+ }
3093
+ function vertLabels(theGap, theTopPad) {
3094
+ let prevGap = 0;
3095
+ const numOccurrences = Object.keys(categoryHeights).map((d) => [d, categoryHeights[d]]);
3096
+ svg.append("g").selectAll("text").data(numOccurrences).enter().append(function(d) {
3097
+ const rows = d[0].split(common$1.lineBreakRegex);
3098
+ const dy = -(rows.length - 1) / 2;
3099
+ const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text");
3100
+ svgLabel.setAttribute("dy", dy + "em");
3101
+ for (const [j, row] of rows.entries()) {
3102
+ const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan");
3103
+ tspan.setAttribute("alignment-baseline", "central");
3104
+ tspan.setAttribute("x", "10");
3105
+ if (j > 0) {
3106
+ tspan.setAttribute("dy", "1em");
3107
+ }
3108
+ tspan.textContent = row;
3109
+ svgLabel.appendChild(tspan);
3110
+ }
3111
+ return svgLabel;
3112
+ }).attr("x", 10).attr("y", function(d, i) {
3113
+ if (i > 0) {
3114
+ for (let j = 0; j < i; j++) {
3115
+ prevGap += numOccurrences[i - 1][1];
3116
+ return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
3117
+ }
3118
+ } else {
3119
+ return d[1] * theGap / 2 + theTopPad;
3120
+ }
3121
+ }).attr("font-size", conf.sectionFontSize).attr("class", function(d) {
3122
+ for (const [i, category] of categories.entries()) {
3123
+ if (d[0] === category) {
3124
+ return "sectionTitle sectionTitle" + i % conf.numberSectionStyles;
3125
+ }
3126
+ }
3127
+ return "sectionTitle";
3128
+ });
3129
+ }
3130
+ function drawToday(theSidePad, theTopPad, w2, h2) {
3131
+ const todayMarker2 = diagObj.db.getTodayMarker();
3132
+ if (todayMarker2 === "off") {
3133
+ return;
3134
+ }
3135
+ const todayG = svg.append("g").attr("class", "today");
3136
+ const today = /* @__PURE__ */ new Date();
3137
+ const todayLine = todayG.append("line");
3138
+ todayLine.attr("x1", timeScale(today) + theSidePad).attr("x2", timeScale(today) + theSidePad).attr("y1", conf.titleTopMargin).attr("y2", h2 - conf.titleTopMargin).attr("class", "today");
3139
+ if (todayMarker2 !== "") {
3140
+ todayLine.attr("style", todayMarker2.replace(/,/g, ";"));
3141
+ }
3142
+ }
3143
+ function checkUnique(arr) {
3144
+ const hash = {};
3145
+ const result = [];
3146
+ for (let i = 0, l = arr.length; i < l; ++i) {
3147
+ if (!Object.prototype.hasOwnProperty.call(hash, arr[i])) {
3148
+ hash[arr[i]] = true;
3149
+ result.push(arr[i]);
3150
+ }
3151
+ }
3152
+ return result;
3153
+ }
3154
+ };
3155
+ const ganttRenderer = {
3156
+ setConf,
3157
+ draw
3158
+ };
3159
+ const getStyles = (options) => `
3160
+ .mermaid-main-font {
3161
+ font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
3162
+ }
3163
+
3164
+ .exclude-range {
3165
+ fill: ${options.excludeBkgColor};
3166
+ }
3167
+
3168
+ .section {
3169
+ stroke: none;
3170
+ opacity: 0.2;
3171
+ }
3172
+
3173
+ .section0 {
3174
+ fill: ${options.sectionBkgColor};
3175
+ }
3176
+
3177
+ .section2 {
3178
+ fill: ${options.sectionBkgColor2};
3179
+ }
3180
+
3181
+ .section1,
3182
+ .section3 {
3183
+ fill: ${options.altSectionBkgColor};
3184
+ opacity: 0.2;
3185
+ }
3186
+
3187
+ .sectionTitle0 {
3188
+ fill: ${options.titleColor};
3189
+ }
3190
+
3191
+ .sectionTitle1 {
3192
+ fill: ${options.titleColor};
3193
+ }
3194
+
3195
+ .sectionTitle2 {
3196
+ fill: ${options.titleColor};
3197
+ }
3198
+
3199
+ .sectionTitle3 {
3200
+ fill: ${options.titleColor};
3201
+ }
3202
+
3203
+ .sectionTitle {
3204
+ text-anchor: start;
3205
+ font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
3206
+ }
3207
+
3208
+
3209
+ /* Grid and axis */
3210
+
3211
+ .grid .tick {
3212
+ stroke: ${options.gridColor};
3213
+ opacity: 0.8;
3214
+ shape-rendering: crispEdges;
3215
+ }
3216
+
3217
+ .grid .tick text {
3218
+ font-family: ${options.fontFamily};
3219
+ fill: ${options.textColor};
3220
+ }
3221
+
3222
+ .grid path {
3223
+ stroke-width: 0;
3224
+ }
3225
+
3226
+
3227
+ /* Today line */
3228
+
3229
+ .today {
3230
+ fill: none;
3231
+ stroke: ${options.todayLineColor};
3232
+ stroke-width: 2px;
3233
+ }
3234
+
3235
+
3236
+ /* Task styling */
3237
+
3238
+ /* Default task */
3239
+
3240
+ .task {
3241
+ stroke-width: 2;
3242
+ }
3243
+
3244
+ .taskText {
3245
+ text-anchor: middle;
3246
+ font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
3247
+ }
3248
+
3249
+ .taskTextOutsideRight {
3250
+ fill: ${options.taskTextDarkColor};
3251
+ text-anchor: start;
3252
+ font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
3253
+ }
3254
+
3255
+ .taskTextOutsideLeft {
3256
+ fill: ${options.taskTextDarkColor};
3257
+ text-anchor: end;
3258
+ }
3259
+
3260
+
3261
+ /* Special case clickable */
3262
+
3263
+ .task.clickable {
3264
+ cursor: pointer;
3265
+ }
3266
+
3267
+ .taskText.clickable {
3268
+ cursor: pointer;
3269
+ fill: ${options.taskTextClickableColor} !important;
3270
+ font-weight: bold;
3271
+ }
3272
+
3273
+ .taskTextOutsideLeft.clickable {
3274
+ cursor: pointer;
3275
+ fill: ${options.taskTextClickableColor} !important;
3276
+ font-weight: bold;
3277
+ }
3278
+
3279
+ .taskTextOutsideRight.clickable {
3280
+ cursor: pointer;
3281
+ fill: ${options.taskTextClickableColor} !important;
3282
+ font-weight: bold;
3283
+ }
3284
+
3285
+
3286
+ /* Specific task settings for the sections*/
3287
+
3288
+ .taskText0,
3289
+ .taskText1,
3290
+ .taskText2,
3291
+ .taskText3 {
3292
+ fill: ${options.taskTextColor};
3293
+ }
3294
+
3295
+ .task0,
3296
+ .task1,
3297
+ .task2,
3298
+ .task3 {
3299
+ fill: ${options.taskBkgColor};
3300
+ stroke: ${options.taskBorderColor};
3301
+ }
3302
+
3303
+ .taskTextOutside0,
3304
+ .taskTextOutside2
3305
+ {
3306
+ fill: ${options.taskTextOutsideColor};
3307
+ }
3308
+
3309
+ .taskTextOutside1,
3310
+ .taskTextOutside3 {
3311
+ fill: ${options.taskTextOutsideColor};
3312
+ }
3313
+
3314
+
3315
+ /* Active task */
3316
+
3317
+ .active0,
3318
+ .active1,
3319
+ .active2,
3320
+ .active3 {
3321
+ fill: ${options.activeTaskBkgColor};
3322
+ stroke: ${options.activeTaskBorderColor};
3323
+ }
3324
+
3325
+ .activeText0,
3326
+ .activeText1,
3327
+ .activeText2,
3328
+ .activeText3 {
3329
+ fill: ${options.taskTextDarkColor} !important;
3330
+ }
3331
+
3332
+
3333
+ /* Completed task */
3334
+
3335
+ .done0,
3336
+ .done1,
3337
+ .done2,
3338
+ .done3 {
3339
+ stroke: ${options.doneTaskBorderColor};
3340
+ fill: ${options.doneTaskBkgColor};
3341
+ stroke-width: 2;
3342
+ }
3343
+
3344
+ .doneText0,
3345
+ .doneText1,
3346
+ .doneText2,
3347
+ .doneText3 {
3348
+ fill: ${options.taskTextDarkColor} !important;
3349
+ }
3350
+
3351
+
3352
+ /* Tasks on the critical line */
3353
+
3354
+ .crit0,
3355
+ .crit1,
3356
+ .crit2,
3357
+ .crit3 {
3358
+ stroke: ${options.critBorderColor};
3359
+ fill: ${options.critBkgColor};
3360
+ stroke-width: 2;
3361
+ }
3362
+
3363
+ .activeCrit0,
3364
+ .activeCrit1,
3365
+ .activeCrit2,
3366
+ .activeCrit3 {
3367
+ stroke: ${options.critBorderColor};
3368
+ fill: ${options.activeTaskBkgColor};
3369
+ stroke-width: 2;
3370
+ }
3371
+
3372
+ .doneCrit0,
3373
+ .doneCrit1,
3374
+ .doneCrit2,
3375
+ .doneCrit3 {
3376
+ stroke: ${options.critBorderColor};
3377
+ fill: ${options.doneTaskBkgColor};
3378
+ stroke-width: 2;
3379
+ cursor: pointer;
3380
+ shape-rendering: crispEdges;
3381
+ }
3382
+
3383
+ .milestone {
3384
+ transform: rotate(45deg) scale(0.8,0.8);
3385
+ }
3386
+
3387
+ .milestoneText {
3388
+ font-style: italic;
3389
+ }
3390
+ .doneCritText0,
3391
+ .doneCritText1,
3392
+ .doneCritText2,
3393
+ .doneCritText3 {
3394
+ fill: ${options.taskTextDarkColor} !important;
3395
+ }
3396
+
3397
+ .activeCritText0,
3398
+ .activeCritText1,
3399
+ .activeCritText2,
3400
+ .activeCritText3 {
3401
+ fill: ${options.taskTextDarkColor} !important;
3402
+ }
3403
+
3404
+ .titleText {
3405
+ text-anchor: middle;
3406
+ font-size: 18px;
3407
+ fill: ${options.titleColor || options.textColor};
3408
+ font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
3409
+ }
3410
+ `;
3411
+ const ganttStyles = getStyles;
3412
+ const diagram = {
3413
+ parser: ganttParser,
3414
+ db: ganttDb,
3415
+ renderer: ganttRenderer,
3416
+ styles: ganttStyles
3417
+ };
3418
+ export {
3419
+ diagram
3420
+ };