@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,1757 +0,0 @@
1
- import { g as tr } from "./index-C8r4OcCO.js";
2
- function ir(ne, Ze) {
3
- for (var S = 0; S < Ze.length; S++) {
4
- const Y = Ze[S];
5
- if (typeof Y != "string" && !Array.isArray(Y)) {
6
- for (const U in Y)
7
- if (U !== "default" && !(U in ne)) {
8
- const le = Object.getOwnPropertyDescriptor(Y, U);
9
- le && Object.defineProperty(ne, U, le.get ? le : {
10
- enumerable: !0,
11
- get: () => Y[U]
12
- });
13
- }
14
- }
15
- }
16
- return Object.freeze(Object.defineProperty(ne, Symbol.toStringTag, { value: "Module" }));
17
- }
18
- var We = { exports: {} }, sr = We.exports, xi;
19
- function or() {
20
- return xi || (xi = 1, function(ne, Ze) {
21
- /**
22
- * Highcharts JS v12.3.0 (2025-06-21)
23
- * @module highcharts/modules/color-axis
24
- * @requires highcharts
25
- *
26
- * ColorAxis module
27
- *
28
- * (c) 2012-2025 Pawel Potaczek
29
- *
30
- * License: www.highcharts.com/license
31
- */
32
- (function(S, Y) {
33
- ne.exports = Y(S._Highcharts, S._Highcharts.Axis, S._Highcharts.Color, S._Highcharts.LegendSymbol, S._Highcharts.SeriesRegistry, S._Highcharts.SVGElement, S._Highcharts.Series, S._Highcharts.Chart, S._Highcharts.SVGRenderer, S._Highcharts.Templating, S._Highcharts.Series.types.scatter, S._Highcharts.Point);
34
- })(typeof window > "u" ? sr : window, (S, Y, U, le, vi, wi, Ci, Pi, Ti, Ai, Li, ji) => (() => {
35
- let Pe;
36
- var Ue, He, qe, Ke, $e, _e, Je, zi = { 28: (l) => {
37
- l.exports = wi;
38
- }, 260: (l) => {
39
- l.exports = ji;
40
- }, 500: (l) => {
41
- l.exports = le;
42
- }, 512: (l) => {
43
- l.exports = vi;
44
- }, 532: (l) => {
45
- l.exports = Y;
46
- }, 540: (l) => {
47
- l.exports = Ti;
48
- }, 620: (l) => {
49
- l.exports = U;
50
- }, 632: (l) => {
51
- l.exports = Li;
52
- }, 820: (l) => {
53
- l.exports = Ci;
54
- }, 944: (l) => {
55
- l.exports = S;
56
- }, 960: (l) => {
57
- l.exports = Pi;
58
- }, 984: (l) => {
59
- l.exports = Ai;
60
- } }, xt = {};
61
- function C(l) {
62
- var e = xt[l];
63
- if (e !== void 0) return e.exports;
64
- var t = xt[l] = { exports: {} };
65
- return zi[l](t, t.exports, C), t.exports;
66
- }
67
- C.n = (l) => {
68
- var e = l && l.__esModule ? () => l.default : () => l;
69
- return C.d(e, { a: e }), e;
70
- }, C.d = (l, e) => {
71
- for (var t in e) C.o(e, t) && !C.o(l, t) && Object.defineProperty(l, t, { enumerable: !0, get: e[t] });
72
- }, C.o = (l, e) => Object.prototype.hasOwnProperty.call(l, e);
73
- var Mt = {};
74
- C.d(Mt, { default: () => Jo });
75
- var ki = C(944), v = C.n(ki), Si = C(532), vt = C.n(Si), Ii = C(620), Qe = C.n(Ii);
76
- let { parse: Te } = Qe(), { addEvent: Q, extend: wt, merge: Bi, pick: Ei, splat: Di } = v();
77
- (function(l) {
78
- let e;
79
- function t() {
80
- let { userOptions: c } = this;
81
- this.colorAxis = [], c.colorAxis && (c.colorAxis = Di(c.colorAxis), c.colorAxis.map((g) => new e(this, g)));
82
- }
83
- function i(c) {
84
- let g = this.chart.colorAxis || [], f = (y) => {
85
- let x = c.allItems.indexOf(y);
86
- x !== -1 && (this.destroyItem(c.allItems[x]), c.allItems.splice(x, 1));
87
- }, u = [], m, b;
88
- for (g.forEach(function(y) {
89
- m = y.options, m?.showInLegend && (m.dataClasses && m.visible ? u = u.concat(y.getDataClassLegendSymbols()) : m.visible && u.push(y), y.series.forEach(function(x) {
90
- (!x.options.showInLegend || m.dataClasses) && (x.options.legendType === "point" ? x.points.forEach(function(M) {
91
- f(M);
92
- }) : f(x));
93
- }));
94
- }), b = u.length; b--; ) c.allItems.unshift(u[b]);
95
- }
96
- function s(c) {
97
- c.visible && c.item.legendColor && c.item.legendItem.symbol.attr({ fill: c.item.legendColor });
98
- }
99
- function r(c) {
100
- this.chart.colorAxis?.forEach((g) => {
101
- g.update({}, c.redraw);
102
- });
103
- }
104
- function a() {
105
- (this.chart.colorAxis?.length || this.colorAttribs) && this.translateColors();
106
- }
107
- function o() {
108
- let c = this.axisTypes;
109
- c ? c.indexOf("colorAxis") === -1 && c.push("colorAxis") : this.axisTypes = ["colorAxis"];
110
- }
111
- function n(c) {
112
- let g = this, f = c ? "show" : "hide";
113
- g.visible = g.options.visible = !!c, ["graphic", "dataLabel"].forEach(function(u) {
114
- g[u] && g[u][f]();
115
- }), this.series.buildKDTree();
116
- }
117
- function h() {
118
- let c = this, g = this.getPointsCollection(), f = this.options.nullColor, u = this.colorAxis, m = this.colorKey;
119
- g.forEach((b) => {
120
- let y = b.getNestedProperty(m), x = b.options.color || (b.isNull || b.value === null ? f : u && y !== void 0 ? u.toColor(y, b) : b.color || c.color);
121
- x && b.color !== x && (b.color = x, c.options.legendType === "point" && b.legendItem && b.legendItem.label && c.chart.legend.colorizeItem(b, b.visible));
122
- });
123
- }
124
- function p() {
125
- this.elem.attr("fill", Te(this.start).tweenTo(Te(this.end), this.pos), void 0, !0);
126
- }
127
- function d() {
128
- this.elem.attr("stroke", Te(this.start).tweenTo(Te(this.end), this.pos), void 0, !0);
129
- }
130
- l.compose = function(c, g, f, u, m) {
131
- let b = g.prototype, y = f.prototype, x = m.prototype;
132
- b.collectionsWithUpdate.includes("colorAxis") || (e = c, b.collectionsWithUpdate.push("colorAxis"), b.collectionsWithInit.colorAxis = [b.addColorAxis], Q(g, "afterCreateAxes", t), function(M) {
133
- let w = M.prototype.createAxis;
134
- M.prototype.createAxis = function(P, j) {
135
- if (P !== "colorAxis") return w.apply(this, arguments);
136
- let A = new e(this, Bi(j.axis, { index: this[P].length, isX: !1 }));
137
- return this.isDirtyLegend = !0, this.axes.forEach((T) => {
138
- T.series = [];
139
- }), this.series.forEach((T) => {
140
- T.bindAxes(), T.isDirtyData = !0;
141
- }), Ei(j.redraw, !0) && this.redraw(j.animation), A;
142
- };
143
- }(g), y.fillSetter = p, y.strokeSetter = d, Q(u, "afterGetAllItems", i), Q(u, "afterColorizeItem", s), Q(u, "afterUpdate", r), wt(x, { optionalAxis: "colorAxis", translateColors: h }), wt(x.pointClass.prototype, { setVisible: n }), Q(m, "afterTranslate", a, { order: 1 }), Q(m, "bindAxes", o));
144
- }, l.pointSetVisible = n;
145
- })(Ue || (Ue = {}));
146
- let Oi = Ue, { parse: et } = Qe(), { merge: Vi } = v();
147
- (function(l) {
148
- l.initDataClasses = function(e) {
149
- let t = this.chart, i = this.legendItem = this.legendItem || {}, s = this.options, r = e.dataClasses || [], a, o, n = t.options.chart.colorCount, h = 0, p;
150
- this.dataClasses = o = [], i.labels = [];
151
- for (let d = 0, c = r.length; d < c; ++d) a = Vi(a = r[d]), o.push(a), (t.styledMode || !a.color) && (s.dataClassColor === "category" ? (t.styledMode || (n = (p = t.options.colors || []).length, a.color = p[h]), a.colorIndex = h, ++h === n && (h = 0)) : a.color = et(s.minColor).tweenTo(et(s.maxColor), c < 2 ? 0.5 : d / (c - 1)));
152
- }, l.initStops = function() {
153
- let e = this.options, t = this.stops = e.stops || [[0, e.minColor || ""], [1, e.maxColor || ""]];
154
- for (let i = 0, s = t.length; i < s; ++i) t[i].color = et(t[i][1]);
155
- }, l.normalizedValue = function(e) {
156
- let t = this.max || 0, i = this.min || 0;
157
- return this.logarithmic && (e = this.logarithmic.log2lin(e)), 1 - (t - e) / (t - i || 1);
158
- }, l.toColor = function(e, t) {
159
- let i, s, r, a, o, n, h = this.dataClasses, p = this.stops;
160
- if (h) {
161
- for (n = h.length; n--; ) if (s = (o = h[n]).from, r = o.to, (s === void 0 || e >= s) && (r === void 0 || e <= r)) {
162
- a = o.color, t && (t.dataClass = n, t.colorIndex = o.colorIndex);
163
- break;
164
- }
165
- } else {
166
- for (i = this.normalizedValue(e), n = p.length; n-- && !(i > p[n][0]); ) ;
167
- s = p[n] || p[n + 1], i = 1 - ((r = p[n + 1] || s)[0] - i) / (r[0] - s[0] || 1), a = s.color.tweenTo(r.color, i);
168
- }
169
- return a;
170
- };
171
- })(He || (He = {}));
172
- let Xi = He;
173
- var Ni = C(500), Yi = C.n(Ni), Gi = C(512), I = C.n(Gi);
174
- let { defaultOptions: tt } = v(), { series: Ct } = I(), { defined: Ae, extend: Pt, fireEvent: Ri, isArray: Fi, isNumber: Wi, merge: Tt, pick: F, relativeLength: At } = v();
175
- tt.colorAxis = Tt(tt.xAxis, { lineWidth: 0, minPadding: 0, maxPadding: 0, gridLineColor: "#ffffff", gridLineWidth: 1, tickPixelInterval: 72, startOnTick: !0, endOnTick: !0, offset: 0, marker: { animation: { duration: 50 }, width: 0.01, color: "#999999" }, labels: { distance: 8, overflow: "justify", rotation: 0 }, minColor: "#e6e9ff", maxColor: "#0022ff", tickLength: 5, showInLegend: !0 });
176
- class O extends vt() {
177
- static compose(e, t, i, s) {
178
- Oi.compose(O, e, t, i, s);
179
- }
180
- constructor(e, t) {
181
- super(e, t), this.coll = "colorAxis", this.visible = !0, this.init(e, t);
182
- }
183
- init(e, t) {
184
- let i = e.options.legend || {}, s = t.layout ? t.layout !== "vertical" : i.layout !== "vertical";
185
- this.side = t.side || s ? 2 : 1, this.reversed = t.reversed || !s, this.opposite = !s, super.init(e, t, "colorAxis"), this.userOptions = t, Fi(e.userOptions.colorAxis) && (e.userOptions.colorAxis[this.index] = t), t.dataClasses && this.initDataClasses(t), this.initStops(), this.horiz = s, this.zoomEnabled = !1;
186
- }
187
- hasData() {
188
- return !!(this.tickPositions || []).length;
189
- }
190
- setTickPositions() {
191
- if (!this.dataClasses) return super.setTickPositions();
192
- }
193
- setOptions(e) {
194
- let t = Tt(tt.colorAxis, e, { showEmpty: !1, title: null, visible: this.chart.options.legend.enabled && e.visible !== !1 });
195
- super.setOptions(t), this.options.crosshair = this.options.marker;
196
- }
197
- setAxisSize() {
198
- let e = this.chart, t = this.legendItem?.symbol, { width: i, height: s } = this.getSize();
199
- t && (this.left = +t.attr("x"), this.top = +t.attr("y"), this.width = i = +t.attr("width"), this.height = s = +t.attr("height"), this.right = e.chartWidth - this.left - i, this.bottom = e.chartHeight - this.top - s, this.pos = this.horiz ? this.left : this.top), this.len = (this.horiz ? i : s) || O.defaultLegendLength;
200
- }
201
- getOffset() {
202
- let e = this.legendItem?.group, t = this.chart.axisOffset[this.side];
203
- if (e) {
204
- this.axisParent = e, super.getOffset();
205
- let i = this.chart.legend;
206
- i.allItems.forEach(function(s) {
207
- s instanceof O && s.drawLegendSymbol(i, s);
208
- }), i.render(), this.chart.getMargins(!0), this.chart.series.some((s) => s.isDrilling) || (this.isDirty = !0), this.added || (this.added = !0, this.labelLeft = 0, this.labelRight = this.width), this.chart.axisOffset[this.side] = t;
209
- }
210
- }
211
- setLegendColor() {
212
- let e = this.horiz, t = this.reversed, i = +!!t, s = +!t, r = e ? [i, 0, s, 0] : [0, s, 0, i];
213
- this.legendColor = { linearGradient: { x1: r[0], y1: r[1], x2: r[2], y2: r[3] }, stops: this.stops };
214
- }
215
- drawLegendSymbol(e, t) {
216
- let i = t.legendItem || {}, s = e.padding, r = e.options, a = this.options.labels, o = F(r.itemDistance, 10), n = this.horiz, { width: h, height: p } = this.getSize(), d = F(r.labelPadding, n ? 16 : 30);
217
- this.setLegendColor(), i.symbol || (i.symbol = this.chart.renderer.symbol("roundedRect").attr({ r: r.symbolRadius ?? 3, zIndex: 1 }).add(i.group)), i.symbol.attr({ x: 0, y: (e.baseline || 0) - 11, width: h, height: p }), i.labelWidth = h + s + (n ? o : F(a.x, a.distance) + (this.maxLabelLength || 0)), i.labelHeight = p + s + (n ? d : 0);
218
- }
219
- setState(e) {
220
- this.series.forEach(function(t) {
221
- t.setState(e);
222
- });
223
- }
224
- setVisible() {
225
- }
226
- getSeriesExtremes() {
227
- let e = this.series, t, i, s, r, a = e.length;
228
- for (this.dataMin = 1 / 0, this.dataMax = -1 / 0; a--; ) {
229
- for (let o of (i = (r = e[a]).colorKey = F(r.options.colorKey, r.colorKey, r.pointValKey, r.zoneAxis, "y"), s = r[i + "Min"] && r[i + "Max"], [i, "value", "y"])) if ((t = r.getColumn(o)).length) break;
230
- if (s) r.minColorValue = r[i + "Min"], r.maxColorValue = r[i + "Max"];
231
- else {
232
- let o = Ct.prototype.getExtremes.call(r, t);
233
- r.minColorValue = o.dataMin, r.maxColorValue = o.dataMax;
234
- }
235
- Ae(r.minColorValue) && Ae(r.maxColorValue) && (this.dataMin = Math.min(this.dataMin, r.minColorValue), this.dataMax = Math.max(this.dataMax, r.maxColorValue)), s || Ct.prototype.applyExtremes.call(r);
236
- }
237
- }
238
- drawCrosshair(e, t) {
239
- let i, s = this.legendItem || {}, r = t?.plotX, a = t?.plotY, o = this.pos, n = this.len;
240
- t && ((i = this.toPixels(t.getNestedProperty(t.series.colorKey))) < o ? i = o - 2 : i > o + n && (i = o + n + 2), t.plotX = i, t.plotY = this.len - i, super.drawCrosshair(e, t), t.plotX = r, t.plotY = a, this.cross && !this.cross.addedToColorAxis && s.group && (this.cross.addClass("highcharts-coloraxis-marker").add(s.group), this.cross.addedToColorAxis = !0, this.chart.styledMode || typeof this.crosshair != "object" || this.cross.attr({ fill: this.crosshair.color })));
241
- }
242
- getPlotLinePath(e) {
243
- let t = this.left, i = e.translatedValue, s = this.top;
244
- return Wi(i) ? this.horiz ? [["M", i - 4, s - 6], ["L", i + 4, s - 6], ["L", i, s], ["Z"]] : [["M", t, i], ["L", t - 6, i + 6], ["L", t - 6, i - 6], ["Z"]] : super.getPlotLinePath(e);
245
- }
246
- update(e, t) {
247
- let i = this.chart.legend;
248
- this.series.forEach((s) => {
249
- s.isDirtyData = !0;
250
- }), (e.dataClasses && i.allItems || this.dataClasses) && this.destroyItems(), super.update(e, t), this.legendItem?.label && (this.setLegendColor(), i.colorizeItem(this, !0));
251
- }
252
- destroyItems() {
253
- let e = this.chart, t = this.legendItem || {};
254
- if (t.label) e.legend.destroyItem(this);
255
- else if (t.labels) for (let i of t.labels) e.legend.destroyItem(i);
256
- e.isDirtyLegend = !0;
257
- }
258
- destroy() {
259
- this.chart.isDirtyLegend = !0, this.destroyItems(), super.destroy(...[].slice.call(arguments));
260
- }
261
- remove(e) {
262
- this.destroyItems(), super.remove(e);
263
- }
264
- getDataClassLegendSymbols() {
265
- let e, t = this, i = t.chart, s = t.legendItem && t.legendItem.labels || [], r = i.options.legend, a = F(r.valueDecimals, -1), o = F(r.valueSuffix, ""), n = (h) => t.series.reduce((p, d) => (p.push(...d.points.filter((c) => c.dataClass === h)), p), []);
266
- return s.length || t.dataClasses.forEach((h, p) => {
267
- let d = h.from, c = h.to, { numberFormatter: g } = i, f = !0;
268
- e = "", d === void 0 ? e = "< " : c === void 0 && (e = "> "), d !== void 0 && (e += g(d, a) + o), d !== void 0 && c !== void 0 && (e += " - "), c !== void 0 && (e += g(c, a) + o), s.push(Pt({ chart: i, name: e, options: {}, drawLegendSymbol: Yi().rectangle, visible: !0, isDataClass: !0, setState: (u) => {
269
- for (let m of n(p)) m.setState(u);
270
- }, setVisible: function() {
271
- this.visible = f = t.visible = !f;
272
- let u = [];
273
- for (let m of n(p)) m.setVisible(f), m.hiddenInDataClass = !f, u.indexOf(m.series) === -1 && u.push(m.series);
274
- i.legend.colorizeItem(this, f), u.forEach((m) => {
275
- Ri(m, "afterDataClassLegendClick");
276
- });
277
- } }, h));
278
- }), s;
279
- }
280
- getSize() {
281
- let { chart: e, horiz: t } = this, { height: i, width: s } = this.options, { legend: r } = e.options;
282
- return { width: F(Ae(s) ? At(s, e.chartWidth) : void 0, r?.symbolWidth, t ? O.defaultLegendLength : 12), height: F(Ae(i) ? At(i, e.chartHeight) : void 0, r?.symbolHeight, t ? 12 : O.defaultLegendLength) };
283
- }
284
- }
285
- O.defaultLegendLength = 200, O.keepProps = ["legendItem"], Pt(O.prototype, Xi), Array.prototype.push.apply(vt().keepProps, O.keepProps);
286
- let H = v();
287
- H.ColorAxis = H.ColorAxis || O, H.ColorAxis.compose(H.Chart, H.Fx, H.Legend, H.Series);
288
- let Zi = { lang: { zoomIn: "Zoom in", zoomOut: "Zoom out" }, mapNavigation: { buttonOptions: { alignTo: "plotBox", align: "left", verticalAlign: "top", x: 0, width: 18, height: 18, padding: 5, style: { color: "#666666", fontSize: "1em", fontWeight: "bold" }, theme: { fill: "#ffffff", stroke: "#e6e6e6", "stroke-width": 1, "text-align": "center" } }, buttons: { zoomIn: { onclick: function() {
289
- this.mapZoom(0.5);
290
- }, text: "+", y: 0 }, zoomOut: { onclick: function() {
291
- this.mapZoom(2);
292
- }, text: "-", y: 28 } }, mouseWheelSensitivity: 1.1 } }, { defined: Ui, extend: Lt, pick: Hi, wrap: jt } = v();
293
- (function(l) {
294
- let e, t = 0;
295
- function i(o) {
296
- let n = this.chart;
297
- o = this.normalize(o), n.options.mapNavigation.enableDoubleClickZoomTo ? n.pointer.inClass(o.target, "highcharts-tracker") && n.hoverPoint && n.hoverPoint.zoomTo() : n.isInsidePlot(o.chartX - n.plotLeft, o.chartY - n.plotTop) && n.mapZoom(0.5, void 0, void 0, o.chartX, o.chartY);
298
- }
299
- function s(o) {
300
- let n = this.chart, h = Ui((o = this.normalize(o)).wheelDelta) && -o.wheelDelta / 120 || o.deltaY || o.detail;
301
- Math.abs(h) >= 1 && (t += Math.abs(h), e && clearTimeout(e), e = setTimeout(() => {
302
- t = 0;
303
- }, 50)), t < 10 && n.isInsidePlot(o.chartX - n.plotLeft, o.chartY - n.plotTop) && n.mapView && n.mapView.zoomBy(-((n.options.mapNavigation.mouseWheelSensitivity - 1) * h), void 0, [o.chartX, o.chartY], !(1 > Math.abs(h)) && void 0);
304
- }
305
- function r(o, n, h) {
306
- let p = this.chart;
307
- if (n = o.call(this, n, h), p && p.mapView) {
308
- let d = p.mapView.pixelsToLonLat({ x: n.chartX - p.plotLeft, y: n.chartY - p.plotTop });
309
- d && Lt(n, d);
310
- }
311
- return n;
312
- }
313
- function a(o) {
314
- let n = this.chart.options.mapNavigation;
315
- n && Hi(n.enableTouchZoom, n.enabled) && (this.chart.zooming.pinchType = "xy"), o.apply(this, [].slice.call(arguments, 1));
316
- }
317
- l.compose = function(o) {
318
- let n = o.prototype;
319
- n.onContainerDblClick || (Lt(n, { onContainerDblClick: i, onContainerMouseWheel: s }), jt(n, "normalize", r), jt(n, "zoomOption", a));
320
- };
321
- })(qe || (qe = {}));
322
- let qi = qe;
323
- function Ki(l, e, t, i, s) {
324
- if (s) {
325
- let r = s?.r || 0;
326
- s.brBoxY = e - r, s.brBoxHeight = i + r;
327
- }
328
- return Pe.roundedRect(l, e, t, i, s);
329
- }
330
- function $i(l, e, t, i, s) {
331
- if (s) {
332
- let r = s?.r || 0;
333
- s.brBoxHeight = i + r;
334
- }
335
- return Pe.roundedRect(l, e, t, i, s);
336
- }
337
- let _i = { compose: function(l) {
338
- (Pe = l.prototype.symbols).bottombutton = Ki, Pe.topbutton = $i;
339
- } }, { setOptions: Ji } = v(), { composed: Qi } = v(), { addEvent: ee, extend: zt, merge: it, objectEach: es, pick: st, pushUnique: ts } = v();
340
- function ot(l) {
341
- l && (l.preventDefault?.(), l.stopPropagation?.(), l.cancelBubble = !0);
342
- }
343
- class Le {
344
- static compose(e, t, i) {
345
- qi.compose(t), _i.compose(i), ts(Qi, "Map.Navigation") && (ee(e, "beforeRender", function() {
346
- this.mapNavigation = new Le(this), this.mapNavigation.update();
347
- }), Ji(Zi));
348
- }
349
- constructor(e) {
350
- this.chart = e, this.navButtons = [];
351
- }
352
- update(e) {
353
- let t = this, i = t.chart, s = t.navButtons, r = function(o) {
354
- this.handler.call(i, o), ot(o);
355
- }, a = i.options.mapNavigation;
356
- for (e && (a = i.options.mapNavigation = it(i.options.mapNavigation, e)); s.length; ) s.pop()?.destroy();
357
- if (!i.renderer.forExport && st(a.enableButtons, a.enabled)) {
358
- t.navButtonsGroup || (t.navButtonsGroup = i.renderer.g().attr({ zIndex: 7 }).add()), es(a.buttons, (n, h) => {
359
- let p = { padding: (n = it(a.buttonOptions, n)).padding };
360
- !i.styledMode && n.theme && (zt(p, n.theme), p.style = it(n.theme.style, n.style));
361
- let { text: d, width: c = 0, height: g = 0, padding: f = 0 } = n, u = i.renderer.button(d !== "+" && d !== "-" && d || "", 0, 0, r, p, void 0, void 0, void 0, h === "zoomIn" ? "topbutton" : "bottombutton").addClass("highcharts-map-navigation highcharts-" + { zoomIn: "zoom-in", zoomOut: "zoom-out" }[h]).attr({ width: c, height: g, title: i.options.lang[h], zIndex: 5 }).add(t.navButtonsGroup);
362
- if (d === "+" || d === "-") {
363
- let m = c + 1, b = [["M", f + 3, f + g / 2], ["L", f + m - 3, f + g / 2]];
364
- d === "+" && b.push(["M", f + m / 2, f + 3], ["L", f + m / 2, f + g - 3]), i.renderer.path(b).addClass("highcharts-button-symbol").attr(i.styledMode ? {} : { stroke: n.style?.color, "stroke-width": 3, "stroke-linecap": "round" }).add(u);
365
- }
366
- if (u.handler = n.onclick, ee(u.element, "dblclick", ot), s.push(u), zt(n, { width: u.width, height: 2 * (u.height || 0) }), i.hasLoaded) u.align(n, !1, n.alignTo);
367
- else {
368
- let m = ee(i, "load", () => {
369
- u.element && u.align(n, !1, n.alignTo), m();
370
- });
371
- }
372
- });
373
- let o = (n, h) => !(h.x >= n.x + n.width || h.x + h.width <= n.x || h.y >= n.y + n.height || h.y + h.height <= n.y);
374
- i.hasLoaded || ee(i, "render", function() {
375
- let n = i.exporting?.group?.getBBox();
376
- if (n) {
377
- let h = t.navButtonsGroup.getBBox();
378
- if (o(n, h)) {
379
- let p = -h.y - h.height + n.y - 5, d = n.y + n.height - h.y + 5, c = a.buttonOptions && a.buttonOptions.verticalAlign;
380
- t.navButtonsGroup.attr({ translateY: c === "bottom" ? p : d });
381
- }
382
- }
383
- });
384
- }
385
- this.updateEvents(a);
386
- }
387
- updateEvents(e) {
388
- let t = this.chart;
389
- st(e.enableDoubleClickZoom, e.enabled) || e.enableDoubleClickZoomTo ? this.unbindDblClick = this.unbindDblClick || ee(t.container, "dblclick", function(i) {
390
- t.pointer.onContainerDblClick(i);
391
- }) : this.unbindDblClick && (this.unbindDblClick = this.unbindDblClick()), st(e.enableMouseWheelZoom, e.enabled) ? this.unbindMouseWheel = this.unbindMouseWheel || ee(t.container, "wheel", function(i) {
392
- if (!t.pointer.inClass(i.target, "highcharts-no-mousewheel")) {
393
- let s = t.mapView?.zoom;
394
- t.pointer.onContainerMouseWheel(i), s !== t.mapView?.zoom && ot(i);
395
- }
396
- return !1;
397
- }) : this.unbindMouseWheel && (this.unbindMouseWheel = this.unbindMouseWheel());
398
- }
399
- }
400
- var is = C(28), ss = C.n(is);
401
- let { column: { prototype: os } } = I().seriesTypes, { addEvent: rs, defined: as } = v();
402
- (function(l) {
403
- function e(t) {
404
- let i = this.series, s = i.chart.renderer;
405
- this.moveToTopOnHover && this.graphic && (i.stateMarkerGraphic || (i.stateMarkerGraphic = new (ss())(s, "use").css({ pointerEvents: "none" }).add(this.graphic.parentGroup)), t?.state === "hover" ? (this.graphic.attr({ id: this.id }), i.stateMarkerGraphic.attr({ href: `${s.url}#${this.id}`, visibility: "visible" })) : i.stateMarkerGraphic.attr({ href: "" }));
406
- }
407
- l.pointMembers = { dataLabelOnNull: !0, moveToTopOnHover: !0, isValid: function() {
408
- return this.value !== null && this.value !== 1 / 0 && this.value !== -1 / 0 && (this.value === void 0 || !isNaN(this.value));
409
- } }, l.seriesMembers = { colorKey: "value", axisTypes: ["xAxis", "yAxis", "colorAxis"], parallelArrays: ["x", "y", "value"], pointArrayMap: ["value"], trackerGroups: ["group", "markerGroup", "dataLabelsGroup"], colorAttribs: function(t) {
410
- let i = {};
411
- return as(t.color) && (!t.state || t.state === "normal") && (i[this.colorProp || "fill"] = t.color), i;
412
- }, pointAttribs: os.pointAttribs }, l.compose = function(t) {
413
- return rs(t.prototype.pointClass, "afterSetState", e), t;
414
- };
415
- })(Ke || (Ke = {}));
416
- let B = Ke;
417
- var ns = C(820), ls = C.n(ns);
418
- let { deg2rad: kt } = v(), { fireEvent: hs, isNumber: rt, pick: je, relativeLength: ps } = v();
419
- (function(l) {
420
- l.getCenter = function() {
421
- let e = this.options, t = this.chart, i = 2 * (e.slicedOffset || 0), s = t.plotWidth - 2 * i, r = t.plotHeight - 2 * i, a = e.center, o = Math.min(s, r), n = e.thickness, h, p = e.size, d = e.innerSize || 0, c, g;
422
- typeof p == "string" && (p = parseFloat(p)), typeof d == "string" && (d = parseFloat(d));
423
- let f = [je(a?.[0], "50%"), je(a?.[1], "50%"), je(p && p < 0 ? void 0 : e.size, "100%"), je(d && d < 0 ? void 0 : e.innerSize || 0, "0%")];
424
- for (!t.angular || this instanceof ls() || (f[3] = 0), c = 0; c < 4; ++c) g = f[c], h = c < 2 || c === 2 && /%$/.test(g), f[c] = ps(g, [s, r, o, f[2]][c]) + (h ? i : 0);
425
- return f[3] > f[2] && (f[3] = f[2]), rt(n) && 2 * n < f[2] && n > 0 && (f[3] = f[2] - 2 * n), hs(this, "afterGetCenter", { positions: f }), f;
426
- }, l.getStartAndEndRadians = function(e, t) {
427
- let i = rt(e) ? e : 0, s = rt(t) && t > i && t - i < 360 ? t : i + 360;
428
- return { start: kt * (i + -90), end: kt * (s + -90) };
429
- };
430
- })($e || ($e = {}));
431
- let ds = $e;
432
- var cs = C(960), us = C.n(cs), ms = C(540), at = C.n(ms);
433
- let { getOptions: gs } = v(), { isNumber: he, merge: fs, pick: St } = v();
434
- class nt extends us() {
435
- init(e, t) {
436
- let i = gs().credits, s = fs({ chart: { panning: { enabled: !0, type: "xy" }, type: "map" }, credits: { mapText: St(i.mapText, ' © <a href="{geojson.copyrightUrl}">{geojson.copyrightShort}</a>'), mapTextFull: St(i.mapTextFull, "{geojson.copyright}") }, mapView: {}, tooltip: { followTouchMove: !1 } }, e);
437
- super.init(s, t);
438
- }
439
- mapZoom(e, t, i, s, r) {
440
- this.mapView && (he(e) && (e = Math.log(e) / Math.log(0.5)), this.mapView.zoomBy(e, he(t) && he(i) ? this.mapView.projection.inverse([t, i]) : void 0, he(s) && he(r) ? [s, r] : void 0));
441
- }
442
- update(e) {
443
- e.chart && "map" in e.chart && this.mapView?.recommendMapView(this, [e.chart.map, ...(this.options.series || []).map((t) => t.mapData)], !0), super.update.apply(this, arguments);
444
- }
445
- }
446
- (function(l) {
447
- l.maps = {}, l.mapChart = function(e, t, i) {
448
- return new l(e, t, i);
449
- }, l.splitPath = function(e) {
450
- let t;
451
- return t = typeof e == "string" ? (e = e.replace(/([A-Z])/gi, " $1 ").replace(/^\s*/, "").replace(/\s*$/, "")).split(/[ ,;]+/).map((i) => /[A-Z]/i.test(i) ? i : parseFloat(i)) : e, at().prototype.pathToSegments(t);
452
- };
453
- })(nt || (nt = {}));
454
- let ze = nt, It = { boundsFromPath: function(l) {
455
- let e = -Number.MAX_VALUE, t = Number.MAX_VALUE, i = -Number.MAX_VALUE, s = Number.MAX_VALUE, r;
456
- if (l.forEach((a) => {
457
- let o = a[a.length - 2], n = a[a.length - 1];
458
- typeof o == "number" && typeof n == "number" && (t = Math.min(t, o), e = Math.max(e, o), s = Math.min(s, n), i = Math.max(i, n), r = !0);
459
- }), r) return { x1: t, y1: s, x2: e, y2: i };
460
- } }, { boundsFromPath: bs } = It, ys = I().seriesTypes.scatter.prototype.pointClass, { extend: Bt, isNumber: pe, pick: Et } = v();
461
- class te extends ys {
462
- static getProjectedPath(e, t) {
463
- return e.projectedPath || (t && e.geometry ? (t.hasCoordinates = !0, e.projectedPath = t.path(e.geometry)) : e.projectedPath = e.path), e.projectedPath || [];
464
- }
465
- applyOptions(e, t) {
466
- let i = this.series, s = super.applyOptions(e, t), r = i.joinBy;
467
- if (i.mapData && i.mapMap) {
468
- let a = r[1], o = super.getNestedProperty(a), n = o !== void 0 && i.mapMap[o];
469
- n ? Bt(s, { ...n, name: s.name ?? n.name }) : i.pointArrayMap.indexOf("value") !== -1 && (s.value = s.value || null);
470
- }
471
- return s;
472
- }
473
- getProjectedBounds(e) {
474
- let t = bs(te.getProjectedPath(this, e)), i = this.properties, s = this.series.chart.mapView;
475
- if (t) {
476
- let r = i?.["hc-middle-lon"], a = i?.["hc-middle-lat"];
477
- if (s && pe(r) && pe(a)) {
478
- let o = e.forward([r, a]);
479
- t.midX = o[0], t.midY = o[1];
480
- } else {
481
- let o = i?.["hc-middle-x"], n = i?.["hc-middle-y"];
482
- t.midX = t.x1 + (t.x2 - t.x1) * Et(this.middleX, pe(o) ? o : 0.5);
483
- let h = Et(this.middleY, pe(n) ? n : 0.5);
484
- this.geometry || (h = 1 - h), t.midY = t.y2 - (t.y2 - t.y1) * h;
485
- }
486
- return t;
487
- }
488
- }
489
- onMouseOver(e) {
490
- v().clearTimeout(this.colorInterval), !this.isNull && this.visible || this.series.options.nullInteraction ? super.onMouseOver.call(this, e) : this.series.onMouseOut();
491
- }
492
- setVisible(e) {
493
- this.visible = this.options.visible = !!e, this.dataLabel && this.dataLabel[e ? "show" : "hide"](), this.graphic && this.graphic.attr(this.series.pointAttribs(this));
494
- }
495
- zoomTo(e) {
496
- let t = this.series.chart, i = t.mapView, s = this.bounds;
497
- if (i && s) {
498
- let r = pe(this.insetIndex) && i.insets[this.insetIndex];
499
- if (r) {
500
- let a = r.projectedUnitsToPixels({ x: s.x1, y: s.y1 }), o = r.projectedUnitsToPixels({ x: s.x2, y: s.y2 }), n = i.pixelsToProjectedUnits({ x: a.x, y: a.y }), h = i.pixelsToProjectedUnits({ x: o.x, y: o.y });
501
- s = { x1: n.x, y1: n.y, x2: h.x, y2: h.y };
502
- }
503
- i.fitToBounds(s, void 0, !1), this.series.isDirty = !0, t.redraw(e);
504
- }
505
- }
506
- }
507
- Bt(te.prototype, { dataLabelOnNull: B.pointMembers.dataLabelOnNull, moveToTopOnHover: B.pointMembers.moveToTopOnHover, isValid: B.pointMembers.isValid });
508
- let { isNumber: xs } = v(), Ms = { center: [0, 0], fitToGeometry: void 0, maxZoom: void 0, padding: 0, projection: { name: void 0, parallels: void 0, rotation: void 0 }, zoom: void 0, insetOptions: { borderColor: "#cccccc", borderWidth: 1, padding: "10%", relativeTo: "mapBoundingBox", units: "percent" } };
509
- var vs = C(984), Dt = C.n(vs);
510
- let { win: Ot } = v(), { format: Vt } = Dt(), { error: Xt, extend: ws, merge: Cs, wrap: Ps } = v();
511
- (function(l) {
512
- function e(o) {
513
- return this.mapView && this.mapView.lonLatToProjectedUnits(o);
514
- }
515
- function t(o) {
516
- return this.mapView && this.mapView.projectedUnitsToLonLat(o);
517
- }
518
- function i(o, n) {
519
- let h = this.options.chart.proj4 || Ot.proj4;
520
- if (!h) return void Xt(21, !1, this);
521
- let { jsonmarginX: p = 0, jsonmarginY: d = 0, jsonres: c = 1, scale: g = 1, xoffset: f = 0, xpan: u = 0, yoffset: m = 0, ypan: b = 0 } = n, y = h(n.crs, [o.lon, o.lat]), x = n.cosAngle || n.rotation && Math.cos(n.rotation), M = n.sinAngle || n.rotation && Math.sin(n.rotation), w = n.rotation ? [y[0] * x + y[1] * M, -y[0] * M + y[1] * x] : y;
522
- return { x: ((w[0] - f) * g + u) * c + p, y: -(((m - w[1]) * g + b) * c - d) };
523
- }
524
- function s(o, n) {
525
- let h = this.options.chart.proj4 || Ot.proj4;
526
- if (!h) return void Xt(21, !1, this);
527
- if (o.y === null) return;
528
- let { jsonmarginX: p = 0, jsonmarginY: d = 0, jsonres: c = 1, scale: g = 1, xoffset: f = 0, xpan: u = 0, yoffset: m = 0, ypan: b = 0 } = n, y = { x: ((o.x - p) / c - u) / g + f, y: ((o.y - d) / c + b) / g + m }, x = n.cosAngle || n.rotation && Math.cos(n.rotation), M = n.sinAngle || n.rotation && Math.sin(n.rotation), w = h(n.crs, "WGS84", n.rotation ? { x: y.x * x + -(y.y * M), y: y.x * M + y.y * x } : y);
529
- return { lat: w.y, lon: w.x };
530
- }
531
- function r(o, n) {
532
- n || (n = Object.keys(o.objects)[0]);
533
- let h = o.objects[n];
534
- if (h["hc-decoded-geojson"] && h["hc-decoded-geojson"].title === o.title) return h["hc-decoded-geojson"];
535
- let p = o.arcs;
536
- if (o.transform) {
537
- let u, m, b, y = o.arcs, { scale: x, translate: M } = o.transform;
538
- p = [];
539
- for (let w = 0, P = y.length; w < P; ++w) {
540
- let j = y[w];
541
- p.push(u = []), m = 0, b = 0;
542
- for (let A = 0, T = j.length; A < T; ++A) u.push([(m += j[A][0]) * x[0] + M[0], (b += j[A][1]) * x[1] + M[1]]);
543
- }
544
- }
545
- let d = (u) => typeof u[0] == "number" ? u.reduce((m, b, y) => {
546
- let x = b < 0 ? p[~b] : p[b];
547
- return b < 0 ? (x = x.slice(0, y === 0 ? x.length : x.length - 1)).reverse() : y && (x = x.slice(1)), m.concat(x);
548
- }, []) : u.map(d), c = h.geometries, g = [];
549
- for (let u = 0, m = c.length; u < m; ++u) g.push({ type: "Feature", properties: c[u].properties, geometry: { type: c[u].type, coordinates: c[u].coordinates || d(c[u].arcs) } });
550
- let f = { type: "FeatureCollection", copyright: o.copyright, copyrightShort: o.copyrightShort, copyrightUrl: o.copyrightUrl, features: g, "hc-recommended-mapview": h["hc-recommended-mapview"], bbox: o.bbox, title: o.title };
551
- return h["hc-decoded-geojson"] = f, f;
552
- }
553
- function a(o, n) {
554
- n = Cs(!0, this.options.credits, n), o.call(this, n), this.credits && this.mapCreditsFull && this.credits.attr({ title: this.mapCreditsFull });
555
- }
556
- l.compose = function(o) {
557
- let n = o.prototype;
558
- n.transformFromLatLon || (n.fromLatLonToPoint = e, n.fromPointToLatLon = t, n.transformFromLatLon = i, n.transformToLatLon = s, Ps(n, "addCredits", a));
559
- }, l.geojson = function(o, n = "map", h) {
560
- let p = [], d = o.type === "Topology" ? r(o) : o, c = d.features;
561
- for (let g = 0, f = c.length; g < f; ++g) {
562
- let u, m = c[g], b = m.geometry || {}, y = b.type, x = b.coordinates, M = m.properties;
563
- if ((n === "map" || n === "mapbubble") && (y === "Polygon" || y === "MultiPolygon") || n === "mapline" && (y === "LineString" || y === "MultiLineString") ? x.length && (u = { geometry: { coordinates: x, type: y } }) : n === "mappoint" && y === "Point" && x.length && (u = { geometry: { coordinates: x, type: y } }), u) {
564
- let w = M && (M.name || M.NAME), P = M && M.lon, j = M && M.lat;
565
- p.push(ws(u, { lat: typeof j == "number" ? j : void 0, lon: typeof P == "number" ? P : void 0, name: typeof w == "string" ? w : void 0, properties: M }));
566
- }
567
- }
568
- return h && d.copyrightShort && (h.chart.mapCredits = Vt(h.chart.options.credits?.mapText, { geojson: d }), h.chart.mapCreditsFull = Vt(h.chart.options.credits?.mapTextFull, { geojson: d })), p;
569
- }, l.topo2geo = r;
570
- })(_e || (_e = {}));
571
- let ke = _e;
572
- (function(l) {
573
- l.getCenterOfPoints = function(e) {
574
- let t = e.reduce((i, s) => (i.x += s.x, i.y += s.y, i), { x: 0, y: 0 });
575
- return { x: t.x / e.length, y: t.y / e.length };
576
- }, l.getDistanceBetweenPoints = function(e, t) {
577
- return Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2));
578
- }, l.getAngleBetweenPoints = function(e, t) {
579
- return Math.atan2(t.x - e.x, t.y - e.y);
580
- }, l.pointInPolygon = function({ x: e, y: t }, i) {
581
- let s = i.length, r, a, o = !1;
582
- for (r = 0, a = s - 1; r < s; a = r++) {
583
- let [n, h] = i[r], [p, d] = i[a];
584
- h > t != d > t && e < (p - n) * (t - h) / (d - h) + n && (o = !o);
585
- }
586
- return o;
587
- };
588
- })(Je || (Je = {}));
589
- let Ts = Je;
590
- function Nt(l, e, t = !0) {
591
- let i = e[e.length - 1], s, r, a, o = l;
592
- for (let n = 0; n < e.length; n++) {
593
- let h = o;
594
- s = e[n], o = [], r = t ? h[h.length - 1] : h[0];
595
- for (let p = 0; p < h.length; p++) lt(i, s, a = h[p]) ? (lt(i, s, r) || o.push(Yt(i, s, r, a)), o.push(a)) : lt(i, s, r) && o.push(Yt(i, s, r, a)), r = a;
596
- i = s;
597
- }
598
- return o;
599
- }
600
- function lt(l, e, t) {
601
- return (e[0] - l[0]) * (t[1] - l[1]) > (e[1] - l[1]) * (t[0] - l[0]);
602
- }
603
- function Yt(l, e, t, i) {
604
- let s = [l[0] - e[0], l[1] - e[1]], r = [t[0] - i[0], t[1] - i[1]], a = l[0] * e[1] - l[1] * e[0], o = t[0] * i[1] - t[1] * i[0], n = 1 / (s[0] * r[1] - s[1] * r[0]), h = [(a * r[0] - o * s[0]) * n, (a * r[1] - o * s[1]) * n];
605
- return h.isIntersection = !0, h;
606
- }
607
- let de = Math.sign || ((l) => l === 0 ? 0 : l > 0 ? 1 : -1), ce = Math.PI / 180, ie = Math.PI / 2, Se = (l) => Math.tan((ie + l) / 2), As = class {
608
- constructor(l) {
609
- let e = (l.parallels || []).map((a) => a * ce), t = e[0] || 0, i = e[1] ?? t, s = Math.cos(t);
610
- typeof l.projectedBounds == "object" && (this.projectedBounds = l.projectedBounds);
611
- let r = t === i ? Math.sin(t) : Math.log(s / Math.cos(i)) / Math.log(Se(i) / Se(t));
612
- 1e-10 > Math.abs(r) && (r = 1e-10 * (de(r) || 1)), this.n = r, this.c = s * Math.pow(Se(t), r) / r;
613
- }
614
- forward(l) {
615
- let { c: e, n: t, projectedBounds: i } = this, s = l[0] * ce, r = l[1] * ce;
616
- e > 0 ? r < -ie + 1e-6 && (r = -ie + 1e-6) : r > ie - 1e-6 && (r = ie - 1e-6);
617
- let a = e / Math.pow(Se(r), t), o = a * Math.sin(t * s) * 63.78137, n = (e - a * Math.cos(t * s)) * 63.78137, h = [o, n];
618
- return i && (o < i.x1 || o > i.x2 || n < i.y1 || n > i.y2) && (h.outside = !0), h;
619
- }
620
- inverse(l) {
621
- let { c: e, n: t } = this, i = l[0] / 63.78137, s = e - l[1] / 63.78137, r = de(t) * Math.sqrt(i * i + s * s), a = Math.atan2(i, Math.abs(s)) * de(s);
622
- return s * t < 0 && (a -= Math.PI * de(i) * de(s)), [a / t / ce, (2 * Math.atan(Math.pow(e / r, 1 / t)) - ie) / ce];
623
- }
624
- }, Ie = Math.sqrt(3) / 2, Ls = class {
625
- constructor() {
626
- this.bounds = { x1: -200.37508342789243, x2: 200.37508342789243, y1: -97.52595454902263, y2: 97.52595454902263 };
627
- }
628
- forward(l) {
629
- let e = Math.PI / 180, t = Math.asin(Ie * Math.sin(l[1] * e)), i = t * t, s = i * i * i;
630
- return [l[0] * e * Math.cos(t) * 74.03120656864502 / (Ie * (1.340264 + -0.24331799999999998 * i + s * (0.0062510000000000005 + 0.034164 * i))), 74.03120656864502 * t * (1.340264 + -0.081106 * i + s * (893e-6 + 3796e-6 * i))];
631
- }
632
- inverse(l) {
633
- let e = l[0] / 74.03120656864502, t = l[1] / 74.03120656864502, i = 180 / Math.PI, s = t, r, a, o, n;
634
- for (let d = 0; d < 12 && (a = (r = s * s) * r * r, o = s * (1.340264 + -0.081106 * r + a * (893e-6 + 3796e-6 * r)) - t, s -= n = o / (1.340264 + -0.24331799999999998 * r + a * (0.0062510000000000005 + 0.034164 * r)), !(1e-9 > Math.abs(n))); ++d) ;
635
- a = (r = s * s) * r * r;
636
- let h = i * Ie * e * (1.340264 + -0.24331799999999998 * r + a * (0.0062510000000000005 + 0.034164 * r)) / Math.cos(s), p = i * Math.asin(Math.sin(s) / Ie);
637
- return Math.abs(h) > 180 ? [NaN, NaN] : [h, p];
638
- }
639
- }, Gt = Math.PI / 4, Be = Math.PI / 180, js = class {
640
- constructor() {
641
- this.bounds = { x1: -200.37508342789243, x2: 200.37508342789243, y1: -146.91480769173063, y2: 146.91480769173063 };
642
- }
643
- forward(l) {
644
- return [l[0] * Be * 63.78137, 79.7267125 * Math.log(Math.tan(Gt + 0.4 * l[1] * Be))];
645
- }
646
- inverse(l) {
647
- return [l[0] / 63.78137 / Be, 2.5 * (Math.atan(Math.exp(0.8 * (l[1] / 63.78137))) - Gt) / Be];
648
- }
649
- }, Ee = Math.PI / 180, zs = class {
650
- constructor() {
651
- this.antimeridianCutting = !1, this.bounds = { x1: -63.78460826781007, x2: 63.78460826781007, y1: -63.78460826781007, y2: 63.78460826781007 };
652
- }
653
- forward(l) {
654
- let e = l[0], t = l[1] * Ee, i = [Math.cos(t) * Math.sin(e * Ee) * 63.78460826781007, 63.78460826781007 * Math.sin(t)];
655
- return (e < -90 || e > 90) && (i.outside = !0), i;
656
- }
657
- inverse(l) {
658
- let e = l[0] / 63.78460826781007, t = l[1] / 63.78460826781007, i = Math.sqrt(e * e + t * t), s = Math.asin(i), r = Math.sin(s);
659
- return [Math.atan2(e * r, i * Math.cos(s)) / Ee, Math.asin(i && t * r / i) / Ee];
660
- }
661
- }, De = Math.PI / 180, ks = class {
662
- constructor() {
663
- this.bounds = { x1: -200.37508342789243, x2: 200.37508342789243, y1: -200.3750834278071, y2: 200.3750834278071 }, this.maxLatitude = 85.0511287798;
664
- }
665
- forward(l) {
666
- let e = Math.sin(l[1] * De), t = [63.78137 * l[0] * De, 63.78137 * Math.log((1 + e) / (1 - e)) / 2];
667
- return Math.abs(l[1]) > this.maxLatitude && (t.outside = !0), t;
668
- }
669
- inverse(l) {
670
- return [l[0] / (63.78137 * De), (2 * Math.atan(Math.exp(l[1] / 63.78137)) - Math.PI / 2) / De];
671
- }
672
- }, { clipLineString: Ss, clipPolygon: Is } = { clipLineString: function(l, e) {
673
- let t = [], i = Nt(l, e, !1);
674
- for (let s = 1; s < i.length; s++) i[s].isIntersection && i[s - 1].isIntersection && (t.push(i.splice(0, s)), s = 0), s === i.length - 1 && t.push(i);
675
- return t;
676
- }, clipPolygon: Nt }, { clamp: Bs, erase: Es } = v(), z = 2 * Math.PI / 360, se = (l) => (l < -180 && (l += 360), l > 180 && (l -= 360), l), Rt = (l) => (1 - Math.cos(l)) / 2, Ds = (l, e) => {
677
- let t = Math.cos, i = l[1] * z, s = l[0] * z, r = e[1] * z, a = e[0] * z;
678
- return Rt(r - i) + t(i) * t(r) * Rt(a - s);
679
- };
680
- class E {
681
- static add(e, t) {
682
- E.registry[e] = t;
683
- }
684
- static distance(e, t) {
685
- let { atan2: i, sqrt: s } = Math, r = Ds(e, t);
686
- return 6371e3 * (2 * i(s(r), s(1 - r)));
687
- }
688
- static geodesic(e, t, i, s = 5e5) {
689
- let { atan2: r, cos: a, sin: o, sqrt: n } = Math, h = E.distance, p = e[1] * z, d = e[0] * z, c = t[1] * z, g = t[0] * z, f = a(p) * a(d), u = a(c) * a(g), m = a(p) * o(d), b = a(c) * o(g), y = o(p), x = o(c), M = h(e, t), w = M / 6371e3, P = o(w), j = Math.round(M / s), A = [];
690
- if (i && A.push(e), j > 1) {
691
- let T = 1 / j;
692
- for (let k = T; k < 0.999; k += T) {
693
- let V = o((1 - k) * w) / P, R = o(k * w) / P, Me = V * f + R * u, ve = V * m + R * b, we = r(V * y + R * x, n(Me * Me + ve * ve)), Ce = r(ve, Me);
694
- A.push([Ce / z, we / z]);
695
- }
696
- }
697
- return i && A.push(t), A;
698
- }
699
- static insertGeodesics(e) {
700
- let t = e.length - 1;
701
- for (; t--; ) if (Math.max(Math.abs(e[t][0] - e[t + 1][0]), Math.abs(e[t][1] - e[t + 1][1])) > 10) {
702
- let i = E.geodesic(e[t], e[t + 1]);
703
- i.length && e.splice(t + 1, 0, ...i);
704
- }
705
- }
706
- static toString(e) {
707
- let { name: t, rotation: i } = e || {};
708
- return [t, i && i.join(",")].join(";");
709
- }
710
- constructor(e = {}) {
711
- this.hasCoordinates = !1, this.hasGeoProjection = !1, this.maxLatitude = 90, this.options = e;
712
- let { name: t, projectedBounds: i, rotation: s } = e;
713
- this.rotator = s ? this.getRotator(s) : void 0;
714
- let r = t ? E.registry[t] : void 0;
715
- r && (this.def = new r(e));
716
- let { def: a, rotator: o } = this;
717
- a && (this.maxLatitude = a.maxLatitude || 90, this.hasGeoProjection = !0), o && a ? (this.forward = (n) => a.forward(o.forward(n)), this.inverse = (n) => o.inverse(a.inverse(n))) : a ? (this.forward = (n) => a.forward(n), this.inverse = (n) => a.inverse(n)) : o && (this.forward = o.forward, this.inverse = o.inverse), this.bounds = i === "world" ? a && a.bounds : i;
718
- }
719
- lineIntersectsBounds(e) {
720
- let { x1: t, x2: i, y1: s, y2: r } = this.bounds || {}, a = (h, p, d) => {
721
- let [c, g] = h, f = +!p;
722
- if (typeof d == "number" && c[p] >= d != g[p] >= d) {
723
- let u = (d - c[p]) / (g[p] - c[p]), m = c[f] + u * (g[f] - c[f]);
724
- return p ? [m, d] : [d, m];
725
- }
726
- }, o, n = e[0];
727
- return ((o = a(e, 0, t)) || (o = a(e, 0, i))) && (n = o, e[1] = o), ((o = a(e, 1, s)) || (o = a(e, 1, r))) && (n = o), n;
728
- }
729
- getRotator(e) {
730
- let t = e[0] * z, i = (e[1] || 0) * z, s = (e[2] || 0) * z, r = Math.cos(i), a = Math.sin(i), o = Math.cos(s), n = Math.sin(s);
731
- if (t !== 0 || i !== 0 || s !== 0) return { forward: (h) => {
732
- let p = h[0] * z + t, d = h[1] * z, c = Math.cos(d), g = Math.cos(p) * c, f = Math.sin(p) * c, u = Math.sin(d), m = u * r + g * a;
733
- return [Math.atan2(f * o - m * n, g * r - u * a) / z, Math.asin(m * o + f * n) / z];
734
- }, inverse: (h) => {
735
- let p = h[0] * z, d = h[1] * z, c = Math.cos(d), g = Math.cos(p) * c, f = Math.sin(p) * c, u = Math.sin(d), m = u * o - f * n;
736
- return [(Math.atan2(f * o + u * n, g * r + m * a) - t) / z, Math.asin(m * r - g * a) / z];
737
- } };
738
- }
739
- forward(e) {
740
- return e;
741
- }
742
- inverse(e) {
743
- return e;
744
- }
745
- cutOnAntimeridian(e, t) {
746
- let i, s = [], r = [e];
747
- for (let a = 0, o = e.length; a < o; ++a) {
748
- let n = e[a], h = e[a - 1];
749
- if (!a) {
750
- if (!t) continue;
751
- h = e[e.length - 1];
752
- }
753
- let p = h[0], d = n[0];
754
- if ((p < -90 || p > 90) && (d < -90 || d > 90) && p > 0 != d > 0) {
755
- let c = Bs((180 - (p + 360) % 360) / ((d + 360) % 360 - (p + 360) % 360), 0, 1), g = h[1] + c * (n[1] - h[1]);
756
- s.push({ i: a, lat: g, direction: p < 0 ? 1 : -1, previousLonLat: h, lonLat: n });
757
- }
758
- }
759
- if (s.length) if (t) {
760
- s.length % 2 == 1 && (i = s.slice().sort((o, n) => Math.abs(n.lat) - Math.abs(o.lat))[0], Es(s, i));
761
- let a = s.length - 2;
762
- for (; a >= 0; ) {
763
- let o = s[a].i, n = se(180 + 1e-6 * s[a].direction), h = se(180 - 1e-6 * s[a].direction), p = e.splice(o, s[a + 1].i - o, ...E.geodesic([n, s[a].lat], [n, s[a + 1].lat], !0));
764
- p.push(...E.geodesic([h, s[a + 1].lat], [h, s[a].lat], !0)), r.push(p), a -= 2;
765
- }
766
- if (i) for (let o = 0; o < r.length; o++) {
767
- let { direction: n, lat: h } = i, p = r[o], d = p.indexOf(i.lonLat);
768
- if (d > -1) {
769
- let c = (h < 0 ? -1 : 1) * this.maxLatitude, g = se(180 + 1e-6 * n), f = se(180 - 1e-6 * n), u = E.geodesic([g, h], [g, c], !0);
770
- for (let m = g + 120 * n; m > -180 && m < 180; m += 120 * n) u.push([m, c]);
771
- u.push(...E.geodesic([f, c], [f, i.lat], !0)), p.splice(d, 0, ...u);
772
- break;
773
- }
774
- }
775
- } else {
776
- let a = s.length;
777
- for (; a--; ) {
778
- let o = s[a].i, n = e.splice(o, e.length, [se(180 + 1e-6 * s[a].direction), s[a].lat]);
779
- n.unshift([se(180 - 1e-6 * s[a].direction), s[a].lat]), r.push(n);
780
- }
781
- }
782
- return r;
783
- }
784
- path(e) {
785
- let t, { bounds: i, def: s, rotator: r } = this, a = [], o = e.type === "Polygon" || e.type === "MultiPolygon", n = this.hasGeoProjection, h = !s || s.antimeridianCutting !== !1, p = h ? r : void 0, d = h && s || this;
786
- i && (t = [[i.x1, i.y1], [i.x2, i.y1], [i.x2, i.y2], [i.x1, i.y2]]);
787
- let c = (g) => {
788
- let f = g.map((m) => {
789
- if (h) {
790
- p && (m = p.forward(m));
791
- let b = m[0];
792
- 1e-6 > Math.abs(b - 180) && (b = b < 180 ? 179.999999 : 180.000001), m = [b, m[1]];
793
- }
794
- return m;
795
- }), u = [f];
796
- n && (E.insertGeodesics(f), h && (u = this.cutOnAntimeridian(f, o))), u.forEach((m) => {
797
- let b, y;
798
- if (m.length < 2) return;
799
- let x = !1, M = !1, w = (T) => {
800
- x ? a.push(["L", T[0], T[1]]) : (a.push(["M", T[0], T[1]]), x = !0);
801
- }, P = !1, j = !1, A = m.map((T) => {
802
- let k = d.forward(T);
803
- return k.outside ? P = !0 : j = !0, k[1] === 1 / 0 ? k[1] = 1e10 : k[1] === -1 / 0 && (k[1] = -1e10), k;
804
- });
805
- if (h) {
806
- if (o && A.push(A[0]), P) {
807
- if (!j) return;
808
- if (t) {
809
- if (o) A = Is(A, t);
810
- else if (i) return void Ss(A, t).forEach((T) => {
811
- x = !1, T.forEach(w);
812
- });
813
- }
814
- }
815
- A.forEach(w);
816
- } else for (let T = 0; T < A.length; T++) {
817
- let k = m[T], V = A[T];
818
- V.outside ? M = !0 : (o && !b && (b = k, m.push(k), A.push(V)), M && y && (o && n ? E.geodesic(y, k).forEach((R) => w(d.forward(R))) : x = !1), w(V), y = k, M = !1);
819
- }
820
- });
821
- };
822
- return e.type === "LineString" ? c(e.coordinates) : e.type === "MultiLineString" ? e.coordinates.forEach((g) => c(g)) : e.type === "Polygon" ? (e.coordinates.forEach((g) => c(g)), a.length && a.push(["Z"])) : e.type === "MultiPolygon" && (e.coordinates.forEach((g) => {
823
- g.forEach((f) => c(f));
824
- }), a.length && a.push(["Z"])), a;
825
- }
826
- }
827
- E.registry = { EqualEarth: Ls, LambertConformalConic: As, Miller: js, Orthographic: zs, WebMercator: ks };
828
- let { composed: Os } = v(), { pointInPolygon: ue } = Ts, { topo2geo: Ft } = ke, { boundsFromPath: Wt } = It, { addEvent: q, clamp: Vs, crisp: Zt, fireEvent: Ut, isArray: Xs, isNumber: X, isObject: Ns, isString: Ys, merge: G, pick: Gs, pushUnique: Rs, relativeLength: W } = v(), me = {};
829
- function Ht(l, e) {
830
- let { width: t, height: i } = e;
831
- return Math.log(400.979322 / Math.max((l.x2 - l.x1) / (t / 256), (l.y2 - l.y1) / (i / 256))) / Math.log(2);
832
- }
833
- function qt(l) {
834
- l.seriesOptions.mapData && this.mapView?.recommendMapView(this, [this.options.chart.map, l.seriesOptions.mapData], this.options.drilldown?.mapZooming);
835
- }
836
- class N {
837
- static compose(e) {
838
- Rs(Os, "MapView") && (me = e.maps, q(e, "afterInit", function() {
839
- this.mapView = new N(this, this.options.mapView);
840
- }, { order: 0 }), q(e, "addSeriesAsDrilldown", qt), q(e, "afterDrillUp", qt));
841
- }
842
- static compositeBounds(e) {
843
- if (e.length) return e.slice(1).reduce((t, i) => (t.x1 = Math.min(t.x1, i.x1), t.y1 = Math.min(t.y1, i.y1), t.x2 = Math.max(t.x2, i.x2), t.y2 = Math.max(t.y2, i.y2), t), G(e[0]));
844
- }
845
- static mergeInsets(e, t) {
846
- let i = (r) => {
847
- let a = {};
848
- return r.forEach((o, n) => {
849
- a[o && o.id || `i${n}`] = o;
850
- }), a;
851
- }, s = G(i(e), i(t));
852
- return Object.keys(s).map((r) => s[r]);
853
- }
854
- constructor(e, t) {
855
- this.allowTransformAnimation = !0, this.eventsToUnbind = [], this.insets = [], this.padding = [0, 0, 0, 0], this.recommendedMapView = {}, this instanceof Kt || this.recommendMapView(e, [e.options.chart.map, ...(e.options.series || []).map((a) => a.mapData)]), this.userOptions = t || {};
856
- let i = G(Ms, this.recommendedMapView, t), s = this.recommendedMapView?.insets, r = t && t.insets;
857
- s && r && (i.insets = N.mergeInsets(s, r)), this.chart = e, this.center = i.center, this.options = i, this.projection = new E(i.projection), this.playingField = e.plotBox, this.zoom = i.zoom || 0, this.minZoom = i.minZoom, this.createInsets(), this.eventsToUnbind.push(q(e, "afterSetChartSize", () => {
858
- this.playingField = this.getField(), (this.minZoom === void 0 || this.minZoom === this.zoom) && (this.fitToBounds(void 0, void 0, !1), !this.chart.hasRendered && X(this.userOptions.zoom) && (this.zoom = this.userOptions.zoom), this.userOptions.center && G(!0, this.center, this.userOptions.center));
859
- })), this.setUpEvents();
860
- }
861
- createInsets() {
862
- let e = this.options, t = e.insets;
863
- t && t.forEach((i) => {
864
- let s = new Kt(this, G(e.insetOptions, i));
865
- this.insets.push(s);
866
- });
867
- }
868
- fitToBounds(e, t, i = !0, s) {
869
- let r = e || this.getProjectedBounds();
870
- if (r) {
871
- let a = Gs(t, e ? 0 : this.options.padding), o = this.getField(!1), n = Xs(a) ? a : [a, a, a, a];
872
- this.padding = [W(n[0], o.height), W(n[1], o.width), W(n[2], o.height), W(n[3], o.width)], this.playingField = this.getField();
873
- let h = Ht(r, this.playingField);
874
- e || (this.minZoom = h);
875
- let p = this.projection.inverse([(r.x2 + r.x1) / 2, (r.y2 + r.y1) / 2]);
876
- this.setView(p, h, i, s);
877
- }
878
- }
879
- getField(e = !0) {
880
- let t = e ? this.padding : [0, 0, 0, 0];
881
- return { x: t[3], y: t[0], width: this.chart.plotWidth - t[1] - t[3], height: this.chart.plotHeight - t[0] - t[2] };
882
- }
883
- getGeoMap(e) {
884
- if (Ys(e)) return me[e] && me[e].type === "Topology" ? Ft(me[e]) : me[e];
885
- if (Ns(e, !0)) {
886
- if (e.type === "FeatureCollection") return e;
887
- if (e.type === "Topology") return Ft(e);
888
- }
889
- }
890
- getMapBBox() {
891
- let e = this.getProjectedBounds(), t = this.getScale();
892
- if (e) {
893
- let i = this.padding, s = this.projectedUnitsToPixels({ x: e.x1, y: e.y2 });
894
- return { width: (e.x2 - e.x1) * t + i[1] + i[3], height: (e.y2 - e.y1) * t + i[0] + i[2], x: s.x - i[3], y: s.y - i[0] };
895
- }
896
- }
897
- getProjectedBounds() {
898
- let e = this.projection, t = this.chart.series.reduce((s, r) => {
899
- let a = r.getProjectedBounds && r.getProjectedBounds();
900
- return a && r.options.affectsMapView !== !1 && s.push(a), s;
901
- }, []), i = this.options.fitToGeometry;
902
- if (i) {
903
- if (!this.fitToGeometryCache) if (i.type === "MultiPoint") {
904
- let s = i.coordinates.map((o) => e.forward(o)), r = s.map((o) => o[0]), a = s.map((o) => o[1]);
905
- this.fitToGeometryCache = { x1: Math.min.apply(0, r), x2: Math.max.apply(0, r), y1: Math.min.apply(0, a), y2: Math.max.apply(0, a) };
906
- } else this.fitToGeometryCache = Wt(e.path(i));
907
- return this.fitToGeometryCache;
908
- }
909
- return this.projection.bounds || N.compositeBounds(t);
910
- }
911
- getScale() {
912
- return 256 / 400.979322 * Math.pow(2, this.zoom);
913
- }
914
- getSVGTransform() {
915
- let { x: e, y: t, width: i, height: s } = this.playingField, r = this.projection.forward(this.center), a = this.projection.hasCoordinates ? -1 : 1, o = this.getScale(), n = o * a, h = e + i / 2 - r[0] * o, p = t + s / 2 - r[1] * n;
916
- return { scaleX: o, scaleY: n, translateX: h, translateY: p };
917
- }
918
- lonLatToPixels(e) {
919
- let t = this.lonLatToProjectedUnits(e);
920
- if (t) return this.projectedUnitsToPixels(t);
921
- }
922
- lonLatToProjectedUnits(e) {
923
- let t = this.chart, i = t.mapTransforms;
924
- if (i) {
925
- for (let r in i) if (Object.hasOwnProperty.call(i, r) && i[r].hitZone) {
926
- let a = t.transformFromLatLon(e, i[r]);
927
- if (a && ue(a, i[r].hitZone.coordinates[0])) return a;
928
- }
929
- return t.transformFromLatLon(e, i.default);
930
- }
931
- for (let r of this.insets) if (r.options.geoBounds && ue({ x: e.lon, y: e.lat }, r.options.geoBounds.coordinates[0])) {
932
- let a = r.projection.forward([e.lon, e.lat]), o = r.projectedUnitsToPixels({ x: a[0], y: a[1] });
933
- return this.pixelsToProjectedUnits(o);
934
- }
935
- let s = this.projection.forward([e.lon, e.lat]);
936
- if (!s.outside) return { x: s[0], y: s[1] };
937
- }
938
- projectedUnitsToLonLat(e) {
939
- let t = this.chart, i = t.mapTransforms;
940
- if (i) {
941
- for (let a in i) if (Object.hasOwnProperty.call(i, a) && i[a].hitZone && ue(e, i[a].hitZone.coordinates[0])) return t.transformToLatLon(e, i[a]);
942
- return t.transformToLatLon(e, i.default);
943
- }
944
- let s = this.projectedUnitsToPixels(e);
945
- for (let a of this.insets) if (a.hitZone && ue(s, a.hitZone.coordinates[0])) {
946
- let o = a.pixelsToProjectedUnits(s), n = a.projection.inverse([o.x, o.y]);
947
- return { lon: n[0], lat: n[1] };
948
- }
949
- let r = this.projection.inverse([e.x, e.y]);
950
- return { lon: r[0], lat: r[1] };
951
- }
952
- recommendMapView(e, t, i = !1) {
953
- this.recommendedMapView = {};
954
- let s = t.map((o) => this.getGeoMap(o)), r = [];
955
- s.forEach((o) => {
956
- if (o && (Object.keys(this.recommendedMapView).length || (this.recommendedMapView = o["hc-recommended-mapview"] || {}), o.bbox)) {
957
- let [n, h, p, d] = o.bbox;
958
- r.push({ x1: n, y1: h, x2: p, y2: d });
959
- }
960
- });
961
- let a = r.length && N.compositeBounds(r);
962
- Ut(this, "onRecommendMapView", { geoBounds: a, chart: e }, function() {
963
- if (a && this.recommendedMapView) {
964
- if (!this.recommendedMapView.projection) {
965
- let { x1: o, y1: n, x2: h, y2: p } = a;
966
- this.recommendedMapView.projection = h - o > 180 && p - n > 90 ? { name: "EqualEarth", parallels: [0, 0], rotation: [0] } : { name: "LambertConformalConic", parallels: [n, p], rotation: [-(o + h) / 2] };
967
- }
968
- this.recommendedMapView.insets || (this.recommendedMapView.insets = void 0);
969
- }
970
- }), this.geoMap = s[0], i && e.hasRendered && !e.userOptions.mapView?.projection && this.recommendedMapView && this.update(this.recommendedMapView);
971
- }
972
- redraw(e) {
973
- this.chart.series.forEach((t) => {
974
- t.useMapGeometry && (t.isDirty = !0);
975
- }), this.chart.redraw(e);
976
- }
977
- setView(e, t, i = !0, s) {
978
- e && (this.center = e), typeof t == "number" && (typeof this.minZoom == "number" && (t = Math.max(t, this.minZoom)), typeof this.options.maxZoom == "number" && (t = Math.min(t, this.options.maxZoom)), X(t) && (this.zoom = t));
979
- let r = this.getProjectedBounds();
980
- if (r) {
981
- let a = this.projection.forward(this.center), { x: o, y: n, width: h, height: p } = this.playingField, d = this.getScale(), c = this.projectedUnitsToPixels({ x: r.x1, y: r.y1 }), g = this.projectedUnitsToPixels({ x: r.x2, y: r.y2 }), f = [(r.x1 + r.x2) / 2, (r.y1 + r.y2) / 2];
982
- if (!this.chart.series.some((u) => u.isDrilling)) {
983
- let u = c.x, m = g.y, b = g.x, y = c.y;
984
- b - u < h ? a[0] = f[0] : u < o && b < o + h ? a[0] += Math.max(u - o, b - h - o) / d : b > o + h && u > o && (a[0] += Math.min(b - h - o, u - o) / d), y - m < p ? a[1] = f[1] : m < n && y < n + p ? a[1] -= Math.max(m - n, y - p - n) / d : y > n + p && m > n && (a[1] -= Math.min(y - p - n, m - n) / d), this.center = this.projection.inverse(a);
985
- }
986
- this.insets.forEach((u) => {
987
- u.options.field && (u.hitZone = u.getHitZone(), u.playingField = u.getField());
988
- }), this.render();
989
- }
990
- Ut(this, "afterSetView"), i && this.redraw(s);
991
- }
992
- projectedUnitsToPixels(e) {
993
- let t = this.getScale(), i = this.projection.forward(this.center), s = this.playingField, r = s.x + s.width / 2, a = s.y + s.height / 2;
994
- return { x: r - t * (i[0] - e.x), y: a + t * (i[1] - e.y) };
995
- }
996
- pixelsToLonLat(e) {
997
- return this.projectedUnitsToLonLat(this.pixelsToProjectedUnits(e));
998
- }
999
- pixelsToProjectedUnits(e) {
1000
- let { x: t, y: i } = e, s = this.getScale(), r = this.projection.forward(this.center), a = this.playingField, o = a.x + a.width / 2, n = a.y + a.height / 2;
1001
- return { x: r[0] + (t - o) / s, y: r[1] - (i - n) / s };
1002
- }
1003
- setUpEvents() {
1004
- let e, t, i, { chart: s } = this, r = (a) => {
1005
- let { lastTouches: o, pinchDown: n } = s.pointer, h = this.projection, p = a.touches, { mouseDownX: d, mouseDownY: c } = s, g = 0;
1006
- if (n?.length === 1 ? (d = n[0].chartX, c = n[0].chartY) : n?.length === 2 && (d = (n[0].chartX + n[1].chartX) / 2, c = (n[0].chartY + n[1].chartY) / 2), p?.length === 2 && o && (g = Math.log(Math.sqrt(Math.pow(o[0].chartX - o[1].chartX, 2) + Math.pow(o[0].chartY - o[1].chartY, 2)) / Math.sqrt(Math.pow(p[0].chartX - p[1].chartX, 2) + Math.pow(p[0].chartY - p[1].chartY, 2))) / Math.log(0.5)), X(d) && X(c)) {
1007
- let f = `${d},${c}`, { chartX: u, chartY: m } = a.originalEvent;
1008
- p?.length === 2 && (u = (p[0].chartX + p[1].chartX) / 2, m = (p[0].chartY + p[1].chartY) / 2), f !== t && (t = f, e = this.projection.forward(this.center), i = (this.projection.options.rotation || [0, 0]).slice());
1009
- let b = h.def && h.def.bounds, y = b && Ht(b, this.playingField) || -1 / 0;
1010
- if (h.options.name === "Orthographic" && 2 > (p?.length || 0) && (this.minZoom || 1 / 0) < 1.3 * y) {
1011
- let x = 440 / (this.getScale() * Math.min(s.plotWidth, s.plotHeight));
1012
- if (i) {
1013
- let M = (d - u) * x - i[0], w = Vs(-i[1] - (c - m) * x, -80, 80), P = this.zoom;
1014
- this.update({ projection: { rotation: [-M, -w] } }, !1), this.fitToBounds(void 0, void 0, !1), this.zoom = P, s.redraw(!1);
1015
- }
1016
- } else if (X(u) && X(m)) {
1017
- let x = this.getScale(), M = this.projection.hasCoordinates ? 1 : -1, w = this.projection.inverse([e[0] + (d - u) / x, e[1] - (c - m) / x * M]);
1018
- isNaN(w[0] + w[1]) || this.zoomBy(g, w, void 0, !1);
1019
- }
1020
- a.preventDefault();
1021
- }
1022
- };
1023
- q(s, "pan", r), q(s, "touchpan", r), q(s, "selection", (a) => {
1024
- if (a.resetSelection) this.zoomBy();
1025
- else {
1026
- let o = a.x - s.plotLeft, n = a.y - s.plotTop, { y: h, x: p } = this.pixelsToProjectedUnits({ x: o, y: n }), { y: d, x: c } = this.pixelsToProjectedUnits({ x: o + a.width, y: n + a.height });
1027
- this.fitToBounds({ x1: p, y1: h, x2: c, y2: d }, void 0, !0, !a.originalEvent.touches && void 0), /^touch/.test(a.originalEvent.type) || s.showResetZoom(), a.preventDefault();
1028
- }
1029
- });
1030
- }
1031
- render() {
1032
- this.group || (this.group = this.chart.renderer.g("map-view").attr({ zIndex: 4 }).add());
1033
- }
1034
- update(e, t = !0, i) {
1035
- let s = e.projection, r = s && E.toString(s) !== E.toString(this.options.projection), a = !1;
1036
- G(!0, this.userOptions, e), G(!0, this.options, e), "insets" in e && (this.insets.forEach((o) => o.destroy()), this.insets.length = 0, a = !0), (r || "fitToGeometry" in e) && delete this.fitToGeometryCache, (r || a) && (this.chart.series.forEach((o) => {
1037
- let n = o.transformGroups;
1038
- if (o.clearBounds && o.clearBounds(), o.isDirty = !0, o.isDirtyData = !0, a && n) for (; n.length > 1; ) {
1039
- let h = n.pop();
1040
- h && h.destroy();
1041
- }
1042
- }), r && (this.projection = new E(this.options.projection)), a && this.createInsets(), !e.center && Object.hasOwnProperty.call(e, "zoom") && !X(e.zoom) && this.fitToBounds(void 0, void 0, !1)), e.center || X(e.zoom) ? this.setView(this.options.center, e.zoom, !1) : "fitToGeometry" in e && this.fitToBounds(void 0, void 0, !1), t && this.chart.redraw(i);
1043
- }
1044
- zoomBy(e, t, i, s) {
1045
- let r = this.chart, a = this.projection.forward(this.center);
1046
- if (typeof e == "number") {
1047
- let o, n, h, p = this.zoom + e;
1048
- if (i) {
1049
- let [d, c] = i, g = this.getScale(), f = d - r.plotLeft - r.plotWidth / 2, u = c - r.plotTop - r.plotHeight / 2;
1050
- n = a[0] + f / g, h = a[1] + u / g;
1051
- }
1052
- if (typeof n == "number" && typeof h == "number") {
1053
- let d = 1 - Math.pow(2, this.zoom) / Math.pow(2, p), c = a[0] - n, g = a[1] - h;
1054
- a[0] -= c * d, a[1] += g * d, o = this.projection.inverse(a);
1055
- }
1056
- this.setView(t || o, p, void 0, s);
1057
- } else this.fitToBounds(void 0, void 0, void 0, s);
1058
- }
1059
- }
1060
- class Kt extends N {
1061
- constructor(e, t) {
1062
- if (super(e.chart, t), this.id = t.id, this.mapView = e, this.options = G({ center: [0, 0] }, e.options.insetOptions, t), this.allBounds = [], this.options.geoBounds) {
1063
- let i = e.projection.path(this.options.geoBounds);
1064
- this.geoBoundsProjectedBox = Wt(i), this.geoBoundsProjectedPolygon = i.map((s) => [s[1] || 0, s[2] || 0]);
1065
- }
1066
- }
1067
- getField(e = !0) {
1068
- let t = this.hitZone;
1069
- if (t) {
1070
- let i = e ? this.padding : [0, 0, 0, 0], s = t.coordinates[0], r = s.map((d) => d[0]), a = s.map((d) => d[1]), o = Math.min.apply(0, r) + i[3], n = Math.max.apply(0, r) - i[1], h = Math.min.apply(0, a) + i[0], p = Math.max.apply(0, a) - i[2];
1071
- if (X(o) && X(h)) return { x: o, y: h, width: n - o, height: p - h };
1072
- }
1073
- return super.getField.call(this, e);
1074
- }
1075
- getHitZone() {
1076
- let { chart: e, mapView: t, options: i } = this, { coordinates: s } = i.field || {};
1077
- if (s) {
1078
- let r = s[0];
1079
- if (i.units === "percent") {
1080
- let a = i.relativeTo === "mapBoundingBox" && t.getMapBBox() || G(e.plotBox, { x: 0, y: 0 });
1081
- r = r.map((o) => [W(`${o[0]}%`, a.width, a.x), W(`${o[1]}%`, a.height, a.y)]);
1082
- }
1083
- return { type: "Polygon", coordinates: [r] };
1084
- }
1085
- }
1086
- getProjectedBounds() {
1087
- return N.compositeBounds(this.allBounds);
1088
- }
1089
- isInside(e) {
1090
- let { geoBoundsProjectedBox: t, geoBoundsProjectedPolygon: i } = this;
1091
- return !!(t && e.x >= t.x1 && e.x <= t.x2 && e.y >= t.y1 && e.y <= t.y2 && i && ue(e, i));
1092
- }
1093
- render() {
1094
- let { chart: e, mapView: t, options: i } = this, s = i.borderPath || i.field;
1095
- if (s && t.group) {
1096
- let r = !0;
1097
- this.border || (this.border = e.renderer.path().addClass("highcharts-mapview-inset-border").add(t.group), r = !1), e.styledMode || this.border.attr({ stroke: i.borderColor, "stroke-width": i.borderWidth });
1098
- let a = this.border.strokeWidth(), o = i.relativeTo === "mapBoundingBox" && t.getMapBBox() || t.playingField, n = (s.coordinates || []).reduce((h, p) => p.reduce((d, c, g) => {
1099
- let [f, u] = c;
1100
- return i.units === "percent" && (f = e.plotLeft + W(`${f}%`, o.width, o.x), u = e.plotTop + W(`${u}%`, o.height, o.y)), f = Zt(f, a), u = Zt(u, a), d.push(g === 0 ? ["M", f, u] : ["L", f, u]), d;
1101
- }, h), []);
1102
- this.border[r ? "animate" : "attr"]({ d: n });
1103
- }
1104
- }
1105
- destroy() {
1106
- this.border && (this.border = this.border.destroy()), this.eventsToUnbind.forEach((e) => e());
1107
- }
1108
- setUpEvents() {
1109
- }
1110
- }
1111
- let { animObject: $t, stop: Fs } = v(), { noop: Oe } = v(), { splitPath: Ws } = ze, { column: _t, scatter: Jt } = I().seriesTypes, { extend: Zs, find: Us, fireEvent: Qt, getNestedProperty: ei, isArray: ht, defined: ti, isNumber: D, isObject: Hs, merge: ge, objectEach: qs, pick: pt, splat: Ks } = v();
1112
- class fe extends Jt {
1113
- constructor() {
1114
- super(...arguments), this.processedData = [];
1115
- }
1116
- animate(e) {
1117
- let { chart: t, group: i } = this, s = $t(this.options.animation);
1118
- e ? i.attr({ translateX: t.plotLeft + t.plotWidth / 2, translateY: t.plotTop + t.plotHeight / 2, scaleX: 1e-3, scaleY: 1e-3 }) : i.animate({ translateX: t.plotLeft, translateY: t.plotTop, scaleX: 1, scaleY: 1 }, s);
1119
- }
1120
- clearBounds() {
1121
- this.points.forEach((e) => {
1122
- delete e.bounds, delete e.insetIndex, delete e.projectedPath;
1123
- }), delete this.bounds;
1124
- }
1125
- doFullTranslate() {
1126
- return !!(this.isDirtyData || this.chart.isResizing || !this.hasRendered);
1127
- }
1128
- drawMapDataLabels() {
1129
- super.drawDataLabels(), this.dataLabelsGroup && this.dataLabelsGroup.clip(this.chart.clipRect);
1130
- }
1131
- drawPoints() {
1132
- let e = this, { chart: t, group: i, transformGroups: s = [] } = this, { mapView: r, renderer: a } = t;
1133
- if (r) {
1134
- this.transformGroups = s, s[0] || (s[0] = a.g().add(i));
1135
- for (let o = 0, n = r.insets.length; o < n; ++o) s[o + 1] || s.push(a.g().add(i));
1136
- this.doFullTranslate() && (this.points.forEach((o) => {
1137
- let { graphic: n } = o;
1138
- o.group = s[typeof o.insetIndex == "number" ? o.insetIndex + 1 : 0], n && n.parentGroup !== o.group && n.add(o.group);
1139
- }), _t.prototype.drawPoints.apply(this), this.points.forEach((o) => {
1140
- let n = o.graphic;
1141
- if (n) {
1142
- let h = n.animate, p = "";
1143
- o.name && (p += "highcharts-name-" + o.name.replace(/ /g, "-").toLowerCase()), o.properties?.["hc-key"] && (p += " highcharts-key-" + o.properties["hc-key"].toString().toLowerCase()), p && n.addClass(p), t.styledMode && n.css(this.pointAttribs(o, o.selected && "select" || void 0)), n.attr({ visibility: !o.visible && (o.visible || o.isNull) ? "hidden" : "inherit" }), n.animate = function(d, c, g) {
1144
- let f = D(d["stroke-width"]) && !D(n["stroke-width"]), u = D(n["stroke-width"]) && !D(d["stroke-width"]);
1145
- if (f || u) {
1146
- let m = pt(e.getStrokeWidth(e.options), 1) / (t.mapView?.getScale() || 1);
1147
- f && (n["stroke-width"] = m), u && (d["stroke-width"] = m);
1148
- }
1149
- return h.call(n, d, c, u ? function() {
1150
- n.element.removeAttribute("stroke-width"), delete n["stroke-width"], g && g.apply(this, arguments);
1151
- } : g);
1152
- };
1153
- }
1154
- })), s.forEach((o, n) => {
1155
- let h = (n === 0 ? r : r.insets[n - 1]).getSVGTransform(), p = pt(this.getStrokeWidth(this.options), 1), d = h.scaleX, c = h.scaleY > 0 ? 1 : -1, g = (f) => {
1156
- (e.points || []).forEach((u) => {
1157
- let m, b = u.graphic;
1158
- b?.["stroke-width"] && (m = this.getStrokeWidth(u.options)) && b.attr({ "stroke-width": m / f });
1159
- });
1160
- };
1161
- if (a.globalAnimation && t.hasRendered && r.allowTransformAnimation) {
1162
- let f = Number(o.attr("translateX")), u = Number(o.attr("translateY")), m = Number(o.attr("scaleX")), b = (M, w) => {
1163
- let P = m + (d - m) * w.pos;
1164
- o.attr({ translateX: f + (h.translateX - f) * w.pos, translateY: u + (h.translateY - u) * w.pos, scaleX: P, scaleY: P * c, "stroke-width": p / P }), g(P);
1165
- }, y = ge($t(a.globalAnimation)), x = y.step;
1166
- y.step = function() {
1167
- x && x.apply(this, arguments), b.apply(this, arguments);
1168
- }, o.attr({ animator: 0 }).animate({ animator: 1 }, y, function() {
1169
- typeof a.globalAnimation != "boolean" && a.globalAnimation.complete && a.globalAnimation.complete({ applyDrilldown: !0 }), Qt(this, "mapZoomComplete");
1170
- }.bind(this));
1171
- } else Fs(o), o.attr(ge(h, { "stroke-width": p / d })), g(d);
1172
- }), this.isDrilling || this.drawMapDataLabels();
1173
- }
1174
- }
1175
- getProjectedBounds() {
1176
- if (!this.bounds && this.chart.mapView) {
1177
- let { insets: e, projection: t } = this.chart.mapView, i = [];
1178
- (this.points || []).forEach((s) => {
1179
- if (s.path || s.geometry) {
1180
- if (typeof s.path == "string" ? s.path = Ws(s.path) : ht(s.path) && s.path[0] === "M" && (s.path = this.chart.renderer.pathToSegments(s.path)), !s.bounds) {
1181
- let r = s.getProjectedBounds(t);
1182
- if (r) {
1183
- s.labelrank = pt(s.labelrank, (r.x2 - r.x1) * (r.y2 - r.y1));
1184
- let { midX: a, midY: o } = r;
1185
- if (e && D(a) && D(o)) {
1186
- let n = Us(e, (h) => h.isInside({ x: a, y: o }));
1187
- n && (delete s.projectedPath, (r = s.getProjectedBounds(n.projection)) && n.allBounds.push(r), s.insetIndex = e.indexOf(n));
1188
- }
1189
- s.bounds = r;
1190
- }
1191
- }
1192
- s.bounds && s.insetIndex === void 0 && i.push(s.bounds);
1193
- }
1194
- }), this.bounds = N.compositeBounds(i);
1195
- }
1196
- return this.bounds;
1197
- }
1198
- getStrokeWidth(e) {
1199
- let t = this.pointAttrToOptions;
1200
- return e[t?.["stroke-width"] || "borderWidth"];
1201
- }
1202
- hasData() {
1203
- return !!this.dataTable.rowCount;
1204
- }
1205
- pointAttribs(e, t) {
1206
- let { mapView: i, styledMode: s } = e.series.chart, r = s ? this.colorAttribs(e) : _t.prototype.pointAttribs.call(this, e, t), a = this.getStrokeWidth(e.options);
1207
- if (t) {
1208
- let n = ge(this.options.states && this.options.states[t], e.options.states && e.options.states[t] || {}), h = this.getStrokeWidth(n);
1209
- ti(h) && (a = h), r.stroke = n.borderColor ?? e.color;
1210
- }
1211
- a && i && (a /= i.getScale());
1212
- let o = this.getStrokeWidth(this.options);
1213
- return r.dashstyle && i && D(o) && (a = o / i.getScale()), e.visible || (r.fill = this.options.nullColor), ti(a) ? r["stroke-width"] = a : delete r["stroke-width"], r["stroke-linecap"] = r["stroke-linejoin"] = this.options.linecap, r;
1214
- }
1215
- updateData() {
1216
- return !this.processedData && super.updateData.apply(this, arguments);
1217
- }
1218
- setData(e, t = !0, i, s) {
1219
- delete this.bounds, super.setData(e, !1, void 0, s), this.processData(), this.generatePoints(), t && this.chart.redraw(i);
1220
- }
1221
- dataColumnKeys() {
1222
- return this.pointArrayMap;
1223
- }
1224
- processData() {
1225
- let e, t, i, s = this.options, r = s.data, a = this.chart, o = a.options.chart, n = this.joinBy, h = s.keys || this.pointArrayMap, p = [], d = {}, c = this.chart.mapView, g = c && (Hs(s.mapData, !0) ? c.getGeoMap(s.mapData) : c.geoMap), f = a.mapTransforms = o.mapTransforms || g?.["hc-transform"] || a.mapTransforms;
1226
- f && qs(f, (m) => {
1227
- m.rotation && (m.cosAngle = Math.cos(m.rotation), m.sinAngle = Math.sin(m.rotation));
1228
- }), ht(s.mapData) ? i = s.mapData : g && g.type === "FeatureCollection" && (this.mapTitle = g.title, i = v().geojson(g, this.type, this)), this.processedData = [];
1229
- let u = this.processedData;
1230
- if (r) {
1231
- let m;
1232
- for (let b = 0, y = r.length; b < y; ++b) {
1233
- if (D(m = r[b])) u[b] = { value: m };
1234
- else if (ht(m)) {
1235
- let x = 0;
1236
- u[b] = {}, !s.keys && m.length > h.length && typeof m[0] == "string" && (u[b]["hc-key"] = m[0], ++x);
1237
- for (let M = 0; M < h.length; ++M, ++x) h[M] && m[x] !== void 0 && (h[M].indexOf(".") > 0 ? te.prototype.setNestedProperty(u[b], m[x], h[M]) : u[b][h[M]] = m[x]);
1238
- } else u[b] = r[b];
1239
- n && n[0] === "_i" && (u[b]._i = b);
1240
- }
1241
- }
1242
- if (i) {
1243
- this.mapData = i, this.mapMap = {};
1244
- for (let m = 0; m < i.length; m++) t = (e = i[m]).properties, e._i = m, n[0] && t && t[n[0]] && (e[n[0]] = t[n[0]]), d[e[n[0]]] = e;
1245
- if (this.mapMap = d, n[1]) {
1246
- let m = n[1];
1247
- u.forEach((b) => {
1248
- let y = ei(m, b);
1249
- d[y] && p.push(d[y]);
1250
- });
1251
- }
1252
- if (s.allAreas) {
1253
- if (n[1]) {
1254
- let b = n[1];
1255
- u.forEach((y) => {
1256
- p.push(ei(b, y));
1257
- });
1258
- }
1259
- let m = "|" + p.map(function(b) {
1260
- return b && b[n[0]];
1261
- }).join("|") + "|";
1262
- i.forEach((b) => {
1263
- n[0] && m.indexOf("|" + b[n[0]] + "|") !== -1 || u.push(ge(b, { value: null }));
1264
- });
1265
- }
1266
- }
1267
- this.dataTable.rowCount = u.length;
1268
- }
1269
- setOptions(e) {
1270
- let t = super.setOptions(e), i = t.joinBy;
1271
- return t.joinBy === null && (i = "_i"), i && (this.joinBy = Ks(i), this.joinBy[1] || (this.joinBy[1] = this.joinBy[0])), t;
1272
- }
1273
- translate() {
1274
- let e = this.doFullTranslate(), t = this.chart.mapView, i = t?.projection;
1275
- if (this.chart.hasRendered && (this.isDirtyData || !this.hasRendered) && (this.processData(), this.generatePoints(), delete this.bounds, !t || t.userOptions.center || D(t.userOptions.zoom) || t.zoom !== t.minZoom ? this.getProjectedBounds() : t.fitToBounds(void 0, void 0, !1)), t) {
1276
- let s = t.getSVGTransform();
1277
- this.points.forEach((r) => {
1278
- let a = D(r.insetIndex) && t.insets[r.insetIndex].getSVGTransform() || s;
1279
- a && r.bounds && D(r.bounds.midX) && D(r.bounds.midY) && (r.plotX = r.bounds.midX * a.scaleX + a.translateX, r.plotY = r.bounds.midY * a.scaleY + a.translateY), e && (r.shapeType = "path", r.shapeArgs = { d: te.getProjectedPath(r, i) }), !r.hiddenInDataClass && (r.projectedPath && !r.projectedPath.length ? r.setVisible(!1) : r.visible || r.setVisible(!0));
1280
- });
1281
- }
1282
- Qt(this, "afterTranslate");
1283
- }
1284
- update(e) {
1285
- e.mapData && this.chart.mapView?.recommendMapView(this.chart, [this.chart.options.chart.map, ...(this.chart.options.series || []).map((t, i) => i === this._i ? e.mapData : t.mapData)], !0), super.update.apply(this, arguments);
1286
- }
1287
- }
1288
- fe.defaultOptions = ge(Jt.defaultOptions, { affectsMapView: !0, animation: !1, dataLabels: { crop: !1, formatter: function() {
1289
- let { numberFormatter: l } = this.series.chart, { value: e } = this.point;
1290
- return xs(e) ? l(e, -1) : this.point.name || "";
1291
- }, inside: !0, overflow: !1, padding: 0, verticalAlign: "middle" }, linecap: "round", marker: null, nullColor: "#f7f7f7", stickyTracking: !1, tooltip: { followPointer: !0, pointFormat: "{point.name}: {point.value}<br/>" }, turboThreshold: 0, allAreas: !0, borderColor: "#e6e6e6", borderWidth: 1, joinBy: "hc-key", states: { hover: { halo: void 0, borderColor: "#666666", borderWidth: 2 }, normal: { animation: !0 }, select: { color: "#cccccc" } }, legendSymbol: "rectangle" }), Zs(fe.prototype, { type: "map", axisTypes: B.seriesMembers.axisTypes, colorAttribs: B.seriesMembers.colorAttribs, colorKey: B.seriesMembers.colorKey, directTouch: !0, drawDataLabels: Oe, drawGraph: Oe, forceDL: !0, getCenter: ds.getCenter, getExtremesFromAll: !0, getSymbol: Oe, isCartesian: !1, parallelArrays: B.seriesMembers.parallelArrays, pointArrayMap: B.seriesMembers.pointArrayMap, pointClass: te, preserveAspectRatio: !0, searchPoint: Oe, trackerGroups: B.seriesMembers.trackerGroups, useMapGeometry: !0 }), B.compose(fe), I().registerSeriesType("map", fe);
1292
- let ii = fe, { extend: $s, merge: _s } = v();
1293
- class dt extends ii {
1294
- pointAttribs(e, t) {
1295
- let i = super.pointAttribs(e, t);
1296
- return i.fill = this.options.fillColor, i;
1297
- }
1298
- }
1299
- dt.defaultOptions = _s(ii.defaultOptions, { lineWidth: 1, fillColor: "none", legendSymbol: "lineMarker" }), $s(dt.prototype, { type: "mapline", colorProp: "stroke", pointAttrToOptions: { stroke: "color", "stroke-width": "lineWidth" } }), I().registerSeriesType("mapline", dt);
1300
- let { scatter: Js } = I().seriesTypes, { isNumber: Ve } = v();
1301
- class Qs extends Js.prototype.pointClass {
1302
- isValid() {
1303
- return !!(this.options.geometry || Ve(this.x) && Ve(this.y) || Ve(this.options.lon) && Ve(this.options.lat));
1304
- }
1305
- }
1306
- C(632);
1307
- let { noop: eo } = v(), { map: to, scatter: si } = I().seriesTypes, { extend: io, fireEvent: so, isNumber: K, merge: oo } = v();
1308
- class ct extends si {
1309
- constructor() {
1310
- super(...arguments), this.clearBounds = to.prototype.clearBounds;
1311
- }
1312
- drawDataLabels() {
1313
- super.drawDataLabels(), this.dataLabelsGroup && this.dataLabelsGroup.clip(this.chart.clipRect);
1314
- }
1315
- projectPoint(e) {
1316
- let t = this.chart.mapView;
1317
- if (t) {
1318
- let { geometry: i, lon: s, lat: r } = e, a = i && i.type === "Point" && i.coordinates;
1319
- if (K(s) && K(r) && (a = [s, r]), a) return t.lonLatToProjectedUnits({ lon: a[0], lat: a[1] });
1320
- }
1321
- }
1322
- translate() {
1323
- let e = this.chart.mapView;
1324
- if (this.generatePoints(), this.getProjectedBounds && this.isDirtyData && (delete this.bounds, this.getProjectedBounds()), e) {
1325
- let t = e.getSVGTransform(), { hasCoordinates: i } = e.projection;
1326
- this.points.forEach((s) => {
1327
- let r, { x: a, y: o } = s, n = K(s.insetIndex) && e.insets[s.insetIndex].getSVGTransform() || t, h = this.projectPoint(s.options) || s.properties && this.projectPoint(s.properties);
1328
- if (h ? (a = h.x, o = h.y) : s.bounds && (a = s.bounds.midX, o = s.bounds.midY, n && K(a) && K(o) && (s.plotX = a * n.scaleX + n.translateX, s.plotY = o * n.scaleY + n.translateY, r = !0)), K(a) && K(o)) {
1329
- if (!r) {
1330
- let p = e.projectedUnitsToPixels({ x: a, y: o });
1331
- s.plotX = p.x, s.plotY = i ? p.y : this.chart.plotHeight - p.y;
1332
- }
1333
- } else s.y = s.plotX = s.plotY = void 0;
1334
- s.isInside = this.isPointInside(s), s.zone = this.zones.length ? s.getZone() : void 0;
1335
- });
1336
- }
1337
- so(this, "afterTranslate");
1338
- }
1339
- }
1340
- ct.defaultOptions = oo(si.defaultOptions, { dataLabels: { crop: !1, defer: !1, enabled: !0, formatter: function() {
1341
- return this.point.name;
1342
- }, overflow: !1, style: { color: "#000000" } }, legendSymbol: "lineMarker" }), at().prototype.symbols.mapmarker = (l, e, t, i, s) => {
1343
- let r, a, o = s && s.context === "legend";
1344
- o ? (r = l + t / 2, a = e + i) : s && typeof s.anchorX == "number" && typeof s.anchorY == "number" ? (r = s.anchorX, a = s.anchorY) : (r = l + t / 2, a = e + i / 2, e -= i);
1345
- let n = o ? i / 3 : i / 2;
1346
- return [["M", r, a], ["C", r, a, r - n, e + 1.5 * n, r - n, e + n], ["A", n, n, 1, 1, 1, r + n, e + n], ["C", r + n, e + 1.5 * n, r, a, r, a], ["Z"]];
1347
- }, io(ct.prototype, { type: "mappoint", axisTypes: ["colorAxis"], forceDL: !0, isCartesian: !1, pointClass: Qs, searchPoint: eo, useMapGeometry: !0 }), I().registerSeriesType("mappoint", ct);
1348
- let ro = { borderColor: void 0, borderWidth: 2, className: void 0, color: void 0, connectorClassName: void 0, connectorColor: void 0, connectorDistance: 60, connectorWidth: 1, enabled: !1, labels: { className: void 0, allowOverlap: !1, format: "", formatter: void 0, align: "right", style: { fontSize: "0.9em", color: "#000000" }, x: 0, y: 0 }, maxSize: 60, minSize: 10, legendIndex: 0, ranges: { value: void 0, borderColor: void 0, color: void 0, connectorColor: void 0 }, sizeBy: "area", sizeByAbsoluteValue: !1, zIndex: 1, zThreshold: 0 }, { noop: ao } = v(), { arrayMax: no, arrayMin: lo, isNumber: oi, merge: be, pick: ye, stableSort: ho } = v(), po = class {
1349
- constructor(l, e) {
1350
- this.setState = ao, this.init(l, e);
1351
- }
1352
- init(l, e) {
1353
- this.options = l, this.visible = !0, this.chart = e.chart, this.legend = e;
1354
- }
1355
- addToLegend(l) {
1356
- l.splice(this.options.legendIndex, 0, this);
1357
- }
1358
- drawLegendSymbol(l) {
1359
- let e, t = ye(l.options.itemDistance, 20), i = this.legendItem || {}, s = this.options, r = s.ranges, a = s.connectorDistance;
1360
- if (!r || !r.length || !oi(r[0].value)) {
1361
- l.options.bubbleLegend.autoRanges = !0;
1362
- return;
1363
- }
1364
- ho(r, function(p, d) {
1365
- return d.value - p.value;
1366
- }), this.ranges = r, this.setOptions(), this.render();
1367
- let o = this.getMaxLabelSize(), n = this.ranges[0].radius, h = 2 * n;
1368
- e = (e = a - n + o.width) > 0 ? e : 0, this.maxLabel = o, this.movementX = s.labels.align === "left" ? e : 0, i.labelWidth = h + e + t, i.labelHeight = h + o.height / 2;
1369
- }
1370
- setOptions() {
1371
- let l = this.ranges, e = this.options, t = this.chart.series[e.seriesIndex], i = this.legend.baseline, s = { zIndex: e.zIndex, "stroke-width": e.borderWidth }, r = { zIndex: e.zIndex, "stroke-width": e.connectorWidth }, a = { align: this.legend.options.rtl || e.labels.align === "left" ? "right" : "left", zIndex: e.zIndex }, o = t.options.marker.fillOpacity, n = this.chart.styledMode;
1372
- l.forEach(function(h, p) {
1373
- n || (s.stroke = ye(h.borderColor, e.borderColor, t.color), s.fill = h.color || e.color, s.fill || (s.fill = t.color, s["fill-opacity"] = o ?? 1), r.stroke = ye(h.connectorColor, e.connectorColor, t.color)), l[p].radius = this.getRangeRadius(h.value), l[p] = be(l[p], { center: l[0].radius - l[p].radius + i }), n || be(!0, l[p], { bubbleAttribs: be(s), connectorAttribs: be(r), labelAttribs: a });
1374
- }, this);
1375
- }
1376
- getRangeRadius(l) {
1377
- let e = this.options, t = this.options.seriesIndex, i = this.chart.series[t], s = e.ranges[0].value, r = e.ranges[e.ranges.length - 1].value, a = e.minSize, o = e.maxSize;
1378
- return i.getRadius.call(this, r, s, a, o, l);
1379
- }
1380
- render() {
1381
- let l = this.legendItem || {}, e = this.chart.renderer, t = this.options.zThreshold;
1382
- for (let i of (this.symbols || (this.symbols = { connectors: [], bubbleItems: [], labels: [] }), l.symbol = e.g("bubble-legend"), l.label = e.g("bubble-legend-item").css(this.legend.itemStyle || {}), l.symbol.translateX = 0, l.symbol.translateY = 0, l.symbol.add(l.label), l.label.add(l.group), this.ranges)) i.value >= t && this.renderRange(i);
1383
- this.hideOverlappingLabels();
1384
- }
1385
- renderRange(l) {
1386
- let e = this.ranges[0], t = this.legend, i = this.options, s = i.labels, r = this.chart, a = r.series[i.seriesIndex], o = r.renderer, n = this.symbols, h = n.labels, p = l.center, d = Math.abs(l.radius), c = i.connectorDistance || 0, g = s.align, f = t.options.rtl, u = i.borderWidth, m = i.connectorWidth, b = e.radius || 0, y = p - d - u / 2 + m / 2, x = (y % 1 ? 1 : 0.5) - (m % 2 ? 0 : 0.5), M = o.styledMode, w = f || g === "left" ? -c : c;
1387
- g === "center" && (w = 0, i.connectorDistance = 0, l.labelAttribs.align = "center"), n.bubbleItems.push(o.circle(b, p + x, d).attr(M ? {} : l.bubbleAttribs).addClass((M ? "highcharts-color-" + a.colorIndex + " " : "") + "highcharts-bubble-legend-symbol " + (i.className || "")).add(this.legendItem.symbol)), n.connectors.push(o.path(o.crispLine([["M", b, y], ["L", b + w, y]], i.connectorWidth)).attr(M ? {} : l.connectorAttribs).addClass((M ? "highcharts-color-" + this.options.seriesIndex + " " : "") + "highcharts-bubble-legend-connectors " + (i.connectorClassName || "")).add(this.legendItem.symbol));
1388
- let P = o.text(this.formatLabel(l)).attr(M ? {} : l.labelAttribs).css(M ? {} : s.style).addClass("highcharts-bubble-legend-labels " + (i.labels.className || "")).add(this.legendItem.symbol), j = { x: b + w + i.labels.x, y: y + i.labels.y + 0.4 * P.getBBox().height };
1389
- P.attr(j), h.push(P), P.placed = !0, P.alignAttr = j;
1390
- }
1391
- getMaxLabelSize() {
1392
- let l, e;
1393
- return this.symbols.labels.forEach(function(t) {
1394
- e = t.getBBox(!0), l = l ? e.width > l.width ? e : l : e;
1395
- }), l || {};
1396
- }
1397
- formatLabel(l) {
1398
- let e = this.options, t = e.labels.formatter, i = e.labels.format, { numberFormatter: s } = this.chart;
1399
- return i ? Dt().format(i, l, this.chart) : t ? t.call(l) : s(l.value, 1);
1400
- }
1401
- hideOverlappingLabels() {
1402
- let l = this.chart, e = this.options.labels.allowOverlap, t = this.symbols;
1403
- !e && t && (l.hideOverlappingLabels(t.labels), t.labels.forEach(function(i, s) {
1404
- i.newOpacity ? i.newOpacity !== i.oldOpacity && t.connectors[s].show() : t.connectors[s].hide();
1405
- }));
1406
- }
1407
- getRanges() {
1408
- let l = this.legend.bubbleLegend, e = l.chart.series, t = l.options.ranges, i, s, r = Number.MAX_VALUE, a = -Number.MAX_VALUE;
1409
- return e.forEach(function(o) {
1410
- o.isBubble && !o.ignoreSeries && (s = o.getColumn("z").filter(oi)).length && (r = ye(o.options.zMin, Math.min(r, Math.max(lo(s), o.options.displayNegative === !1 ? o.options.zThreshold : -Number.MAX_VALUE))), a = ye(o.options.zMax, Math.max(a, no(s))));
1411
- }), i = r === a ? [{ value: a }] : [{ value: r }, { value: (r + a) / 2 }, { value: a, autoRanges: !0 }], t.length && t[0].radius && i.reverse(), i.forEach(function(o, n) {
1412
- t && t[n] && (i[n] = be(t[n], o));
1413
- }), i;
1414
- }
1415
- predictBubbleSizes() {
1416
- let l = this.chart, e = l.legend.options, t = e.floating, i = e.layout === "horizontal", s = i ? l.legend.lastLineHeight : 0, r = l.plotSizeX, a = l.plotSizeY, o = l.series[this.options.seriesIndex], n = o.getPxExtremes(), h = Math.ceil(n.minPxSize), p = Math.ceil(n.maxPxSize), d = Math.min(a, r), c, g = o.options.maxSize;
1417
- return t || !/%$/.test(g) ? c = p : (c = (d + s) * (g = parseFloat(g)) / 100 / (g / 100 + 1), (i && a - c >= r || !i && r - c >= a) && (c = p)), [h, Math.ceil(c)];
1418
- }
1419
- updateRanges(l, e) {
1420
- let t = this.legend.options.bubbleLegend;
1421
- t.minSize = l, t.maxSize = e, t.ranges = this.getRanges();
1422
- }
1423
- correctSizes() {
1424
- let l = this.legend, e = this.chart.series[this.options.seriesIndex].getPxExtremes();
1425
- Math.abs(Math.ceil(e.maxPxSize) - this.options.maxSize) > 1 && (this.updateRanges(this.options.minSize, e.maxPxSize), l.render());
1426
- }
1427
- }, { setOptions: co } = v(), { composed: uo } = v(), { addEvent: ri, objectEach: mo, pushUnique: go, wrap: fo } = v();
1428
- function bo(l, e, t) {
1429
- let i, s, r, a = this.legend, o = ut(this) >= 0;
1430
- a && a.options.enabled && a.bubbleLegend && a.options.bubbleLegend.autoRanges && o ? (i = a.bubbleLegend.options, s = a.bubbleLegend.predictBubbleSizes(), a.bubbleLegend.updateRanges(s[0], s[1]), i.placed || (a.group.placed = !1, a.allItems.forEach((n) => {
1431
- (r = n.legendItem || {}).group && (r.group.translateY = void 0);
1432
- })), a.render(), i.placed || (this.getMargins(), this.axes.forEach((n) => {
1433
- n.setScale(), n.updateNames(), mo(n.ticks, function(h) {
1434
- h.isNew = !0, h.isNewLabel = !0;
1435
- });
1436
- }), this.getMargins()), i.placed = !0, l.call(this, e, t), a.bubbleLegend.correctSizes(), ni(a, ai(a))) : (l.call(this, e, t), a && a.options.enabled && a.bubbleLegend && (a.render(), ni(a, ai(a))));
1437
- }
1438
- function ut(l) {
1439
- let e = l.series, t = 0;
1440
- for (; t < e.length; ) {
1441
- if (e[t] && e[t].isBubble && e[t].visible && e[t].dataTable.rowCount) return t;
1442
- t++;
1443
- }
1444
- return -1;
1445
- }
1446
- function ai(l) {
1447
- let e = l.allItems, t = [], i = e.length, s, r, a, o = 0, n = 0;
1448
- for (o = 0; o < i; o++) if (r = e[o].legendItem || {}, a = (e[o + 1] || {}).legendItem || {}, r.labelHeight && (e[o].itemHeight = r.labelHeight), e[o] === e[i - 1] || r.y !== a.y) {
1449
- for (t.push({ height: 0 }), s = t[t.length - 1]; n <= o; n++) e[n].itemHeight > s.height && (s.height = e[n].itemHeight);
1450
- s.step = o;
1451
- }
1452
- return t;
1453
- }
1454
- function yo(l) {
1455
- let e = this.bubbleLegend, t = this.options, i = t.bubbleLegend, s = ut(this.chart);
1456
- e && e.ranges && e.ranges.length && (i.ranges.length && (i.autoRanges = !!i.ranges[0].autoRanges), this.destroyItem(e)), s >= 0 && t.enabled && i.enabled && (i.seriesIndex = s, this.bubbleLegend = new po(i, this), this.bubbleLegend.addToLegend(l.allItems));
1457
- }
1458
- function xo(l) {
1459
- let e;
1460
- if (l.defaultPrevented) return !1;
1461
- let t = l.legendItem, i = this.chart, s = t.visible;
1462
- this && this.bubbleLegend && (t.visible = !s, t.ignoreSeries = s, e = ut(i) >= 0, this.bubbleLegend.visible !== e && (this.update({ bubbleLegend: { enabled: e } }), this.bubbleLegend.visible = e), t.visible = s);
1463
- }
1464
- function ni(l, e) {
1465
- let t = l.allItems, i = l.options.rtl, s, r, a, o, n = 0;
1466
- t.forEach((h, p) => {
1467
- (o = h.legendItem || {}).group && (s = o.group.translateX || 0, r = o.y || 0, ((a = h.movementX) || i && h.ranges) && (a = i ? s - h.options.maxSize / 2 : s + a, o.group.attr({ translateX: a })), p > e[n].step && n++, o.group.attr({ translateY: Math.round(r + e[n].height / 2) }), o.y = r + e[n].height / 2);
1468
- });
1469
- }
1470
- let Mo = { compose: function(l, e) {
1471
- go(uo, "Series.BubbleLegend") && (co({ legend: { bubbleLegend: ro } }), fo(l.prototype, "drawChartBox", bo), ri(e, "afterGetAllItems", yo), ri(e, "itemClick", xo));
1472
- } };
1473
- var vo = C(260), wo = C.n(vo);
1474
- let { seriesTypes: { scatter: { prototype: { pointClass: Co } } } } = I(), { extend: Po } = v();
1475
- class li extends Co {
1476
- haloPath(e) {
1477
- let t = (e && this.marker && this.marker.radius || 0) + e;
1478
- if (this.series.chart.inverted) {
1479
- let i = this.pos() || [0, 0], { xAxis: s, yAxis: r, chart: a } = this.series, o = 2 * t;
1480
- return a.renderer.symbols.circle((s?.len || 0) - i[1] - t, (r?.len || 0) - i[0] - t, o, o);
1481
- }
1482
- return wo().prototype.haloPath.call(this, t);
1483
- }
1484
- }
1485
- Po(li.prototype, { ttBelow: !1 });
1486
- let hi = li, { composed: To, noop: mt } = v(), { series: Ao, seriesTypes: { column: { prototype: Lo }, scatter: pi } } = I(), { addEvent: Xe, arrayMax: jo, arrayMin: zo, clamp: ko, extend: gt, isNumber: $, merge: So, pick: _, pushUnique: Io } = v();
1487
- function Bo() {
1488
- let l = this.len, { coll: e, isXAxis: t, min: i } = this, s = (this.max || 0) - (i || 0), r = 0, a = l, o = l / s, n;
1489
- (e === "xAxis" || e === "yAxis") && (this.series.forEach((h) => {
1490
- if (h.bubblePadding && h.reserveSpace()) {
1491
- this.allowZoomOutside = !0, n = !0;
1492
- let p = h.getColumn(t ? "x" : "y");
1493
- if (t && ((h.onPoint || h).getRadii(0, 0, h), h.onPoint && (h.radii = h.onPoint.radii)), s > 0) {
1494
- let d = p.length;
1495
- for (; d--; ) if ($(p[d]) && this.dataMin <= p[d] && p[d] <= this.max) {
1496
- let c = h.radii && h.radii[d] || 0;
1497
- r = Math.min((p[d] - i) * o - c, r), a = Math.max((p[d] - i) * o + c, a);
1498
- }
1499
- }
1500
- }
1501
- }), n && s > 0 && !this.logarithmic && (a -= l, o *= (l + Math.max(0, r) - Math.min(a, l)) / l, [["min", "userMin", r], ["max", "userMax", a]].forEach((h) => {
1502
- _(this.options[h[0]], this[h[1]]) === void 0 && (this[h[0]] += h[2] / o);
1503
- })));
1504
- }
1505
- function Eo() {
1506
- let { ticks: l, tickPositions: e, dataMin: t = 0, dataMax: i = 0, categories: s } = this, r = this.options.type;
1507
- if ((s?.length || r === "category") && this.series.find((a) => a.bubblePadding)) {
1508
- let a = e.length;
1509
- for (; a--; ) {
1510
- let o = l[e[a]], n = o.pos || 0;
1511
- (n > i || n < t) && o.label?.hide();
1512
- }
1513
- }
1514
- }
1515
- class oe extends pi {
1516
- static compose(e, t, i) {
1517
- Mo.compose(t, i), Io(To, "Series.Bubble") && (Xe(e, "foundExtremes", Bo), Xe(e, "afterRender", Eo));
1518
- }
1519
- animate(e) {
1520
- !e && this.points.length < this.options.animationLimit && this.points.forEach(function(t) {
1521
- let { graphic: i, plotX: s = 0, plotY: r = 0 } = t;
1522
- i && i.width && (this.hasRendered || i.attr({ x: s, y: r, width: 1, height: 1 }), i.animate(this.markerAttribs(t), this.options.animation));
1523
- }, this);
1524
- }
1525
- getRadii() {
1526
- let e = this.getColumn("z"), t = this.getColumn("y"), i = [], s, r, a, o = this.chart.bubbleZExtremes, { minPxSize: n, maxPxSize: h } = this.getPxExtremes();
1527
- if (!o) {
1528
- let p, d = Number.MAX_VALUE, c = -Number.MAX_VALUE;
1529
- this.chart.series.forEach((g) => {
1530
- if (g.bubblePadding && g.reserveSpace()) {
1531
- let f = (g.onPoint || g).getZExtremes();
1532
- f && (d = Math.min(_(d, f.zMin), f.zMin), c = Math.max(_(c, f.zMax), f.zMax), p = !0);
1533
- }
1534
- }), p ? (o = { zMin: d, zMax: c }, this.chart.bubbleZExtremes = o) : o = { zMin: 0, zMax: 0 };
1535
- }
1536
- for (r = 0, s = e.length; r < s; r++) a = e[r], i.push(this.getRadius(o.zMin, o.zMax, n, h, a, t && t[r]));
1537
- this.radii = i;
1538
- }
1539
- getRadius(e, t, i, s, r, a) {
1540
- let o = this.options, n = o.sizeBy !== "width", h = o.zThreshold, p = t - e, d = 0.5;
1541
- if (a === null || r === null) return null;
1542
- if ($(r)) {
1543
- if (o.sizeByAbsoluteValue && (r = Math.abs(r - h), t = p = Math.max(t - h, Math.abs(e - h)), e = 0), r < e) return i / 2 - 1;
1544
- p > 0 && (d = (r - e) / p);
1545
- }
1546
- return n && d >= 0 && (d = Math.sqrt(d)), Math.ceil(i + d * (s - i)) / 2;
1547
- }
1548
- hasData() {
1549
- return !!this.dataTable.rowCount;
1550
- }
1551
- markerAttribs(e, t) {
1552
- let i = super.markerAttribs(e, t), { height: s = 0, width: r = 0 } = i;
1553
- return this.chart.inverted ? gt(i, { x: (e.plotX || 0) - r / 2, y: (e.plotY || 0) - s / 2 }) : i;
1554
- }
1555
- pointAttribs(e, t) {
1556
- let i = this.options.marker, s = i?.fillOpacity, r = Ao.prototype.pointAttribs.call(this, e, t);
1557
- return r["fill-opacity"] = s ?? 1, r;
1558
- }
1559
- translate() {
1560
- super.translate.call(this), this.getRadii(), this.translateBubble();
1561
- }
1562
- translateBubble() {
1563
- let { data: e, options: t, radii: i } = this, { minPxSize: s } = this.getPxExtremes(), r = e.length;
1564
- for (; r--; ) {
1565
- let a = e[r], o = i ? i[r] : 0;
1566
- this.zoneAxis === "z" && (a.negative = (a.z || 0) < (t.zThreshold || 0)), $(o) && o >= s / 2 ? (a.marker = gt(a.marker, { radius: o, width: 2 * o, height: 2 * o }), a.dlBox = { x: a.plotX - o, y: a.plotY - o, width: 2 * o, height: 2 * o }) : (a.shapeArgs = a.plotY = a.dlBox = void 0, a.isInside = !1);
1567
- }
1568
- }
1569
- getPxExtremes() {
1570
- let e = Math.min(this.chart.plotWidth, this.chart.plotHeight), t = (r) => {
1571
- let a;
1572
- return typeof r == "string" && (a = /%$/.test(r), r = parseInt(r, 10)), a ? e * r / 100 : r;
1573
- }, i = t(_(this.options.minSize, 8)), s = Math.max(t(_(this.options.maxSize, "20%")), i);
1574
- return { minPxSize: i, maxPxSize: s };
1575
- }
1576
- getZExtremes() {
1577
- let e = this.options, t = this.getColumn("z").filter($);
1578
- if (t.length) {
1579
- let i = _(e.zMin, ko(zo(t), e.displayNegative === !1 ? e.zThreshold || 0 : -Number.MAX_VALUE, Number.MAX_VALUE)), s = _(e.zMax, jo(t));
1580
- if ($(i) && $(s)) return { zMin: i, zMax: s };
1581
- }
1582
- }
1583
- searchKDTree(e, t, i, s = mt, r = mt) {
1584
- return s = (a, o, n) => {
1585
- let h = a[n] || 0, p = o[n] || 0, d, c = !1;
1586
- return h === p ? d = a.index > o.index ? a : o : h < 0 && p < 0 ? (d = h - (a.marker?.radius || 0) >= p - (o.marker?.radius || 0) ? a : o, c = !0) : d = h < p ? a : o, [d, c];
1587
- }, r = (a, o, n) => !n && a > o || a < o, super.searchKDTree(e, t, i, s, r);
1588
- }
1589
- }
1590
- oe.defaultOptions = So(pi.defaultOptions, { dataLabels: { formatter: function() {
1591
- let { numberFormatter: l } = this.series.chart, { z: e } = this.point;
1592
- return $(e) ? l(e, -1) : "";
1593
- }, inside: !0, verticalAlign: "middle" }, animationLimit: 250, marker: { lineColor: null, lineWidth: 1, fillOpacity: 0.5, radius: null, states: { hover: { radiusPlus: 0 } }, symbol: "circle" }, minSize: 8, maxSize: "20%", softThreshold: !1, states: { hover: { halo: { size: 5 } } }, tooltip: { pointFormat: "({point.x}, {point.y}), Size: {point.z}" }, turboThreshold: 0, zThreshold: 0, zoneAxis: "z" }), gt(oe.prototype, { alignDataLabel: Lo.alignDataLabel, applyZones: mt, bubblePadding: !0, isBubble: !0, keysAffectYAxis: ["y"], pointArrayMap: ["y", "z"], pointClass: hi, parallelArrays: ["x", "y", "z"], trackerGroups: ["group", "dataLabelsGroup"], specialGroup: "group", zoneAxis: "z" }), Xe(oe, "updatedData", (l) => {
1594
- delete l.target.chart.bubbleZExtremes;
1595
- }), Xe(oe, "remove", (l) => {
1596
- delete l.target.chart.bubbleZExtremes;
1597
- }), I().registerSeriesType("bubble", oe);
1598
- let di = oe, { seriesTypes: { map: { prototype: { pointClass: { prototype: ci } } } } } = I(), { extend: Do } = v();
1599
- class ui extends hi {
1600
- isValid() {
1601
- return typeof this.z == "number";
1602
- }
1603
- }
1604
- Do(ui.prototype, { applyOptions: ci.applyOptions, getProjectedBounds: ci.getProjectedBounds });
1605
- let { seriesTypes: { map: { prototype: re }, mappoint: { prototype: mi } } } = I(), { extend: Oo, merge: Vo } = v();
1606
- class Ne extends di {
1607
- constructor() {
1608
- super(...arguments), this.clearBounds = re.clearBounds;
1609
- }
1610
- searchPoint(e, t) {
1611
- return this.searchKDTree({ plotX: e.chartX - this.chart.plotLeft, plotY: e.chartY - this.chart.plotTop }, t, e);
1612
- }
1613
- translate() {
1614
- mi.translate.call(this), this.getRadii(), this.translateBubble();
1615
- }
1616
- }
1617
- Ne.defaultOptions = Vo(di.defaultOptions, { lineWidth: 0, animationLimit: 500, joinBy: "hc-key", tooltip: { pointFormat: "{point.name}: {point.z}" } }), Oo(Ne.prototype, { type: "mapbubble", axisTypes: ["colorAxis"], getProjectedBounds: re.getProjectedBounds, isCartesian: !1, pointArrayMap: ["z"], pointClass: ui, processData: re.processData, projectPoint: mi.projectPoint, kdAxisArray: ["plotX", "plotY"], setData: re.setData, setOptions: re.setOptions, updateData: re.updateData, useMapGeometry: !0, xyFromShape: !0 }), I().registerSeriesType("mapbubble", Ne);
1618
- let { scatter: { prototype: { pointClass: Xo } } } = I().seriesTypes, { clamp: Ye, defined: No, extend: Yo, pick: Go } = v();
1619
- class gi extends Xo {
1620
- applyOptions(e, t) {
1621
- return (this.isNull || this.value === null) && delete this.color, super.applyOptions(e, t), this.formatPrefix = this.isNull || this.value === null ? "null" : "point", this;
1622
- }
1623
- getCellAttributes() {
1624
- let e = this.series, t = e.options, i = (t.colsize || 1) / 2, s = (t.rowsize || 1) / 2, r = e.xAxis, a = e.yAxis, o = this.options.marker || e.options.marker, n = e.pointPlacementToXValue(), h = Go(this.pointPadding, t.pointPadding, 0), p = { x1: Ye(Math.round(r.len - r.translate(this.x - i, !1, !0, !1, !0, -n)), -r.len, 2 * r.len), x2: Ye(Math.round(r.len - r.translate(this.x + i, !1, !0, !1, !0, -n)), -r.len, 2 * r.len), y1: Ye(Math.round(a.translate(this.y - s, !1, !0, !1, !0)), -a.len, 2 * a.len), y2: Ye(Math.round(a.translate(this.y + s, !1, !0, !1, !0)), -a.len, 2 * a.len) };
1625
- for (let d of [["width", "x"], ["height", "y"]]) {
1626
- let c = d[0], g = d[1], f = g + "1", u = g + "2", m = Math.abs(p[f] - p[u]), b = o && o.lineWidth || 0, y = Math.abs(p[f] + p[u]) / 2, x = o && o[c];
1627
- if (No(x) && x < m) {
1628
- let M = x / 2 + b / 2;
1629
- p[f] = y - M, p[u] = y + M;
1630
- }
1631
- h && ((g === "x" && r.reversed || g === "y" && !a.reversed) && (f = u, u = g + "1"), p[f] += h, p[u] -= h);
1632
- }
1633
- return p;
1634
- }
1635
- haloPath(e) {
1636
- if (!e) return [];
1637
- let { x: t = 0, y: i = 0, width: s = 0, height: r = 0 } = this.shapeArgs || {};
1638
- return [["M", t - e, i - e], ["L", t - e, i + r + e], ["L", t + s + e, i + r + e], ["L", t + s + e, i - e], ["Z"]];
1639
- }
1640
- isValid() {
1641
- return this.value !== 1 / 0 && this.value !== -1 / 0;
1642
- }
1643
- }
1644
- Yo(gi.prototype, { dataLabelOnNull: !0, moveToTopOnHover: !0, ttBelow: !1 });
1645
- let { isNumber: Ro } = v(), { doc: Fo } = v(), { defined: Wo, pick: fi } = v(), { series: ae, seriesTypes: { column: Zo, scatter: bi } } = I(), { prototype: { symbols: Ge } } = at(), { addEvent: Uo, extend: Ho, fireEvent: qo, isNumber: Re, merge: ft, pick: Ko } = v(), { colorFromPoint: $o, getContext: _o } = { colorFromPoint: function(l, e) {
1646
- let t = e.series.colorAxis;
1647
- if (t) {
1648
- let i = t.toColor(l || 0, e).split(")")[0].split("(")[1].split(",").map((s) => fi(parseFloat(s), parseInt(s, 10)));
1649
- return i[3] = 255 * fi(i[3], 1), Wo(l) && e.visible || (i[3] = 0), i;
1650
- }
1651
- return [0, 0, 0, 0];
1652
- }, getContext: function(l) {
1653
- let { canvas: e, context: t } = l;
1654
- return e && t ? (t.clearRect(0, 0, e.width, e.height), t) : (l.canvas = Fo.createElement("canvas"), l.context = l.canvas.getContext("2d", { willReadFrequently: !0 }) || void 0, l.context);
1655
- } };
1656
- class xe extends bi {
1657
- constructor() {
1658
- super(...arguments), this.valueMax = NaN, this.valueMin = NaN, this.isDirtyCanvas = !0;
1659
- }
1660
- drawPoints() {
1661
- let e = this, t = e.options, i = t.interpolation, s = t.marker || {};
1662
- if (i) {
1663
- let { image: r, chart: a, xAxis: o, yAxis: n } = e, { reversed: h = !1, len: p } = o, { reversed: d = !1, len: c } = n, g = { width: p, height: c };
1664
- if (!r || e.isDirtyData || e.isDirtyCanvas) {
1665
- let f = _o(e), { canvas: u, options: { colsize: m = 1, rowsize: b = 1 }, points: y, points: { length: x } } = e, M = a.colorAxis && a.colorAxis[0];
1666
- if (u && f && M) {
1667
- let { min: w, max: P } = o.getExtremes(), { min: j, max: A } = n.getExtremes(), T = P - w, k = A - j, V = Math.round(T / m / 8 * 8), R = Math.round(k / b / 8 * 8), [Me, ve] = [[V, V / T, h, "ceil"], [R, R / k, !d, "floor"]].map(([J, Z, bt, Fe]) => bt ? (yt) => Math[Fe](J - Z * yt) : (yt) => Math[Fe](Z * yt)), we = u.width = V + 1, Ce = we * (u.height = R + 1), Qo = (x - 1) / Ce, yi = new Uint8ClampedArray(4 * Ce), er = (J, Z) => 4 * Math.ceil(we * ve(Z - j) + Me(J - w));
1668
- e.buildKDTree();
1669
- for (let J = 0; J < Ce; J++) {
1670
- let Z = y[Math.ceil(Qo * J)], { x: bt, y: Fe } = Z;
1671
- yi.set($o(Z.value, Z), er(bt, Fe));
1672
- }
1673
- f.putImageData(new ImageData(yi, we), 0, 0), r ? r.attr({ ...g, href: u.toDataURL("image/png", 1) }) : (e.directTouch = !1, e.image = a.renderer.image(u.toDataURL("image/png", 1)).attr(g).add(e.group));
1674
- }
1675
- e.isDirtyCanvas = !1;
1676
- } else (r.width !== p || r.height !== c) && r.attr(g);
1677
- } else (s.enabled || e._hasPointMarkers) && (ae.prototype.drawPoints.call(e), e.points.forEach((r) => {
1678
- r.graphic && (r.graphic[e.chart.styledMode ? "css" : "animate"](e.colorAttribs(r)), r.value === null && r.graphic.addClass("highcharts-null-point"));
1679
- }));
1680
- }
1681
- getExtremes() {
1682
- let { dataMin: e, dataMax: t } = ae.prototype.getExtremes.call(this, this.getColumn("value"));
1683
- return Re(e) && (this.valueMin = e), Re(t) && (this.valueMax = t), ae.prototype.getExtremes.call(this);
1684
- }
1685
- getValidPoints(e, t) {
1686
- return ae.prototype.getValidPoints.call(this, e, t, !0);
1687
- }
1688
- hasData() {
1689
- return !!this.dataTable.rowCount;
1690
- }
1691
- init() {
1692
- super.init.apply(this, arguments);
1693
- let e = this.options;
1694
- e.pointRange = Ko(e.pointRange, e.colsize || 1), this.yAxis.axisPointRange = e.rowsize || 1, Ge.ellipse = Ge.circle, e.marker && Re(e.borderRadius) && (e.marker.r = e.borderRadius);
1695
- }
1696
- markerAttribs(e, t) {
1697
- let i = e.shapeArgs || {};
1698
- if (e.hasImage) return { x: e.plotX, y: e.plotY };
1699
- if (t && t !== "normal") {
1700
- let s = e.options.marker || {}, r = this.options.marker || {}, a = r.states?.[t] || {}, o = s.states?.[t] || {}, n = (o.width || a.width || i.width || 0) + (o.widthPlus || a.widthPlus || 0), h = (o.height || a.height || i.height || 0) + (o.heightPlus || a.heightPlus || 0);
1701
- return { x: (i.x || 0) + ((i.width || 0) - n) / 2, y: (i.y || 0) + ((i.height || 0) - h) / 2, width: n, height: h };
1702
- }
1703
- return i;
1704
- }
1705
- pointAttribs(e, t) {
1706
- let i = ae.prototype.pointAttribs.call(this, e, t), s = this.options || {}, r = this.chart.options.plotOptions || {}, a = r.series || {}, o = r.heatmap || {}, n = e?.options.borderColor || s.borderColor || o.borderColor || a.borderColor, h = e?.options.borderWidth || s.borderWidth || o.borderWidth || a.borderWidth || i["stroke-width"];
1707
- if (i.stroke = e?.marker?.lineColor || s.marker?.lineColor || n || this.color, i["stroke-width"] = h, t && t !== "normal") {
1708
- let p = ft(s.states?.[t], s.marker?.states?.[t], e?.options.states?.[t] || {});
1709
- i.fill = p.color || Qe().parse(i.fill).brighten(p.brightness || 0).get(), i.stroke = p.lineColor || i.stroke;
1710
- }
1711
- return i;
1712
- }
1713
- translate() {
1714
- let { borderRadius: e, marker: t } = this.options, i = t?.symbol || "rect", s = Ge[i] ? i : "rect", r = ["circle", "square"].indexOf(s) !== -1;
1715
- for (let a of (this.generatePoints(), this.points)) {
1716
- let o = a.getCellAttributes(), n = Math.min(o.x1, o.x2), h = Math.min(o.y1, o.y2), p = Math.max(Math.abs(o.x2 - o.x1), 0), d = Math.max(Math.abs(o.y2 - o.y1), 0);
1717
- if (a.hasImage = (a.marker?.symbol || i).indexOf("url") === 0, r) {
1718
- let c = Math.abs(p - d);
1719
- n = Math.min(o.x1, o.x2) + (p < d ? 0 : c / 2), h = Math.min(o.y1, o.y2) + (p < d ? c / 2 : 0), p = d = Math.min(p, d);
1720
- }
1721
- a.hasImage && (a.marker = { width: p, height: d }), a.plotX = a.clientX = (o.x1 + o.x2) / 2, a.plotY = (o.y1 + o.y2) / 2, a.shapeType = "path", a.shapeArgs = ft(!0, { x: n, y: h, width: p, height: d }, { d: Ge[s](n, h, p, d, { r: Re(e) ? e : 0 }) });
1722
- }
1723
- qo(this, "afterTranslate");
1724
- }
1725
- }
1726
- xe.defaultOptions = ft(bi.defaultOptions, { animation: !1, borderRadius: 0, borderWidth: 0, interpolation: !1, nullColor: "#f7f7f7", dataLabels: { formatter: function() {
1727
- let { numberFormatter: l } = this.series.chart, { value: e } = this.point;
1728
- return Ro(e) ? l(e, -1) : "";
1729
- }, inside: !0, verticalAlign: "middle", crop: !1, overflow: "allow", padding: 0 }, marker: { symbol: "rect", radius: 0, lineColor: void 0, states: { hover: { lineWidthPlus: 0 }, select: {} } }, clip: !0, pointRange: null, tooltip: { pointFormat: "{point.x}, {point.y}: {point.value}<br/>" }, states: { hover: { halo: !1, brightness: 0.2 } }, legendSymbol: "rectangle" }), Uo(xe, "afterDataClassLegendClick", function() {
1730
- this.isDirtyCanvas = !0, this.drawPoints();
1731
- }), Ho(xe.prototype, { axisTypes: B.seriesMembers.axisTypes, colorKey: B.seriesMembers.colorKey, directTouch: !0, getExtremesFromAll: !0, keysAffectYAxis: ["y"], parallelArrays: B.seriesMembers.parallelArrays, pointArrayMap: ["y", "value"], pointClass: gi, specialGroup: "group", trackerGroups: B.seriesMembers.trackerGroups, alignDataLabel: Zo.prototype.alignDataLabel, colorAttribs: B.seriesMembers.colorAttribs, getSymbol: ae.prototype.getSymbol }), B.compose(xe), I().registerSeriesType("heatmap", xe);
1732
- /**
1733
- * @license Highmaps JS v12.3.0 (2025-06-21)
1734
- * @module highcharts/modules/map
1735
- * @requires highcharts
1736
- *
1737
- * Highmaps as a plugin for Highcharts or Highcharts Stock.
1738
- *
1739
- * (c) 2011-2025 Torstein Honsi
1740
- *
1741
- * License: www.highcharts.com/license
1742
- */
1743
- let L = v();
1744
- L.ColorMapComposition = B, L.MapChart = L.MapChart || ze, L.MapNavigation = L.MapNavigation || Le, L.MapView = L.MapView || N, L.Projection = L.Projection || E, L.mapChart = L.Map = L.MapChart.mapChart, L.maps = L.MapChart.maps, L.geojson = ke.geojson, L.topo2geo = ke.topo2geo, ke.compose(L.Chart), Ne.compose(L.Axis, L.Chart, L.Legend), Le.compose(ze, L.Pointer, L.SVGRenderer), N.compose(ze);
1745
- let Jo = v();
1746
- return Mt.default;
1747
- })());
1748
- }(We)), We.exports;
1749
- }
1750
- var Mi = or();
1751
- const rr = /* @__PURE__ */ tr(Mi), nr = /* @__PURE__ */ ir({
1752
- __proto__: null,
1753
- default: rr
1754
- }, [Mi]);
1755
- export {
1756
- nr as m
1757
- };