@mobileaction/action-kit 1.57.0 → 1.57.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.
@@ -1,2044 +0,0 @@
1
- import { g as fa } from "./index-C8r4OcCO.js";
2
- function ma(Dt, ee) {
3
- for (var H = 0; H < ee.length; H++) {
4
- const et = ee[H];
5
- if (typeof et != "string" && !Array.isArray(et)) {
6
- for (const dt in et)
7
- if (dt !== "default" && !(dt in Dt)) {
8
- const Pt = Object.getOwnPropertyDescriptor(et, dt);
9
- Pt && Object.defineProperty(Dt, dt, Pt.get ? Pt : {
10
- enumerable: !0,
11
- get: () => et[dt]
12
- });
13
- }
14
- }
15
- }
16
- return Object.freeze(Object.defineProperty(Dt, Symbol.toStringTag, { value: "Module" }));
17
- }
18
- var te = { exports: {} }, xa = te.exports, Ji;
19
- function ba() {
20
- return Ji || (Ji = 1, function(Dt, ee) {
21
- /**
22
- * Highcharts JS v12.3.0 (2025-06-21)
23
- * @module highcharts/modules/broken-axis
24
- * @requires highcharts
25
- *
26
- * (c) 2009-2025 Torstein Honsi
27
- *
28
- * License: www.highcharts.com/license
29
- */
30
- (function(H, et) {
31
- Dt.exports = et(H._Highcharts, H._Highcharts.Axis, H._Highcharts.Point, H._Highcharts.Series, H._Highcharts.Color, H._Highcharts.SeriesRegistry, H._Highcharts.RendererRegistry, H._Highcharts.SVGRenderer, H._Highcharts.SVGElement, H._Highcharts.Templating, H._Highcharts.Chart, H._Highcharts.Series.types.column, H._Highcharts.StackItem);
32
- })(typeof window > "u" ? xa : window, (H, et, dt, Pt, ts, es, is, ss, os, rs, as, ns, ls) => (() => {
33
- let ie, se, He, oe;
34
- var re, ae, ne, le, he, de, pe, ue, hs = { 28: (a) => {
35
- a.exports = os;
36
- }, 184: (a) => {
37
- a.exports = ls;
38
- }, 260: (a) => {
39
- a.exports = dt;
40
- }, 448: (a) => {
41
- a.exports = ns;
42
- }, 512: (a) => {
43
- a.exports = es;
44
- }, 532: (a) => {
45
- a.exports = et;
46
- }, 540: (a) => {
47
- a.exports = ss;
48
- }, 608: (a) => {
49
- a.exports = is;
50
- }, 620: (a) => {
51
- a.exports = ts;
52
- }, 820: (a) => {
53
- a.exports = Pt;
54
- }, 944: (a) => {
55
- a.exports = H;
56
- }, 960: (a) => {
57
- a.exports = as;
58
- }, 984: (a) => {
59
- a.exports = rs;
60
- } }, Ye = {};
61
- function G(a) {
62
- var t = Ye[a];
63
- if (t !== void 0) return t.exports;
64
- var e = Ye[a] = { exports: {} };
65
- return hs[a](e, e.exports, G), e.exports;
66
- }
67
- G.n = (a) => {
68
- var t = a && a.__esModule ? () => a.default : () => a;
69
- return G.d(t, { a: t }), t;
70
- }, G.d = (a, t) => {
71
- for (var e in t) G.o(t, e) && !G.o(a, e) && Object.defineProperty(a, e, { enumerable: !0, get: t[e] });
72
- }, G.o = (a, t) => Object.prototype.hasOwnProperty.call(a, t);
73
- var Ne = {};
74
- G.d(Ne, { default: () => ga });
75
- var ds = G(944), B = G.n(ds), ps = G(532), ce = G.n(ps), us = G(260), cs = G.n(us), gs = G(820), fs = G.n(gs);
76
- let { tooltipFormatter: ms } = cs().prototype, { addEvent: ge, arrayMax: xs, arrayMin: bs, correctFloat: vs, defined: Fe, isArray: ys, isNumber: Ms, isString: As, pick: Rt } = B();
77
- (function(a) {
78
- function t(d, r, l) {
79
- !this.isXAxis && (this.series.forEach(function(h) {
80
- d === "compare" && typeof r != "boolean" ? h.setCompare(r, !1) : d !== "cumulative" || As(r) || h.setCumulative(r, !1);
81
- }), Rt(l, !0) && this.chart.redraw());
82
- }
83
- function e(d) {
84
- let r = this, { numberFormatter: l } = r.series.chart, h = function(f) {
85
- d = d.replace("{point." + f + "}", (r[f] > 0 && f === "change" ? "+" : "") + l(r[f], Rt(r.series.tooltipOptions.changeDecimals, 2)));
86
- };
87
- return Fe(r.change) && h("change"), Fe(r.cumulativeSum) && h("cumulativeSum"), ms.apply(this, [d]);
88
- }
89
- function i() {
90
- let d, r = this.options.compare;
91
- (r === "percent" || r === "value" || this.options.cumulative) && (d = new p(this), r === "percent" || r === "value" ? d.initCompare(r) : d.initCumulative()), this.dataModify = d;
92
- }
93
- function s(d) {
94
- let r = d.dataExtremes, l = r.activeYData;
95
- if (this.dataModify && r) {
96
- let h;
97
- this.options.compare ? h = [this.dataModify.modifyValue(r.dataMin), this.dataModify.modifyValue(r.dataMax)] : this.options.cumulative && ys(l) && l.length >= 2 && (h = p.getCumulativeExtremes(l)), h && (r.dataMin = bs(h), r.dataMax = xs(h));
98
- }
99
- }
100
- function o(d, r) {
101
- this.options.compare = this.userOptions.compare = d, this.update({}, Rt(r, !0)), this.dataModify && (d === "value" || d === "percent") ? this.dataModify.initCompare(d) : this.points.forEach((l) => {
102
- delete l.change;
103
- });
104
- }
105
- function n() {
106
- let d = this.getColumn(this.pointArrayMap && (this.options.pointValKey || this.pointValKey) || "y", !0);
107
- if (this.xAxis && d.length && this.dataModify) {
108
- let r = this.getColumn("x", !0), l = this.dataTable.rowCount, h = +(this.options.compareStart !== !0);
109
- for (let f = 0; f < l - h; f++) {
110
- let m = d[f];
111
- if (Ms(m) && m !== 0 && r[f + h] >= (this.xAxis.min || 0)) {
112
- this.dataModify.compareValue = m;
113
- break;
114
- }
115
- }
116
- }
117
- }
118
- function c(d, r) {
119
- this.setModifier("compare", d, r);
120
- }
121
- function u(d, r) {
122
- d = Rt(d, !1), this.options.cumulative = this.userOptions.cumulative = d, this.update({}, Rt(r, !0)), this.dataModify ? this.dataModify.initCumulative() : this.points.forEach((l) => {
123
- delete l.cumulativeSum;
124
- });
125
- }
126
- function g(d, r) {
127
- this.setModifier("cumulative", d, r);
128
- }
129
- a.compose = function(d, r, l) {
130
- let h = r.prototype, f = l.prototype, m = d.prototype;
131
- return m.setCompare || (m.setCompare = o, m.setCumulative = u, ge(d, "afterInit", i), ge(d, "afterGetExtremes", s), ge(d, "afterProcessData", n)), h.setCompare || (h.setCompare = c, h.setModifier = t, h.setCumulative = g, f.tooltipFormatter = e), d;
132
- };
133
- class p {
134
- constructor(r) {
135
- this.series = r;
136
- }
137
- modifyValue() {
138
- return 0;
139
- }
140
- static getCumulativeExtremes(r) {
141
- let l = 1 / 0, h = -1 / 0;
142
- return r.reduce((f, m) => {
143
- let x = f + m;
144
- return l = Math.min(l, x, f), h = Math.max(h, x, f), x;
145
- }), [l, h];
146
- }
147
- initCompare(r) {
148
- this.modifyValue = function(l, h) {
149
- l === null && (l = 0);
150
- let f = this.compareValue;
151
- if (l !== void 0 && f !== void 0) {
152
- if (r === "value" ? l -= f : l = l / f * 100 - 100 * (this.series.options.compareBase !== 100), h !== void 0) {
153
- let m = this.series.points[h];
154
- m && (m.change = l);
155
- }
156
- return l;
157
- }
158
- return 0;
159
- };
160
- }
161
- initCumulative() {
162
- this.modifyValue = function(r, l) {
163
- if (r === null && (r = 0), r !== void 0 && l !== void 0) {
164
- let h = l > 0 ? this.series.points[l - 1] : null;
165
- h && h.cumulativeSum && (r = vs(h.cumulativeSum + r));
166
- let f = this.series.points[l], m = f.series.options.cumulativeStart, x = f.x <= this.series.xAxis.max && f.x >= this.series.xAxis.min;
167
- return f && (!m || x ? f.cumulativeSum = r : f.cumulativeSum = void 0), r;
168
- }
169
- return 0;
170
- };
171
- }
172
- }
173
- a.Additions = p;
174
- })(re || (re = {}));
175
- let ks = re, { isTouchDevice: Ue } = B(), { addEvent: xt, merge: Ve, pick: fe } = B(), ws = [];
176
- function Ss() {
177
- this.navigator && this.navigator.setBaseSeries(null, !1);
178
- }
179
- function Ts() {
180
- let a, t, e, i = this.legend, s = this.navigator;
181
- if (s) {
182
- a = i && i.options, t = s.xAxis, e = s.yAxis;
183
- let { scrollbarHeight: o, scrollButtonSize: n } = s;
184
- this.inverted ? (s.left = s.opposite ? this.chartWidth - o - s.height : this.spacing[3] + o, s.top = this.plotTop + n) : (s.left = fe(t.left, this.plotLeft + n), s.top = s.navigatorOptions.top || this.chartHeight - s.height - o - (this.scrollbar?.options.margin || 0) - this.spacing[2] - (this.rangeSelector && this.extraBottomMargin ? this.rangeSelector.getHeight() : 0) - (a && a.verticalAlign === "bottom" && a.layout !== "proximate" && a.enabled && !a.floating ? i.legendHeight + fe(a.margin, 10) : 0) - (this.titleOffset ? this.titleOffset[2] : 0)), t && e && (this.inverted ? t.options.left = e.options.left = s.left : t.options.top = e.options.top = s.top, t.setAxisSize(), e.setAxisSize());
185
- }
186
- }
187
- function Es(a) {
188
- !this.navigator && !this.scroller && (this.options.navigator.enabled || this.options.scrollbar.enabled) && (this.scroller = this.navigator = new ie(this), fe(a.redraw, !0) && this.redraw(a.animation));
189
- }
190
- function Os() {
191
- let a = this.options;
192
- (a.navigator.enabled || a.scrollbar.enabled) && (this.scroller = this.navigator = new ie(this));
193
- }
194
- function Bs() {
195
- let a = this.options, t = a.navigator, e = a.rangeSelector;
196
- if ((t && t.enabled || e && e.enabled) && (!Ue && this.zooming.type === "x" || Ue && this.zooming.pinchType === "x")) return !1;
197
- }
198
- function Cs(a) {
199
- let t = a.navigator;
200
- if (t && a.xAxis[0]) {
201
- let e = a.xAxis[0].getExtremes();
202
- t.render(e.min, e.max);
203
- }
204
- }
205
- function Ds(a) {
206
- let t = a.options.navigator || {}, e = a.options.scrollbar || {};
207
- !this.navigator && !this.scroller && (t.enabled || e.enabled) && (Ve(!0, this.options.navigator, t), Ve(!0, this.options.scrollbar, e), delete a.options.navigator, delete a.options.scrollbar);
208
- }
209
- let Ps = { compose: function(a, t) {
210
- if (B().pushUnique(ws, a)) {
211
- let e = a.prototype;
212
- ie = t, e.callbacks.push(Cs), xt(a, "afterAddSeries", Ss), xt(a, "afterSetChartSize", Ts), xt(a, "afterUpdate", Es), xt(a, "beforeRender", Os), xt(a, "beforeShowResetZoom", Bs), xt(a, "update", Ds);
213
- }
214
- } }, { isTouchDevice: Rs } = B(), { addEvent: _e, correctFloat: je, defined: me, isNumber: qe, pick: Ze } = B();
215
- function Gs() {
216
- this.navigatorAxis || (this.navigatorAxis = new xe(this));
217
- }
218
- function Is(a) {
219
- let t, e = this.chart, i = e.options, s = i.navigator, o = this.navigatorAxis, n = e.zooming.pinchType, c = i.rangeSelector, u = e.zooming.type;
220
- if (this.isXAxis && (s?.enabled || c?.enabled)) {
221
- if (u === "y" && a.trigger === "zoom") t = !1;
222
- else if ((a.trigger === "zoom" && u === "xy" || Rs && n === "xy") && this.options.range) {
223
- let g = o.previousZoom;
224
- me(a.min) ? o.previousZoom = [this.min, this.max] : g && (a.min = g[0], a.max = g[1], o.previousZoom = void 0);
225
- }
226
- }
227
- t !== void 0 && a.preventDefault();
228
- }
229
- class xe {
230
- static compose(t) {
231
- t.keepProps.includes("navigatorAxis") || (t.keepProps.push("navigatorAxis"), _e(t, "init", Gs), _e(t, "setExtremes", Is));
232
- }
233
- constructor(t) {
234
- this.axis = t;
235
- }
236
- destroy() {
237
- this.axis = void 0;
238
- }
239
- toFixedRange(t, e, i, s) {
240
- let o = this.axis, n = (o.pointRange || 0) / 2, c = Ze(i, o.translate(t, !0, !o.horiz)), u = Ze(s, o.translate(e, !0, !o.horiz));
241
- return me(i) || (c = je(c + n)), me(s) || (u = je(u - n)), qe(c) && qe(u) || (c = u = void 0), { min: c, max: u };
242
- }
243
- }
244
- var zs = G(620), Ls = G.n(zs), Ws = G(512), _ = G.n(Ws);
245
- let { parse: Xs } = Ls(), { seriesTypes: Hs } = _(), be = { height: 40, margin: 22, maskInside: !0, handles: { width: 7, borderRadius: 0, height: 15, symbols: ["navigator-handle", "navigator-handle"], enabled: !0, lineWidth: 1, backgroundColor: "#f2f2f2", borderColor: "#999999" }, maskFill: Xs("#667aff").setOpacity(0.3).get(), outlineColor: "#999999", outlineWidth: 1, series: { type: Hs.areaspline === void 0 ? "line" : "areaspline", fillOpacity: 0.05, lineWidth: 1, compare: null, sonification: { enabled: !1 }, dataGrouping: { approximation: "average", enabled: !0, groupPixelWidth: 2, firstAnchor: "firstPoint", anchor: "middle", lastAnchor: "lastPoint", units: [["millisecond", [1, 2, 5, 10, 20, 25, 50, 100, 200, 500]], ["second", [1, 2, 5, 10, 15, 30]], ["minute", [1, 2, 5, 10, 15, 30]], ["hour", [1, 2, 3, 4, 6, 8, 12]], ["day", [1, 2, 3, 4]], ["week", [1, 2, 3]], ["month", [1, 3, 6]], ["year", null]] }, dataLabels: { enabled: !1, zIndex: 2 }, id: "highcharts-navigator-series", className: "highcharts-navigator-series", lineColor: null, marker: { enabled: !1 }, threshold: null }, xAxis: { className: "highcharts-navigator-xaxis", tickLength: 0, lineWidth: 0, gridLineColor: "#e6e6e6", id: "navigator-x-axis", gridLineWidth: 1, tickPixelInterval: 200, labels: { align: "left", style: { color: "#000000", fontSize: "0.7em", opacity: 0.6, textOutline: "2px contrast" }, x: 3, y: -4 }, crosshair: !1 }, yAxis: { className: "highcharts-navigator-yaxis", gridLineWidth: 0, startOnTick: !1, endOnTick: !1, minPadding: 0.1, id: "navigator-y-axis", maxPadding: 0.1, labels: { enabled: !1 }, crosshair: !1, title: { text: void 0 }, tickLength: 0, tickWidth: 0 } }, { defined: ya, isNumber: Ma, pick: Aa } = B(), Ys = { rect: function(a, t, e, i, s) {
246
- return s?.r ? function(o, n, c, u, g) {
247
- let p = g?.r || 0;
248
- return [["M", o + p, n], ["L", o + c - p, n], ["A", p, p, 0, 0, 1, o + c, n + p], ["L", o + c, n + u - p], ["A", p, p, 0, 0, 1, o + c - p, n + u], ["L", o + p, n + u], ["A", p, p, 0, 0, 1, o, n + u - p], ["L", o, n + p], ["A", p, p, 0, 0, 1, o + p, n], ["Z"]];
249
- }(a, t, e, i, s) : [["M", a, t], ["L", a + e, t], ["L", a + e, t + i], ["L", a, t + i], ["Z"]];
250
- } }, { relativeLength: Ns } = B(), Fs = { "navigator-handle": function(a, t, e, i, s = {}) {
251
- let o = s.width ? s.width / 2 : e, n = Ns(s.borderRadius || 0, Math.min(2 * o, i));
252
- return [["M", -1.5, (i = s.height || i) / 2 - 3.5], ["L", -1.5, i / 2 + 4.5], ["M", 0.5, i / 2 - 3.5], ["L", 0.5, i / 2 + 4.5], ...Ys.rect(-o - 1, 0.5, 2 * o + 1, i, { r: n })];
253
- } };
254
- var Us = G(608), Ke = G.n(Us);
255
- let { defined: $e } = B(), Je = { setFixedRange: function(a) {
256
- let t = this.xAxis[0];
257
- $e(t.dataMax) && $e(t.dataMin) && a ? this.fixedRange = Math.min(a, t.dataMax - t.dataMin) : this.fixedRange = a;
258
- } }, { defaultOptions: Vs } = B(), { composed: _s } = B(), { getRendererType: js } = Ke(), { setFixedRange: qs } = Je, { addEvent: Zs, extend: Qe, pushUnique: Ks } = B();
259
- function $s() {
260
- this.chart.navigator && !this.options.isInternal && this.chart.navigator.setBaseSeries(null, !1);
261
- }
262
- let Js = { compose: function(a, t, e) {
263
- xe.compose(t), Ks(_s, "Navigator") && (a.prototype.setFixedRange = qs, Qe(js().prototype.symbols, Fs), Qe(Vs, { navigator: be }), Zs(e, "afterUpdate", $s));
264
- } }, { composed: Qs } = B(), { addEvent: Nt, defined: bt, pick: Ft, pushUnique: to } = B();
265
- (function(a) {
266
- let t;
267
- function e(n) {
268
- let c = Ft(n.options?.min, n.min), u = Ft(n.options?.max, n.max);
269
- return { axisMin: c, axisMax: u, scrollMin: bt(n.dataMin) ? Math.min(c, n.min, n.dataMin, Ft(n.threshold, 1 / 0)) : c, scrollMax: bt(n.dataMax) ? Math.max(u, n.max, n.dataMax, Ft(n.threshold, -1 / 0)) : u };
270
- }
271
- function i() {
272
- let n = this.scrollbar, c = n && !n.options.opposite, u = this.horiz ? 2 : c ? 3 : 1;
273
- n && (this.chart.scrollbarsOffsets = [0, 0], this.chart.axisOffset[u] += n.size + (n.options.margin || 0));
274
- }
275
- function s() {
276
- let n = this;
277
- n.options?.scrollbar?.enabled && (n.options.scrollbar.vertical = !n.horiz, n.options.startOnTick = n.options.endOnTick = !1, n.scrollbar = new t(n.chart.renderer, n.options.scrollbar, n.chart), Nt(n.scrollbar, "changed", function(c) {
278
- let u, g, { axisMin: p, axisMax: d, scrollMin: r, scrollMax: l } = e(n), h = l - r;
279
- if (bt(p) && bt(d)) if (n.horiz && !n.reversed || !n.horiz && n.reversed ? (u = r + h * this.to, g = r + h * this.from) : (u = r + h * (1 - this.from), g = r + h * (1 - this.to)), this.shouldUpdateExtremes(c.DOMType)) {
280
- let f = c.DOMType !== "mousemove" && c.DOMType !== "touchmove" && void 0;
281
- n.setExtremes(g, u, !0, f, c);
282
- } else this.setRange(this.from, this.to);
283
- }));
284
- }
285
- function o() {
286
- let n, c, u, { scrollMin: g, scrollMax: p } = e(this), d = this.scrollbar, r = this.axisTitleMargin + (this.titleOffset || 0), l = this.chart.scrollbarsOffsets, h = this.options.margin || 0;
287
- if (d && l) {
288
- if (this.horiz) this.opposite || (l[1] += r), d.position(this.left, this.top + this.height + 2 + l[1] - (this.opposite ? h : 0), this.width, this.height), this.opposite || (l[1] += h), n = 1;
289
- else {
290
- let f;
291
- this.opposite && (l[0] += r), f = d.options.opposite ? this.left + this.width + 2 + l[0] - (this.opposite ? 0 : h) : this.opposite ? 0 : h, d.position(f, this.top, this.width, this.height), this.opposite && (l[0] += h), n = 0;
292
- }
293
- if (l[n] += d.size + (d.options.margin || 0), isNaN(g) || isNaN(p) || !bt(this.min) || !bt(this.max) || this.dataMin === this.dataMax) d.setRange(0, 1);
294
- else if (this.min === this.max) {
295
- let f = this.pointRange / (this.dataMax + 1);
296
- c = f * this.min, u = f * (this.max + 1), d.setRange(c, u);
297
- } else c = (this.min - g) / (p - g), u = (this.max - g) / (p - g), this.horiz && !this.reversed || !this.horiz && this.reversed ? d.setRange(c, u) : d.setRange(1 - u, 1 - c);
298
- }
299
- }
300
- a.compose = function(n, c) {
301
- to(Qs, "Axis.Scrollbar") && (t = c, Nt(n, "afterGetOffset", i), Nt(n, "afterInit", s), Nt(n, "afterRender", o));
302
- };
303
- })(ae || (ae = {}));
304
- let eo = ae, Ut = { height: 10, barBorderRadius: 5, buttonBorderRadius: 0, buttonsEnabled: !1, liveRedraw: void 0, margin: void 0, minWidth: 6, opposite: !0, step: 0.2, zIndex: 3, barBackgroundColor: "#cccccc", barBorderWidth: 0, barBorderColor: "#cccccc", buttonArrowColor: "#333333", buttonBackgroundColor: "#e6e6e6", buttonBorderColor: "#cccccc", buttonBorderWidth: 1, rifleColor: "none", trackBackgroundColor: "rgba(255, 255, 255, 0.001)", trackBorderColor: "#cccccc", trackBorderRadius: 5, trackBorderWidth: 1 }, { defaultOptions: ti } = B(), { composed: io } = B(), { addEvent: so, correctFloat: pt, crisp: Vt, defined: ei, destroyObjectProperties: oo, extend: ro, fireEvent: Gt, merge: ii, pick: It, pushUnique: ao, removeEvent: no } = B();
305
- class ut {
306
- static compose(t) {
307
- eo.compose(t, ut), ao(io, "Scrollbar") && ro(ti, { scrollbar: Ut });
308
- }
309
- static swapXY(t, e) {
310
- return e && t.forEach((i) => {
311
- let s, o = i.length;
312
- for (let n = 0; n < o; n += 2) typeof (s = i[n + 1]) == "number" && (i[n + 1] = i[n + 2], i[n + 2] = s);
313
- }), t;
314
- }
315
- constructor(t, e, i) {
316
- this._events = [], this.chartX = 0, this.chartY = 0, this.from = 0, this.scrollbarButtons = [], this.scrollbarLeft = 0, this.scrollbarStrokeWidth = 1, this.scrollbarTop = 0, this.size = 0, this.to = 0, this.trackBorderWidth = 1, this.x = 0, this.y = 0, this.init(t, e, i);
317
- }
318
- addEvents() {
319
- let t = this.options.inverted ? [1, 0] : [0, 1], e = this.scrollbarButtons, i = this.scrollbarGroup.element, s = this.track.element, o = this.mouseDownHandler.bind(this), n = this.mouseMoveHandler.bind(this), c = this.mouseUpHandler.bind(this), u = [[e[t[0]].element, "click", this.buttonToMinClick.bind(this)], [e[t[1]].element, "click", this.buttonToMaxClick.bind(this)], [s, "click", this.trackClick.bind(this)], [i, "mousedown", o], [i.ownerDocument, "mousemove", n], [i.ownerDocument, "mouseup", c], [i, "touchstart", o], [i.ownerDocument, "touchmove", n], [i.ownerDocument, "touchend", c]];
320
- u.forEach(function(g) {
321
- so.apply(null, g);
322
- }), this._events = u;
323
- }
324
- buttonToMaxClick(t) {
325
- let e = (this.to - this.from) * It(this.options.step, 0.2);
326
- this.updatePosition(this.from + e, this.to + e), Gt(this, "changed", { from: this.from, to: this.to, trigger: "scrollbar", DOMEvent: t });
327
- }
328
- buttonToMinClick(t) {
329
- let e = pt(this.to - this.from) * It(this.options.step, 0.2);
330
- this.updatePosition(pt(this.from - e), pt(this.to - e)), Gt(this, "changed", { from: this.from, to: this.to, trigger: "scrollbar", DOMEvent: t });
331
- }
332
- cursorToScrollbarPosition(t) {
333
- let e = this.options, i = e.minWidth > this.calculatedWidth ? e.minWidth : 0;
334
- return { chartX: (t.chartX - this.x - this.xOffset) / (this.barWidth - i), chartY: (t.chartY - this.y - this.yOffset) / (this.barWidth - i) };
335
- }
336
- destroy() {
337
- let t = this, e = t.chart.scroller;
338
- t.removeEvents(), ["track", "scrollbarRifles", "scrollbar", "scrollbarGroup", "group"].forEach(function(i) {
339
- t[i] && t[i].destroy && (t[i] = t[i].destroy());
340
- }), e && t === e.scrollbar && (e.scrollbar = null, oo(e.scrollbarButtons));
341
- }
342
- drawScrollbarButton(t) {
343
- let e = this.renderer, i = this.scrollbarButtons, s = this.options, o = this.size, n = e.g().add(this.group);
344
- if (i.push(n), s.buttonsEnabled) {
345
- let c = e.rect().addClass("highcharts-scrollbar-button").add(n);
346
- this.chart.styledMode || c.attr({ stroke: s.buttonBorderColor, "stroke-width": s.buttonBorderWidth, fill: s.buttonBackgroundColor }), c.attr(c.crisp({ x: -0.5, y: -0.5, width: o, height: o, r: s.buttonBorderRadius }, c.strokeWidth()));
347
- let u = e.path(ut.swapXY([["M", o / 2 + (t ? -1 : 1), o / 2 - 3], ["L", o / 2 + (t ? -1 : 1), o / 2 + 3], ["L", o / 2 + (t ? 2 : -2), o / 2]], s.vertical)).addClass("highcharts-scrollbar-arrow").add(i[t]);
348
- this.chart.styledMode || u.attr({ fill: s.buttonArrowColor });
349
- }
350
- }
351
- init(t, e, i) {
352
- this.scrollbarButtons = [], this.renderer = t, this.userOptions = e, this.options = ii(Ut, ti.scrollbar, e), this.options.margin = It(this.options.margin, 10), this.chart = i, this.size = It(this.options.size, this.options.height), e.enabled && (this.render(), this.addEvents());
353
- }
354
- mouseDownHandler(t) {
355
- let e = this.chart.pointer?.normalize(t) || t, i = this.cursorToScrollbarPosition(e);
356
- this.chartX = i.chartX, this.chartY = i.chartY, this.initPositions = [this.from, this.to], this.grabbedCenter = !0;
357
- }
358
- mouseMoveHandler(t) {
359
- let e, i = this.chart.pointer?.normalize(t) || t, s = this.options.vertical ? "chartY" : "chartX", o = this.initPositions || [];
360
- this.grabbedCenter && (!t.touches || t.touches[0][s] !== 0) && (e = this.cursorToScrollbarPosition(i)[s] - this[s], this.hasDragged = !0, this.updatePosition(o[0] + e, o[1] + e), this.hasDragged && Gt(this, "changed", { from: this.from, to: this.to, trigger: "scrollbar", DOMType: t.type, DOMEvent: t }));
361
- }
362
- mouseUpHandler(t) {
363
- this.hasDragged && Gt(this, "changed", { from: this.from, to: this.to, trigger: "scrollbar", DOMType: t.type, DOMEvent: t }), this.grabbedCenter = this.hasDragged = this.chartX = this.chartY = null;
364
- }
365
- position(t, e, i, s) {
366
- let { buttonsEnabled: o, margin: n = 0, vertical: c } = this.options, u = this.rendered ? "animate" : "attr", g = s, p = 0;
367
- this.group.show(), this.x = t, this.y = e + this.trackBorderWidth, this.width = i, this.height = s, this.xOffset = g, this.yOffset = p, c ? (this.width = this.yOffset = i = p = this.size, this.xOffset = g = 0, this.yOffset = p = o ? this.size : 0, this.barWidth = s - (o ? 2 * i : 0), this.x = t += n) : (this.height = s = this.size, this.xOffset = g = o ? this.size : 0, this.barWidth = i - (o ? 2 * s : 0), this.y = this.y + n), this.group[u]({ translateX: t, translateY: this.y }), this.track[u]({ width: i, height: s }), this.scrollbarButtons[1][u]({ translateX: c ? 0 : i - g, translateY: c ? s - p : 0 });
368
- }
369
- removeEvents() {
370
- this._events.forEach(function(t) {
371
- no.apply(null, t);
372
- }), this._events.length = 0;
373
- }
374
- render() {
375
- let t = this.renderer, e = this.options, i = this.size, s = this.chart.styledMode, o = t.g("scrollbar").attr({ zIndex: e.zIndex }).hide().add();
376
- this.group = o, this.track = t.rect().addClass("highcharts-scrollbar-track").attr({ r: e.trackBorderRadius || 0, height: i, width: i }).add(o), s || this.track.attr({ fill: e.trackBackgroundColor, stroke: e.trackBorderColor, "stroke-width": e.trackBorderWidth });
377
- let n = this.trackBorderWidth = this.track.strokeWidth();
378
- this.track.attr({ x: -Vt(0, n), y: -Vt(0, n) }), this.scrollbarGroup = t.g().add(o), this.scrollbar = t.rect().addClass("highcharts-scrollbar-thumb").attr({ height: i - n, width: i - n, r: e.barBorderRadius || 0 }).add(this.scrollbarGroup), this.scrollbarRifles = t.path(ut.swapXY([["M", -3, i / 4], ["L", -3, 2 * i / 3], ["M", 0, i / 4], ["L", 0, 2 * i / 3], ["M", 3, i / 4], ["L", 3, 2 * i / 3]], e.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup), s || (this.scrollbar.attr({ fill: e.barBackgroundColor, stroke: e.barBorderColor, "stroke-width": e.barBorderWidth }), this.scrollbarRifles.attr({ stroke: e.rifleColor, "stroke-width": 1 })), this.scrollbarStrokeWidth = this.scrollbar.strokeWidth(), this.scrollbarGroup.translate(-Vt(0, this.scrollbarStrokeWidth), -Vt(0, this.scrollbarStrokeWidth)), this.drawScrollbarButton(0), this.drawScrollbarButton(1);
379
- }
380
- setRange(t, e) {
381
- let i, s, o = this.options, n = o.vertical, c = o.minWidth, u = this.barWidth, g = !this.rendered || this.hasDragged || this.chart.navigator && this.chart.navigator.hasDragged ? "attr" : "animate";
382
- if (!ei(u)) return;
383
- let p = u * Math.min(e, 1);
384
- i = Math.ceil(u * (t = Math.max(t, 0))), this.calculatedWidth = s = pt(p - i), s < c && (i = (u - c + s) * t, s = c);
385
- let d = Math.floor(i + this.xOffset + this.yOffset), r = s / 2 - 0.5;
386
- this.from = t, this.to = e, n ? (this.scrollbarGroup[g]({ translateY: d }), this.scrollbar[g]({ height: s }), this.scrollbarRifles[g]({ translateY: r }), this.scrollbarTop = d, this.scrollbarLeft = 0) : (this.scrollbarGroup[g]({ translateX: d }), this.scrollbar[g]({ width: s }), this.scrollbarRifles[g]({ translateX: r }), this.scrollbarLeft = d, this.scrollbarTop = 0), s <= 12 ? this.scrollbarRifles.hide() : this.scrollbarRifles.show(), o.showFull === !1 && (t <= 0 && e >= 1 ? this.group.hide() : this.group.show()), this.rendered = !0;
387
- }
388
- shouldUpdateExtremes(t) {
389
- return It(this.options.liveRedraw, B().svg && !B().isTouchDevice && !this.chart.boosted) || t === "mouseup" || t === "touchend" || !ei(t);
390
- }
391
- trackClick(t) {
392
- let e = this.chart.pointer?.normalize(t) || t, i = this.to - this.from, s = this.y + this.scrollbarTop, o = this.x + this.scrollbarLeft;
393
- this.options.vertical && e.chartY > s || !this.options.vertical && e.chartX > o ? this.updatePosition(this.from + i, this.to + i) : this.updatePosition(this.from - i, this.to - i), Gt(this, "changed", { from: this.from, to: this.to, trigger: "scrollbar", DOMEvent: t });
394
- }
395
- update(t) {
396
- this.destroy(), this.init(this.chart.renderer, ii(!0, this.options, t), this.chart);
397
- }
398
- updatePosition(t, e) {
399
- e > 1 && (t = pt(1 - pt(e - t)), e = 1), t < 0 && (e = pt(e - t), t = 0), this.from = t, this.to = e;
400
- }
401
- }
402
- ut.defaultOptions = Ut;
403
- var lo = G(540), ho = G.n(lo);
404
- let { defaultOptions: ve } = B(), { isTouchDevice: po } = B(), { prototype: { symbols: si } } = ho(), { addEvent: N, clamp: oi, correctFloat: _t, defined: vt, destroyObjectProperties: uo, erase: yt, extend: co, find: go, fireEvent: ye, isArray: ri, isNumber: K, merge: Mt, pick: j, removeEvent: jt, splat: ai } = B();
405
- function qt(a, ...t) {
406
- let e = [].filter.call(t, K);
407
- if (e.length) return Math[a].apply(0, e);
408
- }
409
- class Zt {
410
- static compose(t, e, i) {
411
- Ps.compose(t, Zt), Js.compose(t, e, i);
412
- }
413
- constructor(t) {
414
- this.isDirty = !1, this.scrollbarHeight = 0, this.init(t);
415
- }
416
- drawHandle(t, e, i, s) {
417
- let o = this.navigatorOptions.handles.height;
418
- this.handles[e][s](i ? { translateX: Math.round(this.left + this.height / 2), translateY: Math.round(this.top + parseInt(t, 10) + 0.5 - o) } : { translateX: Math.round(this.left + parseInt(t, 10)), translateY: Math.round(this.top + this.height / 2 - o / 2 - 1) });
419
- }
420
- drawOutline(t, e, i, s) {
421
- let o = this.navigatorOptions.maskInside, n = this.outline.strokeWidth(), c = n / 2, u = n % 2 / 2, g = this.scrollButtonSize, p = this.size, d = this.top, r = this.height, l = d - c, h = d + r, f = this.left, m, x;
422
- i ? (m = d + e + u, e = d + t + u, x = [["M", f + r, d - g - u], ["L", f + r, m], ["L", f, m], ["M", f, e], ["L", f + r, e], ["L", f + r, d + p + g]], o && x.push(["M", f + r, m - c], ["L", f + r, e + c])) : (f -= g, t += f + g - u, e += f + g - u, x = [["M", f, l], ["L", t, l], ["L", t, h], ["M", e, h], ["L", e, l], ["L", f + p + 2 * g, l]], o && x.push(["M", t - c, l], ["L", e + c, l])), this.outline[s]({ d: x });
423
- }
424
- drawMasks(t, e, i, s) {
425
- let o, n, c, u, g = this.left, p = this.top, d = this.height;
426
- i ? (c = [g, g, g], u = [p, p + t, p + e], n = [d, d, d], o = [t, e - t, this.size - e]) : (c = [g, g + t, g + e], u = [p, p, p], n = [t, e - t, this.size - e], o = [d, d, d]), this.shades.forEach((r, l) => {
427
- r[s]({ x: c[l], y: u[l], width: n[l], height: o[l] });
428
- });
429
- }
430
- renderElements() {
431
- let t = this, e = t.navigatorOptions, i = e.maskInside, s = t.chart, o = s.inverted, n = s.renderer, c = { cursor: o ? "ns-resize" : "ew-resize" }, u = t.navigatorGroup ?? (t.navigatorGroup = n.g("navigator").attr({ zIndex: 8, visibility: "hidden" }).add());
432
- if ([!i, i, !i].forEach((g, p) => {
433
- let d = t.shades[p] ?? (t.shades[p] = n.rect().addClass("highcharts-navigator-mask" + (p === 1 ? "-inside" : "-outside")).add(u));
434
- s.styledMode || (d.attr({ fill: g ? e.maskFill : "rgba(0,0,0,0)" }), p === 1 && d.css(c));
435
- }), t.outline || (t.outline = n.path().addClass("highcharts-navigator-outline").add(u)), s.styledMode || t.outline.attr({ "stroke-width": e.outlineWidth, stroke: e.outlineColor }), e.handles?.enabled) {
436
- let g = e.handles, { height: p, width: d } = g;
437
- [0, 1].forEach((r) => {
438
- let l = g.symbols[r];
439
- if (t.handles[r] && t.handles[r].symbolUrl === l) {
440
- if (!t.handles[r].isImg && t.handles[r].symbolName !== l) {
441
- let h = si[l].call(si, -d / 2 - 1, 0, d, p);
442
- t.handles[r].attr({ d: h }), t.handles[r].symbolName = l;
443
- }
444
- } else t.handles[r]?.destroy(), t.handles[r] = n.symbol(l, -d / 2 - 1, 0, d, p, g), t.handles[r].attr({ zIndex: 7 - r }).addClass("highcharts-navigator-handle highcharts-navigator-handle-" + ["left", "right"][r]).add(u), t.addMouseEvents();
445
- s.inverted && t.handles[r].attr({ rotation: 90, rotationOriginX: Math.floor(-d / 2), rotationOriginY: (p + d) / 2 }), s.styledMode || t.handles[r].attr({ fill: g.backgroundColor, stroke: g.borderColor, "stroke-width": g.lineWidth, width: g.width, height: g.height, x: -d / 2 - 1, y: 0 }).css(c);
446
- });
447
- }
448
- }
449
- update(t, e = !1) {
450
- let i = this.chart, s = i.options.chart.inverted !== i.scrollbar?.options.vertical;
451
- if (Mt(!0, i.options.navigator, t), this.navigatorOptions = i.options.navigator || {}, this.setOpposite(), vt(t.enabled) || s) return this.destroy(), this.navigatorEnabled = t.enabled || this.navigatorEnabled, this.init(i);
452
- if (this.navigatorEnabled && (this.isDirty = !0, t.adaptToUpdatedData === !1 && this.baseSeries.forEach((o) => {
453
- jt(o, "updatedData", this.updatedDataHandler);
454
- }, this), t.adaptToUpdatedData && this.baseSeries.forEach((o) => {
455
- o.eventsToUnbind.push(N(o, "updatedData", this.updatedDataHandler));
456
- }, this), (t.series || t.baseSeries) && this.setBaseSeries(void 0, !1), t.height || t.xAxis || t.yAxis)) {
457
- this.height = t.height ?? this.height;
458
- let o = this.getXAxisOffsets();
459
- this.xAxis.update({ ...t.xAxis, offsets: o, [i.inverted ? "width" : "height"]: this.height, [i.inverted ? "height" : "width"]: void 0 }, !1), this.yAxis.update({ ...t.yAxis, [i.inverted ? "width" : "height"]: this.height }, !1);
460
- }
461
- e && i.redraw();
462
- }
463
- render(t, e, i, s) {
464
- let o = this.chart, n = this.xAxis, c = n.pointRange || 0, u = n.navigatorAxis.fake ? o.xAxis[0] : n, g = this.navigatorEnabled, p = this.rendered, d = o.inverted, r = o.xAxis[0].minRange, l = o.xAxis[0].options.maxRange, h = this.scrollButtonSize, f, m, x, b = this.scrollbarHeight, S, v;
465
- if (this.hasDragged && !vt(i)) return;
466
- if (this.isDirty && this.renderElements(), t = _t(t - c / 2), e = _t(e + c / 2), !K(t) || !K(e)) if (p) i = 0, s = j(n.width, u.width);
467
- else return;
468
- this.left = j(n.left, o.plotLeft + h + (d ? o.plotWidth : 0));
469
- let M = this.size = S = j(n.len, (d ? o.plotHeight : o.plotWidth) - 2 * h);
470
- f = d ? b : S + 2 * h, i = j(i, n.toPixels(t, !0)), s = j(s, n.toPixels(e, !0)), K(i) && Math.abs(i) !== 1 / 0 || (i = 0, s = f);
471
- let A = n.toValue(i, !0), y = n.toValue(s, !0), E = Math.abs(_t(y - A));
472
- E < r ? this.grabbedLeft ? i = n.toPixels(y - r - c, !0) : this.grabbedRight && (s = n.toPixels(A + r + c, !0)) : vt(l) && _t(E - c) > l && (this.grabbedLeft ? i = n.toPixels(y - l - c, !0) : this.grabbedRight && (s = n.toPixels(A + l + c, !0))), this.zoomedMax = oi(Math.max(i, s), 0, M), this.zoomedMin = oi(this.fixedWidth ? this.zoomedMax - this.fixedWidth : Math.min(i, s), 0, M), this.range = this.zoomedMax - this.zoomedMin, M = Math.round(this.zoomedMax);
473
- let w = Math.round(this.zoomedMin);
474
- g && (this.navigatorGroup.attr({ visibility: "inherit" }), v = p && !this.hasDragged ? "animate" : "attr", this.drawMasks(w, M, d, v), this.drawOutline(w, M, d, v), this.navigatorOptions.handles.enabled && (this.drawHandle(w, 0, d, v), this.drawHandle(M, 1, d, v))), this.scrollbar && (d ? (x = this.top - h, m = this.left - b + (g || !u.opposite ? 0 : (u.titleOffset || 0) + u.axisTitleMargin), b = S + 2 * h) : (x = this.top + (g ? this.height : -b), m = this.left - h), this.scrollbar.position(m, x, f, b), this.scrollbar.setRange(this.zoomedMin / (S || 1), this.zoomedMax / (S || 1))), this.rendered = !0, this.isDirty = !1, ye(this, "afterRender");
475
- }
476
- addMouseEvents() {
477
- let t = this, e = t.chart, i = e.container, s = [], o, n;
478
- t.mouseMoveHandler = o = function(c) {
479
- t.onMouseMove(c);
480
- }, t.mouseUpHandler = n = function(c) {
481
- t.onMouseUp(c);
482
- }, (s = t.getPartsEvents("mousedown")).push(N(e.renderTo, "mousemove", o), N(i.ownerDocument, "mouseup", n), N(e.renderTo, "touchmove", o), N(i.ownerDocument, "touchend", n)), s.concat(t.getPartsEvents("touchstart")), t.eventsToUnbind = s, t.series && t.series[0] && s.push(N(t.series[0].xAxis, "foundExtremes", function() {
483
- e.navigator.modifyNavigatorAxisExtremes();
484
- }));
485
- }
486
- getPartsEvents(t) {
487
- let e = this, i = [];
488
- return ["shades", "handles"].forEach(function(s) {
489
- e[s].forEach(function(o, n) {
490
- i.push(N(o.element, t, function(c) {
491
- e[s + "Mousedown"](c, n);
492
- }));
493
- });
494
- }), i;
495
- }
496
- shadesMousedown(t, e) {
497
- t = this.chart.pointer?.normalize(t) || t;
498
- let i = this.chart, s = this.xAxis, o = this.zoomedMin, n = this.size, c = this.range, u = this.left, g = t.chartX, p, d, r, l;
499
- i.inverted && (g = t.chartY, u = this.top), e === 1 ? (this.grabbedCenter = g, this.fixedWidth = c, this.dragOffset = g - o) : (l = g - u - c / 2, e === 0 ? l = Math.max(0, l) : e === 2 && l + c >= n && (l = n - c, this.reversedExtremes ? (l -= c, d = this.getUnionExtremes().dataMin) : p = this.getUnionExtremes().dataMax), l !== o && (this.fixedWidth = c, vt((r = s.navigatorAxis.toFixedRange(l, l + c, d, p)).min) && ye(this, "setRange", { min: Math.min(r.min, r.max), max: Math.max(r.min, r.max), redraw: !0, eventArguments: { trigger: "navigator" } })));
500
- }
501
- handlesMousedown(t, e) {
502
- t = this.chart.pointer?.normalize(t) || t;
503
- let i = this.chart, s = i.xAxis[0], o = this.reversedExtremes;
504
- e === 0 ? (this.grabbedLeft = !0, this.otherHandlePos = this.zoomedMax, this.fixedExtreme = o ? s.min : s.max) : (this.grabbedRight = !0, this.otherHandlePos = this.zoomedMin, this.fixedExtreme = o ? s.max : s.min), i.setFixedRange(void 0);
505
- }
506
- onMouseMove(t) {
507
- let e = this, i = e.chart, s = e.navigatorSize, o = e.range, n = e.dragOffset, c = i.inverted, u = e.left, g;
508
- (!t.touches || t.touches[0].pageX !== 0) && (g = (t = i.pointer?.normalize(t) || t).chartX, c && (u = e.top, g = t.chartY), e.grabbedLeft ? (e.hasDragged = !0, e.render(0, 0, g - u, e.otherHandlePos)) : e.grabbedRight ? (e.hasDragged = !0, e.render(0, 0, e.otherHandlePos, g - u)) : e.grabbedCenter && (e.hasDragged = !0, g < n ? g = n : g > s + n - o && (g = s + n - o), e.render(0, 0, g - n, g - n + o)), e.hasDragged && e.scrollbar && j(e.scrollbar.options.liveRedraw, !po && !this.chart.boosted) && (t.DOMType = t.type, setTimeout(function() {
509
- e.onMouseUp(t);
510
- }, 0)));
511
- }
512
- onMouseUp(t) {
513
- let e, i, s, o, n, c, u = this.chart, g = this.xAxis, p = this.scrollbar, d = t.DOMEvent || t, r = u.inverted, l = this.rendered && !this.hasDragged ? "animate" : "attr";
514
- (this.hasDragged && (!p || !p.hasDragged) || t.trigger === "scrollbar") && (s = this.getUnionExtremes(), this.zoomedMin === this.otherHandlePos ? o = this.fixedExtreme : this.zoomedMax === this.otherHandlePos && (n = this.fixedExtreme), this.zoomedMax === this.size && (n = this.reversedExtremes ? s.dataMin : s.dataMax), this.zoomedMin === 0 && (o = this.reversedExtremes ? s.dataMax : s.dataMin), vt((c = g.navigatorAxis.toFixedRange(this.zoomedMin, this.zoomedMax, o, n)).min) && ye(this, "setRange", { min: Math.min(c.min, c.max), max: Math.max(c.min, c.max), redraw: !0, animation: !this.hasDragged && null, eventArguments: { trigger: "navigator", triggerOp: "navigator-drag", DOMEvent: d } })), t.DOMType !== "mousemove" && t.DOMType !== "touchmove" && (this.grabbedLeft = this.grabbedRight = this.grabbedCenter = this.fixedWidth = this.fixedExtreme = this.otherHandlePos = this.hasDragged = this.dragOffset = null), this.navigatorEnabled && K(this.zoomedMin) && K(this.zoomedMax) && (i = Math.round(this.zoomedMin), e = Math.round(this.zoomedMax), this.shades && this.drawMasks(i, e, r, l), this.outline && this.drawOutline(i, e, r, l), this.navigatorOptions.handles.enabled && Object.keys(this.handles).length === this.handles.length && (this.drawHandle(i, 0, r, l), this.drawHandle(e, 1, r, l)));
515
- }
516
- removeEvents() {
517
- this.eventsToUnbind && (this.eventsToUnbind.forEach(function(t) {
518
- t();
519
- }), this.eventsToUnbind = void 0), this.removeBaseSeriesEvents();
520
- }
521
- removeBaseSeriesEvents() {
522
- let t = this.baseSeries || [];
523
- this.navigatorEnabled && t[0] && (this.navigatorOptions.adaptToUpdatedData !== !1 && t.forEach(function(e) {
524
- jt(e, "updatedData", this.updatedDataHandler);
525
- }, this), t[0].xAxis && jt(t[0].xAxis, "foundExtremes", this.modifyBaseAxisExtremes));
526
- }
527
- getXAxisOffsets() {
528
- return this.chart.inverted ? [this.scrollButtonSize, 0, -this.scrollButtonSize, 0] : [0, -this.scrollButtonSize, 0, this.scrollButtonSize];
529
- }
530
- init(t) {
531
- let e = t.options, i = e.navigator || {}, s = i.enabled, o = e.scrollbar || {}, n = o.enabled, c = s && i.height || 0, u = n && o.height || 0, g = o.buttonsEnabled && u || 0;
532
- this.handles = [], this.shades = [], this.chart = t, this.setBaseSeries(), this.height = c, this.scrollbarHeight = u, this.scrollButtonSize = g, this.scrollbarEnabled = n, this.navigatorEnabled = s, this.navigatorOptions = i, this.scrollbarOptions = o, this.setOpposite();
533
- let p = this, d = p.baseSeries, r = t.xAxis.length, l = t.yAxis.length, h = d && d[0] && d[0].xAxis || t.xAxis[0] || { options: {} };
534
- if (t.isDirtyBox = !0, p.navigatorEnabled) {
535
- let f = this.getXAxisOffsets();
536
- p.xAxis = new (ce())(t, Mt({ breaks: h.options.breaks, ordinal: h.options.ordinal, overscroll: h.options.overscroll }, i.xAxis, { type: "datetime", yAxis: i.yAxis?.id, index: r, isInternal: !0, offset: 0, keepOrdinalPadding: !0, startOnTick: !1, endOnTick: !1, minPadding: h.options.ordinal ? 0 : h.options.minPadding, maxPadding: h.options.ordinal ? 0 : h.options.maxPadding, zoomEnabled: !1 }, t.inverted ? { offsets: f, width: c } : { offsets: f, height: c }), "xAxis"), p.yAxis = new (ce())(t, Mt(i.yAxis, { alignTicks: !1, offset: 0, index: l, isInternal: !0, reversed: j(i.yAxis && i.yAxis.reversed, t.yAxis[0] && t.yAxis[0].reversed, !1), zoomEnabled: !1 }, t.inverted ? { width: c } : { height: c }), "yAxis"), d || i.series.data ? p.updateNavigatorSeries(!1) : t.series.length === 0 && (p.unbindRedraw = N(t, "beforeRedraw", function() {
537
- t.series.length > 0 && !p.series && (p.setBaseSeries(), p.unbindRedraw());
538
- })), p.reversedExtremes = t.inverted && !p.xAxis.reversed || !t.inverted && p.xAxis.reversed, p.renderElements(), p.addMouseEvents();
539
- } else p.xAxis = { chart: t, navigatorAxis: { fake: !0 }, translate: function(f, m) {
540
- let x = t.xAxis[0], b = x.getExtremes(), S = x.len - 2 * g, v = qt("min", x.options.min, b.dataMin), M = qt("max", x.options.max, b.dataMax) - v;
541
- return m ? f * M / S + v : S * (f - v) / M;
542
- }, toPixels: function(f) {
543
- return this.translate(f);
544
- }, toValue: function(f) {
545
- return this.translate(f, !0);
546
- } }, p.xAxis.navigatorAxis.axis = p.xAxis, p.xAxis.navigatorAxis.toFixedRange = xe.prototype.toFixedRange.bind(p.xAxis.navigatorAxis);
547
- if (t.options.scrollbar?.enabled) {
548
- let f = Mt(t.options.scrollbar, { vertical: t.inverted });
549
- K(f.margin) || (f.margin = t.inverted ? -3 : 3), t.scrollbar = p.scrollbar = new ut(t.renderer, f, t), N(p.scrollbar, "changed", function(m) {
550
- let x = p.size, b = x * this.to, S = x * this.from;
551
- p.hasDragged = p.scrollbar.hasDragged, p.render(0, 0, S, b), this.shouldUpdateExtremes(m.DOMType) && setTimeout(function() {
552
- p.onMouseUp(m);
553
- });
554
- });
555
- }
556
- p.addBaseSeriesEvents(), p.addChartEvents();
557
- }
558
- setOpposite() {
559
- let t = this.navigatorOptions, e = this.navigatorEnabled, i = this.chart;
560
- this.opposite = j(t.opposite, !!(!e && i.inverted));
561
- }
562
- getUnionExtremes(t) {
563
- let e, i = this.chart.xAxis[0], s = this.chart.time, o = this.xAxis, n = o.options, c = i.options;
564
- return t && i.dataMin === null || (e = { dataMin: j(s.parse(n?.min), qt("min", s.parse(c.min), i.dataMin, o.dataMin, o.min)), dataMax: j(s.parse(n?.max), qt("max", s.parse(c.max), i.dataMax, o.dataMax, o.max)) }), e;
565
- }
566
- setBaseSeries(t, e) {
567
- let i = this.chart, s = this.baseSeries = [];
568
- t = t || i.options && i.options.navigator.baseSeries || (i.series.length ? go(i.series, (o) => !o.options.isInternal).index : 0), (i.series || []).forEach((o, n) => {
569
- !o.options.isInternal && (o.options.showInNavigator || (n === t || o.options.id === t) && o.options.showInNavigator !== !1) && s.push(o);
570
- }), this.xAxis && !this.xAxis.navigatorAxis.fake && this.updateNavigatorSeries(!0, e);
571
- }
572
- updateNavigatorSeries(t, e) {
573
- let i = this, s = i.chart, o = i.baseSeries, n = { enableMouseTracking: !1, index: null, linkedTo: null, group: "nav", padXAxis: !1, xAxis: this.navigatorOptions.xAxis?.id, yAxis: this.navigatorOptions.yAxis?.id, showInLegend: !1, stacking: void 0, isInternal: !0, states: { inactive: { opacity: 1 } } }, c = i.series = (i.series || []).filter((r) => {
574
- let l = r.baseSeries;
575
- return !(0 > o.indexOf(l)) || (l && (jt(l, "updatedData", i.updatedDataHandler), delete l.navigatorSeries), r.chart && r.destroy(), !1);
576
- }), u, g, p = i.navigatorOptions.series, d;
577
- o && o.length && o.forEach((r) => {
578
- let l = r.navigatorSeries, h = co({ color: r.color, visible: r.visible }, ri(p) ? ve.navigator.series : p);
579
- if (l && i.navigatorOptions.adaptToUpdatedData === !1) return;
580
- n.name = "Navigator " + o.length, d = (u = r.options || {}).navigatorOptions || {}, h.dataLabels = ai(h.dataLabels), (g = Mt(u, n, h, d)).pointRange = j(h.pointRange, d.pointRange, ve.plotOptions[g.type || "line"].pointRange);
581
- let f = d.data || h.data;
582
- i.hasNavigatorData = i.hasNavigatorData || !!f, g.data = f || u.data?.slice(0), l && l.options ? l.update(g, e) : (r.navigatorSeries = s.initSeries(g), s.setSortedData(), r.navigatorSeries.baseSeries = r, c.push(r.navigatorSeries));
583
- }), (p.data && !(o && o.length) || ri(p)) && (i.hasNavigatorData = !1, (p = ai(p)).forEach((r, l) => {
584
- n.name = "Navigator " + (c.length + 1), (g = Mt(ve.navigator.series, { color: s.series[l] && !s.series[l].options.isInternal && s.series[l].color || s.options.colors[l] || s.options.colors[0] }, n, r)).data = r.data, g.data && (i.hasNavigatorData = !0, c.push(s.initSeries(g)));
585
- })), t && this.addBaseSeriesEvents();
586
- }
587
- addBaseSeriesEvents() {
588
- let t = this, e = t.baseSeries || [];
589
- e[0] && e[0].xAxis && e[0].eventsToUnbind.push(N(e[0].xAxis, "foundExtremes", this.modifyBaseAxisExtremes)), e.forEach((i) => {
590
- i.eventsToUnbind.push(N(i, "show", function() {
591
- this.navigatorSeries && this.navigatorSeries.setVisible(!0, !1);
592
- })), i.eventsToUnbind.push(N(i, "hide", function() {
593
- this.navigatorSeries && this.navigatorSeries.setVisible(!1, !1);
594
- })), this.navigatorOptions.adaptToUpdatedData !== !1 && i.xAxis && i.eventsToUnbind.push(N(i, "updatedData", this.updatedDataHandler)), i.eventsToUnbind.push(N(i, "remove", function() {
595
- e && yt(e, i), this.navigatorSeries && t.series && (yt(t.series, this.navigatorSeries), vt(this.navigatorSeries.options) && this.navigatorSeries.remove(!1), delete this.navigatorSeries);
596
- }));
597
- });
598
- }
599
- getBaseSeriesMin(t) {
600
- return this.baseSeries.reduce(function(e, i) {
601
- return Math.min(e, i.getColumn("x")[0] ?? e);
602
- }, t);
603
- }
604
- modifyNavigatorAxisExtremes() {
605
- let t = this.xAxis;
606
- if (t.getExtremes !== void 0) {
607
- let e = this.getUnionExtremes(!0);
608
- e && (e.dataMin !== t.min || e.dataMax !== t.max) && (t.min = e.dataMin, t.max = e.dataMax);
609
- }
610
- }
611
- modifyBaseAxisExtremes() {
612
- let t, e, i = this.chart.navigator, s = this.getExtremes(), o = s.min, n = s.max, c = s.dataMin, u = s.dataMax, g = n - o, p = i.stickToMin, d = i.stickToMax, r = j(this.ordinal?.convertOverscroll(this.options.overscroll), 0), l = i.series && i.series[0], h = !!this.setExtremes;
613
- !(this.eventArgs && this.eventArgs.trigger === "rangeSelectorButton") && (p && (t = (e = c) + g), d && (t = u + r, p || (e = Math.max(c, t - g, i.getBaseSeriesMin(l && l.xData ? l.xData[0] : -Number.MAX_VALUE)))), h && (p || d) && K(e) && (this.min = this.userMin = e, this.max = this.userMax = t)), i.stickToMin = i.stickToMax = null;
614
- }
615
- updatedDataHandler() {
616
- let t = this.chart.navigator, e = this.navigatorSeries, i = t.reversedExtremes ? Math.round(t.zoomedMin) === 0 : Math.round(t.zoomedMax) >= Math.round(t.size);
617
- t.stickToMax = j(this.chart.options.navigator && this.chart.options.navigator.stickToMax, i), t.stickToMin = t.shouldStickToMin(this, t), e && !t.hasNavigatorData && (e.options.pointStart = this.getColumn("x")[0], e.setData(this.options.data, !1, null, !1));
618
- }
619
- shouldStickToMin(t, e) {
620
- let i = e.getBaseSeriesMin(t.getColumn("x")[0]), s = t.xAxis, o = s.max, n = s.min, c = s.options.range;
621
- return !!(K(o) && K(n)) && (c && o - i > 0 ? o - i < c : n <= i);
622
- }
623
- addChartEvents() {
624
- this.eventsToUnbind || (this.eventsToUnbind = []), this.eventsToUnbind.push(N(this.chart, "redraw", function() {
625
- let t = this.navigator, e = t && (t.baseSeries && t.baseSeries[0] && t.baseSeries[0].xAxis || this.xAxis[0]);
626
- e && t.render(e.min, e.max);
627
- }), N(this.chart, "getMargins", function() {
628
- let t = this.navigator, e = t.opposite ? "plotTop" : "marginBottom";
629
- this.inverted && (e = t.opposite ? "marginRight" : "plotLeft"), this[e] = (this[e] || 0) + (t.navigatorEnabled || !this.inverted ? t.height + (this.scrollbar?.options.margin || 0) + t.scrollbarHeight : 0) + (t.navigatorOptions.margin || 0);
630
- }), N(Zt, "setRange", function(t) {
631
- this.chart.xAxis[0].setExtremes(t.min, t.max, t.redraw, t.animation, t.eventArguments);
632
- }));
633
- }
634
- destroy() {
635
- this.removeEvents(), this.xAxis && (yt(this.chart.xAxis, this.xAxis), yt(this.chart.axes, this.xAxis)), this.yAxis && (yt(this.chart.yAxis, this.yAxis), yt(this.chart.axes, this.yAxis)), (this.series || []).forEach((t) => {
636
- t.destroy && t.destroy();
637
- }), ["series", "xAxis", "yAxis", "shades", "outline", "scrollbarTrack", "scrollbarRifles", "scrollbarGroup", "scrollbar", "navigatorGroup", "rendered"].forEach((t) => {
638
- this[t] && this[t].destroy && this[t].destroy(), this[t] = null;
639
- }), [this.handles].forEach((t) => {
640
- uo(t);
641
- }), this.baseSeries.forEach((t) => {
642
- t.navigatorSeries = void 0;
643
- }), this.navigatorEnabled = !1;
644
- }
645
- }
646
- (function(a) {
647
- a.setLength = function(t, e, i) {
648
- return Array.isArray(t) ? (t.length = e, t) : t[i ? "subarray" : "slice"](0, e);
649
- }, a.splice = function(t, e, i, s, o = []) {
650
- if (Array.isArray(t)) return Array.isArray(o) || (o = Array.from(o)), { removed: t.splice(e, i, ...o), array: t };
651
- let n = Object.getPrototypeOf(t).constructor, c = t[s ? "subarray" : "slice"](e, e + i), u = new n(t.length - i + o.length);
652
- return u.set(t.subarray(0, e), 0), u.set(o, e), u.set(t.subarray(e + i), e + o.length), { removed: c, array: u };
653
- };
654
- })(ne || (ne = {}));
655
- let { setLength: fo, splice: ni } = ne, { fireEvent: Me, objectEach: zt, uniqueKey: Lt } = B(), li = class {
656
- constructor(a = {}) {
657
- this.autoId = !a.id, this.columns = {}, this.id = a.id || Lt(), this.modified = this, this.rowCount = 0, this.versionTag = Lt();
658
- let t = 0;
659
- zt(a.columns || {}, (e, i) => {
660
- this.columns[i] = e.slice(), t = Math.max(t, e.length);
661
- }), this.applyRowCount(t);
662
- }
663
- applyRowCount(a) {
664
- this.rowCount = a, zt(this.columns, (t, e) => {
665
- t.length !== a && (this.columns[e] = fo(t, a));
666
- });
667
- }
668
- deleteRows(a, t = 1) {
669
- if (t > 0 && a < this.rowCount) {
670
- let e = 0;
671
- zt(this.columns, (i, s) => {
672
- this.columns[s] = ni(i, a, t).array, e = i.length;
673
- }), this.rowCount = e;
674
- }
675
- Me(this, "afterDeleteRows", { rowIndex: a, rowCount: t }), this.versionTag = Lt();
676
- }
677
- getColumn(a, t) {
678
- return this.columns[a];
679
- }
680
- getColumns(a, t) {
681
- return (a || Object.keys(this.columns)).reduce((e, i) => (e[i] = this.columns[i], e), {});
682
- }
683
- getRow(a, t) {
684
- return (t || Object.keys(this.columns)).map((e) => this.columns[e]?.[a]);
685
- }
686
- setColumn(a, t = [], e = 0, i) {
687
- this.setColumns({ [a]: t }, e, i);
688
- }
689
- setColumns(a, t, e) {
690
- let i = this.rowCount;
691
- zt(a, (s, o) => {
692
- this.columns[o] = s.slice(), i = s.length;
693
- }), this.applyRowCount(i), e?.silent || (Me(this, "afterSetColumns"), this.versionTag = Lt());
694
- }
695
- setRow(a, t = this.rowCount, e, i) {
696
- let { columns: s } = this, o = e ? this.rowCount + 1 : t + 1;
697
- zt(a, (n, c) => {
698
- let u = s[c] || i?.addColumns !== !1 && Array(o);
699
- u && (e ? u = ni(u, t, 0, !0, [n]).array : u[t] = n, s[c] = u);
700
- }), o > this.rowCount && this.applyRowCount(o), i?.silent || (Me(this, "afterSetRows"), this.versionTag = Lt());
701
- }
702
- }, { addEvent: ct, correctFloat: Kt, css: mo, defined: $, error: xo, isNumber: Ae, pick: ke, timeUnits: bo, isString: vo } = B();
703
- (function(a) {
704
- function t(r, l, h, f, m = [], x = 0, b) {
705
- let S = {}, v = this.options.tickPixelInterval, M = this.chart.time, A = [], y, E, w, O, T, k = 0, C = [], z = -Number.MAX_VALUE;
706
- if (!this.options.ordinal && !this.options.breaks || !m || m.length < 3 || l === void 0) return M.getTimeTicks.apply(M, arguments);
707
- let I = m.length;
708
- for (y = 0; y < I; y++) {
709
- if (T = y && m[y - 1] > h, m[y] < l && (k = y), y === I - 1 || m[y + 1] - m[y] > 5 * x || T) {
710
- if (m[y] > z) {
711
- for (E = M.getTimeTicks(r, m[k], m[y], f); E.length && E[0] <= z; ) E.shift();
712
- E.length && (z = E[E.length - 1]), A.push(C.length), C = C.concat(E);
713
- }
714
- k = y + 1;
715
- }
716
- if (T) break;
717
- }
718
- if (E) {
719
- if (O = E.info, b && O.unitRange <= bo.hour) {
720
- for (k = 1, y = C.length - 1; k < y; k++) M.dateFormat("%d", C[k]) !== M.dateFormat("%d", C[k - 1]) && (S[C[k]] = "day", w = !0);
721
- w && (S[C[0]] = "day"), O.higherRanks = S;
722
- }
723
- O.segmentStarts = A, C.info = O;
724
- } else xo(12, !1, this.chart);
725
- if (b && $(v)) {
726
- let D = C.length, W = [], L = [], R, X, Y, lt, Bt, V = D;
727
- for (; V--; ) X = this.translate(C[V]), Y && (L[V] = Y - X), W[V] = Y = X;
728
- for (L.sort((Ct, Qt) => Ct - Qt), (lt = L[Math.floor(L.length / 2)]) < 0.6 * v && (lt = null), V = C[D - 1] > h ? D - 1 : D, Y = void 0; V--; ) Bt = Math.abs(Y - (X = W[V])), Y && Bt < 0.8 * v && (lt === null || Bt < 0.8 * lt) ? (S[C[V]] && !S[C[V + 1]] ? (R = V + 1, Y = X) : R = V, C.splice(R, 1)) : Y = X;
729
- }
730
- return C;
731
- }
732
- function e(r) {
733
- let l = this.ordinal.positions;
734
- if (!l) return r;
735
- let h = l.length - 1, f;
736
- return r < 0 ? r = l[0] : r > h ? r = l[h] : (h = Math.floor(r), f = r - h), f !== void 0 && l[h] !== void 0 ? l[h] + (f ? f * (l[h + 1] - l[h]) : 0) : r;
737
- }
738
- function i(r) {
739
- let l = this.ordinal, h = this.old ? this.old.min : this.min, f = this.old ? this.old.transA : this.transA, m = l.getExtendedPositions();
740
- if (m?.length) {
741
- let x = Kt((r - h) * f + this.minPixelPadding), b = Kt(l.getIndexOfPoint(x, m)), S = Kt(b % 1);
742
- if (b >= 0 && b <= m.length - 1) {
743
- let v = m[Math.floor(b)], M = m[Math.ceil(b)];
744
- return m[Math.floor(b)] + S * (M - v);
745
- }
746
- }
747
- return r;
748
- }
749
- function s(r, l) {
750
- let h = a.Additions.findIndexOf(r, l, !0);
751
- if (r[h] === l) return h;
752
- let f = (l - r[h]) / (r[h + 1] - r[h]);
753
- return h + f;
754
- }
755
- function o() {
756
- this.ordinal || (this.ordinal = new a.Additions(this));
757
- }
758
- function n() {
759
- let { eventArgs: r, options: l } = this;
760
- if (this.isXAxis && $(l.overscroll) && l.overscroll !== 0 && Ae(this.max) && Ae(this.min) && (this.options.ordinal && !this.ordinal.originalOrdinalRange && this.ordinal.getExtendedPositions(!1), this.max === this.dataMax && (r?.trigger !== "pan" || this.isInternal) && r?.trigger !== "navigator")) {
761
- let h = this.ordinal.convertOverscroll(l.overscroll);
762
- this.max += h, !this.isInternal && $(this.userMin) && r?.trigger !== "mousewheel" && (this.min += h);
763
- }
764
- }
765
- function c() {
766
- this.horiz && !this.isDirty && (this.isDirty = this.isOrdinal && this.chart.navigator && !this.chart.navigator.adaptToUpdatedData);
767
- }
768
- function u() {
769
- this.ordinal && (this.ordinal.beforeSetTickPositions(), this.tickInterval = this.ordinal.postProcessTickInterval(this.tickInterval));
770
- }
771
- function g(r) {
772
- let l = this.xAxis[0], h = l.ordinal.convertOverscroll(l.options.overscroll), f = r.originalEvent.chartX, m = this.options.chart.panning, x = !1;
773
- if (m?.type !== "y" && l.options.ordinal && l.series.length && (!r.touches || r.touches.length <= 1)) {
774
- let b, S, v = this.mouseDownX, M = l.getExtremes(), A = M.dataMin, y = M.dataMax, E = M.min, w = M.max, O = this.hoverPoints, T = l.closestPointRange || l.ordinal?.overscrollPointsRange, k = Math.round((v - f) / (l.translationSlope * (l.ordinal.slope || T))), C = l.ordinal.getExtendedPositions(), z = { ordinal: { positions: C, extendedOrdinalPositions: C } }, I = l.index2val, D = l.val2lin;
775
- if (E <= A && k <= 0 || w >= y + h && k >= 0) return void r.preventDefault();
776
- z.ordinal.positions ? Math.abs(k) > 1 && (O && O.forEach(function(W) {
777
- W.setState();
778
- }), S = z.ordinal.positions, h && (S = z.ordinal.positions = S.concat(l.ordinal.getOverscrollPositions())), y > S[S.length - 1] && S.push(y), this.setFixedRange(w - E), (b = l.navigatorAxis.toFixedRange(void 0, void 0, I.apply(z, [D.apply(z, [E, !0]) + k]), I.apply(z, [D.apply(z, [w, !0]) + k]))).min >= Math.min(S[0], E) && b.max <= Math.max(S[S.length - 1], w) + h && l.setExtremes(b.min, b.max, !0, !1, { trigger: "pan" }), this.mouseDownX = f, mo(this.container, { cursor: "move" })) : x = !0;
779
- } else x = !0;
780
- x || m && /y/.test(m.type) ? h && Ae(l.dataMax) && (l.max = l.dataMax + h) : r.preventDefault();
781
- }
782
- function p() {
783
- let r = this.xAxis;
784
- r?.options.ordinal && (delete r.ordinal.index, delete r.ordinal.originalOrdinalRange);
785
- }
786
- function d(r, l) {
787
- let h, f = this.ordinal, m = f.positions, x = f.slope, b;
788
- if (!m) return r;
789
- let S = m.length;
790
- if (m[0] <= r && m[S - 1] >= r) h = s(m, r);
791
- else {
792
- if (b = f.getExtendedPositions?.(), !b?.length) return r;
793
- let v = b.length;
794
- x || (x = (b[v - 1] - b[0]) / v);
795
- let M = s(b, m[0]);
796
- if (r >= b[0] && r <= b[v - 1]) h = s(b, r) - M;
797
- else {
798
- if (!l) return r;
799
- h = r < b[0] ? -M - (b[0] - r) / x : (r - b[v - 1]) / x + v - M;
800
- }
801
- }
802
- return l ? h : x * (h || 0) + f.offset;
803
- }
804
- a.compose = function(r, l, h) {
805
- let f = r.prototype;
806
- return f.ordinal2lin || (f.getTimeTicks = t, f.index2val = e, f.lin2val = i, f.val2lin = d, f.ordinal2lin = f.val2lin, ct(r, "afterInit", o), ct(r, "foundExtremes", n), ct(r, "afterSetScale", c), ct(r, "initialAxisTranslation", u), ct(h, "pan", g), ct(h, "touchpan", g), ct(l, "updatedData", p)), r;
807
- }, a.Additions = class {
808
- constructor(r) {
809
- this.index = {}, this.axis = r;
810
- }
811
- beforeSetTickPositions() {
812
- let r = this.axis, l = r.ordinal, h = r.getExtremes(), f = h.min, m = h.max, x = r.brokenAxis?.hasBreaks, b = r.options.ordinal, S = r.options.overscroll && r.ordinal.convertOverscroll(r.options.overscroll) || 0, v, M, A, y, E, w, O, T = [], k = Number.MAX_VALUE, C = !1, z = !1, I = !1;
813
- if (b || x) {
814
- let D = 0;
815
- if (r.series.forEach(function(W, L) {
816
- let R = W.getColumn("x", !0);
817
- if (M = [], L > 0 && W.options.id !== "highcharts-navigator-series" && R.length > 1 && (z = D !== R[1] - R[0]), D = R[1] - R[0], W.boosted && (I = W.boosted), W.reserveSpace() && (W.takeOrdinalPosition !== !1 || x) && (v = (T = T.concat(R)).length, T.sort(function(X, Y) {
818
- return X - Y;
819
- }), k = Math.min(k, ke(W.closestPointRange, k)), v)) {
820
- for (L = 0; L < v - 1; ) T[L] !== T[L + 1] && M.push(T[L + 1]), L++;
821
- M[0] !== T[0] && M.unshift(T[0]), T = M;
822
- }
823
- }), r.ordinal.originalOrdinalRange || (r.ordinal.originalOrdinalRange = (T.length - 1) * k), z && I && (T.pop(), T.shift()), (v = T.length) > 2) {
824
- for (A = T[1] - T[0], O = v - 1; O-- && !C; ) T[O + 1] - T[O] !== A && (C = !0);
825
- !r.options.keepOrdinalPadding && (T[0] - f > A || m - S - T[v - 1] > A) && (C = !0);
826
- } else r.options.overscroll && (v === 2 ? k = T[1] - T[0] : v === 1 ? (k = S, T = [T[0], T[0] + k]) : k = l.overscrollPointsRange);
827
- C || r.forceOrdinal ? (r.options.overscroll && (l.overscrollPointsRange = k, T = T.concat(l.getOverscrollPositions())), l.positions = T, y = r.ordinal2lin(Math.max(f, T[0]), !0), E = Math.max(r.ordinal2lin(Math.min(m, T[T.length - 1]), !0), 1), l.slope = w = (m - f) / (E - y), l.offset = f - y * w) : (l.overscrollPointsRange = ke(r.closestPointRange, l.overscrollPointsRange), l.positions = r.ordinal.slope = l.offset = void 0);
828
- }
829
- r.isOrdinal = b && C, l.groupIntervalFactor = null;
830
- }
831
- static findIndexOf(r, l, h) {
832
- let f = 0, m = r.length - 1, x;
833
- for (; f < m; ) r[x = Math.ceil((f + m) / 2)] <= l ? f = x : m = x - 1;
834
- return r[f] === l || h ? f : -1;
835
- }
836
- getExtendedPositions(r = !0) {
837
- let l = this, h = l.axis, f = h.constructor.prototype, m = h.chart, x = h.series.reduce((y, E) => {
838
- let w = E.currentDataGrouping;
839
- return y + (w ? w.count + w.unitName : "raw");
840
- }, ""), b = r ? h.ordinal.convertOverscroll(h.options.overscroll) : 0, S = h.getExtremes(), v, M, A = l.index;
841
- return A || (A = l.index = {}), !A[x] && ((v = { series: [], chart: m, forceOrdinal: !1, getExtremes: function() {
842
- return { min: S.dataMin, max: S.dataMax + b };
843
- }, applyGrouping: f.applyGrouping, getGroupPixelWidth: f.getGroupPixelWidth, getTimeTicks: f.getTimeTicks, options: { ordinal: !0 }, ordinal: { getGroupIntervalFactor: this.getGroupIntervalFactor }, ordinal2lin: f.ordinal2lin, getIndexOfPoint: f.getIndexOfPoint, val2lin: f.val2lin }).ordinal.axis = v, h.series.forEach((y) => {
844
- if (y.takeOrdinalPosition === !1) return;
845
- M = { xAxis: v, chart: m, groupPixelWidth: y.groupPixelWidth, destroyGroupedData: B().noop, getColumn: y.getColumn, applyGrouping: y.applyGrouping, getProcessedData: y.getProcessedData, reserveSpace: y.reserveSpace, visible: y.visible };
846
- let E = y.getColumn("x").concat(r ? l.getOverscrollPositions() : []);
847
- M.dataTable = new li({ columns: { x: E } }), M.options = { ...y.options, dataGrouping: y.currentDataGrouping ? { firstAnchor: y.options.dataGrouping?.firstAnchor, anchor: y.options.dataGrouping?.anchor, lastAnchor: y.options.dataGrouping?.firstAnchor, enabled: !0, forced: !0, approximation: "open", units: [[y.currentDataGrouping.unitName, [y.currentDataGrouping.count]]] } : { enabled: !1 } }, v.series.push(M), y.processData.apply(M);
848
- }), v.applyGrouping({ hasExtremesChanged: !0 }), M?.closestPointRange !== M?.basePointRange && M.currentDataGrouping && (v.forceOrdinal = !0), h.ordinal.beforeSetTickPositions.apply({ axis: v }), !h.ordinal.originalOrdinalRange && v.ordinal.originalOrdinalRange && (h.ordinal.originalOrdinalRange = v.ordinal.originalOrdinalRange), v.ordinal.positions && (A[x] = v.ordinal.positions)), A[x];
849
- }
850
- getGroupIntervalFactor(r, l, h) {
851
- let f = h.getColumn("x", !0), m = f.length, x = [], b, S, v = this.groupIntervalFactor;
852
- if (!v) {
853
- for (S = 0; S < m - 1; S++) x[S] = f[S + 1] - f[S];
854
- x.sort(function(M, A) {
855
- return M - A;
856
- }), b = x[Math.floor(m / 2)], r = Math.max(r, f[0]), l = Math.min(l, f[m - 1]), this.groupIntervalFactor = v = m * b / (l - r);
857
- }
858
- return v;
859
- }
860
- getIndexOfPoint(r, l) {
861
- let h = this.axis, f = h.min, m = h.minPixelPadding;
862
- return s(l, f) + Kt((r - m) / (h.translationSlope * (this.slope || h.closestPointRange || this.overscrollPointsRange)));
863
- }
864
- getOverscrollPositions() {
865
- let r = this.axis, l = this.convertOverscroll(r.options.overscroll), h = this.overscrollPointsRange, f = [], m = r.dataMax;
866
- if ($(h)) for (; m < r.dataMax + l; ) f.push(m += h);
867
- return f;
868
- }
869
- postProcessTickInterval(r) {
870
- let l = this.axis, h = this.slope, f = l.closestPointRange;
871
- return h && f ? l.options.breaks ? f || r : r / (h / f) : r;
872
- }
873
- convertOverscroll(r = 0) {
874
- let l = this, h = l.axis, f = function(m) {
875
- return ke(l.originalOrdinalRange, $(h.dataMax) && $(h.dataMin) ? h.dataMax - h.dataMin : 0) * m;
876
- };
877
- if (vo(r)) {
878
- let m, x = parseInt(r, 10);
879
- if ($(h.min) && $(h.max) && $(h.dataMin) && $(h.dataMax) && ((m = h.max - h.min == h.dataMax - h.dataMin) || (this.originalOrdinalRange = h.max - h.min)), /%$/.test(r)) return f(x / 100);
880
- if (/px/.test(r)) {
881
- let b = Math.min(x, 0.9 * h.len) / h.len;
882
- return f(b / (m ? 1 - b : 1));
883
- }
884
- return 0;
885
- }
886
- return r;
887
- }
888
- };
889
- })(le || (le = {}));
890
- let we = le, Se = { lang: { rangeSelectorZoom: "Zoom", rangeSelectorFrom: "", rangeSelectorTo: "→", rangeSelector: { allText: "All", allTitle: "View all", monthText: "{count}m", monthTitle: "View {count} {#eq count 1}month{else}months{/eq}", yearText: "{count}y", yearTitle: "View {count} {#eq count 1}year{else}years{/eq}", ytdText: "YTD", ytdTitle: "View year to date" } }, rangeSelector: { allButtonsEnabled: !1, buttons: [{ type: "month", count: 1 }, { type: "month", count: 3 }, { type: "month", count: 6 }, { type: "ytd" }, { type: "year", count: 1 }, { type: "all" }], buttonSpacing: 5, dropdown: "responsive", enabled: void 0, verticalAlign: "top", buttonTheme: { width: 28, height: 18, padding: 2, zIndex: 7 }, floating: !1, x: 0, y: 0, height: void 0, inputBoxBorderColor: "none", inputBoxHeight: 17, inputBoxWidth: void 0, inputDateFormat: "%[ebY]", inputDateParser: void 0, inputEditDateFormat: "%Y-%m-%d", inputEnabled: !0, inputPosition: { align: "right", x: 0, y: 0 }, inputSpacing: 5, selected: void 0, buttonPosition: { align: "left", x: 0, y: 0 }, inputStyle: { color: "#334eff", cursor: "pointer", fontSize: "0.8em" }, labelStyle: { color: "#666666", fontSize: "0.8em" } } }, { defaultOptions: hi } = B(), { composed: yo } = B(), { addEvent: gt, defined: Mo, extend: di, isNumber: At, merge: Ao, pick: pi, pushUnique: ko } = B(), Te = [];
891
- function wo() {
892
- let a, t, e = this.range, i = e.type, s = this.max, o = this.chart.time, n = function(u, g) {
893
- let p = o.toParts(u), d = p.slice();
894
- i === "year" ? d[0] += g : d[1] += g;
895
- let r = o.makeTime.apply(o, d), l = o.toParts(r);
896
- return i === "month" && p[1] === l[1] && Math.abs(g) === 1 && (d[0] = p[0], d[1] = p[1], d[2] = 0), (r = o.makeTime.apply(o, d)) - u;
897
- };
898
- At(e) ? (a = s - e, t = e) : e && (a = s + n(s, -(e.count || 1)), this.chart && this.chart.setFixedRange(s - a));
899
- let c = pi(this.dataMin, Number.MIN_VALUE);
900
- return At(a) || (a = c), a <= c && (a = c, t === void 0 && (t = n(a, e.count)), this.newMax = Math.min(a + t, pi(this.dataMax, Number.MAX_VALUE))), At(s) ? !At(e) && e && e._offsetMin && (a += e._offsetMin) : a = void 0, a;
901
- }
902
- function So() {
903
- this.rangeSelector?.redrawElements();
904
- }
905
- function To() {
906
- this.options.rangeSelector && this.options.rangeSelector.enabled && (this.rangeSelector = new se(this));
907
- }
908
- function Eo() {
909
- let a = this.rangeSelector;
910
- if (a) {
911
- At(a.deferredYTDClick) && (a.clickButton(a.deferredYTDClick), delete a.deferredYTDClick);
912
- let t = a.options.verticalAlign;
913
- a.options.floating || (t === "bottom" ? this.extraBottomMargin = !0 : t === "top" && (this.extraTopMargin = !0));
914
- }
915
- }
916
- function ui() {
917
- let a, t = this.rangeSelector;
918
- if (!t) return;
919
- let e = this.xAxis[0].getExtremes(), i = this.legend, s = t && t.options.verticalAlign;
920
- At(e.min) && t.render(e.min, e.max), i.display && s === "top" && s === i.options.verticalAlign && (a = Ao(this.spacingBox), i.options.layout === "vertical" ? a.y = this.plotTop : a.y += t.getHeight(), i.group.placed = !1, i.align(a));
921
- }
922
- function Oo() {
923
- for (let a = 0, t = Te.length; a < t; ++a) {
924
- let e = Te[a];
925
- if (e[0] === this) {
926
- e[1].forEach((i) => i()), Te.splice(a, 1);
927
- return;
928
- }
929
- }
930
- }
931
- function Bo() {
932
- let a = this.rangeSelector;
933
- if (a?.options?.enabled) {
934
- let t = a.getHeight(), e = a.options.verticalAlign;
935
- a.options.floating || (e === "bottom" ? this.marginBottom += t : e !== "middle" && (this.plotTop += t));
936
- }
937
- }
938
- function Co(a) {
939
- let t = a.options.rangeSelector, e = this.extraBottomMargin, i = this.extraTopMargin, s = this.rangeSelector;
940
- if (t && t.enabled && !Mo(s) && this.options.rangeSelector && (this.options.rangeSelector.enabled = !0, this.rangeSelector = s = new se(this)), this.extraBottomMargin = !1, this.extraTopMargin = !1, s) {
941
- let o = t && t.verticalAlign || s.options && s.options.verticalAlign;
942
- s.options.floating || (o === "bottom" ? this.extraBottomMargin = !0 : o !== "middle" && (this.extraTopMargin = !0)), (this.extraBottomMargin !== e || this.extraTopMargin !== i) && (this.isDirtyBox = !0);
943
- }
944
- }
945
- let Do = { compose: function(a, t, e) {
946
- if (se = e, ko(yo, "RangeSelector")) {
947
- let i = t.prototype;
948
- a.prototype.minFromRange = wo, gt(t, "afterGetContainer", To), gt(t, "beforeRender", Eo), gt(t, "destroy", Oo), gt(t, "getMargins", Bo), gt(t, "redraw", ui), gt(t, "update", Co), gt(t, "beforeRedraw", So), i.callbacks.push(ui), di(hi, { rangeSelector: Se.rangeSelector }), di(hi.lang, Se.lang);
949
- }
950
- } };
951
- var Po = G(28), ci = G.n(Po), Ro = G(984), Ee = G.n(Ro);
952
- let { defaultOptions: Oe } = B(), { format: gi } = Ee(), { addEvent: J, createElement: Wt, css: it, defined: st, destroyObjectProperties: Go, diffObjects: Io, discardElement: zo, extend: fi, fireEvent: kt, isNumber: F, isString: Be, merge: at, objectEach: Lo, pick: Q, splat: Wo } = B();
953
- function mi(a) {
954
- let t = (s) => RegExp(`%[[a-zA-Z]*${s}`).test(a);
955
- if (Be(a) ? a.indexOf("%L") !== -1 : a.fractionalSecondDigits) return "text";
956
- let e = Be(a) ? ["a", "A", "d", "e", "w", "b", "B", "m", "o", "y", "Y"].some(t) : a.dateStyle || a.day || a.month || a.year, i = Be(a) ? ["H", "k", "I", "l", "M", "S"].some(t) : a.timeStyle || a.hour || a.minute || a.second;
957
- return e && i ? "datetime-local" : e ? "date" : i ? "time" : "text";
958
- }
959
- class Xt {
960
- static compose(t, e) {
961
- Do.compose(t, e, Xt);
962
- }
963
- constructor(t) {
964
- this.isDirty = !1, this.buttonOptions = [], this.initialButtonGroupWidth = 0, this.maxButtonWidth = () => {
965
- let e = 0;
966
- return this.buttons.forEach((i) => {
967
- let s = i.getBBox();
968
- s.width > e && (e = s.width);
969
- }), e;
970
- }, this.init(t);
971
- }
972
- clickButton(t, e) {
973
- let i = this.chart, s = this.buttonOptions[t], o = i.xAxis[0], n = i.scroller && i.scroller.getUnionExtremes() || o || {}, c = s.type, u = s.dataGrouping, g = n.dataMin, p = n.dataMax, d, r = F(o?.max) ? Math.round(Math.min(o.max, p ?? o.max)) : void 0, l, h = s._range, f, m, x, b = !0;
974
- if (g !== null && p !== null) {
975
- if (this.setSelected(t), u && (this.forcedDataGrouping = !0, ce().prototype.setDataGrouping.call(o || { chart: this.chart }, u, !1), this.frozenStates = s.preserveDataGrouping), c === "month" || c === "year") o ? (m = { range: s, max: r, chart: i, dataMin: g, dataMax: p }, d = o.minFromRange.call(m), F(m.newMax) && (r = m.newMax), b = !1) : h = s;
976
- else if (h) F(r) && (r = Math.min((d = Math.max(r - h, g)) + h, p), b = !1);
977
- else if (c === "ytd") if (o) !o.hasData() || F(p) && F(g) || (g = Number.MAX_VALUE, p = -Number.MAX_VALUE, i.series.forEach((S) => {
978
- let v = S.getColumn("x");
979
- v.length && (g = Math.min(v[0], g), p = Math.max(v[v.length - 1], p));
980
- }), e = !1), F(p) && F(g) && (d = f = (x = this.getYTDExtremes(p, g)).min, r = x.max);
981
- else {
982
- this.deferredYTDClick = t;
983
- return;
984
- }
985
- else c === "all" && o && (i.navigator && i.navigator.baseSeries[0] && (i.navigator.baseSeries[0].xAxis.options.range = void 0), d = g, r = p);
986
- if (b && s._offsetMin && st(d) && (d += s._offsetMin), s._offsetMax && st(r) && (r += s._offsetMax), this.dropdown && (this.dropdown.selectedIndex = t + 1), o) F(d) && F(r) && (o.setExtremes(d, r, Q(e, !0), void 0, { trigger: "rangeSelectorButton", rangeSelectorButton: s }), i.setFixedRange(s._range));
987
- else {
988
- l = Wo(i.options.xAxis || {})[0];
989
- let S = J(i, "afterCreateAxes", function() {
990
- let v = i.xAxis[0];
991
- v.range = v.options.range = h, v.min = v.options.min = f;
992
- });
993
- J(i, "load", function() {
994
- let v = i.xAxis[0];
995
- i.setFixedRange(s._range), v.options.range = l.range, v.options.min = l.min, S();
996
- });
997
- }
998
- kt(this, "afterBtnClick");
999
- }
1000
- }
1001
- setSelected(t) {
1002
- this.selected = this.options.selected = t;
1003
- }
1004
- init(t) {
1005
- let e = this, i = t.options.rangeSelector, s = t.options.lang, o = i.buttons, n = i.selected, c = function() {
1006
- let u = e.minInput, g = e.maxInput;
1007
- u && u.blur && kt(u, "blur"), g && g.blur && kt(g, "blur");
1008
- };
1009
- e.chart = t, e.options = i, e.buttons = [], e.buttonOptions = o.map((u) => (u.type && s.rangeSelector && (u.text ?? (u.text = s.rangeSelector[`${u.type}Text`]), u.title ?? (u.title = s.rangeSelector[`${u.type}Title`])), u.text = gi(u.text, { count: u.count || 1 }), u.title = gi(u.title, { count: u.count || 1 }), u)), this.eventsToUnbind = [], this.eventsToUnbind.push(J(t.container, "mousedown", c)), this.eventsToUnbind.push(J(t, "resize", c)), o.forEach(e.computeButtonRange), n !== void 0 && o[n] && this.clickButton(n, !1), this.eventsToUnbind.push(J(t, "load", function() {
1010
- t.xAxis && t.xAxis[0] && J(t.xAxis[0], "setExtremes", function(u) {
1011
- F(this.max) && F(this.min) && this.max - this.min !== t.fixedRange && u.trigger !== "rangeSelectorButton" && u.trigger !== "updatedData" && e.forcedDataGrouping && !e.frozenStates && this.setDataGrouping(!1, !1);
1012
- });
1013
- })), this.createElements();
1014
- }
1015
- updateButtonStates() {
1016
- let t = this, e = this.chart, i = this.dropdown, s = this.dropdownLabel, o = e.xAxis[0], n = Math.round(o.max - o.min), c = !o.hasVisibleSeries, u = 24 * 36e5, g = e.scroller && e.scroller.getUnionExtremes() || o, p = g.dataMin, d = g.dataMax, r = t.getYTDExtremes(d, p), l = r.min, h = r.max, f = t.selected, m = t.options.allButtonsEnabled, x = Array(t.buttonOptions.length).fill(0), b = F(f), S = t.buttons, v = !1, M = null;
1017
- t.buttonOptions.forEach((A, y) => {
1018
- let E = A._range, w = A.type, O = A.count || 1, T = A._offsetMax - A._offsetMin, k = y === f, C = E > d - p, z = E < o.minRange, I = !1, D = E === n;
1019
- if (k && C && (v = !0), o.isOrdinal && o.ordinal?.positions && E && n < E) {
1020
- let R = o.ordinal.positions, X = we.Additions.findIndexOf(R, o.min, !0), Y = Math.min(we.Additions.findIndexOf(R, o.max, !0) + 1, R.length - 1);
1021
- R[Y] - R[X] > E && (D = !0);
1022
- } else (w === "month" || w === "year") && n + 36e5 >= { month: 28, year: 365 }[w] * u * O - T && n - 36e5 <= { month: 31, year: 366 }[w] * u * O + T ? D = !0 : w === "ytd" ? (D = h - l + T === n, I = !k) : w === "all" && (D = o.max - o.min >= d - p);
1023
- let W = !m && !(v && w === "all") && (C || z || c), L = v && w === "all" || !I && D || k && t.frozenStates;
1024
- W ? x[y] = 3 : L && (!b || y === f) && (M = y);
1025
- }), M !== null ? (x[M] = 2, t.setSelected(M), this.dropdown && (this.dropdown.selectedIndex = M + 1)) : (t.setSelected(), this.dropdown && (this.dropdown.selectedIndex = -1), s && (s.setState(0), s.attr({ text: (Oe.lang.rangeSelectorZoom || "") + " ▾" })));
1026
- for (let A = 0; A < x.length; A++) {
1027
- let y = x[A], E = S[A];
1028
- if (E.state !== y && (E.setState(y), i)) {
1029
- i.options[A + 1].disabled = y === 3, y === 2 && (s && (s.setState(2), s.attr({ text: t.buttonOptions[A].text + " ▾" })), i.selectedIndex = A + 1);
1030
- let w = s.getBBox();
1031
- it(i, { width: `${w.width}px`, height: `${w.height}px` });
1032
- }
1033
- }
1034
- }
1035
- computeButtonRange(t) {
1036
- let e = t.type, i = t.count || 1, s = { millisecond: 1, second: 1e3, minute: 6e4, hour: 36e5, day: 864e5, week: 6048e5 };
1037
- s[e] ? t._range = s[e] * i : (e === "month" || e === "year") && (t._range = 24 * { month: 30, year: 365 }[e] * 36e5 * i), t._offsetMin = Q(t.offsetMin, 0), t._offsetMax = Q(t.offsetMax, 0), t._range += t._offsetMax - t._offsetMin;
1038
- }
1039
- getInputValue(t) {
1040
- let e = t === "min" ? this.minInput : this.maxInput, i = this.chart.options.rangeSelector, s = this.chart.time;
1041
- return e ? (e.type === "text" && i.inputDateParser || this.defaultInputDateParser)(e.value, s.timezone === "UTC", s) : 0;
1042
- }
1043
- setInputValue(t, e) {
1044
- let i = this.options, s = this.chart.time, o = t === "min" ? this.minInput : this.maxInput, n = t === "min" ? this.minDateBox : this.maxDateBox;
1045
- if (o) {
1046
- o.setAttribute("type", mi(i.inputDateFormat || "%e %b %Y"));
1047
- let c = o.getAttribute("data-hc-time"), u = st(c) ? Number(c) : void 0;
1048
- if (st(e)) {
1049
- let g = u;
1050
- st(g) && o.setAttribute("data-hc-time-previous", g), o.setAttribute("data-hc-time", e), u = e;
1051
- }
1052
- o.value = s.dateFormat(this.inputTypeFormats[o.type] || i.inputEditDateFormat, u), n && n.attr({ text: s.dateFormat(i.inputDateFormat, u) });
1053
- }
1054
- }
1055
- setInputExtremes(t, e, i) {
1056
- let s = t === "min" ? this.minInput : this.maxInput;
1057
- if (s) {
1058
- let o = this.inputTypeFormats[s.type], n = this.chart.time;
1059
- if (o) {
1060
- let c = n.dateFormat(o, e);
1061
- s.min !== c && (s.min = c);
1062
- let u = n.dateFormat(o, i);
1063
- s.max !== u && (s.max = u);
1064
- }
1065
- }
1066
- }
1067
- showInput(t) {
1068
- let e = t === "min" ? this.minDateBox : this.maxDateBox, i = t === "min" ? this.minInput : this.maxInput;
1069
- if (i && e && this.inputGroup) {
1070
- let s = i.type === "text", { translateX: o = 0, translateY: n = 0 } = this.inputGroup, { x: c = 0, width: u = 0, height: g = 0 } = e, { inputBoxWidth: p } = this.options;
1071
- it(i, { width: s ? u + (p ? -2 : 20) + "px" : "auto", height: g - 2 + "px", border: "2px solid silver" }), s && p ? it(i, { left: o + c + "px", top: n + "px" }) : it(i, { left: Math.min(Math.round(c + o - (i.offsetWidth - u) / 2), this.chart.chartWidth - i.offsetWidth) + "px", top: n - (i.offsetHeight - g) / 2 + "px" });
1072
- }
1073
- }
1074
- hideInput(t) {
1075
- let e = t === "min" ? this.minInput : this.maxInput;
1076
- e && it(e, { top: "-9999em", border: 0, width: "1px", height: "1px" });
1077
- }
1078
- defaultInputDateParser(t, e, i) {
1079
- return i?.parse(t) || 0;
1080
- }
1081
- drawInput(t) {
1082
- let { chart: e, div: i, inputGroup: s } = this, o = this, n = e.renderer.style || {}, c = e.renderer, u = e.options.rangeSelector, g = Oe.lang, p = t === "min";
1083
- function d(x) {
1084
- let { maxInput: b, minInput: S } = o, v = e.xAxis[0], M = e.scroller?.getUnionExtremes() || v, A = M.dataMin, y = M.dataMax, E = e.xAxis[0].getExtremes()[x], w = o.getInputValue(x);
1085
- F(w) && w !== E && (p && b && F(A) ? w > Number(b.getAttribute("data-hc-time")) ? w = void 0 : w < A && (w = A) : S && F(y) && (w < Number(S.getAttribute("data-hc-time")) ? w = void 0 : w > y && (w = y)), w !== void 0 && v.setExtremes(p ? w : v.min, p ? v.max : w, void 0, void 0, { trigger: "rangeSelectorInput" }));
1086
- }
1087
- let r = g[p ? "rangeSelectorFrom" : "rangeSelectorTo"] || "", l = c.label(r, 0).addClass("highcharts-range-label").attr({ padding: 2 * !!r, height: r ? u.inputBoxHeight : 0 }).add(s), h = c.label("", 0).addClass("highcharts-range-input").attr({ padding: 2, width: u.inputBoxWidth, height: u.inputBoxHeight, "text-align": "center" }).on("click", function() {
1088
- o.showInput(t), o[t + "Input"].focus();
1089
- });
1090
- e.styledMode || h.attr({ stroke: u.inputBoxBorderColor, "stroke-width": 1 }), h.add(s);
1091
- let f = Wt("input", { name: t, className: "highcharts-range-selector" }, void 0, i);
1092
- f.setAttribute("type", mi(u.inputDateFormat || "%e %b %Y")), e.styledMode || (l.css(at(n, u.labelStyle)), h.css(at({ color: "#333333" }, n, u.inputStyle)), it(f, fi({ position: "absolute", border: 0, boxShadow: "0 0 15px rgba(0,0,0,0.3)", width: "1px", height: "1px", padding: 0, textAlign: "center", fontSize: n.fontSize, fontFamily: n.fontFamily, top: "-9999em" }, u.inputStyle))), f.onfocus = () => {
1093
- o.showInput(t);
1094
- }, f.onblur = () => {
1095
- f === B().doc.activeElement && d(t), o.hideInput(t), o.setInputValue(t), f.blur();
1096
- };
1097
- let m = !1;
1098
- return f.onchange = () => {
1099
- m || (d(t), o.hideInput(t), f.blur());
1100
- }, f.onkeypress = (x) => {
1101
- x.keyCode === 13 && d(t);
1102
- }, f.onkeydown = (x) => {
1103
- m = !0, (x.key === "ArrowUp" || x.key === "ArrowDown" || x.key === "Tab") && d(t);
1104
- }, f.onkeyup = () => {
1105
- m = !1;
1106
- }, { dateBox: h, input: f, label: l };
1107
- }
1108
- getPosition() {
1109
- let t = this.chart, e = t.options.rangeSelector, i = e.verticalAlign === "top" ? t.plotTop - t.axisOffset[0] : 0;
1110
- return { buttonTop: i + e.buttonPosition.y, inputTop: i + e.inputPosition.y - 10 };
1111
- }
1112
- getYTDExtremes(t, e) {
1113
- let i = this.chart.time, s = i.toParts(t)[0];
1114
- return { max: t, min: Math.max(e, i.makeTime(s, 0)) };
1115
- }
1116
- createElements() {
1117
- let t = this.chart, e = t.renderer, i = t.container, s = t.options, o = s.rangeSelector, n = o.inputEnabled, c = Q(s.chart.style?.zIndex, 0) + 1;
1118
- o.enabled !== !1 && (this.group = e.g("range-selector-group").attr({ zIndex: 7 }).add(), this.div = Wt("div", void 0, { position: "relative", height: 0, zIndex: c }), this.buttonOptions.length && this.renderButtons(), i.parentNode && i.parentNode.insertBefore(this.div, i), n && this.createInputs());
1119
- }
1120
- createInputs() {
1121
- this.inputGroup = this.chart.renderer.g("input-group").add(this.group);
1122
- let t = this.drawInput("min");
1123
- this.minDateBox = t.dateBox, this.minLabel = t.label, this.minInput = t.input;
1124
- let e = this.drawInput("max");
1125
- this.maxDateBox = e.dateBox, this.maxLabel = e.label, this.maxInput = e.input;
1126
- }
1127
- render(t, e) {
1128
- if (this.options.enabled === !1) return;
1129
- let i = this.chart, s = i.options.rangeSelector;
1130
- if (s.inputEnabled) {
1131
- this.inputGroup || this.createInputs(), this.setInputValue("min", t), this.setInputValue("max", e), this.chart.styledMode || (this.maxLabel?.css(s.labelStyle), this.minLabel?.css(s.labelStyle));
1132
- let o = i.scroller && i.scroller.getUnionExtremes() || i.xAxis[0] || {};
1133
- if (st(o.dataMin) && st(o.dataMax)) {
1134
- let n = i.xAxis[0].minRange || 0;
1135
- this.setInputExtremes("min", o.dataMin, Math.min(o.dataMax, this.getInputValue("max")) - n), this.setInputExtremes("max", Math.max(o.dataMin, this.getInputValue("min")) + n, o.dataMax);
1136
- }
1137
- if (this.inputGroup) {
1138
- let n = 0;
1139
- [this.minLabel, this.minDateBox, this.maxLabel, this.maxDateBox].forEach((c) => {
1140
- if (c) {
1141
- let { width: u } = c.getBBox();
1142
- u && (c.attr({ x: n }), n += u + s.inputSpacing);
1143
- }
1144
- });
1145
- }
1146
- } else this.inputGroup && (this.inputGroup.destroy(), delete this.inputGroup);
1147
- !this.chart.styledMode && this.zoomText && this.zoomText.css(s.labelStyle), this.alignElements(), this.updateButtonStates();
1148
- }
1149
- renderButtons() {
1150
- var t;
1151
- let { chart: e, options: i } = this, s = Oe.lang, o = e.renderer, n = at(i.buttonTheme), c = n && n.states;
1152
- delete n.width, delete n.states, this.buttonGroup = o.g("range-selector-buttons").add(this.group);
1153
- let u = this.dropdown = Wt("select", void 0, { position: "absolute", padding: 0, border: 0, cursor: "pointer", opacity: 1e-4 }, this.div), g = e.userOptions.rangeSelector?.buttonTheme;
1154
- this.dropdownLabel = o.button("", 0, 0, () => {
1155
- }, at(n, { "stroke-width": Q(n["stroke-width"], 0), width: "auto", paddingLeft: Q(i.buttonTheme.paddingLeft, g?.padding, 8), paddingRight: Q(i.buttonTheme.paddingRight, g?.padding, 8) }), c && c.hover, c && c.select, c && c.disabled).hide().add(this.group), J(u, "touchstart", () => {
1156
- u.style.fontSize = "16px";
1157
- });
1158
- let p = B().isMS ? "mouseover" : "mouseenter", d = B().isMS ? "mouseout" : "mouseleave";
1159
- J(u, p, () => {
1160
- kt(this.dropdownLabel.element, p);
1161
- }), J(u, d, () => {
1162
- kt(this.dropdownLabel.element, d);
1163
- }), J(u, "change", () => {
1164
- kt(this.buttons[u.selectedIndex - 1].element, "click");
1165
- }), this.zoomText = o.label(s.rangeSelectorZoom || "", 0).attr({ padding: i.buttonTheme.padding, height: i.buttonTheme.height, paddingLeft: 0, paddingRight: 0 }).add(this.buttonGroup), this.chart.styledMode || (this.zoomText.css(i.labelStyle), (t = i.buttonTheme)["stroke-width"] ?? (t["stroke-width"] = 0)), Wt("option", { textContent: this.zoomText.textStr, disabled: !0 }, void 0, u), this.createButtons();
1166
- }
1167
- createButtons() {
1168
- let { options: t } = this, e = at(t.buttonTheme), i = e && e.states, s = e.width || 28;
1169
- delete e.width, delete e.states, this.buttonOptions.forEach((o, n) => {
1170
- this.createButton(o, n, s, i);
1171
- });
1172
- }
1173
- createButton(t, e, i, s) {
1174
- let { dropdown: o, buttons: n, chart: c, options: u } = this, g = c.renderer, p = at(u.buttonTheme);
1175
- o?.add(Wt("option", { textContent: t.title || t.text }), e + 2), n[e] = g.button(t.text ?? "", 0, 0, (d) => {
1176
- let r, l = t.events && t.events.click;
1177
- l && (r = l.call(t, d)), r !== !1 && this.clickButton(e), this.isActive = !0;
1178
- }, p, s && s.hover, s && s.select, s && s.disabled).attr({ "text-align": "center", width: i }).add(this.buttonGroup), t.title && n[e].attr("title", t.title);
1179
- }
1180
- alignElements() {
1181
- let { buttonGroup: t, buttons: e, chart: i, group: s, inputGroup: o, options: n, zoomText: c } = this, u = i.options, g = u.exporting && u.exporting.enabled !== !1 && u.navigation && u.navigation.buttonOptions, { buttonPosition: p, inputPosition: d, verticalAlign: r } = n, l = (f, m, x) => g && this.titleCollision(i) && r === "top" && x && m.y - f.getBBox().height - 12 < (g.y || 0) + (g.height || 0) + i.spacing[0] ? -40 : 0, h = i.plotLeft;
1182
- if (s && p && d) {
1183
- let f = p.x - i.spacing[3];
1184
- if (t) {
1185
- if (this.positionButtons(), !this.initialButtonGroupWidth) {
1186
- let E = 0;
1187
- c && (E += c.getBBox().width + 5), e.forEach((w, O) => {
1188
- E += w.width || 0, O !== e.length - 1 && (E += n.buttonSpacing);
1189
- }), this.initialButtonGroupWidth = E;
1190
- }
1191
- h -= i.spacing[3];
1192
- let y = l(t, p, p.align === "right" || d.align === "right");
1193
- this.alignButtonGroup(y), this.buttonGroup?.translateY && this.dropdownLabel.attr({ y: this.buttonGroup.translateY }), s.placed = t.placed = i.hasLoaded;
1194
- }
1195
- let m = 0;
1196
- n.inputEnabled && o && (m = l(o, d, p.align === "right" || d.align === "right"), d.align === "left" ? f = h : d.align === "right" && (f = -Math.max(i.axisOffset[1], -m)), o.align({ y: d.y, width: o.getBBox().width, align: d.align, x: d.x + f - 2 }, !0, i.spacingBox), o.placed = i.hasLoaded), this.handleCollision(m), s.align({ verticalAlign: r }, !0, i.spacingBox);
1197
- let x = s.alignAttr.translateY, b = s.getBBox().height + 20, S = 0;
1198
- if (r === "bottom") {
1199
- let y = i.legend && i.legend.options;
1200
- S = x - (b = b + (y && y.verticalAlign === "bottom" && y.enabled && !y.floating ? i.legend.legendHeight + Q(y.margin, 10) : 0) - 20) - (n.floating ? 0 : n.y) - (i.titleOffset ? i.titleOffset[2] : 0) - 10;
1201
- }
1202
- r === "top" ? (n.floating && (S = 0), i.titleOffset && i.titleOffset[0] && (S = i.titleOffset[0]), S += i.margin[0] - i.spacing[0] || 0) : r === "middle" && (d.y === p.y ? S = x : (d.y || p.y) && (d.y < 0 || p.y < 0 ? S -= Math.min(d.y, p.y) : S = x - b)), s.translate(n.x, n.y + Math.floor(S));
1203
- let { minInput: v, maxInput: M, dropdown: A } = this;
1204
- n.inputEnabled && v && M && (v.style.marginTop = s.translateY + "px", M.style.marginTop = s.translateY + "px"), A && (A.style.marginTop = s.translateY + "px");
1205
- }
1206
- }
1207
- redrawElements() {
1208
- let t = this.chart, { inputBoxHeight: e, inputBoxBorderColor: i } = this.options;
1209
- if (this.maxDateBox?.attr({ height: e }), this.minDateBox?.attr({ height: e }), t.styledMode || (this.maxDateBox?.attr({ stroke: i }), this.minDateBox?.attr({ stroke: i })), this.isDirty) {
1210
- this.isDirty = !1, this.isCollapsed = void 0;
1211
- let s = this.options.buttons ?? [], o = Math.min(s.length, this.buttonOptions.length), { dropdown: n, options: c } = this, u = at(c.buttonTheme), g = u && u.states, p = u.width || 28;
1212
- if (s.length < this.buttonOptions.length) for (let d = this.buttonOptions.length - 1; d >= s.length; d--)
1213
- this.buttons.pop()?.destroy(), this.dropdown?.options.remove(d + 1);
1214
- for (let d = o - 1; d >= 0; d--) if (Object.keys(Io(s[d], this.buttonOptions[d])).length !== 0) {
1215
- let r = s[d];
1216
- this.buttons[d].destroy(), n?.options.remove(d + 1), this.createButton(r, d, p, g), this.computeButtonRange(r);
1217
- }
1218
- if (s.length > this.buttonOptions.length) for (let d = this.buttonOptions.length; d < s.length; d++) this.createButton(s[d], d, p, g), this.computeButtonRange(s[d]);
1219
- this.buttonOptions = this.options.buttons ?? [], st(this.options.selected) && this.buttons.length && this.clickButton(this.options.selected, !1);
1220
- }
1221
- }
1222
- alignButtonGroup(t, e) {
1223
- let { chart: i, options: s, buttonGroup: o, dropdown: n, dropdownLabel: c } = this, { buttonPosition: u } = s, g = i.plotLeft - i.spacing[3], p = u.x - i.spacing[3], d = i.plotLeft;
1224
- u.align === "right" ? (p += t - g, this.hasVisibleDropdown && (d = i.chartWidth + t - this.maxButtonWidth() - 20)) : u.align === "center" && (p -= g / 2, this.hasVisibleDropdown && (d = i.chartWidth / 2 - this.maxButtonWidth())), n && it(n, { left: d + "px", top: o?.translateY + "px" }), c?.attr({ x: d }), o && o.align({ y: u.y, width: Q(e, this.initialButtonGroupWidth), align: u.align, x: p }, !0, i.spacingBox);
1225
- }
1226
- positionButtons() {
1227
- let { buttons: t, chart: e, options: i, zoomText: s } = this, o = e.hasLoaded ? "animate" : "attr", { buttonPosition: n } = i, c = e.plotLeft, u = c;
1228
- s && s.visibility !== "hidden" && (s[o]({ x: Q(c + n.x, c) }), u += n.x + s.getBBox().width + 5);
1229
- for (let g = 0, p = this.buttonOptions.length; g < p; ++g) t[g].visibility !== "hidden" ? (t[g][o]({ x: u }), u += (t[g].width || 0) + i.buttonSpacing) : t[g][o]({ x: c });
1230
- }
1231
- handleCollision(t) {
1232
- let { chart: e, buttonGroup: i, inputGroup: s, initialButtonGroupWidth: o } = this, { buttonPosition: n, dropdown: c, inputPosition: u } = this.options, g = () => {
1233
- s && i && s.attr({ translateX: s.alignAttr.translateX + (e.axisOffset[1] >= -t ? 0 : -t), translateY: s.alignAttr.translateY + i.getBBox().height + 10 });
1234
- };
1235
- s && i ? u.align === n.align ? (g(), o > e.plotWidth + t - 20 ? this.collapseButtons() : this.expandButtons()) : o - t + s.getBBox().width > e.plotWidth ? c === "responsive" ? this.collapseButtons() : g() : this.expandButtons() : i && c === "responsive" && (o > e.plotWidth ? this.collapseButtons() : this.expandButtons()), i && (c === "always" && this.collapseButtons(), c === "never" && this.expandButtons()), this.alignButtonGroup(t);
1236
- }
1237
- collapseButtons() {
1238
- let { buttons: t, zoomText: e } = this;
1239
- this.isCollapsed !== !0 && (this.isCollapsed = !0, e.hide(), t.forEach((i) => void i.hide()), this.showDropdown());
1240
- }
1241
- expandButtons() {
1242
- let { buttons: t, zoomText: e } = this;
1243
- this.isCollapsed !== !1 && (this.isCollapsed = !1, this.hideDropdown(), e.show(), t.forEach((i) => void i.show()), this.positionButtons());
1244
- }
1245
- showDropdown() {
1246
- let { buttonGroup: t, dropdownLabel: e, dropdown: i } = this;
1247
- t && i && (e.show(), it(i, { visibility: "inherit" }), this.hasVisibleDropdown = !0);
1248
- }
1249
- hideDropdown() {
1250
- let { dropdown: t } = this;
1251
- t && (this.dropdownLabel.hide(), it(t, { visibility: "hidden", width: "1px", height: "1px" }), this.hasVisibleDropdown = !1);
1252
- }
1253
- getHeight() {
1254
- let t = this.options, e = this.group, i = t.inputPosition, s = t.buttonPosition, o = t.y, n = s.y, c = i.y, u = 0;
1255
- if (t.height) return t.height;
1256
- this.alignElements(), u = e ? e.getBBox(!0).height + 13 + o : 0;
1257
- let g = Math.min(c, n);
1258
- return (c < 0 && n < 0 || c > 0 && n > 0) && (u += Math.abs(g)), u;
1259
- }
1260
- titleCollision(t) {
1261
- return !(t.options.title.text || t.options.subtitle.text);
1262
- }
1263
- update(t, e = !0) {
1264
- let i = this.chart;
1265
- if (at(!0, this.options, t), this.options.selected && this.options.selected >= this.options.buttons.length && (this.options.selected = void 0, i.options.rangeSelector.selected = void 0), st(t.enabled)) return this.destroy(), this.init(i);
1266
- this.isDirty = !!t.buttons, e && this.render();
1267
- }
1268
- destroy() {
1269
- let t = this, e = t.minInput, i = t.maxInput;
1270
- t.eventsToUnbind && (t.eventsToUnbind.forEach((s) => s()), t.eventsToUnbind = void 0), Go(t.buttons), e && (e.onfocus = e.onblur = e.onchange = null), i && (i.onfocus = i.onblur = i.onchange = null), Lo(t, function(s, o) {
1271
- s && o !== "chart" && (s instanceof ci() ? s.destroy() : s instanceof window.HTMLElement && zo(s), delete t[o]), s !== Xt.prototype[o] && (t[o] = null);
1272
- }, this), this.buttons = [];
1273
- }
1274
- }
1275
- fi(Xt.prototype, { inputTypeFormats: { "datetime-local": "%Y-%m-%dT%H:%M:%S", date: "%Y-%m-%d", time: "%H:%M:%S" } });
1276
- var Xo = G(960), xi = G.n(Xo);
1277
- let { format: Ho } = Ee(), { getOptions: bi } = B(), { setFixedRange: Yo } = Je, { addEvent: ft, clamp: vi, crisp: yi, defined: Ce, extend: No, find: Fo, isNumber: nt, isString: Uo, merge: wt, pick: ot, splat: Mi } = B();
1278
- function De(a, t, e) {
1279
- return a === "xAxis" ? { minPadding: 0, maxPadding: 0, overscroll: 0, ordinal: !0 } : a === "yAxis" ? { labels: { y: -2 }, opposite: e.opposite ?? t.opposite ?? !0, showLastLabel: !!(t.categories || t.type === "category"), title: { text: void 0 } } : {};
1280
- }
1281
- function Ai(a, t) {
1282
- if (a === "xAxis") {
1283
- let e = ot(t.navigator?.enabled, be.enabled, !0), i = { type: "datetime", categories: void 0 };
1284
- return e && (i.startOnTick = !1, i.endOnTick = !1), i;
1285
- }
1286
- return {};
1287
- }
1288
- class Pe extends xi() {
1289
- init(t, e) {
1290
- let i = bi(), s = t.xAxis, o = t.yAxis, n = ot(t.navigator?.enabled, be.enabled, !0);
1291
- t.xAxis = t.yAxis = void 0;
1292
- let c = wt({ chart: { panning: { enabled: !0, type: "x" }, zooming: { pinchType: "x", mouseWheel: { type: "x" } } }, navigator: { enabled: n }, scrollbar: { enabled: ot(Ut.enabled, !0) }, rangeSelector: { enabled: ot(Se.rangeSelector.enabled, !0) }, title: { text: null }, tooltip: { split: ot(i.tooltip?.split, !0), crosshairs: !0 }, legend: { enabled: !1 } }, t, { isStock: !0 });
1293
- t.xAxis = s, t.yAxis = o, c.xAxis = Mi(t.xAxis || {}).map((u) => wt(De("xAxis", u, i.xAxis), u, Ai("xAxis", t))), c.yAxis = Mi(t.yAxis || {}).map((u) => wt(De("yAxis", u, i.yAxis), u)), super.init(c, e);
1294
- }
1295
- createAxis(t, e) {
1296
- return e.axis = wt(De(t, e.axis, bi()[t]), e.axis, Ai(t, this.userOptions)), super.createAxis(t, e);
1297
- }
1298
- }
1299
- ft(xi(), "update", function(a) {
1300
- let t = a.options;
1301
- "scrollbar" in t && this.navigator && (wt(!0, this.options.scrollbar, t.scrollbar), this.navigator.update({ enabled: !!this.navigator.navigatorEnabled }), delete t.scrollbar);
1302
- }), function(a) {
1303
- function t(g) {
1304
- if (!(this.crosshair?.label?.enabled && this.cross && nt(this.min) && nt(this.max))) return;
1305
- let p = this.chart, d = this.logarithmic, r = this.crosshair.label, l = this.horiz, h = this.opposite, f = this.left, m = this.top, x = this.width, b = this.options.tickPosition === "inside", S = this.crosshair.snap !== !1, v = g.e || this.cross?.e, M = g.point, A = this.crossLabel, y, E, w = r.format, O = "", T, k = 0, C = this.min, z = this.max;
1306
- d && (C = d.lin2log(this.min), z = d.lin2log(this.max));
1307
- let I = l ? "center" : h ? this.labelAlign === "right" ? "right" : "left" : this.labelAlign === "left" ? "left" : "center";
1308
- !A && (A = this.crossLabel = p.renderer.label("", 0, void 0, r.shape || "callout").addClass("highcharts-crosshair-label highcharts-color-" + (M?.series ? M.series.colorIndex : this.series[0] && this.series[0].colorIndex)).attr({ align: r.align || I, padding: ot(r.padding, 8), r: ot(r.borderRadius, 3), zIndex: 2 }).add(this.labelGroup), p.styledMode || A.attr({ fill: r.backgroundColor || M?.series?.color || "#666666", stroke: r.borderColor || "", "stroke-width": r.borderWidth || 0 }).css(No({ color: "#ffffff", fontWeight: "normal", fontSize: "0.7em", textAlign: "center" }, r.style || {}))), l ? (y = S ? (M.plotX || 0) + f : v.chartX, E = m + (h ? 0 : this.height)) : (y = f + this.offset + (h ? x : 0), E = S ? (M.plotY || 0) + m : v.chartY), w || r.formatter || (this.dateTime && (O = "%b %d, %Y"), w = "{value" + (O ? ":" + O : "") + "}");
1309
- let D = S ? this.isXAxis ? M.x : M.y : this.toValue(l ? v.chartX : v.chartY), W = M?.series ? M.series.isPointInside(M) : nt(D) && D > C && D < z, L = "";
1310
- w ? L = Ho(w, { value: D }, p) : r.formatter && nt(D) && (L = r.formatter.call(this, D)), A.attr({ text: L, x: y, y: E, visibility: W ? "inherit" : "hidden" });
1311
- let R = A.getBBox();
1312
- !nt(A.x) || l || h || (y = A.x - R.width / 2), nt(A.y) && (l ? (b && !h || !b && h) && (E = A.y - R.height) : E = A.y - R.height / 2), T = l ? { left: f, right: f + this.width } : { left: this.labelAlign === "left" ? f : 0, right: this.labelAlign === "right" ? f + this.width : p.chartWidth };
1313
- let X = A.translateX || 0;
1314
- X < T.left && (k = T.left - X), X + R.width >= T.right && (k = -(X + R.width - T.right)), A.attr({ x: Math.max(0, y + k), y: Math.max(0, E), anchorX: l ? y : this.opposite ? 0 : p.chartWidth, anchorY: l ? this.opposite ? p.chartHeight : 0 : E + R.height / 2 });
1315
- }
1316
- function e() {
1317
- this.crossLabel && (this.crossLabel = this.crossLabel.hide());
1318
- }
1319
- function i(g) {
1320
- let p = this.chart, d = this.options, r = p._labelPanes = p._labelPanes || {}, l = d.labels;
1321
- if (p.options.isStock && this.coll === "yAxis") {
1322
- let h = d.top + "," + d.height;
1323
- !r[h] && l.enabled && (l.distance === 15 && this.side === 1 && (l.distance = 0), l.align === void 0 && (l.align = "right"), r[h] = this, g.align = "right", g.preventDefault());
1324
- }
1325
- }
1326
- function s() {
1327
- let g = this.chart, p = this.options && this.options.top + "," + this.options.height;
1328
- p && g._labelPanes && g._labelPanes[p] === this && delete g._labelPanes[p];
1329
- }
1330
- function o(g) {
1331
- let p = this, d = p.isLinked && !p.series && p.linkedParent ? p.linkedParent.series : p.series, r = p.chart, l = r.renderer, h = p.left, f = p.top, m = [], x = g.translatedValue, b = g.value, S = g.force, v, M, A, y, E = [], w, O;
1332
- if (r.options.isStock && g.acrossPanes !== !1 && p.coll === "xAxis" || p.coll === "yAxis") {
1333
- for (let T of (g.preventDefault(), E = ((k) => {
1334
- let C = k === "xAxis" ? "yAxis" : "xAxis", z = p.options[C];
1335
- return nt(z) ? [r[C][z]] : Uo(z) ? [r.get(z)] : d.map((I) => I[C]);
1336
- })(p.coll), p.isXAxis ? r.yAxis : r.xAxis)) if (!T.options.isInternal) {
1337
- let k = T.isXAxis ? "yAxis" : "xAxis";
1338
- p === (Ce(T.options[k]) ? r[k][T.options[k]] : r[k][0]) && E.push(T);
1339
- }
1340
- for (let T of (w = E.length ? [] : [p.isXAxis ? r.yAxis[0] : r.xAxis[0]], E)) w.indexOf(T) !== -1 || Fo(w, (k) => k.pos === T.pos && k.len === T.len) || w.push(T);
1341
- if (nt(O = ot(x, p.translate(b || 0, void 0, void 0, g.old)))) if (p.horiz) for (let T of w) {
1342
- let k;
1343
- y = (M = T.pos) + T.len, v = A = Math.round(O + p.transB), S !== "pass" && (v < h || v > h + p.width) && (S ? v = A = vi(v, h, h + p.width) : k = !0), k || m.push(["M", v, M], ["L", A, y]);
1344
- }
1345
- else for (let T of w) {
1346
- let k;
1347
- A = (v = T.pos) + T.len, M = y = f + p.height - O, S !== "pass" && (M < f || M > f + p.height) && (S ? M = y = vi(M, f, f + p.height) : k = !0), k || m.push(["M", v, M], ["L", A, y]);
1348
- }
1349
- g.path = m.length > 0 ? l.crispPolyLine(m, g.lineWidth || 1) : void 0;
1350
- }
1351
- }
1352
- function n(g) {
1353
- if (this.chart.options.isStock) {
1354
- let p;
1355
- this.is("column") || this.is("columnrange") ? p = { borderWidth: 0, shadow: !1 } : this.is("scatter") || this.is("sma") || (p = { marker: { enabled: !1, radius: 2 } }), p && (g.plotOptions[this.type] = wt(g.plotOptions[this.type], p));
1356
- }
1357
- }
1358
- function c() {
1359
- let g = this.chart, p = this.options.dataGrouping;
1360
- return this.allowDG !== !1 && p && ot(p.enabled, g.options.isStock);
1361
- }
1362
- function u(g, p) {
1363
- for (let d = 0; d < g.length; d += 2) {
1364
- let r = g[d], l = g[d + 1];
1365
- Ce(r[1]) && r[1] === l[1] && (r[1] = l[1] = yi(r[1], p)), Ce(r[2]) && r[2] === l[2] && (r[2] = l[2] = yi(r[2], p));
1366
- }
1367
- return g;
1368
- }
1369
- a.compose = function(g, p, d, r) {
1370
- let l = d.prototype;
1371
- l.forceCropping || (ft(p, "afterDrawCrosshair", t), ft(p, "afterHideCrosshair", e), ft(p, "autoLabelAlign", i), ft(p, "destroy", s), ft(p, "getPlotLinePath", o), g.prototype.setFixedRange = Yo, l.forceCropping = c, ft(d, "setOptions", n), r.prototype.crispPolyLine = u);
1372
- }, a.stockChart = function(g, p, d) {
1373
- return new a(g, p, d);
1374
- };
1375
- }(Pe || (Pe = {}));
1376
- let ki = Pe, { column: { prototype: { pointClass: Vo } } } = _().seriesTypes, { column: wi } = _().seriesTypes, { crisp: Si, extend: Ti, merge: _o } = B(), { defaultOptions: jo } = B();
1377
- class Re extends wi {
1378
- extendStem(t, e, i) {
1379
- let s = t[0], o = t[1];
1380
- typeof s[2] == "number" && (s[2] = Math.max(i + e, s[2])), typeof o[2] == "number" && (o[2] = Math.min(i - e, o[2]));
1381
- }
1382
- getPointPath(t, e) {
1383
- let i = e.strokeWidth(), s = t.series, o = Si(t.plotX || 0, i), n = Math.round(t.shapeArgs.width / 2), c = [["M", o, Math.round(t.yBottom)], ["L", o, Math.round(t.plotHigh)]];
1384
- if (t.close !== null) {
1385
- let u = Si(t.plotClose, i);
1386
- c.push(["M", o, u], ["L", o + n, u]), s.extendStem(c, i / 2, u);
1387
- }
1388
- return c;
1389
- }
1390
- drawSinglePoint(t) {
1391
- let e = t.series, i = e.chart, s, o = t.graphic;
1392
- t.plotY !== void 0 && (o || (t.graphic = o = i.renderer.path().add(e.group)), i.styledMode || o.attr(e.pointAttribs(t, t.selected && "select")), s = e.getPointPath(t, o), o[o ? "animate" : "attr"]({ d: s }).addClass(t.getClassName(), !0));
1393
- }
1394
- drawPoints() {
1395
- this.points.forEach(this.drawSinglePoint);
1396
- }
1397
- init() {
1398
- super.init.apply(this, arguments), this.options.stacking = void 0;
1399
- }
1400
- pointAttribs(t, e) {
1401
- let i = super.pointAttribs.call(this, t, e);
1402
- return delete i.fill, i;
1403
- }
1404
- toYData(t) {
1405
- return [t.high, t.low, t.close];
1406
- }
1407
- translate() {
1408
- let t = this, e = t.yAxis, i = this.pointArrayMap && this.pointArrayMap.slice() || [], s = i.map((o) => `plot${o.charAt(0).toUpperCase() + o.slice(1)}`);
1409
- s.push("yBottom"), i.push("low"), super.translate.apply(t), t.points.forEach(function(o) {
1410
- i.forEach(function(n, c) {
1411
- let u = o[n];
1412
- u !== null && (t.dataModify && (u = t.dataModify.modifyValue(u)), o[s[c]] = e.toPixels(u, !0));
1413
- }), o.tooltipPos[1] = o.plotHigh + e.pos - t.chart.plotTop;
1414
- });
1415
- }
1416
- }
1417
- Re.defaultOptions = _o(wi.defaultOptions, { lineWidth: 1, tooltip: { pointFormat: '<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>{series.chart.options.lang.stockHigh}: {point.high}<br/>{series.chart.options.lang.stockLow}: {point.low}<br/>{series.chart.options.lang.stockClose}: {point.close}<br/>' }, threshold: null, states: { hover: { lineWidth: 3 } }, stickyTracking: !0 }), Ti(Re.prototype, { pointClass: class extends Vo {
1418
- }, animate: null, directTouch: !1, keysAffectYAxis: ["low", "high"], pointArrayMap: ["high", "low", "close"], pointAttrToOptions: { stroke: "color", "stroke-width": "lineWidth" }, pointValKey: "close" }), Ti(jo.lang, { stockOpen: "Open", stockHigh: "High", stockLow: "Low", stockClose: "Close" }), _().registerSeriesType("hlc", Re);
1419
- let { seriesTypes: { hlc: qo } } = _();
1420
- class Zo extends qo.prototype.pointClass {
1421
- getClassName() {
1422
- return super.getClassName.call(this) + (this.open < this.close ? " highcharts-point-up" : " highcharts-point-down");
1423
- }
1424
- resolveUpColor() {
1425
- this.open < this.close && !this.options.color && this.series.options.upColor && (this.color = this.series.options.upColor);
1426
- }
1427
- resolveColor() {
1428
- super.resolveColor(), this.series.is("heikinashi") || this.resolveUpColor();
1429
- }
1430
- getZone() {
1431
- let t = super.getZone();
1432
- return this.resolveUpColor(), t;
1433
- }
1434
- applyOptions() {
1435
- return super.applyOptions.apply(this, arguments), this.resolveColor && this.resolveColor(), this;
1436
- }
1437
- }
1438
- let { composed: Ko } = B(), { hlc: Ei } = _().seriesTypes, { addEvent: Oi, crisp: Bi, extend: Ci, merge: $o, pushUnique: Jo } = B();
1439
- function Qo(a) {
1440
- let t = a.options, e = t.dataGrouping;
1441
- e && t.useOhlcData && t.id !== "highcharts-navigator-series" && (e.approximation = "ohlc");
1442
- }
1443
- function tr(a) {
1444
- let t = a.options;
1445
- t.useOhlcData && t.id !== "highcharts-navigator-series" && Ci(this, { pointValKey: mt.prototype.pointValKey, pointArrayMap: mt.prototype.pointArrayMap, toYData: mt.prototype.toYData });
1446
- }
1447
- class mt extends Ei {
1448
- static compose(t, ...e) {
1449
- Jo(Ko, "OHLCSeries") && (Oi(t, "afterSetOptions", Qo), Oi(t, "init", tr));
1450
- }
1451
- getPointPath(t, e) {
1452
- let i = super.getPointPath(t, e), s = e.strokeWidth(), o = Bi(t.plotX || 0, s), n = Math.round(t.shapeArgs.width / 2);
1453
- if (t.open !== null) {
1454
- let c = Bi(t.plotOpen, s);
1455
- i.push(["M", o, c], ["L", o - n, c]), super.extendStem(i, s / 2, c);
1456
- }
1457
- return i;
1458
- }
1459
- pointAttribs(t, e) {
1460
- let i = super.pointAttribs.call(this, t, e), s = this.options;
1461
- return delete i.fill, !t.options.color && s.upColor && t.open < t.close && (i.stroke = s.upColor), i;
1462
- }
1463
- toYData(t) {
1464
- return [t.open, t.high, t.low, t.close];
1465
- }
1466
- }
1467
- mt.defaultOptions = $o(Ei.defaultOptions, { tooltip: { pointFormat: '<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>{series.chart.options.lang.stockOpen}: {point.open}<br/>{series.chart.options.lang.stockHigh}: {point.high}<br/>{series.chart.options.lang.stockLow}: {point.low}<br/>{series.chart.options.lang.stockClose}: {point.close}<br/>' } }), Ci(mt.prototype, { pointClass: Zo, pointArrayMap: ["open", "high", "low", "close"] }), _().registerSeriesType("ohlc", mt);
1468
- let { column: er, ohlc: Ge } = _().seriesTypes, { crisp: Ie, merge: ir } = B();
1469
- class Di extends Ge {
1470
- pointAttribs(t, e) {
1471
- let i = er.prototype.pointAttribs.call(this, t, e), s = this.options, o = t.open < t.close, n = s.lineColor || this.color, c = t.color || this.color;
1472
- if (i["stroke-width"] = s.lineWidth, i.fill = t.options.color || o && s.upColor || c, i.stroke = t.options.lineColor || o && s.upLineColor || n, e) {
1473
- let u = s.states[e];
1474
- i.fill = u.color || i.fill, i.stroke = u.lineColor || i.stroke, i["stroke-width"] = u.lineWidth || i["stroke-width"];
1475
- }
1476
- return i;
1477
- }
1478
- drawPoints() {
1479
- let t = this.points, e = this.chart, i = this.yAxis.reversed;
1480
- for (let s of t) {
1481
- let o = s.graphic, n, c, u, g, p, d, r, l, h, f = !o;
1482
- if (s.plotY !== void 0) {
1483
- o || (s.graphic = o = e.renderer.path().add(this.group)), this.chart.styledMode || o.attr(this.pointAttribs(s, s.selected && "select")).shadow(this.options.shadow);
1484
- let m = o.strokeWidth();
1485
- r = Ie(s.plotX || 0, m), u = Math.min(n = s.plotOpen, c = s.plotClose), g = Math.max(n, c), h = Math.round(s.shapeArgs.width / 2), p = i ? g !== s.yBottom : Math.round(u) !== Math.round(s.plotHigh || 0), d = i ? Math.round(u) !== Math.round(s.plotHigh || 0) : g !== s.yBottom, u = Ie(u, m), g = Ie(g, m), (l = []).push(["M", r - h, g], ["L", r - h, u], ["L", r + h, u], ["L", r + h, g], ["Z"], ["M", r, u], ["L", r, p ? Math.round(i ? s.yBottom : s.plotHigh) : u], ["M", r, g], ["L", r, d ? Math.round(i ? s.plotHigh : s.yBottom) : g]), o[f ? "attr" : "animate"]({ d: l }).addClass(s.getClassName(), !0);
1486
- }
1487
- }
1488
- }
1489
- }
1490
- Di.defaultOptions = ir(Ge.defaultOptions, { tooltip: Ge.defaultOptions.tooltip }, { states: { hover: { lineWidth: 2 } }, threshold: null, lineColor: "#000000", lineWidth: 1, upColor: "#ffffff", stickyTracking: !0 }), _().registerSeriesType("candlestick", Di);
1491
- let { column: { prototype: { pointClass: sr } } } = _().seriesTypes, { isNumber: or } = B(), rr = class extends sr {
1492
- constructor() {
1493
- super(...arguments), this.ttBelow = !1;
1494
- }
1495
- isValid() {
1496
- return or(this.y) || this.y === void 0;
1497
- }
1498
- hasNewShapeType() {
1499
- let a = this.options.shape || this.series.options.shape;
1500
- return this.graphic && a && a !== this.graphic.symbolKey;
1501
- }
1502
- };
1503
- (function(a) {
1504
- let t = [];
1505
- function e(s, o, n, c, u) {
1506
- let g = u && u.anchorX || s, p = u && u.anchorY || o, d = this.circle(g - 1, p - 1, 2, 2);
1507
- return d.push(["M", g, p], ["L", s, o + c], ["L", s, o], ["L", s + n, o], ["L", s + n, o + c], ["L", s, o + c], ["Z"]), d;
1508
- }
1509
- function i(s, o) {
1510
- s[o + "pin"] = function(n, c, u, g, p) {
1511
- let d, r = p && p.anchorX, l = p && p.anchorY;
1512
- if (o === "circle" && g > u && (n -= Math.round((g - u) / 2), u = g), d = s[o](n, c, u, g, p), r && l) {
1513
- let h = r;
1514
- if (o === "circle") h = n + u / 2;
1515
- else {
1516
- let m = d[0], x = d[1];
1517
- m[0] === "M" && x[0] === "L" && (h = (m[1] + x[1]) / 2);
1518
- }
1519
- let f = c > l ? c : c + g;
1520
- d.push(["M", h, f], ["L", r, l]), d = d.concat(s.circle(r - 1, l - 1, 2, 2));
1521
- }
1522
- return d;
1523
- };
1524
- }
1525
- a.compose = function(s) {
1526
- if (t.indexOf(s) === -1) {
1527
- t.push(s);
1528
- let n = s.prototype.symbols;
1529
- n.flag = e, i(n, "circle"), i(n, "square");
1530
- }
1531
- let o = Ke().getRendererType();
1532
- t.indexOf(o) && t.push(o);
1533
- };
1534
- })(he || (he = {}));
1535
- let ar = he;
1536
- var nr = G(448), lr = G.n(nr);
1537
- let { composed: hr } = B(), { prototype: dr } = lr(), { prototype: pr } = fs(), { defined: ze, pushUnique: ur, stableSort: cr } = B();
1538
- (function(a) {
1539
- function t(i) {
1540
- return pr.getPlotBox.call(this.options.onSeries && this.chart.get(this.options.onSeries) || this, i);
1541
- }
1542
- function e() {
1543
- dr.translate.apply(this);
1544
- let i = this, s = i.options, o = i.chart, n = i.points, c = s.onSeries, u = c && o.get(c), g = u && u.options.step, p = u && u.points, d = o.inverted, r = i.xAxis, l = i.yAxis, h = n.length - 1, f, m, x = s.onKey || "y", b = p && p.length, S = 0, v, M, A, y, E;
1545
- if (u && u.visible && b) {
1546
- for (S = (u.pointXOffset || 0) + (u.barW || 0) / 2, y = u.currentDataGrouping, M = p[b - 1].x + (y ? y.totalRange : 0), cr(n, (w, O) => w.x - O.x), x = "plot" + x[0].toUpperCase() + x.substr(1); b-- && n[h]; ) if (v = p[b], (f = n[h]).y = v.y, v.x <= f.x && v[x] !== void 0) {
1547
- if (f.x <= M && (f.plotY = v[x], v.x < f.x && !g && (A = p[b + 1])) && A[x] !== void 0) if (ze(f.plotX) && u.is("spline")) {
1548
- let w = [v.plotX || 0, v.plotY || 0], O = [A.plotX || 0, A.plotY || 0], T = v.controlPoints?.high || w, k = A.controlPoints?.low || O, C = (W, L) => Math.pow(1 - W, 3) * w[L] + 3 * (1 - W) * (1 - W) * W * T[L] + 3 * (1 - W) * W * W * k[L] + W * W * W * O[L], z = 0, I = 1, D;
1549
- for (let W = 0; W < 100; W++) {
1550
- let L = (z + I) / 2, R = C(L, 0);
1551
- if (R === null) break;
1552
- if (0.25 > Math.abs(R - f.plotX)) {
1553
- D = L;
1554
- break;
1555
- }
1556
- R < f.plotX ? z = L : I = L;
1557
- }
1558
- ze(D) && (f.plotY = C(D, 1), f.y = l.toValue(f.plotY, !0));
1559
- } else E = (f.x - v.x) / (A.x - v.x), f.plotY += E * (A[x] - v[x]), f.y += E * (A.y - v.y);
1560
- if (h--, b++, h < 0) break;
1561
- }
1562
- }
1563
- n.forEach((w, O) => {
1564
- let T;
1565
- w.plotX += S, (w.plotY === void 0 || d) && (w.plotX >= 0 && w.plotX <= r.len ? d ? (w.plotY = r.translate(w.x, 0, 1, 0, 1), w.plotX = ze(w.y) ? l.translate(w.y, 0, 0, 0, 1) : 0) : w.plotY = (r.opposite ? 0 : i.yAxis.len) + r.offset : w.shapeArgs = {}), (m = n[O - 1]) && m.plotX === w.plotX && (m.stackIndex === void 0 && (m.stackIndex = 0), T = m.stackIndex + 1), w.stackIndex = T;
1566
- }), this.onSeries = u;
1567
- }
1568
- a.compose = function(i) {
1569
- if (ur(hr, "OnSeries")) {
1570
- let s = i.prototype;
1571
- s.getPlotBox = t, s.translate = e;
1572
- }
1573
- return i;
1574
- }, a.getPlotBox = t, a.translate = e;
1575
- })(de || (de = {}));
1576
- let gr = de, { noop: fr } = B(), { distribute: mr } = B(), { series: Pi, seriesTypes: { column: Ri } } = _(), { addEvent: xr, defined: br, extend: vr, isNumber: yr, merge: Gi, objectEach: Mr, wrap: Ar } = B();
1577
- class St extends Ri {
1578
- animate(t) {
1579
- t && this.setClip();
1580
- }
1581
- drawPoints() {
1582
- let t, e, i, s, o, n, c, u, g, p, d, r = this.points, l = this.chart, h = l.renderer, f = l.inverted, m = this.options, x = m.y, b = this.yAxis, S = {}, v = [], M = yr(m.borderRadius) ? m.borderRadius : 0;
1583
- for (s = r.length; s--; ) o = r[s], p = (f ? o.plotY : o.plotX) > this.xAxis.len, t = o.plotX, c = o.stackIndex, i = o.options.shape || m.shape, (e = o.plotY) !== void 0 && (e = o.plotY + x - (c !== void 0 && c * m.stackDistance)), o.anchorX = c ? void 0 : o.plotX, u = c ? void 0 : o.plotY, d = i !== "flag", n = o.graphic, e !== void 0 && t >= 0 && !p ? (n && o.hasNewShapeType() && (n = n.destroy()), n || (n = o.graphic = h.label("", 0, void 0, i, void 0, void 0, m.useHTML).addClass("highcharts-point").add(this.markerGroup), o.graphic.div && (o.graphic.div.point = o), n.isNew = !0), n.attr({ align: d ? "center" : "left", width: m.width, height: m.height, "text-align": m.textAlign, r: M }), l.styledMode || n.attr(this.pointAttribs(o)).css(Gi(m.style, o.style)).shadow(m.shadow), t > 0 && (t -= n.strokeWidth() % 2), g = { y: e, anchorY: u }, m.allowOverlapX && (g.x = t, g.anchorX = o.anchorX), n.attr({ text: o.options.title ?? m.title ?? "A" })[n.isNew ? "attr" : "animate"](g), m.allowOverlapX || (S[o.plotX] ? S[o.plotX].size = Math.max(S[o.plotX].size, n.width || 0) : S[o.plotX] = { align: 0.5 * !!d, size: n.width || 0, target: t, anchorX: t }), o.tooltipPos = [t, e + b.pos - l.plotTop]) : n && (o.graphic = n.destroy());
1584
- if (!m.allowOverlapX) {
1585
- let A = 100;
1586
- for (let y of (Mr(S, function(E) {
1587
- E.plotX = E.anchorX, v.push(E), A = Math.max(E.size, A);
1588
- }), mr(v, f ? b.len : this.xAxis.len, A), r)) {
1589
- let E = y.plotX, w = y.graphic, O = w && S[E];
1590
- O && w && (br(O.pos) ? w[w.isNew ? "attr" : "animate"]({ x: O.pos + (O.align || 0) * O.size, anchorX: y.anchorX }).show().isNew = !1 : w.hide().isNew = !0);
1591
- }
1592
- }
1593
- m.useHTML && this.markerGroup && Ar(this.markerGroup, "on", function(A) {
1594
- return ci().prototype.on.apply(A.apply(this, [].slice.call(arguments, 1)), [].slice.call(arguments, 1));
1595
- });
1596
- }
1597
- drawTracker() {
1598
- let t = this.points;
1599
- for (let e of (super.drawTracker(), t)) {
1600
- let i = e.graphic;
1601
- i && (e.unbindMouseOver && e.unbindMouseOver(), e.unbindMouseOver = xr(i.element, "mouseover", function() {
1602
- for (let s of (e.stackIndex > 0 && !e.raised && (e._y = i.y, i.attr({ y: e._y - 8 }), e.raised = !0), t)) s !== e && s.raised && s.graphic && (s.graphic.attr({ y: s._y }), s.raised = !1);
1603
- }));
1604
- }
1605
- }
1606
- pointAttribs(t, e) {
1607
- let i = this.options, s = t && t.color || this.color, o = i.lineColor, n = t && t.lineWidth, c = t && t.fillColor || i.fillColor;
1608
- return e && (c = i.states[e].fillColor, o = i.states[e].lineColor, n = i.states[e].lineWidth), { fill: c || s, stroke: o || s, "stroke-width": n || i.lineWidth || 0 };
1609
- }
1610
- setClip() {
1611
- Pi.prototype.setClip.apply(this, arguments), this.options.clip !== !1 && this.sharedClipKey && this.markerGroup && this.markerGroup.clip(this.chart.sharedClips[this.sharedClipKey]);
1612
- }
1613
- }
1614
- St.compose = ar.compose, St.defaultOptions = Gi(Ri.defaultOptions, { borderRadius: 0, pointRange: 0, allowOverlapX: !1, shape: "flag", stackDistance: 12, textAlign: "center", tooltip: { pointFormat: "{point.text}" }, threshold: null, y: -30, fillColor: "#ffffff", lineWidth: 1, states: { hover: { lineColor: "#000000", fillColor: "#ccd3ff" } }, style: { color: "#000000", fontSize: "0.7em", fontWeight: "bold" } }), gr.compose(St), vr(St.prototype, { allowDG: !1, forceCrop: !0, invertible: !1, noSharedTooltip: !0, pointClass: rr, sorted: !1, takeOrdinalPosition: !1, trackerGroups: ["markerGroup"], buildKDTree: fr, init: Pi.prototype.init }), _().registerSeriesType("flags", St);
1615
- var kr = G(184), wr = G.n(kr);
1616
- let { addEvent: Tt, find: Sr, fireEvent: Le, isArray: Tr, isNumber: q, pick: Et } = B();
1617
- (function(a) {
1618
- function t() {
1619
- this.brokenAxis !== void 0 && this.brokenAxis.setBreaks(this.options.breaks, !1);
1620
- }
1621
- function e() {
1622
- this.brokenAxis?.hasBreaks && (this.options.ordinal = !1);
1623
- }
1624
- function i() {
1625
- let p = this.brokenAxis;
1626
- if (p?.hasBreaks) {
1627
- let d = this.tickPositions, r = this.tickPositions.info, l = [];
1628
- for (let h = 0; h < d.length; h++) p.isInAnyBreak(d[h]) || l.push(d[h]);
1629
- this.tickPositions = l, this.tickPositions.info = r;
1630
- }
1631
- }
1632
- function s() {
1633
- this.brokenAxis || (this.brokenAxis = new g(this));
1634
- }
1635
- function o() {
1636
- let { isDirty: p, options: { connectNulls: d }, points: r, xAxis: l, yAxis: h } = this;
1637
- if (p) {
1638
- let f = r.length;
1639
- for (; f--; ) {
1640
- let m = r[f], x = (m.y !== null || d !== !1) && (l?.brokenAxis?.isInAnyBreak(m.x, !0) || h?.brokenAxis?.isInAnyBreak(m.y, !0));
1641
- m.visible = !x && m.options.visible !== !1;
1642
- }
1643
- }
1644
- }
1645
- function n() {
1646
- this.drawBreaks(this.xAxis, ["x"]), this.drawBreaks(this.yAxis, Et(this.pointArrayMap, ["y"]));
1647
- }
1648
- function c(p, d) {
1649
- let r, l, h, f = this, m = f.points;
1650
- if (p?.brokenAxis?.hasBreaks) {
1651
- let x = p.brokenAxis;
1652
- d.forEach(function(b) {
1653
- r = x?.breakArray || [], l = p.isXAxis ? p.min : Et(f.options.threshold, p.min);
1654
- let S = p?.options?.breaks?.filter(function(v) {
1655
- let M = !0;
1656
- for (let A = 0; A < r.length; A++) {
1657
- let y = r[A];
1658
- if (y.from === v.from && y.to === v.to) {
1659
- M = !1;
1660
- break;
1661
- }
1662
- }
1663
- return M;
1664
- });
1665
- m.forEach(function(v) {
1666
- h = Et(v["stack" + b.toUpperCase()], v[b]), r.forEach(function(M) {
1667
- if (q(l) && q(h)) {
1668
- let A = "";
1669
- l < M.from && h > M.to || l > M.from && h < M.from ? A = "pointBreak" : (l < M.from && h > M.from && h < M.to || l > M.from && h > M.to && h < M.from) && (A = "pointInBreak"), A && Le(p, A, { point: v, brk: M });
1670
- }
1671
- }), S?.forEach(function(M) {
1672
- Le(p, "pointOutsideOfBreak", { point: v, brk: M });
1673
- });
1674
- });
1675
- });
1676
- }
1677
- }
1678
- function u() {
1679
- let p = this.currentDataGrouping, d = p?.gapSize, r = this.points.slice(), l = this.yAxis, h = this.options.gapSize, f = r.length - 1;
1680
- if (h && f > 0) {
1681
- let m, x;
1682
- for (this.options.gapUnit !== "value" && (h *= this.basePointRange), d && d > h && d >= this.basePointRange && (h = d); f--; ) if (x && x.visible !== !1 || (x = r[f + 1]), m = r[f], x.visible !== !1 && m.visible !== !1) {
1683
- if (x.x - m.x > h) {
1684
- let b = (m.x + x.x) / 2;
1685
- r.splice(f + 1, 0, { isNull: !0, x: b }), l.stacking && this.options.stacking && ((l.stacking.stacks[this.stackKey][b] = new (wr())(l, l.options.stackLabels, !1, b, this.stack)).total = 0);
1686
- }
1687
- x = m;
1688
- }
1689
- }
1690
- return this.getGraphPath(r);
1691
- }
1692
- a.compose = function(p, d) {
1693
- if (!p.keepProps.includes("brokenAxis")) {
1694
- p.keepProps.push("brokenAxis"), Tt(p, "init", s), Tt(p, "afterInit", t), Tt(p, "afterSetTickPositions", i), Tt(p, "afterSetOptions", e);
1695
- let r = d.prototype;
1696
- r.drawBreaks = c, r.gappedPath = u, Tt(d, "afterGeneratePoints", o), Tt(d, "afterRender", n);
1697
- }
1698
- return p;
1699
- };
1700
- class g {
1701
- static isInBreak(d, r) {
1702
- let l = d.repeat || 1 / 0, h = d.from, f = d.to - d.from, m = r >= h ? (r - h) % l : l - (h - r) % l;
1703
- return d.inclusive ? m <= f : m < f && m !== 0;
1704
- }
1705
- static lin2Val(d) {
1706
- let r = this.brokenAxis, l = r?.breakArray;
1707
- if (!l || !q(d)) return d;
1708
- let h = d, f, m;
1709
- for (m = 0; m < l.length && !((f = l[m]).from >= h); m++) (f.to < h || g.isInBreak(f, h)) && (h += f.len);
1710
- return h;
1711
- }
1712
- static val2Lin(d) {
1713
- let r = this.brokenAxis, l = r?.breakArray;
1714
- if (!l || !q(d)) return d;
1715
- let h = d, f, m;
1716
- for (m = 0; m < l.length; m++) if ((f = l[m]).to <= d) h -= f.len;
1717
- else {
1718
- if (f.from >= d) break;
1719
- if (g.isInBreak(f, d)) {
1720
- h -= d - f.from;
1721
- break;
1722
- }
1723
- }
1724
- return h;
1725
- }
1726
- constructor(d) {
1727
- this.hasBreaks = !1, this.axis = d;
1728
- }
1729
- findBreakAt(d, r) {
1730
- return Sr(r, function(l) {
1731
- return l.from < d && d < l.to;
1732
- });
1733
- }
1734
- isInAnyBreak(d, r) {
1735
- let l = this.axis, h = l.options.breaks || [], f = h.length, m, x, b;
1736
- if (f && q(d)) {
1737
- for (; f--; ) g.isInBreak(h[f], d) && (m = !0, x || (x = Et(h[f].showPoints, !l.isXAxis)));
1738
- b = m && r ? m && !x : m;
1739
- }
1740
- return b;
1741
- }
1742
- setBreaks(d, r) {
1743
- let l = this, h = l.axis, f = h.chart.time, m = Tr(d) && !!d.length && !!Object.keys(d[0]).length;
1744
- h.isDirty = l.hasBreaks !== m, l.hasBreaks = m, d?.forEach((x) => {
1745
- x.from = f.parse(x.from) || 0, x.to = f.parse(x.to) || 0;
1746
- }), d !== h.options.breaks && (h.options.breaks = h.userOptions.breaks = d), h.forceRedraw = !0, h.series.forEach(function(x) {
1747
- x.isDirty = !0;
1748
- }), m || h.val2lin !== g.val2Lin || (delete h.val2lin, delete h.lin2val), m && (h.userOptions.ordinal = !1, h.lin2val = g.lin2Val, h.val2lin = g.val2Lin, h.setExtremes = function(x, b, S, v, M) {
1749
- if (l.hasBreaks) {
1750
- let A, y = this.options.breaks || [];
1751
- for (; A = l.findBreakAt(x, y); ) x = A.to;
1752
- for (; A = l.findBreakAt(b, y); ) b = A.from;
1753
- b < x && (b = x);
1754
- }
1755
- h.constructor.prototype.setExtremes.call(this, x, b, S, v, M);
1756
- }, h.setAxisTranslation = function() {
1757
- if (h.constructor.prototype.setAxisTranslation.call(this), l.unitLength = void 0, l.hasBreaks) {
1758
- let x = h.options.breaks || [], b = [], S = [], v = Et(h.pointRangePadding, 0), M = 0, A, y, E = h.userMin || h.min, w = h.userMax || h.max, O, T;
1759
- x.forEach(function(k) {
1760
- y = k.repeat || 1 / 0, q(E) && q(w) && (g.isInBreak(k, E) && (E += k.to % y - E % y), g.isInBreak(k, w) && (w -= w % y - k.from % y));
1761
- }), x.forEach(function(k) {
1762
- if (O = k.from, y = k.repeat || 1 / 0, q(E) && q(w)) {
1763
- for (; O - y > E; ) O -= y;
1764
- for (; O < E; ) O += y;
1765
- for (T = O; T < w; T += y) b.push({ value: T, move: "in" }), b.push({ value: T + k.to - k.from, move: "out", size: k.breakSize });
1766
- }
1767
- }), b.sort(function(k, C) {
1768
- return k.value === C.value ? (k.move !== "in") - (C.move !== "in") : k.value - C.value;
1769
- }), A = 0, O = E, b.forEach(function(k) {
1770
- (A += k.move === "in" ? 1 : -1) === 1 && k.move === "in" && (O = k.value), A === 0 && q(O) && (S.push({ from: O, to: k.value, len: k.value - O - (k.size || 0) }), M += k.value - O - (k.size || 0));
1771
- }), l.breakArray = S, q(E) && q(w) && q(h.min) && (l.unitLength = w - E - M + v, Le(h, "afterBreaks"), h.staticScale ? h.transA = h.staticScale : l.unitLength && (h.transA *= (w - h.min + v) / l.unitLength), v && (h.minPixelPadding = h.transA * (h.minPointOffset || 0)), h.min = E, h.max = w);
1772
- }
1773
- }), Et(r, !0) && h.chart.redraw();
1774
- }
1775
- }
1776
- a.Additions = g;
1777
- })(pe || (pe = {}));
1778
- let Er = pe, Ht = B();
1779
- Ht.BrokenAxis = Ht.BrokenAxis || Er, Ht.BrokenAxis.compose(Ht.Axis, Ht.Series);
1780
- let U = {}, { arrayMax: Or, arrayMin: Br, correctFloat: Cr, extend: Dr, isNumber: tt } = B();
1781
- function Ii(a) {
1782
- let t = a.length, e = zi(a);
1783
- return tt(e) && t && (e = Cr(e / t)), e;
1784
- }
1785
- function zi(a) {
1786
- let t = a.length, e;
1787
- if (!t && a.hasNulls) e = null;
1788
- else if (t) for (e = 0; t--; ) e += a[t];
1789
- return e;
1790
- }
1791
- let Li = { average: Ii, averages: function() {
1792
- let a = [];
1793
- return [].forEach.call(arguments, function(t) {
1794
- a.push(Ii(t));
1795
- }), a[0] === void 0 ? void 0 : a;
1796
- }, close: function(a) {
1797
- return a.length ? a[a.length - 1] : a.hasNulls ? null : void 0;
1798
- }, high: function(a) {
1799
- return a.length ? Or(a) : a.hasNulls ? null : void 0;
1800
- }, hlc: function(a, t, e) {
1801
- if (a = U.high(a), t = U.low(t), e = U.close(e), tt(a) || tt(t) || tt(e)) return [a, t, e];
1802
- }, low: function(a) {
1803
- return a.length ? Br(a) : a.hasNulls ? null : void 0;
1804
- }, ohlc: function(a, t, e, i) {
1805
- if (a = U.open(a), t = U.high(t), e = U.low(e), i = U.close(i), tt(a) || tt(t) || tt(e) || tt(i)) return [a, t, e, i];
1806
- }, open: function(a) {
1807
- return a.length ? a[0] : a.hasNulls ? null : void 0;
1808
- }, range: function(a, t) {
1809
- return a = U.low(a), t = U.high(t), tt(a) || tt(t) ? [a, t] : a === null && t === null ? null : void 0;
1810
- }, sum: zi };
1811
- Dr(U, Li);
1812
- let Ot = { common: { groupPixelWidth: 2, dateTimeLabelFormats: { millisecond: ["%[AebHMSL]", "%[AebHMSL]", "-%[HMSL]"], second: ["%[AebHMS]", "%[AebHMS]", "-%[HMS]"], minute: ["%[AebHM]", "%[AebHM]", "-%[HM]"], hour: ["%[AebHM]", "%[AebHM]", "-%[HM]"], day: ["%[AebY]", "%[Aeb]", "-%[AebY]"], week: ["%v %[AebY]", "%[Aeb]", "-%[AebY]"], month: ["%[BY]", "%[B]", "-%[BY]"], year: ["%Y", "%Y", "-%Y"] } }, seriesSpecific: { line: {}, spline: {}, area: {}, areaspline: {}, arearange: {}, column: { groupPixelWidth: 10 }, columnrange: { groupPixelWidth: 10 }, candlestick: { groupPixelWidth: 10 }, ohlc: { groupPixelWidth: 5 }, hlc: { groupPixelWidth: 5 }, heikinashi: { groupPixelWidth: 10 } }, units: [["millisecond", [1, 2, 5, 10, 20, 25, 50, 100, 200, 500]], ["second", [1, 2, 5, 10, 15, 30]], ["minute", [1, 2, 5, 10, 15, 30]], ["hour", [1, 2, 3, 4, 6, 8, 12]], ["day", [1]], ["week", [1]], ["month", [1, 3, 6]], ["year", null]] }, { addEvent: Wi, extend: Pr, merge: Rr, pick: Xi } = B();
1813
- function Hi(a) {
1814
- let t = this, e = t.series;
1815
- e.forEach(function(i) {
1816
- i.groupPixelWidth = void 0;
1817
- }), e.forEach(function(i) {
1818
- i.groupPixelWidth = t.getGroupPixelWidth && t.getGroupPixelWidth(), i.groupPixelWidth && (i.hasProcessed = !0), i.applyGrouping(!!a.hasExtremesChanged);
1819
- });
1820
- }
1821
- function Gr() {
1822
- let a = this.series, t = a.length, e = 0, i = !1, s, o;
1823
- for (; t--; ) (o = a[t].options.dataGrouping) && (e = Math.max(e, Xi(o.groupPixelWidth, Ot.common.groupPixelWidth)), s = (a[t].dataTable.modified || a[t].dataTable).rowCount, (a[t].groupPixelWidth || s > this.chart.plotSizeX / e || s && o.forced) && (i = !0));
1824
- return i ? e : 0;
1825
- }
1826
- function Ir() {
1827
- this.series.forEach(function(a) {
1828
- a.hasProcessed = !1;
1829
- });
1830
- }
1831
- function zr(a, t) {
1832
- let e;
1833
- if (t = Xi(t, !0), a || (a = { forced: !1, units: null }), this instanceof He) for (e = this.series.length; e--; ) this.series[e].update({ dataGrouping: a }, !1);
1834
- else this.chart.options.series.forEach(function(i) {
1835
- i.dataGrouping = typeof a == "boolean" ? a : Rr(a, i.dataGrouping);
1836
- });
1837
- this.ordinal && (this.ordinal.slope = void 0), t && this.chart.redraw();
1838
- }
1839
- let Lr = { compose: function(a) {
1840
- He = a;
1841
- let t = a.prototype;
1842
- t.applyGrouping || (Wi(a, "afterSetScale", Ir), Wi(a, "postProcessData", Hi), Pr(t, { applyGrouping: Hi, getGroupPixelWidth: Gr, setDataGrouping: zr }));
1843
- } }, { addEvent: Wr, getMagnitude: Xr, normalizeTickInterval: Hr, timeUnits: $t } = B();
1844
- (function(a) {
1845
- function t() {
1846
- return this.chart.time.getTimeTicks.apply(this.chart.time, arguments);
1847
- }
1848
- function e() {
1849
- if (this.type !== "datetime") {
1850
- this.dateTime = void 0;
1851
- return;
1852
- }
1853
- this.dateTime || (this.dateTime = new i(this));
1854
- }
1855
- a.compose = function(s) {
1856
- return s.keepProps.includes("dateTime") || (s.keepProps.push("dateTime"), s.prototype.getTimeTicks = t, Wr(s, "afterSetType", e)), s;
1857
- };
1858
- class i {
1859
- constructor(o) {
1860
- this.axis = o;
1861
- }
1862
- normalizeTimeTickInterval(o, n) {
1863
- let c = n || [["millisecond", [1, 2, 5, 10, 20, 25, 50, 100, 200, 500]], ["second", [1, 2, 5, 10, 15, 30]], ["minute", [1, 2, 5, 10, 15, 30]], ["hour", [1, 2, 3, 4, 6, 8, 12]], ["day", [1, 2]], ["week", [1, 2]], ["month", [1, 2, 3, 4, 6]], ["year", null]], u = c[c.length - 1], g = $t[u[0]], p = u[1], d;
1864
- for (d = 0; d < c.length && (g = $t[(u = c[d])[0]], p = u[1], !c[d + 1] || !(o <= (g * p[p.length - 1] + $t[c[d + 1][0]]) / 2)); d++) ;
1865
- g === $t.year && o < 5 * g && (p = [1, 2, 5]);
1866
- let r = Hr(o / g, p, u[0] === "year" ? Math.max(Xr(o / g), 1) : 1);
1867
- return { unitRange: g, count: r, unitName: u[0] };
1868
- }
1869
- getXDateFormat(o, n) {
1870
- let { axis: c } = this, u = c.chart.time;
1871
- return c.closestPointRange ? u.getDateFormat(c.closestPointRange, o, c.options.startOfWeek, n) || u.resolveDTLFormat(n.year).main : u.resolveDTLFormat(n.day).main;
1872
- }
1873
- }
1874
- a.Additions = i;
1875
- })(ue || (ue = {}));
1876
- let Yr = ue, { series: { prototype: Yi } } = _(), { addEvent: We, defined: Yt, error: Ni, extend: Nr, isNumber: Z, merge: Xe, pick: Fr, splat: Ur } = B(), Vr = Yi.generatePoints;
1877
- function _r(a) {
1878
- var t, e, i;
1879
- let s, o, n = this.chart, c = this.options.dataGrouping, u = this.allowDG !== !1 && c && Fr(c.enabled, n.options.isStock), g = this.reserveSpace(), p = this.currentDataGrouping, d, r, l = !1;
1880
- u && !this.requireSorting && (this.requireSorting = l = !0);
1881
- let h = (t = this, e = a, !!(t.isCartesian && !t.isDirty && !t.xAxis.isDirty && !t.yAxis.isDirty && !e) || !u);
1882
- if (l && (this.requireSorting = !1), h) return;
1883
- this.destroyGroupedData();
1884
- let f = c.groupAll ? this.dataTable : this.dataTable.modified || this.dataTable, m = this.getColumn("x", !c.groupAll), x = n.plotSizeX, b = this.xAxis, S = b.getExtremes(), v = b.options.ordinal, M = this.groupPixelWidth;
1885
- if (M && m && f.rowCount && x && Z(S.min)) {
1886
- o = !0, this.isDirty = !0, this.points = null;
1887
- let A = S.min, y = S.max, E = v && b.ordinal && b.ordinal.getGroupIntervalFactor(A, y, this) || 1, w = M * (y - A) / x * E, O = b.getTimeTicks(Yr.Additions.prototype.normalizeTimeTickInterval(w, c.units || Ot.units), Math.min(A, m[0]), Math.max(y, m[m.length - 1]), b.options.startOfWeek, m, this.closestPointRange), T = Yi.groupData.apply(this, [f, O, c.approximation]), k = T.modified, C = k.getColumn("x", !0), z = 0;
1888
- for (c?.smoothed && k.rowCount && (c.firstAnchor = "firstPoint", c.anchor = "middle", c.lastAnchor = "lastPoint", Ni(32, !1, n, { "dataGrouping.smoothed": "use dataGrouping.anchor" })), s = 1; s < O.length; s++) O.info.segmentStarts && O.info.segmentStarts.indexOf(s) !== -1 || (z = Math.max(O[s] - O[s - 1], z));
1889
- (d = O.info).gapSize = z, this.closestPointRange = O.info.totalRange, this.groupMap = T.groupMap, this.currentDataGrouping = d, function(I, D, W) {
1890
- let L = I.options.dataGrouping, R = I.currentDataGrouping && I.currentDataGrouping.gapSize, X = I.getColumn("x");
1891
- if (!(L && X.length && R && I.groupMap)) return;
1892
- let Y = D.length - 1, lt = L.anchor, Bt = L.firstAnchor, V = L.lastAnchor, Ct = D.length - 1, Qt = 0;
1893
- if (Bt && X[0] >= D[0]) {
1894
- let ht;
1895
- Qt++;
1896
- let Ki = I.groupMap[0].start, $i = I.groupMap[0].length;
1897
- Z(Ki) && Z($i) && (ht = Ki + ($i - 1)), D[0] = { start: D[0], middle: D[0] + 0.5 * R, end: D[0] + R, firstPoint: X[0], lastPoint: ht && X[ht] }[Bt];
1898
- }
1899
- if (Y > 0 && V && R && D[Y] >= W - R) {
1900
- Ct--;
1901
- let ht = I.groupMap[I.groupMap.length - 1].start;
1902
- D[Y] = { start: D[Y], middle: D[Y] + 0.5 * R, end: D[Y] + R, firstPoint: ht && X[ht], lastPoint: X[X.length - 1] }[V];
1903
- }
1904
- if (lt && lt !== "start") {
1905
- let ht = R * { middle: 0.5, end: 1 }[lt];
1906
- for (; Ct >= Qt; ) D[Ct] += ht, Ct--;
1907
- }
1908
- }(this, C || [], y), g && C && (Yt((i = C)[0]) && Z(b.min) && Z(b.dataMin) && i[0] < b.min && ((!Yt(b.options.min) && b.min <= b.dataMin || b.min === b.dataMin) && (b.min = Math.min(i[0], b.min)), b.dataMin = Math.min(i[0], b.dataMin)), Yt(i[i.length - 1]) && Z(b.max) && Z(b.dataMax) && i[i.length - 1] > b.max && ((!Yt(b.options.max) && Z(b.dataMax) && b.max >= b.dataMax || b.max === b.dataMax) && (b.max = Math.max(i[i.length - 1], b.max)), b.dataMax = Math.max(i[i.length - 1], b.dataMax))), c.groupAll && (this.allGroupedTable = k, C = (k = (r = this.cropData(k, b.min || 0, b.max || 0)).modified).getColumn("x"), this.cropStart = r.start), this.dataTable.modified = k;
1909
- } else this.groupMap = void 0, this.currentDataGrouping = void 0;
1910
- this.hasGroupedData = o, this.preventGraphAnimation = (p && p.totalRange) !== (d && d.totalRange);
1911
- }
1912
- function Fi() {
1913
- this.groupedData && (this.groupedData.forEach(function(a, t) {
1914
- a && (this.groupedData[t] = a.destroy ? a.destroy() : null);
1915
- }, this), this.groupedData.length = 0, delete this.allGroupedTable);
1916
- }
1917
- function jr() {
1918
- Vr.apply(this), this.destroyGroupedData(), this.groupedData = this.hasGroupedData ? this.points : null;
1919
- }
1920
- function qr() {
1921
- return this.is("arearange") ? "range" : this.is("ohlc") ? "ohlc" : this.is("hlc") ? "hlc" : this.is("column") || this.options.cumulative ? "sum" : "average";
1922
- }
1923
- function Ui(a, t, e) {
1924
- let i = a.getColumn("x", !0) || [], s = a.getColumn("y", !0), o = this, n = o.data, c = o.options && o.options.data, u = [], g = new li(), p = [], d = a.rowCount, r = !!s, l = [], h = o.pointArrayMap, f = h && h.length, m = ["x"].concat(h || ["y"]), x = (h || ["y"]).map(() => []), b = this.options.dataGrouping && this.options.dataGrouping.groupAll, S, v, M, A = 0, y = 0, E = typeof e == "function" ? e : e && U[e] ? U[e] : U[o.getDGApproximation && o.getDGApproximation() || "average"];
1925
- if (f) {
1926
- let T = h.length;
1927
- for (; T--; ) l.push([]);
1928
- } else l.push([]);
1929
- let w = f || 1;
1930
- for (let T = 0; T <= d; T++) if (!(i[T] < t[0])) {
1931
- for (; t[A + 1] !== void 0 && i[T] >= t[A + 1] || T === d; ) {
1932
- if (S = t[A], o.dataGroupInfo = { start: b ? y : o.cropStart + y, length: l[0].length, groupStart: S }, M = E.apply(o, l), o.pointClass && !Yt(o.dataGroupInfo.options) && (o.dataGroupInfo.options = Xe(o.pointClass.prototype.optionsToObject.call({ series: o }, o.options.data[o.cropStart + y])), m.forEach(function(k) {
1933
- delete o.dataGroupInfo.options[k];
1934
- })), M !== void 0) {
1935
- u.push(S);
1936
- let k = Ur(M);
1937
- for (let C = 0; C < k.length; C++) x[C].push(k[C]);
1938
- p.push(o.dataGroupInfo);
1939
- }
1940
- y = T;
1941
- for (let k = 0; k < w; k++) l[k].length = 0, l[k].hasNulls = !1;
1942
- if (A += 1, T === d) break;
1943
- }
1944
- if (T === d) break;
1945
- if (h) {
1946
- let k, C = b ? T : o.cropStart + T, z = n && n[C] || o.pointClass.prototype.applyOptions.apply({ series: o }, [c[C]]);
1947
- for (let I = 0; I < f; I++) Z(k = z[h[I]]) ? l[I].push(k) : k === null && (l[I].hasNulls = !0);
1948
- } else Z(v = r ? s[T] : null) ? l[0].push(v) : v === null && (l[0].hasNulls = !0);
1949
- }
1950
- let O = { x: u };
1951
- return (h || ["y"]).forEach((T, k) => {
1952
- O[T] = x[k];
1953
- }), g.setColumns(O), { groupMap: p, modified: g };
1954
- }
1955
- function Zr(a) {
1956
- let t = a.options, e = this.type, i = this.chart.options.plotOptions, s = this.useCommonDataGrouping && Ot.common, o = Ot.seriesSpecific, n = B().defaultOptions.plotOptions[e].dataGrouping;
1957
- if (i && (o[e] || s)) {
1958
- let c = this.chart.rangeSelector;
1959
- n || (n = Xe(Ot.common, o[e])), t.dataGrouping = Xe(s, n, i.series && i.series.dataGrouping, i[e].dataGrouping, this.userOptions.dataGrouping, !t.isInternal && c && Z(c.selected) && c.buttonOptions[c.selected].dataGrouping);
1960
- }
1961
- }
1962
- let Vi = { compose: function(a) {
1963
- let t = a.prototype;
1964
- t.applyGrouping || (We(a.prototype.pointClass, "update", function() {
1965
- if (this.dataGroup) return Ni(24, !1, this.series.chart), !1;
1966
- }), We(a, "afterSetOptions", Zr), We(a, "destroy", Fi), Nr(t, { applyGrouping: _r, destroyGroupedData: Fi, generatePoints: jr, getDGApproximation: qr, groupData: Ui }));
1967
- }, groupData: Ui }, { format: Kr } = Ee(), { composed: $r } = B(), { addEvent: Jr, extend: Qr, isNumber: ta, pick: ea, pushUnique: ia } = B();
1968
- function sa(a) {
1969
- let t = this.chart, e = t.time, i = a.point, s = i.series, o = s.options, n = s.tooltipOptions, c = o.dataGrouping, u = s.xAxis, g = n.xDateFormat || "", p, d, r, l, h, f = n[a.isFooter ? "footerFormat" : "headerFormat"];
1970
- if (u && u.options.type === "datetime" && c && ta(i.key)) {
1971
- d = s.currentDataGrouping, r = c.dateTimeLabelFormats || Ot.common.dateTimeLabelFormats, d ? (l = r[d.unitName], d.count === 1 ? g = l[0] : (g = l[1], p = l[2])) : !g && r && u.dateTime && (g = u.dateTime.getXDateFormat(i.x, n.dateTimeLabelFormats));
1972
- let m = ea(s.groupMap?.[i.index].groupStart, i.key), x = m + (d?.totalRange || 0) - 1;
1973
- h = e.dateFormat(g, m), p && (h += e.dateFormat(p, x)), s.chart.styledMode && (f = this.styledModeFormat(f)), a.text = Kr(f, { point: Qr(i, { key: h }), series: s }, t), a.preventDefault();
1974
- }
1975
- }
1976
- let oa = { compose: function(a, t, e) {
1977
- Lr.compose(a), Vi.compose(t), e && ia($r, "DataGrouping") && Jr(e, "headerFormatter", sa);
1978
- }, groupData: Vi.groupData }, rt = B();
1979
- rt.dataGrouping = rt.dataGrouping || {}, rt.dataGrouping.approximationDefaults = rt.dataGrouping.approximationDefaults || Li, rt.dataGrouping.approximations = rt.dataGrouping.approximations || U, oa.compose(rt.Axis, rt.Series, rt.Tooltip);
1980
- let { defined: ka, isNumber: _i, pick: ra } = B(), { addEvent: ji, isObject: aa, pick: na, defined: la, merge: ha } = B(), { getAssignedAxis: qi } = { getAssignedAxis: function(a) {
1981
- return a.filter((t) => {
1982
- let e = t.axis.getExtremes(), i = e.min, s = e.max, o = ra(t.axis.minPointOffset, 0);
1983
- return _i(i) && _i(s) && t.value >= i - o && t.value <= s + o && !t.axis.options.isInternal;
1984
- })[0];
1985
- } }, Zi = [], da = { enabled: !0, sensitivity: 1.1 }, pa = (a) => (aa(a) || (a = { enabled: a ?? !0 }), ha(da, a)), ua = function(a, t, e, i, s, o, n) {
1986
- let c = na(n.type, a.zooming.type, ""), u = [];
1987
- c === "x" ? u = e : c === "y" ? u = i : c === "xy" && (u = a.axes);
1988
- let g = a.transform({ axes: u, to: { x: s - 5, y: o - 5, width: 10, height: 10 }, from: { x: s - 5 * t, y: o - 5 * t, width: 10 * t, height: 10 * t }, trigger: "mousewheel" });
1989
- return g && (la(oe) && clearTimeout(oe), oe = setTimeout(() => {
1990
- a.pointer?.drop();
1991
- }, 400)), g;
1992
- };
1993
- function ca() {
1994
- let a = pa(this.zooming.mouseWheel);
1995
- a.enabled && ji(this.container, "wheel", (t) => {
1996
- t = this.pointer?.normalize(t) || t;
1997
- let { pointer: e } = this, i = e && !e.inClass(t.target, "highcharts-no-mousewheel");
1998
- if (this.isInsidePlot(t.chartX - this.plotLeft, t.chartY - this.plotTop) && i) {
1999
- let s = a.sensitivity || 1.1, o = t.detail || (t.deltaY || 0) / 120, n = qi(e.getCoordinates(t).xAxis), c = qi(e.getCoordinates(t).yAxis);
2000
- ua(this, Math.pow(s, o), n ? [n.axis] : this.xAxis, c ? [c.axis] : this.yAxis, t.chartX, t.chartY, a) && t.preventDefault?.();
2001
- }
2002
- });
2003
- }
2004
- /**
2005
- * @license Highcharts JS v12.3.0 (2025-06-21)
2006
- * @module highcharts/modules/mouse-wheel-zoom
2007
- * @requires highcharts
2008
- *
2009
- * Mousewheel zoom module
2010
- *
2011
- * (c) 2023 Askel Eirik Johansson
2012
- *
2013
- * License: www.highcharts.com/license
2014
- */
2015
- let Jt = B();
2016
- Jt.MouseWheelZoom = Jt.MouseWheelZoom || { compose: function(a) {
2017
- Zi.indexOf(a) === -1 && (Zi.push(a), ji(a, "afterGetContainer", ca));
2018
- } }, Jt.MouseWheelZoom.compose(Jt.Chart);
2019
- /**
2020
- * @license Highstock JS v12.3.0 (2025-06-21)
2021
- * @module highcharts/modules/stock
2022
- * @requires highcharts
2023
- *
2024
- * Highcharts Stock as a plugin for Highcharts
2025
- *
2026
- * (c) 2010-2025 Torstein Honsi
2027
- *
2028
- * License: www.highcharts.com/license
2029
- */
2030
- let P = B();
2031
- P.Navigator = P.Navigator || Zt, P.OrdinalAxis = P.OrdinalAxis || we, P.RangeSelector = P.RangeSelector || Xt, P.Scrollbar = P.Scrollbar || ut, P.stockChart = P.stockChart || ki.stockChart, P.StockChart = P.StockChart || P.stockChart, P.extend(P.StockChart, ki), ks.compose(P.Series, P.Axis, P.Point), St.compose(P.Renderer), mt.compose(P.Series), P.Navigator.compose(P.Chart, P.Axis, P.Series), P.OrdinalAxis.compose(P.Axis, P.Series, P.Chart), P.RangeSelector.compose(P.Axis, P.Chart), P.Scrollbar.compose(P.Axis), P.StockChart.compose(P.Chart, P.Axis, P.Series, P.SVGRenderer);
2032
- let ga = B();
2033
- return Ne.default;
2034
- })());
2035
- }(te)), te.exports;
2036
- }
2037
- var Qi = ba();
2038
- const va = /* @__PURE__ */ fa(Qi), Sa = /* @__PURE__ */ ma({
2039
- __proto__: null,
2040
- default: va
2041
- }, [Qi]);
2042
- export {
2043
- Sa as s
2044
- };