@hybridcore/ui 1.5.90 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AccordionDetails-DhriPVPP.js → AccordionSummary-DgAwVTk8.js} +81 -82
- package/dist/{Add-CMz4N2zT.js → Add-DJLrrVHm.js} +52 -51
- package/dist/AnimatedTheme-jnasw6rT.js +11305 -0
- package/dist/AxisRenderer-DTyLLA6c.js +3579 -0
- package/dist/AxisRendererY-C_ItLPNV.js +445 -0
- package/dist/Box-p6OtTUEo.js +30 -0
- package/dist/Bullet-DVczI2TD.js +41 -0
- package/dist/Button-CcsPEIDh.js +35 -0
- package/dist/{Button-eqWvpDuh.js → Button-CvE2gnly.js} +138 -124
- package/dist/{ButtonBase-DsX-jMQJ.js → ButtonBase-2bPw77UP.js} +5 -5
- package/dist/{CardContent-DsYqqPeJ.js → CardContent-CSHh-ZlM.js} +4 -4
- package/dist/CategoryAxis-CwnfaGc8.js +458 -0
- package/dist/{Checkbox-CrU2hpWB.js → Checkbox-CWRMFTBp.js} +12 -11
- package/dist/Circle-Cy5s-pVc.js +27 -0
- package/dist/ColorSet-C7vpNXhM.js +2957 -0
- package/dist/{ColumnSeries-BTcqshjB.js → ColumnSeries-CjgdJ2QL.js} +129 -126
- package/dist/DataProcessor-CHDO51q4.js +83 -0
- package/dist/DateAxis-YX3QNIB-.js +569 -0
- package/dist/{Delete-86TO0fMo.js → Delete-CW0UZv1m.js} +1 -1
- package/dist/{DialogContent-CqTojymQ.js → DialogContent-B3nbEbuv.js} +10 -11
- package/dist/FormControl-BLbrq4C7.js +1636 -0
- package/dist/{FormControlLabel-BrdX4R71.js → FormControlLabel-C8SPv14J.js} +8 -8
- package/dist/Hierarchy-Bihj0S61.js +925 -0
- package/dist/{IconButton-DJ-31-Fd.js → IconButton-CHwRQF-g.js} +20 -19
- package/dist/IconPlus-yPkff_Vj.js +19 -0
- package/dist/{InputAdornment-B7qEA4kN.js → InputAdornment-DLxWUE6H.js} +6 -6
- package/dist/Legend-Dp_MKfS4.js +178 -0
- package/dist/LineSeries-Uiv5o56b.js +472 -0
- package/dist/{List-DOD5kSk3.js → List-tqElle9C.js} +4 -4
- package/dist/{ListItem-r8PbsvCz.js → ListItem-CfjsIg4B.js} +9 -8
- package/dist/{MenuItem-C6qlUyV3.js → MenuItem-xZx_w7zA.js} +14 -13
- package/dist/{Modal-CkcFEpHa.js → Modal-DhPpOoGB.js} +292 -277
- package/dist/{Paper-CjqLScHA.js → Paper-2B03OBmZ.js} +47 -41
- package/dist/PieSeries-B2fW3z0s.js +693 -0
- package/dist/RoundedRectangle-CWLi2PXn.js +34 -0
- package/dist/Scrollbar-D86MJyr2.js +171 -0
- package/dist/{Select-t3ewnSdf.js → Select-BgYwkZgI.js} +2066 -1633
- package/dist/Slice-B19rbYDZ.js +261 -0
- package/dist/{Source-BESIjd9X.js → Source-BSZST_GH.js} +2472 -2445
- package/dist/{Text-Cl1H4b0h.js → Text-ChJRuaD8.js} +398 -397
- package/dist/{TextField-BQ8a50fA.js → TextField-1yCesIbH.js} +23 -25
- package/dist/Tick-2bcLyHpF.js +162 -0
- package/dist/{Typography-D1t7XuLN.js → Typography-CxbneZy_.js} +11 -11
- package/dist/Vector-BmuhQO4p.js +3606 -0
- package/dist/Vector-DfTqQEln.js +1735 -0
- package/dist/WKT-2wsDT-nq.js +2310 -0
- package/dist/XYCursor-C8WktvKM.js +362 -0
- package/dist/ZoomableContainer-DYyqwaMb.js +220 -0
- package/dist/_commonjsHelpers-BVfed4GL.js +28 -0
- package/dist/capitalize-ciszXJ7R.js +9 -0
- package/dist/components/access/helpers.js +1 -1
- package/dist/components/access/index.js +1 -1
- package/dist/components/card/index.js +6 -6
- package/dist/components/card/styled.js +1 -1
- package/dist/components/charts/_common/utils.js +20 -0
- package/dist/components/charts/candlestick/logic.js +170 -140
- package/dist/components/charts/chart-wrapper/helpers.js +27 -0
- package/dist/components/charts/chart-wrapper/index.js +44 -0
- package/dist/components/charts/chart-wrapper/logic.js +47 -0
- package/dist/components/charts/chart-wrapper/styled.js +44 -0
- package/dist/components/charts/column-line-mix/index.js +10 -0
- package/dist/components/charts/column-line-mix/logic.js +162 -0
- package/dist/components/charts/column-line-mix/styled.js +12 -0
- package/dist/components/charts/drill-down-treemap/index.js +10 -0
- package/dist/components/charts/drill-down-treemap/logic.js +391 -0
- package/dist/components/charts/drill-down-treemap/styled.js +12 -0
- package/dist/components/charts/drill-down-voronoi-treemap/index.js +10 -0
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +1527 -0
- package/dist/components/charts/drill-down-voronoi-treemap/styled.js +12 -0
- package/dist/components/charts/heatmap/index.js +10 -0
- package/dist/components/charts/heatmap/logic.js +361 -0
- package/dist/components/charts/heatmap/styled.js +12 -0
- package/dist/components/charts/highlighting-line-data/logic.js +89 -256
- package/dist/components/charts/line/index.js +10 -0
- package/dist/components/charts/line/logic.js +148 -0
- package/dist/components/charts/line/styled.js +12 -0
- package/dist/components/charts/logaritmic-scale/index.js +10 -0
- package/dist/components/charts/logaritmic-scale/logic.js +119 -0
- package/dist/components/charts/logaritmic-scale/styled.js +12 -0
- package/dist/components/charts/multiple-value-axes/index.js +10 -0
- package/dist/components/charts/multiple-value-axes/logic.js +191 -0
- package/dist/components/charts/multiple-value-axes/styled.js +12 -0
- package/dist/components/charts/nested-pie/index.js +10 -0
- package/dist/components/charts/nested-pie/logic.js +110 -0
- package/dist/components/charts/nested-pie/styled.js +12 -0
- package/dist/components/charts/packed-circles/index.js +10 -0
- package/dist/components/charts/packed-circles/logic.js +423 -0
- package/dist/components/charts/packed-circles/styled.js +12 -0
- package/dist/components/charts/pie-chart/index.js +10 -0
- package/dist/components/charts/pie-chart/logic.js +70 -0
- package/dist/components/charts/pie-chart/styled.js +12 -0
- package/dist/components/charts/stacked-area-radar/index.js +10 -0
- package/dist/components/charts/stacked-area-radar/logic.js +868 -0
- package/dist/components/charts/stacked-area-radar/styled.js +12 -0
- package/dist/components/charts/stacked-column-chart/index.js +10 -0
- package/dist/components/charts/stacked-column-chart/logic.js +148 -0
- package/dist/components/charts/stacked-column-chart/styled.js +12 -0
- package/dist/components/charts/xy-chart/index.js +10 -0
- package/dist/components/charts/xy-chart/logic.js +170 -0
- package/dist/components/charts/xy-chart/styled.js +12 -0
- package/dist/components/collapsible-card/index.js +58 -32
- package/dist/components/collapsible-card/logic.js +20 -0
- package/dist/components/collapsible-card/styled.js +52 -0
- package/dist/components/confirm/dialog.js +3 -3
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/container/index.js +7 -7
- package/dist/components/context-menu/index.js +153 -253
- package/dist/components/data-map/components/controls/index.js +12 -0
- package/dist/components/data-map/components/controls/styled.js +34 -0
- package/dist/components/data-map/index.js +51 -0
- package/dist/components/data-map/logic.js +108 -0
- package/dist/components/data-map/styled.js +32 -0
- package/dist/components/data-security-selectors/security-level/index.js +5 -5
- package/dist/components/date-picker-with-custom-range/index.js +9 -0
- package/dist/components/date-picker-with-custom-range/logic.js +66 -0
- package/dist/components/date-picker-with-custom-range/styled.js +43 -0
- package/dist/components/divider/index.js +18 -0
- package/dist/components/divider/logic.js +13 -0
- package/dist/components/divider/styled.js +14 -0
- package/dist/components/geometry-picker/coordinate/index.js +1 -1
- package/dist/components/geometry-picker/edit/index.js +1 -1
- package/dist/components/geometry-picker/geometry/index.js +1 -1
- package/dist/components/geometry-picker/index.js +7 -8
- package/dist/components/geometry-picker/kml/index.js +1 -1
- package/dist/components/geometry-picker/map/index.js +1 -1
- package/dist/components/geometry-picker/map/logic.js +65 -62
- package/dist/components/geometry-picker/map/style.js +1 -1
- package/dist/components/heat-map/components/controls/index.js +12 -0
- package/dist/components/heat-map/components/controls/styled.js +34 -0
- package/dist/components/heat-map/components/legend/index.js +26 -0
- package/dist/components/heat-map/components/legend/styled.js +14 -0
- package/dist/components/heat-map/index.js +37 -0
- package/dist/components/heat-map/logic.js +1945 -0
- package/dist/components/heat-map/styled.js +32 -0
- package/dist/components/icon-button/index.js +22 -15
- package/dist/components/icon-button/logic.js +15 -0
- package/dist/components/icon-button/styled.js +22 -10
- package/dist/components/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/instance-form/components/composite-matrix/components/json-editor/index.js +8 -7
- package/dist/components/instance-form/components/variable/index.js +8 -8
- package/dist/components/instance-form/components/variables/index.js +1 -1
- package/dist/components/instance-hierarchy-table/styled.js +1 -1
- package/dist/components/instance-variable-list/index.js +34 -29
- package/dist/components/instance-variable-list/styled.js +21 -21
- package/dist/components/instance-variable-list/variable.js +44 -74
- package/dist/components/linear-indicator/index.js +10 -67
- package/dist/components/linear-indicator/logic.js +47 -0
- package/dist/components/linear-indicator/styled.js +39 -40
- package/dist/components/map/helpers/kml.js +1 -1
- package/dist/components/map/helpers/mapbox.js +14 -14
- package/dist/components/map/helpers/ol.js +23 -19
- package/dist/components/map/helpers/wkt.js +26 -1314
- package/dist/components/map/index.js +1 -1
- package/dist/components/map/logic.js +113 -101
- package/dist/components/map/styled.js +39 -31
- package/dist/components/metric-card/MetricChart.js +50 -498
- package/dist/components/metric-card/index.js +94 -115
- package/dist/components/metric-card/logic.js +70 -131
- package/dist/components/object-profile-card/components/avatar/index.js +44 -0
- package/dist/components/object-profile-card/components/avatar/logic.js +19 -0
- package/dist/components/object-profile-card/components/avatar/styled.js +41 -0
- package/dist/components/object-profile-card/index.js +90 -0
- package/dist/components/object-profile-card/logic.js +33 -0
- package/dist/components/object-profile-card/styled.js +48 -0
- package/dist/components/paginated-list/index.js +93 -89
- package/dist/components/paginated-list/logic.js +51 -40
- package/dist/components/paginated-list/styled.js +25 -21
- package/dist/components/property-mapping/index.js +2 -2
- package/dist/components/prr-map/components/controls/index.js +12 -0
- package/dist/components/prr-map/components/controls/styled.js +34 -0
- package/dist/components/prr-map/components/legend/index.js +36 -0
- package/dist/components/prr-map/components/legend/styled.js +21 -0
- package/dist/components/prr-map/index.js +38 -0
- package/dist/components/prr-map/logic.js +104 -0
- package/dist/components/prr-map/styled.js +32 -0
- package/dist/components/range-selector/components/composite-list-range/index.js +1 -1
- package/dist/components/range-selector/components/date-range/index.js +4282 -7
- package/dist/components/range-selector/index.js +1 -1
- package/dist/components/raster-grid-map/components/controls/index.js +12 -0
- package/dist/components/raster-grid-map/components/controls/styled.js +34 -0
- package/dist/components/raster-grid-map/components/legend/index.js +14 -0
- package/dist/components/raster-grid-map/components/legend/styled.js +21 -0
- package/dist/components/raster-grid-map/helpers.js +190 -0
- package/dist/components/raster-grid-map/index.js +38 -0
- package/dist/components/raster-grid-map/logic.js +172 -0
- package/dist/components/raster-grid-map/styled.js +32 -0
- package/dist/components/search-input/index.js +62 -140
- package/dist/components/search-input/logic.js +43 -0
- package/dist/components/search-input/styled.js +33 -0
- package/dist/components/simple-pivot-table/index.js +66 -0
- package/dist/components/simple-pivot-table/logic.js +51 -0
- package/dist/components/simple-pivot-table/styled.js +45 -0
- package/dist/components/static-text/index.js +18 -0
- package/dist/components/static-text/logic.js +13 -0
- package/dist/components/static-text/styled.js +45 -0
- package/dist/components/tabs/index.js +56 -2160
- package/dist/components/tabs/logic.js +36 -0
- package/dist/components/tabs/styled.js +94 -16
- package/dist/components/tabs/tab-panel.js +11 -10
- package/dist/components/template-filters/components/tab-panel/index.js +1 -1
- package/dist/components/template-form/components/property-list/index.js +7 -7
- package/dist/components/template-form/components/property-list/property-list-columns.js +3 -3
- package/dist/components/template-form/components/property-list/property-list-form.js +9 -9
- package/dist/components/template-form/components/recognition-property-list/index.js +6 -6
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +2 -2
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +7 -7
- package/dist/components/template-form/index.js +5 -5
- package/dist/components/template-property-filters/property.js +5 -5
- package/dist/components/timeline/index.js +61 -0
- package/dist/components/timeline/logic.js +40 -0
- package/dist/components/timeline/styled.js +48 -0
- package/dist/components/tree-select/index.js +5 -5
- package/dist/components/treeview-filter/item-label/index.js +3 -3
- package/dist/constant-BiOGvlZc.js +21 -0
- package/dist/createReactComponent-C7L-DMHj.js +60 -0
- package/dist/{createSvgIcon-DLPYMuH1.js → createSvgIcon-BjpIhJ30.js} +30 -32
- package/dist/{createSvgIcon-OuwzpcaC.js → createSvgIcon-DrtgaibK.js} +5 -5
- package/dist/{createTheme-CNnKNxwL.js → createTheme-DYxDnE9u.js} +226 -285
- package/dist/{dialog-BE4D6swf.js → dialog-DcwXug9J.js} +6 -6
- package/dist/{helpers-DaCoWmi2.js → helpers-B4UL9NMD.js} +3 -3
- package/dist/index-BMS1Otro.js +183 -0
- package/dist/index-C__OZmYy.js +663 -0
- package/dist/{index-CGNxsLVm.js → index-CcdvNlgr.js} +7 -7
- package/dist/{index-JrtqxUdI.js → index-kCJ_Zvl8.js} +5 -5
- package/dist/index-syTc6m_V.js +1934 -0
- package/dist/index.es-CHNMhaMi.js +2067 -0
- package/dist/index.esm-BLLrbTzY.js +318 -0
- package/dist/{listItemTextClasses-CNjn41Of.js → listItemTextClasses-C3lndiXO.js} +2 -2
- package/dist/main.d.ts +1226 -358
- package/dist/main.js +141 -443
- package/dist/{has-DNclCIDV.js → math-Bvt2Ubuz.js} +220 -222
- package/dist/ol-yOE-NV0X.js +7465 -0
- package/dist/path-CNVruS--.js +84 -0
- package/dist/{property-list-form-C5hcK2y2.js → property-list-form-zZQfpR0X.js} +13 -13
- package/dist/styled-eZwjUruw.js +12 -0
- package/dist/useId-B4-oF9Mq.js +34 -0
- package/dist/useMobilePicker-BLg3Blg8.js +7589 -0
- package/dist/useThemeProps-BzzHcQyd.js +58 -0
- package/dist/{utils-CsOZUsQj.js → utils-BDNynJcd.js} +2 -2
- package/package.json +11 -2
- package/dist/AxisRendererY-kADUad00.js +0 -18370
- package/dist/Box-B1AVyJ_s.js +0 -71
- package/dist/DateAxis-CMum47iz.js +0 -924
- package/dist/Input-CoIrGZAh.js +0 -326
- package/dist/InputLabel-CBuAYyuT.js +0 -1367
- package/dist/LineSeries-CfcpoYla.js +0 -549
- package/dist/OutlinedInput-B-iZoc9l.js +0 -450
- package/dist/Tabs-Cn42Z5QI.js +0 -789
- package/dist/components/collapsible-card/style.js +0 -49
- package/dist/components/profile-card/index.js +0 -80
- package/dist/components/profile-card/logic.js +0 -33
- package/dist/components/profile-card/styled.js +0 -43
- package/dist/components/tabs/appleTabs.style.js +0 -55
- package/dist/createStyled-BGx1I94c.js +0 -352
- package/dist/createTheme-CyC5HawC.js +0 -879
- package/dist/exactProp-cjT0t_Pt.js +0 -36
- package/dist/extendSxProp-FEpqY5_S.js +0 -30
- package/dist/index-DMSHuq6l.js +0 -688
- package/dist/index-SpeaLUQD.js +0 -10963
- package/dist/ol-lGwSyEIV.js +0 -15050
- package/dist/ownerDocument-CUrv0DIK.js +0 -6
- package/dist/ownerWindow-niciwP7I.js +0 -7
- package/dist/styled-B8ugzvji.js +0 -12
- package/dist/useId-BHG98T5I.js +0 -26
- package/dist/useTheme-C15Eq8KG.js +0 -18
- package/dist/useTheme-D-uii9iX.js +0 -10
- package/dist/useThemeProps-DRP1dikX.js +0 -95
|
@@ -0,0 +1,2957 @@
|
|
|
1
|
+
function Q(s, e, t, i) {
|
|
2
|
+
function r(n) {
|
|
3
|
+
return n instanceof t ? n : new t(function(a) {
|
|
4
|
+
a(n);
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return new (t || (t = Promise))(function(n, a) {
|
|
8
|
+
function u(f) {
|
|
9
|
+
try {
|
|
10
|
+
l(i.next(f));
|
|
11
|
+
} catch (d) {
|
|
12
|
+
a(d);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function o(f) {
|
|
16
|
+
try {
|
|
17
|
+
l(i.throw(f));
|
|
18
|
+
} catch (d) {
|
|
19
|
+
a(d);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function l(f) {
|
|
23
|
+
f.done ? n(f.value) : r(f.value).then(u, o);
|
|
24
|
+
}
|
|
25
|
+
l((i = i.apply(s, e || [])).next());
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
class g {
|
|
29
|
+
/**
|
|
30
|
+
* Constructor.
|
|
31
|
+
*
|
|
32
|
+
* @param percent Percent value
|
|
33
|
+
*/
|
|
34
|
+
constructor(e) {
|
|
35
|
+
Object.defineProperty(this, "_value", {
|
|
36
|
+
enumerable: !0,
|
|
37
|
+
configurable: !0,
|
|
38
|
+
writable: !0,
|
|
39
|
+
value: void 0
|
|
40
|
+
}), this._value = e;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Relative value.
|
|
44
|
+
*
|
|
45
|
+
* E.g. 100% is 1, 50% is 0.5, etc.
|
|
46
|
+
*
|
|
47
|
+
* This is useful to apply transformations to other values. E.g.:
|
|
48
|
+
*
|
|
49
|
+
* ```TypeScript
|
|
50
|
+
* let value = 256;
|
|
51
|
+
* let percent = new am5.p50;
|
|
52
|
+
* console.log(value * percent.value); // outputs 128
|
|
53
|
+
* ```
|
|
54
|
+
* ```JavaScript
|
|
55
|
+
* var value = 256;
|
|
56
|
+
* var percent = new am5.p50;
|
|
57
|
+
* console.log(value * percent.value); // outputs 128
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* Alternatively, you can use `am5.percent()` helper function:
|
|
61
|
+
*
|
|
62
|
+
* ```TypeScript
|
|
63
|
+
* let value = 256;
|
|
64
|
+
* let percent = am5.p50;
|
|
65
|
+
* console.log(value * percent.value); // outputs 128
|
|
66
|
+
* ```
|
|
67
|
+
* ```JavaScript
|
|
68
|
+
* var value = 256;
|
|
69
|
+
* var percent = am5.p50;
|
|
70
|
+
* console.log(value * percent.value); // outputs 128
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @readonly
|
|
74
|
+
* @return Relative value
|
|
75
|
+
*/
|
|
76
|
+
get value() {
|
|
77
|
+
return this._value / 100;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Value in percent.
|
|
81
|
+
*
|
|
82
|
+
* @readonly
|
|
83
|
+
* @return Percent
|
|
84
|
+
*/
|
|
85
|
+
get percent() {
|
|
86
|
+
return this._value;
|
|
87
|
+
}
|
|
88
|
+
toString() {
|
|
89
|
+
return "" + this._value + "%";
|
|
90
|
+
}
|
|
91
|
+
interpolate(e, t) {
|
|
92
|
+
return e + this.value * (t - e);
|
|
93
|
+
}
|
|
94
|
+
static normalize(e, t, i) {
|
|
95
|
+
return e instanceof g ? e : t === i ? new g(0) : new g(Math.min(Math.max((e - t) * (1 / (i - t)), 0), 1) * 100);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function R(s) {
|
|
99
|
+
return new g(s);
|
|
100
|
+
}
|
|
101
|
+
R(0);
|
|
102
|
+
const Ie = R(100), Le = R(50);
|
|
103
|
+
function Fe(s) {
|
|
104
|
+
return s instanceof g;
|
|
105
|
+
}
|
|
106
|
+
function Y(s) {
|
|
107
|
+
return Number(s) !== s;
|
|
108
|
+
}
|
|
109
|
+
function X(s) {
|
|
110
|
+
return {}.toString.call(s);
|
|
111
|
+
}
|
|
112
|
+
function k(s) {
|
|
113
|
+
if (s != null && !v(s)) {
|
|
114
|
+
let e = Number(s);
|
|
115
|
+
if (Y(e) && $(s) && s != "" && s.match(/[0-9]+/)) {
|
|
116
|
+
const t = s.replace(/[^0-9.\-]+/g, "");
|
|
117
|
+
return s === t ? e : k(t);
|
|
118
|
+
}
|
|
119
|
+
return e;
|
|
120
|
+
}
|
|
121
|
+
return s;
|
|
122
|
+
}
|
|
123
|
+
function Re(s) {
|
|
124
|
+
if (ee(s))
|
|
125
|
+
return new Date(s);
|
|
126
|
+
if (v(s))
|
|
127
|
+
return new Date(s);
|
|
128
|
+
{
|
|
129
|
+
let e = Number(s);
|
|
130
|
+
return v(e) ? new Date(e) : new Date(s);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function Me(s) {
|
|
134
|
+
if (Y(s))
|
|
135
|
+
return "NaN";
|
|
136
|
+
if (s === 1 / 0)
|
|
137
|
+
return "Infinity";
|
|
138
|
+
if (s === -1 / 0)
|
|
139
|
+
return "-Infinity";
|
|
140
|
+
if (s === 0 && 1 / s === -1 / 0)
|
|
141
|
+
return "-0";
|
|
142
|
+
let e = s < 0;
|
|
143
|
+
s = Math.abs(s);
|
|
144
|
+
let t = /^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec("" + s), i = t[1], r = t[2] || "", n;
|
|
145
|
+
if (t[3] === void 0)
|
|
146
|
+
n = r === "" ? i : i + "." + r;
|
|
147
|
+
else {
|
|
148
|
+
let a = +t[3];
|
|
149
|
+
if (s < 1) {
|
|
150
|
+
let u = a - 1;
|
|
151
|
+
n = "0." + K("0", u) + i + r;
|
|
152
|
+
} else {
|
|
153
|
+
let u = a - r.length;
|
|
154
|
+
u === 0 ? n = i + r : u < 0 ? n = i + r.slice(0, u) + "." + r.slice(u) : n = i + r + K("0", u);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return e ? "-" + n : n;
|
|
158
|
+
}
|
|
159
|
+
function K(s, e) {
|
|
160
|
+
return new Array(e + 1).join(s);
|
|
161
|
+
}
|
|
162
|
+
function ee(s) {
|
|
163
|
+
return X(s) === "[object Date]";
|
|
164
|
+
}
|
|
165
|
+
function $(s) {
|
|
166
|
+
return typeof s == "string";
|
|
167
|
+
}
|
|
168
|
+
function v(s) {
|
|
169
|
+
return typeof s == "number" && Number(s) == s;
|
|
170
|
+
}
|
|
171
|
+
function Ne(s) {
|
|
172
|
+
return typeof s == "object" && s !== null;
|
|
173
|
+
}
|
|
174
|
+
function Ke(s) {
|
|
175
|
+
return Array.isArray(s);
|
|
176
|
+
}
|
|
177
|
+
const Be = "__§§§__", Ue = "__§§§§__";
|
|
178
|
+
function I(s, e) {
|
|
179
|
+
const t = s.length;
|
|
180
|
+
for (let i = 0; i < t; ++i)
|
|
181
|
+
if (s[i] === e)
|
|
182
|
+
return i;
|
|
183
|
+
return -1;
|
|
184
|
+
}
|
|
185
|
+
function te(s, e) {
|
|
186
|
+
const t = s.length;
|
|
187
|
+
for (let i = 0; i < t; ++i)
|
|
188
|
+
if (e(s[i]))
|
|
189
|
+
return !0;
|
|
190
|
+
return !1;
|
|
191
|
+
}
|
|
192
|
+
function He(s, e) {
|
|
193
|
+
const t = s.length, i = new Array(t);
|
|
194
|
+
for (let r = 0; r < t; ++r)
|
|
195
|
+
i[r] = e(s[r], r);
|
|
196
|
+
return i;
|
|
197
|
+
}
|
|
198
|
+
function c(s, e) {
|
|
199
|
+
const t = s.length;
|
|
200
|
+
for (let i = 0; i < t; ++i)
|
|
201
|
+
e(s[i], i);
|
|
202
|
+
}
|
|
203
|
+
function j(s, e) {
|
|
204
|
+
let t = s.length;
|
|
205
|
+
for (; t > 0; )
|
|
206
|
+
--t, e(s[t], t);
|
|
207
|
+
}
|
|
208
|
+
function ze(s, e) {
|
|
209
|
+
const t = s.length;
|
|
210
|
+
for (let i = 0; i < t && e(s[i], i); ++i)
|
|
211
|
+
;
|
|
212
|
+
}
|
|
213
|
+
function se(s, e) {
|
|
214
|
+
let t = !1, i = 0;
|
|
215
|
+
for (; ; ) {
|
|
216
|
+
if (i = s.indexOf(e, i), i === -1)
|
|
217
|
+
return t;
|
|
218
|
+
t = !0, s.splice(i, 1);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function P(s, e) {
|
|
222
|
+
let t = s.indexOf(e);
|
|
223
|
+
return t !== -1 ? (s.splice(t, 1), !0) : !1;
|
|
224
|
+
}
|
|
225
|
+
function Ye(s, e, t) {
|
|
226
|
+
let i = I(s, e);
|
|
227
|
+
i !== -1 && ie(s, i), s.push(e);
|
|
228
|
+
}
|
|
229
|
+
function $e(s, e) {
|
|
230
|
+
s.indexOf(e) === -1 && s.push(e);
|
|
231
|
+
}
|
|
232
|
+
function We(s) {
|
|
233
|
+
const e = s.length, t = new Array(e);
|
|
234
|
+
for (let i = 0; i < e; ++i)
|
|
235
|
+
t[i] = s[i];
|
|
236
|
+
return t;
|
|
237
|
+
}
|
|
238
|
+
function Ze(s, e, t) {
|
|
239
|
+
s.splice(e, 0, t);
|
|
240
|
+
}
|
|
241
|
+
function ie(s, e) {
|
|
242
|
+
s.splice(e, 1);
|
|
243
|
+
}
|
|
244
|
+
function W(s, e) {
|
|
245
|
+
const t = s.length;
|
|
246
|
+
for (let i = 0; i < t; ++i)
|
|
247
|
+
if (e(s[i], i))
|
|
248
|
+
return i;
|
|
249
|
+
return -1;
|
|
250
|
+
}
|
|
251
|
+
function re(s, e) {
|
|
252
|
+
let t = s.length;
|
|
253
|
+
for (; t > 0; )
|
|
254
|
+
if (--t, e(s[t], t))
|
|
255
|
+
return t;
|
|
256
|
+
return -1;
|
|
257
|
+
}
|
|
258
|
+
function ne(s, e) {
|
|
259
|
+
const t = W(s, e);
|
|
260
|
+
if (t !== -1)
|
|
261
|
+
return s[t];
|
|
262
|
+
}
|
|
263
|
+
function ae(s, e) {
|
|
264
|
+
const t = re(s, e);
|
|
265
|
+
if (t !== -1)
|
|
266
|
+
return s[t];
|
|
267
|
+
}
|
|
268
|
+
function Ge(s, e) {
|
|
269
|
+
let t = 0, i = s.length, r = !1;
|
|
270
|
+
for (; t < i; ) {
|
|
271
|
+
const n = t + i >> 1, a = e(s[n]);
|
|
272
|
+
a < 0 ? t = n + 1 : a === 0 ? (r = !0, t = n + 1) : i = n;
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
found: r,
|
|
276
|
+
index: r ? t - 1 : t
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function ue(s, e) {
|
|
280
|
+
let t = 0, i = s.length, r = !1;
|
|
281
|
+
for (; t < i; ) {
|
|
282
|
+
const n = t + i >> 1, a = e(s[n]);
|
|
283
|
+
a < 0 ? t = n + 1 : (a === 0 && (r = !0), i = n);
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
found: r,
|
|
287
|
+
index: t
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function Ve(s, e) {
|
|
291
|
+
let t = s.length;
|
|
292
|
+
for (; t > 0; )
|
|
293
|
+
--t, e(s[t]) || s.splice(t, 1);
|
|
294
|
+
}
|
|
295
|
+
function y(s) {
|
|
296
|
+
return Object.keys(s);
|
|
297
|
+
}
|
|
298
|
+
function qe(s, e) {
|
|
299
|
+
return y(s).sort(e);
|
|
300
|
+
}
|
|
301
|
+
function Je(s) {
|
|
302
|
+
return Object.assign({}, s);
|
|
303
|
+
}
|
|
304
|
+
function p(s, e) {
|
|
305
|
+
y(s).forEach((t) => {
|
|
306
|
+
e(t, s[t]);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function Qe(s, e) {
|
|
310
|
+
for (let t in s)
|
|
311
|
+
if (oe(s, t) && !e(t, s[t]))
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
function oe(s, e) {
|
|
315
|
+
return {}.hasOwnProperty.call(s, e);
|
|
316
|
+
}
|
|
317
|
+
class Z {
|
|
318
|
+
/**
|
|
319
|
+
* Constructor.
|
|
320
|
+
*/
|
|
321
|
+
constructor() {
|
|
322
|
+
Object.defineProperty(this, "_disposed", {
|
|
323
|
+
enumerable: !0,
|
|
324
|
+
configurable: !0,
|
|
325
|
+
writable: !0,
|
|
326
|
+
value: void 0
|
|
327
|
+
}), this._disposed = !1;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Checks if object is disposed.
|
|
331
|
+
*
|
|
332
|
+
* @return Disposed?
|
|
333
|
+
*/
|
|
334
|
+
isDisposed() {
|
|
335
|
+
return this._disposed;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Disposes the object.
|
|
339
|
+
*/
|
|
340
|
+
dispose() {
|
|
341
|
+
this._disposed || (this._disposed = !0, this._dispose());
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
class w {
|
|
345
|
+
/**
|
|
346
|
+
* Constructor.
|
|
347
|
+
*
|
|
348
|
+
* @param dispose Function that disposes object
|
|
349
|
+
*/
|
|
350
|
+
constructor(e) {
|
|
351
|
+
Object.defineProperty(this, "_disposed", {
|
|
352
|
+
enumerable: !0,
|
|
353
|
+
configurable: !0,
|
|
354
|
+
writable: !0,
|
|
355
|
+
value: void 0
|
|
356
|
+
}), Object.defineProperty(this, "_dispose", {
|
|
357
|
+
enumerable: !0,
|
|
358
|
+
configurable: !0,
|
|
359
|
+
writable: !0,
|
|
360
|
+
value: void 0
|
|
361
|
+
}), this._disposed = !1, this._dispose = e;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Checks if object is disposed.
|
|
365
|
+
*
|
|
366
|
+
* @return Disposed?
|
|
367
|
+
*/
|
|
368
|
+
isDisposed() {
|
|
369
|
+
return this._disposed;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Disposes the object.
|
|
373
|
+
*/
|
|
374
|
+
dispose() {
|
|
375
|
+
this._disposed || (this._disposed = !0, this._dispose());
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
class Xe extends Z {
|
|
379
|
+
constructor() {
|
|
380
|
+
super(...arguments), Object.defineProperty(this, "_disposers", {
|
|
381
|
+
enumerable: !0,
|
|
382
|
+
configurable: !0,
|
|
383
|
+
writable: !0,
|
|
384
|
+
value: []
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
_dispose() {
|
|
388
|
+
c(this._disposers, (e) => {
|
|
389
|
+
e.dispose();
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
class le extends Z {
|
|
394
|
+
constructor(e) {
|
|
395
|
+
super(), Object.defineProperty(this, "_disposers", {
|
|
396
|
+
enumerable: !0,
|
|
397
|
+
configurable: !0,
|
|
398
|
+
writable: !0,
|
|
399
|
+
value: void 0
|
|
400
|
+
}), this._disposers = e;
|
|
401
|
+
}
|
|
402
|
+
_dispose() {
|
|
403
|
+
c(this._disposers, (e) => {
|
|
404
|
+
e.dispose();
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
get disposers() {
|
|
408
|
+
return this._disposers;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
class ke extends w {
|
|
412
|
+
constructor() {
|
|
413
|
+
super(...arguments), Object.defineProperty(this, "_counter", {
|
|
414
|
+
enumerable: !0,
|
|
415
|
+
configurable: !0,
|
|
416
|
+
writable: !0,
|
|
417
|
+
value: 0
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* [increment description]
|
|
422
|
+
*
|
|
423
|
+
* @todo Description
|
|
424
|
+
*/
|
|
425
|
+
increment() {
|
|
426
|
+
return ++this._counter, new w(() => {
|
|
427
|
+
--this._counter, this._counter === 0 && this.dispose();
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
function et(s) {
|
|
432
|
+
s.parentNode && s.parentNode.removeChild(s);
|
|
433
|
+
}
|
|
434
|
+
function he(s, e, t, i) {
|
|
435
|
+
return s.addEventListener(e, t, i || !1), new w(() => {
|
|
436
|
+
s.removeEventListener(e, t, i || !1);
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
function tt(s) {
|
|
440
|
+
return he(window, "resize", (e) => {
|
|
441
|
+
s();
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
function x(s) {
|
|
445
|
+
switch (s) {
|
|
446
|
+
case "touchevents":
|
|
447
|
+
return window.hasOwnProperty("TouchEvent");
|
|
448
|
+
case "pointerevents":
|
|
449
|
+
return window.hasOwnProperty("PointerEvent");
|
|
450
|
+
case "mouseevents":
|
|
451
|
+
return window.hasOwnProperty("MouseEvent");
|
|
452
|
+
case "wheelevents":
|
|
453
|
+
return window.hasOwnProperty("WheelEvent");
|
|
454
|
+
case "keyboardevents":
|
|
455
|
+
return window.hasOwnProperty("KeyboardEvent");
|
|
456
|
+
}
|
|
457
|
+
return !1;
|
|
458
|
+
}
|
|
459
|
+
function st(s) {
|
|
460
|
+
return s.pointerId || 0;
|
|
461
|
+
}
|
|
462
|
+
function it() {
|
|
463
|
+
if (document.activeElement && document.activeElement != document.body)
|
|
464
|
+
if (document.activeElement.blur)
|
|
465
|
+
document.activeElement.blur();
|
|
466
|
+
else {
|
|
467
|
+
let s = document.createElement("button");
|
|
468
|
+
s.style.position = "fixed", s.style.top = "0px", s.style.left = "-10000px", document.body.appendChild(s), s.focus(), s.blur(), document.body.removeChild(s);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function rt(s) {
|
|
472
|
+
s && s.focus();
|
|
473
|
+
}
|
|
474
|
+
function nt(s) {
|
|
475
|
+
if (x("pointerevents"))
|
|
476
|
+
return s;
|
|
477
|
+
if (x("touchevents"))
|
|
478
|
+
switch (s) {
|
|
479
|
+
case "pointerover":
|
|
480
|
+
return "touchstart";
|
|
481
|
+
case "pointerout":
|
|
482
|
+
return "touchend";
|
|
483
|
+
case "pointerleave":
|
|
484
|
+
return "touchend";
|
|
485
|
+
case "pointerdown":
|
|
486
|
+
return "touchstart";
|
|
487
|
+
case "pointermove":
|
|
488
|
+
return "touchmove";
|
|
489
|
+
case "pointerup":
|
|
490
|
+
return "touchend";
|
|
491
|
+
case "click":
|
|
492
|
+
return "click";
|
|
493
|
+
case "dblclick":
|
|
494
|
+
return "dblclick";
|
|
495
|
+
}
|
|
496
|
+
else if (x("mouseevents"))
|
|
497
|
+
switch (s) {
|
|
498
|
+
case "pointerover":
|
|
499
|
+
return "mouseover";
|
|
500
|
+
case "pointerout":
|
|
501
|
+
return "mouseout";
|
|
502
|
+
case "pointerleave":
|
|
503
|
+
return "mouseleave";
|
|
504
|
+
case "pointerdown":
|
|
505
|
+
return "mousedown";
|
|
506
|
+
case "pointermove":
|
|
507
|
+
return "mousemove";
|
|
508
|
+
case "pointerup":
|
|
509
|
+
return "mouseup";
|
|
510
|
+
case "click":
|
|
511
|
+
return "click";
|
|
512
|
+
case "dblclick":
|
|
513
|
+
return "dblclick";
|
|
514
|
+
}
|
|
515
|
+
return s;
|
|
516
|
+
}
|
|
517
|
+
function at(s) {
|
|
518
|
+
if (typeof Touch < "u" && s instanceof Touch)
|
|
519
|
+
return !0;
|
|
520
|
+
if (typeof PointerEvent < "u" && s instanceof PointerEvent && s.pointerType != null)
|
|
521
|
+
switch (s.pointerType) {
|
|
522
|
+
case "touch":
|
|
523
|
+
case "pen":
|
|
524
|
+
case 2:
|
|
525
|
+
return !0;
|
|
526
|
+
case "mouse":
|
|
527
|
+
case 4:
|
|
528
|
+
return !1;
|
|
529
|
+
default:
|
|
530
|
+
return !(s instanceof MouseEvent);
|
|
531
|
+
}
|
|
532
|
+
else if (s.type != null && s.type.match(/^mouse/))
|
|
533
|
+
return !1;
|
|
534
|
+
return !0;
|
|
535
|
+
}
|
|
536
|
+
function ut(s, e, t) {
|
|
537
|
+
s.style[e] = t;
|
|
538
|
+
}
|
|
539
|
+
function ot(s, e) {
|
|
540
|
+
return s.style[e];
|
|
541
|
+
}
|
|
542
|
+
function lt(s) {
|
|
543
|
+
if (s.composedPath) {
|
|
544
|
+
const e = s.composedPath();
|
|
545
|
+
return e.length === 0 ? null : e[0];
|
|
546
|
+
} else
|
|
547
|
+
return s.target;
|
|
548
|
+
}
|
|
549
|
+
function ce(s, e) {
|
|
550
|
+
let t = e;
|
|
551
|
+
for (; ; ) {
|
|
552
|
+
if (s === t)
|
|
553
|
+
return !0;
|
|
554
|
+
if (t.parentNode === null) {
|
|
555
|
+
if (t.host == null)
|
|
556
|
+
return !1;
|
|
557
|
+
t = t.host;
|
|
558
|
+
} else
|
|
559
|
+
t = t.parentNode;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function ht(s, e) {
|
|
563
|
+
return s.target && ce(e.root.dom, s.target);
|
|
564
|
+
}
|
|
565
|
+
function ct(s, e) {
|
|
566
|
+
e ? s.style.pointerEvents = "auto" : s.style.pointerEvents = "none";
|
|
567
|
+
}
|
|
568
|
+
function ft(s) {
|
|
569
|
+
if (s.key !== void 0)
|
|
570
|
+
return s.key;
|
|
571
|
+
switch (s.keyCode) {
|
|
572
|
+
case 9:
|
|
573
|
+
return "Tab";
|
|
574
|
+
case 13:
|
|
575
|
+
return "Enter";
|
|
576
|
+
case 16:
|
|
577
|
+
return "Shift";
|
|
578
|
+
case 17:
|
|
579
|
+
return "Control";
|
|
580
|
+
case 27:
|
|
581
|
+
return "Escape";
|
|
582
|
+
case 32:
|
|
583
|
+
return " ";
|
|
584
|
+
case 37:
|
|
585
|
+
return "ArrowLeft";
|
|
586
|
+
case 38:
|
|
587
|
+
return "ArrowUp";
|
|
588
|
+
case 39:
|
|
589
|
+
return "ArrowRight";
|
|
590
|
+
case 40:
|
|
591
|
+
return "ArrowDown";
|
|
592
|
+
case 46:
|
|
593
|
+
return "Delete";
|
|
594
|
+
}
|
|
595
|
+
return "" + s.keyCode;
|
|
596
|
+
}
|
|
597
|
+
function fe() {
|
|
598
|
+
return /apple/i.test(navigator.vendor) && "ontouchend" in document;
|
|
599
|
+
}
|
|
600
|
+
function dt() {
|
|
601
|
+
return fe() ? 1 : void 0;
|
|
602
|
+
}
|
|
603
|
+
function pt(s, e) {
|
|
604
|
+
return v(s) ? s : s != null && v(s.value) && v(e) ? e * s.value : 0;
|
|
605
|
+
}
|
|
606
|
+
function _t(s) {
|
|
607
|
+
let e = ("" + s).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
|
|
608
|
+
return e ? Math.max(0, (e[1] ? e[1].length : 0) - (e[2] ? +e[2] : 0)) : 0;
|
|
609
|
+
}
|
|
610
|
+
function A(s, e = 0, t = "0") {
|
|
611
|
+
return typeof s != "string" && (s = s.toString()), e > s.length ? Array(e - s.length + 1).join(t) + s : s;
|
|
612
|
+
}
|
|
613
|
+
function de(s) {
|
|
614
|
+
return s.replace(/^[\s]*/, "");
|
|
615
|
+
}
|
|
616
|
+
function pe(s) {
|
|
617
|
+
return s.replace(/[\s]*$/, "");
|
|
618
|
+
}
|
|
619
|
+
function B(s) {
|
|
620
|
+
return de(pe(s));
|
|
621
|
+
}
|
|
622
|
+
function gt(s, e, t = !1, i = "...") {
|
|
623
|
+
if (s.length > e) {
|
|
624
|
+
let r = e - 1;
|
|
625
|
+
for (; r >= 0 && s.charAt(r).match(/\w/); )
|
|
626
|
+
r--;
|
|
627
|
+
return r >= 0 && t == !1 ? s.substring(0, r + 1) + "..." : s.substring(0, e) + i;
|
|
628
|
+
} else
|
|
629
|
+
return s;
|
|
630
|
+
}
|
|
631
|
+
function mt(s) {
|
|
632
|
+
return s.replace(/\/(date|number|duration)$/i, "");
|
|
633
|
+
}
|
|
634
|
+
function bt(s) {
|
|
635
|
+
return s && s.replace(/<[^>]*>/g, "");
|
|
636
|
+
}
|
|
637
|
+
function vt(s) {
|
|
638
|
+
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
639
|
+
}
|
|
640
|
+
function wt(s) {
|
|
641
|
+
const e = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/, t = /([^اأدذرزو]*[اأدذرزو])/gi;
|
|
642
|
+
let i = s.split(/(\s+)/), r = [];
|
|
643
|
+
return i.forEach((n) => {
|
|
644
|
+
if (n.match(/^\s+$/))
|
|
645
|
+
(n = " ") && (n = " "), r.push(n);
|
|
646
|
+
else if (e.test(n)) {
|
|
647
|
+
let a = n.split(t).filter((u) => u !== "");
|
|
648
|
+
r = r.concat(a);
|
|
649
|
+
} else
|
|
650
|
+
r = r.concat([...n]);
|
|
651
|
+
}), r;
|
|
652
|
+
}
|
|
653
|
+
function yt(s, e = !1) {
|
|
654
|
+
const t = new Date(s.getFullYear(), 0, 0), i = s.getTime() - t.getTime() + (t.getTimezoneOffset() - s.getTimezoneOffset()) * 60 * 1e3, r = 1e3 * 60 * 60 * 24;
|
|
655
|
+
return Math.floor(i / r);
|
|
656
|
+
}
|
|
657
|
+
function U(s, e = !1) {
|
|
658
|
+
const t = new Date(Date.UTC(s.getFullYear(), s.getMonth(), s.getDate())), i = t.getUTCDay() || 7;
|
|
659
|
+
t.setUTCDate(t.getUTCDate() + 4 - i);
|
|
660
|
+
const r = new Date(Date.UTC(t.getUTCFullYear(), 0, 1));
|
|
661
|
+
return Math.ceil(((t.getTime() - r.getTime()) / 864e5 + 1) / 7);
|
|
662
|
+
}
|
|
663
|
+
function Pt(s, e = !1) {
|
|
664
|
+
const t = new Date(Date.UTC(s.getFullYear(), s.getMonth(), s.getDate())), i = t.getUTCDay() || 7;
|
|
665
|
+
return t.setUTCDate(t.getUTCDate() + 4 - i), new Date(Date.UTC(t.getUTCFullYear(), 0, 1)).getFullYear();
|
|
666
|
+
}
|
|
667
|
+
function Tt(s, e = !1) {
|
|
668
|
+
const t = U(new Date(s.getFullYear(), s.getMonth(), 1), e);
|
|
669
|
+
let i = U(s, e);
|
|
670
|
+
return i == 1 && (i = 53), i - t + 1;
|
|
671
|
+
}
|
|
672
|
+
function St(s, e, t = 1, i = !1) {
|
|
673
|
+
let r = new Date(e, 0, 4, 0, 0, 0, 0);
|
|
674
|
+
return i && r.setUTCFullYear(e), s * 7 + t - ((r.getDay() || 7) + 3);
|
|
675
|
+
}
|
|
676
|
+
function Dt(s, e) {
|
|
677
|
+
return s > 12 ? s -= 12 : s === 0 && (s = 12), e != null ? s + (e - 1) : s;
|
|
678
|
+
}
|
|
679
|
+
function Ot(s, e = !1, t = !1, i = !1, r) {
|
|
680
|
+
if (i)
|
|
681
|
+
return e ? "Coordinated Universal Time" : "UTC";
|
|
682
|
+
if (r) {
|
|
683
|
+
const u = s.toLocaleString("en-US", { timeZone: r }), o = s.toLocaleString("en-US", { timeZone: r, timeZoneName: e ? "long" : "short" });
|
|
684
|
+
return B(o.substr(u.length));
|
|
685
|
+
}
|
|
686
|
+
let n = s.toLocaleString("UTC"), a = s.toLocaleString("UTC", { timeZoneName: e ? "long" : "short" }).substr(n.length);
|
|
687
|
+
return t === !1 && (a = a.replace(/ (standard|daylight|summer|winter) /i, " ")), B(a);
|
|
688
|
+
}
|
|
689
|
+
function Et(s, e) {
|
|
690
|
+
const t = e || new Date(Date.UTC(2012, 0, 1, 0, 0, 0, 0)), i = new Date(t.toLocaleString("en-US", { timeZone: "UTC" }));
|
|
691
|
+
return (new Date(t.toLocaleString("en-US", { timeZone: s })).getTime() - i.getTime()) / 6e4 * -1;
|
|
692
|
+
}
|
|
693
|
+
function jt(s) {
|
|
694
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
695
|
+
}
|
|
696
|
+
function G(s) {
|
|
697
|
+
let e, t, i, r = s.h, n = s.s, a = s.l;
|
|
698
|
+
if (n == 0)
|
|
699
|
+
e = t = i = a;
|
|
700
|
+
else {
|
|
701
|
+
let u = function(d, m, _) {
|
|
702
|
+
return _ < 0 && (_ += 1), _ > 1 && (_ -= 1), _ < 0.16666666666666666 ? d + (m - d) * 6 * _ : _ < 0.5 ? m : _ < 0.6666666666666666 ? d + (m - d) * (0.6666666666666666 - _) * 6 : d;
|
|
703
|
+
}, o = a < 0.5 ? a * (1 + n) : a + n - a * n, l = 2 * a - o;
|
|
704
|
+
e = u(l, o, r + 1 / 3), t = u(l, o, r), i = u(l, o, r - 1 / 3);
|
|
705
|
+
}
|
|
706
|
+
return {
|
|
707
|
+
r: Math.round(e * 255),
|
|
708
|
+
g: Math.round(t * 255),
|
|
709
|
+
b: Math.round(i * 255)
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
function V(s) {
|
|
713
|
+
let e = s.r / 255, t = s.g / 255, i = s.b / 255, r = Math.max(e, t, i), n = Math.min(e, t, i), a = 0, u = 0, o = (r + n) / 2;
|
|
714
|
+
if (r === n)
|
|
715
|
+
a = u = 0;
|
|
716
|
+
else {
|
|
717
|
+
let l = r - n;
|
|
718
|
+
switch (u = o > 0.5 ? l / (2 - r - n) : l / (r + n), r) {
|
|
719
|
+
case e:
|
|
720
|
+
a = (t - i) / l + (t < i ? 6 : 0);
|
|
721
|
+
break;
|
|
722
|
+
case t:
|
|
723
|
+
a = (i - e) / l + 2;
|
|
724
|
+
break;
|
|
725
|
+
case i:
|
|
726
|
+
a = (e - t) / l + 4;
|
|
727
|
+
break;
|
|
728
|
+
}
|
|
729
|
+
a /= 6;
|
|
730
|
+
}
|
|
731
|
+
return {
|
|
732
|
+
h: a,
|
|
733
|
+
s: u,
|
|
734
|
+
l: o
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
function _e(s, e) {
|
|
738
|
+
return s && {
|
|
739
|
+
r: Math.max(0, Math.min(255, s.r + D(s.r, e))),
|
|
740
|
+
g: Math.max(0, Math.min(255, s.g + D(s.g, e))),
|
|
741
|
+
b: Math.max(0, Math.min(255, s.b + D(s.b, e))),
|
|
742
|
+
a: s.a
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
function D(s, e) {
|
|
746
|
+
let t = e > 0 ? 255 - s : s;
|
|
747
|
+
return Math.round(t * e);
|
|
748
|
+
}
|
|
749
|
+
function ge(s, e) {
|
|
750
|
+
if (s) {
|
|
751
|
+
let t = Math.min(Math.max(s.r, s.g, s.b), 230), i = D(t, e);
|
|
752
|
+
return {
|
|
753
|
+
r: Math.max(0, Math.min(255, Math.round(s.r + i))),
|
|
754
|
+
g: Math.max(0, Math.min(255, Math.round(s.g + i))),
|
|
755
|
+
b: Math.max(0, Math.min(255, Math.round(s.b + i))),
|
|
756
|
+
a: s.a
|
|
757
|
+
};
|
|
758
|
+
} else
|
|
759
|
+
return s;
|
|
760
|
+
}
|
|
761
|
+
function H(s) {
|
|
762
|
+
return (s.r * 299 + s.g * 587 + s.b * 114) / 1e3 >= 128;
|
|
763
|
+
}
|
|
764
|
+
function me(s, e) {
|
|
765
|
+
if (s === void 0 || e == 1)
|
|
766
|
+
return s;
|
|
767
|
+
let t = V(s);
|
|
768
|
+
return t.s = e, G(t);
|
|
769
|
+
}
|
|
770
|
+
function be(s, e = { r: 255, g: 255, b: 255 }, t = { r: 255, g: 255, b: 255 }) {
|
|
771
|
+
let i = e, r = t;
|
|
772
|
+
return H(t) && (i = t, r = e), H(s) ? r : i;
|
|
773
|
+
}
|
|
774
|
+
function xt(s, e) {
|
|
775
|
+
return s || (s = []), [...s, ...e].filter((t, i, r) => r.indexOf(t) === i);
|
|
776
|
+
}
|
|
777
|
+
function At(s, e) {
|
|
778
|
+
return !(!e || s.left != e.left || s.right != e.right || s.top != e.top || s.bottom != e.bottom);
|
|
779
|
+
}
|
|
780
|
+
function q(s) {
|
|
781
|
+
return s[0] === "#" && (s = s.substr(1)), s.length == 3 && (s = s[0].repeat(2) + s[1].repeat(2) + s[2].repeat(2)), parseInt(s, 16);
|
|
782
|
+
}
|
|
783
|
+
function ve(s) {
|
|
784
|
+
s = s.replace(/[ ]/g, "");
|
|
785
|
+
let e = s.match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);
|
|
786
|
+
if (e)
|
|
787
|
+
e.push("1");
|
|
788
|
+
else if (e = s.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i), !e)
|
|
789
|
+
return 0;
|
|
790
|
+
let t = "";
|
|
791
|
+
for (let i = 1; i <= 3; i++) {
|
|
792
|
+
let r = parseInt(e[i]).toString(16);
|
|
793
|
+
r.length == 1 && (r = "0" + r), t += r;
|
|
794
|
+
}
|
|
795
|
+
return q(t);
|
|
796
|
+
}
|
|
797
|
+
function Ct(s) {
|
|
798
|
+
return h.fromAny(s);
|
|
799
|
+
}
|
|
800
|
+
class h {
|
|
801
|
+
constructor(e) {
|
|
802
|
+
Object.defineProperty(this, "_hex", {
|
|
803
|
+
enumerable: !0,
|
|
804
|
+
configurable: !0,
|
|
805
|
+
writable: !0,
|
|
806
|
+
value: void 0
|
|
807
|
+
}), this._hex = e | 0;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Color numeric value.
|
|
811
|
+
*/
|
|
812
|
+
get hex() {
|
|
813
|
+
return this._hex;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Value of color's R channel.
|
|
817
|
+
* @return R value
|
|
818
|
+
*/
|
|
819
|
+
get r() {
|
|
820
|
+
return this._hex >>> 16;
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Value of color's G channel.
|
|
824
|
+
* @return G value
|
|
825
|
+
*/
|
|
826
|
+
get g() {
|
|
827
|
+
return this._hex >> 8 & 255;
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Value of color's B channel.
|
|
831
|
+
* @return B value
|
|
832
|
+
*/
|
|
833
|
+
get b() {
|
|
834
|
+
return this._hex & 255;
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Returns color CSS representation in form of `rgba(r, g, b, a)` string.
|
|
838
|
+
*
|
|
839
|
+
* @param alpha Opacity
|
|
840
|
+
* @return CSS string
|
|
841
|
+
*/
|
|
842
|
+
toCSS(e = 1) {
|
|
843
|
+
return "rgba(" + this.r + ", " + this.g + ", " + this.b + ", " + e + ")";
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Returns color CSS representation in form of `#rgb` string.
|
|
847
|
+
*
|
|
848
|
+
* @return CSS string
|
|
849
|
+
*/
|
|
850
|
+
toCSSHex() {
|
|
851
|
+
return "#" + A(this.r.toString(16), 2) + A(this.g.toString(16), 2) + A(this.b.toString(16), 2);
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Returns color's HSL info.
|
|
855
|
+
* @param alpha Opacity
|
|
856
|
+
* @return HSL info
|
|
857
|
+
*/
|
|
858
|
+
toHSL(e = 1) {
|
|
859
|
+
return V({
|
|
860
|
+
r: this.r,
|
|
861
|
+
g: this.g,
|
|
862
|
+
b: this.b,
|
|
863
|
+
a: e
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Converts HSL values into a new [[Color]] object.
|
|
868
|
+
*
|
|
869
|
+
* @param h H value
|
|
870
|
+
* @param s S value
|
|
871
|
+
* @param l L value
|
|
872
|
+
* @return Color object
|
|
873
|
+
*/
|
|
874
|
+
static fromHSL(e, t, i) {
|
|
875
|
+
const r = G({
|
|
876
|
+
h: e,
|
|
877
|
+
s: t,
|
|
878
|
+
l: i
|
|
879
|
+
});
|
|
880
|
+
return this.fromRGB(r.r, r.g, r.b);
|
|
881
|
+
}
|
|
882
|
+
toString() {
|
|
883
|
+
return this.toCSSHex();
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Converts hex number into a new [[Color]] object.
|
|
887
|
+
*
|
|
888
|
+
* ```TypeScript
|
|
889
|
+
* Color.fromHex(0xff0000) // red
|
|
890
|
+
* ```
|
|
891
|
+
* ```JavaScript
|
|
892
|
+
* Color.fromHex(0xff0000) // red
|
|
893
|
+
* ```
|
|
894
|
+
*
|
|
895
|
+
* @param hex Hex color
|
|
896
|
+
* @return Color
|
|
897
|
+
*/
|
|
898
|
+
static fromHex(e) {
|
|
899
|
+
return new h(e);
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Converts RGB values to a new [[Color]] object.
|
|
903
|
+
*
|
|
904
|
+
* @param r R value
|
|
905
|
+
* @param g G value
|
|
906
|
+
* @param b B value
|
|
907
|
+
* @return Color
|
|
908
|
+
*/
|
|
909
|
+
static fromRGB(e, t, i) {
|
|
910
|
+
return new h((i | 0) + (t << 8) + (e << 16));
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Converts RGB string to a new [[Color]] object.
|
|
914
|
+
*
|
|
915
|
+
* ```TypeScript
|
|
916
|
+
* Color.fromString("#ff0000") // red
|
|
917
|
+
* ```
|
|
918
|
+
* ```JavaScript
|
|
919
|
+
* Color.fromString("#ff0000") // red
|
|
920
|
+
* ```
|
|
921
|
+
*
|
|
922
|
+
* @param s RGB string
|
|
923
|
+
* @return Color
|
|
924
|
+
*/
|
|
925
|
+
static fromString(e) {
|
|
926
|
+
return new h(q(e));
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Converts CSS rgba() syntax to a new [[Color]] object.
|
|
930
|
+
*
|
|
931
|
+
* ```TypeScript
|
|
932
|
+
* Color.fromCSS("rgba(255, 0, 0, 1)") // red
|
|
933
|
+
* ```
|
|
934
|
+
* ```JavaScript
|
|
935
|
+
* Color.fromCSS("rgba(255, 0, 0, 1)") // red
|
|
936
|
+
* ```
|
|
937
|
+
*
|
|
938
|
+
* @param {string} s [description]
|
|
939
|
+
* @return {Color} [description]
|
|
940
|
+
*/
|
|
941
|
+
static fromCSS(e) {
|
|
942
|
+
return new h(ve(e));
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Convert to color from virtually anything.
|
|
946
|
+
*
|
|
947
|
+
* Will throw an exception if unable to resolve the color.
|
|
948
|
+
*
|
|
949
|
+
* @param s Source
|
|
950
|
+
* @return Color
|
|
951
|
+
*/
|
|
952
|
+
static fromAny(e) {
|
|
953
|
+
if ($(e)) {
|
|
954
|
+
if (e[0] == "#")
|
|
955
|
+
return h.fromString(e);
|
|
956
|
+
if (e.substr(0, 3) == "rgb")
|
|
957
|
+
return h.fromCSS(e);
|
|
958
|
+
} else {
|
|
959
|
+
if (v(e))
|
|
960
|
+
return h.fromHex(e);
|
|
961
|
+
if (e instanceof h)
|
|
962
|
+
return h.fromHex(e.hex);
|
|
963
|
+
}
|
|
964
|
+
throw new Error("Unknown color syntax: " + e);
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Returns a new [[Color]] object based on either `lightAlternative` or
|
|
968
|
+
* `darkAlternative` depending on which one is more contrasting with
|
|
969
|
+
* the `color`.
|
|
970
|
+
*
|
|
971
|
+
* @param color Reference color
|
|
972
|
+
* @param lightAlternative Light color
|
|
973
|
+
* @param darkAlternative Dark color
|
|
974
|
+
* @return Alternative color
|
|
975
|
+
*/
|
|
976
|
+
static alternative(e, t, i) {
|
|
977
|
+
const r = be({ r: e.r, g: e.g, b: e.b }, t ? { r: t.r, g: t.g, b: t.b } : void 0, i ? { r: i.r, g: i.g, b: i.b } : void 0);
|
|
978
|
+
return this.fromRGB(r.r, r.g, r.b);
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Returns an intermediate Color between two reference colors depending on
|
|
982
|
+
* the progress (`diff`) between the two.
|
|
983
|
+
*
|
|
984
|
+
* @param diff Progress
|
|
985
|
+
* @param from Source color
|
|
986
|
+
* @param to Target color
|
|
987
|
+
* @param mode Interpolation mode
|
|
988
|
+
* @return Color
|
|
989
|
+
*/
|
|
990
|
+
static interpolate(e, t, i, r = "rgb") {
|
|
991
|
+
if (r == "hsl") {
|
|
992
|
+
const n = t.toHSL(), a = i.toHSL();
|
|
993
|
+
return h.fromHSL(b(e, n.h, a.h), b(e, n.s, a.s), b(e, n.l, a.l));
|
|
994
|
+
} else
|
|
995
|
+
return h.fromRGB(b(e, t.r, i.r), b(e, t.g, i.g), b(e, t.b, i.b));
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Returns a new [[Color]] lightened by `percent` value.
|
|
999
|
+
*
|
|
1000
|
+
* Use negative value to darken the color.
|
|
1001
|
+
*
|
|
1002
|
+
* @param color Source color
|
|
1003
|
+
* @param percent Percent
|
|
1004
|
+
* @return New color
|
|
1005
|
+
*/
|
|
1006
|
+
static lighten(e, t) {
|
|
1007
|
+
const i = _e({ r: e.r, g: e.g, b: e.b }, t);
|
|
1008
|
+
return h.fromRGB(i.r, i.g, i.b);
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Returns a new [[Color]] brightened by `percent` value.
|
|
1012
|
+
*
|
|
1013
|
+
* Use negative value to dim the color.
|
|
1014
|
+
*
|
|
1015
|
+
* @param color Source color
|
|
1016
|
+
* @param percent Percent
|
|
1017
|
+
* @return New color
|
|
1018
|
+
*/
|
|
1019
|
+
static brighten(e, t) {
|
|
1020
|
+
const i = ge({ r: e.r, g: e.g, b: e.b }, t);
|
|
1021
|
+
return h.fromRGB(i.r, i.g, i.b);
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Returns a new [[Color]] saturated by `percent` value.
|
|
1025
|
+
*
|
|
1026
|
+
* Value range is between `0` (fully desaturated), to `1` (full color).
|
|
1027
|
+
*
|
|
1028
|
+
* @param color Source color
|
|
1029
|
+
* @param percent Percent
|
|
1030
|
+
* @return New color
|
|
1031
|
+
*/
|
|
1032
|
+
static saturate(e, t) {
|
|
1033
|
+
const i = me({ r: e.r, g: e.g, b: e.b }, t);
|
|
1034
|
+
return h.fromRGB(i.r, i.g, i.b);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
class J {
|
|
1038
|
+
/**
|
|
1039
|
+
* Constructor
|
|
1040
|
+
*/
|
|
1041
|
+
constructor() {
|
|
1042
|
+
Object.defineProperty(this, "_listeners", {
|
|
1043
|
+
enumerable: !0,
|
|
1044
|
+
configurable: !0,
|
|
1045
|
+
writable: !0,
|
|
1046
|
+
value: void 0
|
|
1047
|
+
}), Object.defineProperty(this, "_killed", {
|
|
1048
|
+
enumerable: !0,
|
|
1049
|
+
configurable: !0,
|
|
1050
|
+
writable: !0,
|
|
1051
|
+
value: void 0
|
|
1052
|
+
}), Object.defineProperty(this, "_disabled", {
|
|
1053
|
+
enumerable: !0,
|
|
1054
|
+
configurable: !0,
|
|
1055
|
+
writable: !0,
|
|
1056
|
+
value: void 0
|
|
1057
|
+
}), Object.defineProperty(this, "_iterating", {
|
|
1058
|
+
enumerable: !0,
|
|
1059
|
+
configurable: !0,
|
|
1060
|
+
writable: !0,
|
|
1061
|
+
value: void 0
|
|
1062
|
+
}), Object.defineProperty(this, "_enabled", {
|
|
1063
|
+
enumerable: !0,
|
|
1064
|
+
configurable: !0,
|
|
1065
|
+
writable: !0,
|
|
1066
|
+
value: void 0
|
|
1067
|
+
}), Object.defineProperty(this, "_disposed", {
|
|
1068
|
+
enumerable: !0,
|
|
1069
|
+
configurable: !0,
|
|
1070
|
+
writable: !0,
|
|
1071
|
+
value: void 0
|
|
1072
|
+
}), this._listeners = [], this._killed = [], this._disabled = {}, this._iterating = 0, this._enabled = !0, this._disposed = !1;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Returns if this object has been already disposed.
|
|
1076
|
+
*
|
|
1077
|
+
* @return Disposed?
|
|
1078
|
+
*/
|
|
1079
|
+
isDisposed() {
|
|
1080
|
+
return this._disposed;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Dispose (destroy) this object.
|
|
1084
|
+
*/
|
|
1085
|
+
dispose() {
|
|
1086
|
+
if (!this._disposed) {
|
|
1087
|
+
this._disposed = !0;
|
|
1088
|
+
const e = this._listeners;
|
|
1089
|
+
this._iterating = 1, this._listeners = null, this._disabled = null;
|
|
1090
|
+
try {
|
|
1091
|
+
c(e, (t) => {
|
|
1092
|
+
t.disposer.dispose();
|
|
1093
|
+
});
|
|
1094
|
+
} finally {
|
|
1095
|
+
this._killed = null, this._iterating = null;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Checks if this particular event dispatcher has any listeners set.
|
|
1101
|
+
*
|
|
1102
|
+
* @return Has listeners?
|
|
1103
|
+
*/
|
|
1104
|
+
hasListeners() {
|
|
1105
|
+
return this._listeners.length !== 0;
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Checks if this particular event dispatcher has any particular listeners set.
|
|
1109
|
+
*
|
|
1110
|
+
* @return Has particular event listeners?
|
|
1111
|
+
*/
|
|
1112
|
+
hasListenersByType(e) {
|
|
1113
|
+
return te(this._listeners, (t) => (t.type === null || t.type === e) && !t.killed);
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Enable dispatching of events if they were previously disabled by
|
|
1117
|
+
* `disable()`.
|
|
1118
|
+
*/
|
|
1119
|
+
enable() {
|
|
1120
|
+
this._enabled = !0;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Disable dispatching of events until re-enabled by `enable()`.
|
|
1124
|
+
*/
|
|
1125
|
+
disable() {
|
|
1126
|
+
this._enabled = !1;
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Enable dispatching particular event, if it was disabled before by
|
|
1130
|
+
* `disableType()`.
|
|
1131
|
+
*
|
|
1132
|
+
* @param type Event type
|
|
1133
|
+
*/
|
|
1134
|
+
enableType(e) {
|
|
1135
|
+
delete this._disabled[e];
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Disable dispatching of events for a certain event type.
|
|
1139
|
+
*
|
|
1140
|
+
* Optionally, can set how many dispatches to skip before automatically
|
|
1141
|
+
* re-enabling the dispatching.
|
|
1142
|
+
*
|
|
1143
|
+
* @param type Event type
|
|
1144
|
+
* @param amount Number of event dispatches to skip
|
|
1145
|
+
*/
|
|
1146
|
+
disableType(e, t = 1 / 0) {
|
|
1147
|
+
this._disabled[e] = t;
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Removes listener from dispatcher.
|
|
1151
|
+
*
|
|
1152
|
+
* Will throw an exception if such listener does not exists.
|
|
1153
|
+
*
|
|
1154
|
+
* @param listener Listener to remove
|
|
1155
|
+
*/
|
|
1156
|
+
_removeListener(e) {
|
|
1157
|
+
if (this._iterating === 0) {
|
|
1158
|
+
const t = this._listeners.indexOf(e);
|
|
1159
|
+
if (t === -1)
|
|
1160
|
+
throw new Error("Invalid state: could not remove listener");
|
|
1161
|
+
this._listeners.splice(t, 1);
|
|
1162
|
+
} else
|
|
1163
|
+
this._killed.push(e);
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* Removes existing listener by certain parameters.
|
|
1167
|
+
*
|
|
1168
|
+
* @param once Listener's once setting
|
|
1169
|
+
* @param type Listener's type
|
|
1170
|
+
* @param callback Callback function
|
|
1171
|
+
* @param context Callback context
|
|
1172
|
+
*/
|
|
1173
|
+
_removeExistingListener(e, t, i, r) {
|
|
1174
|
+
if (this._disposed)
|
|
1175
|
+
throw new Error("EventDispatcher is disposed");
|
|
1176
|
+
this._eachListener((n) => {
|
|
1177
|
+
n.once === e && // TODO is this correct ?
|
|
1178
|
+
n.type === t && (i === void 0 || n.callback === i) && n.context === r && n.disposer.dispose();
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Checks if dispatching for particular event type is enabled.
|
|
1183
|
+
*
|
|
1184
|
+
* @param type Event type
|
|
1185
|
+
* @return Enabled?
|
|
1186
|
+
*/
|
|
1187
|
+
isEnabled(e) {
|
|
1188
|
+
if (this._disposed)
|
|
1189
|
+
throw new Error("EventDispatcher is disposed");
|
|
1190
|
+
return this._enabled && this._listeners.length > 0 && this.hasListenersByType(e) && this._disabled[e] === void 0;
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Removes all listeners of a particular event type
|
|
1194
|
+
*
|
|
1195
|
+
* @param type Listener's type
|
|
1196
|
+
*/
|
|
1197
|
+
removeType(e) {
|
|
1198
|
+
if (this._disposed)
|
|
1199
|
+
throw new Error("EventDispatcher is disposed");
|
|
1200
|
+
this._eachListener((t) => {
|
|
1201
|
+
t.type === e && t.disposer.dispose();
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Checks if there's already a listener with specific parameters.
|
|
1206
|
+
*
|
|
1207
|
+
* @param type Listener's type
|
|
1208
|
+
* @param callback Callback function
|
|
1209
|
+
* @param context Callback context
|
|
1210
|
+
* @return Has listener?
|
|
1211
|
+
*/
|
|
1212
|
+
has(e, t, i) {
|
|
1213
|
+
return W(this._listeners, (n) => n.once !== !0 && // Ignoring "once" listeners
|
|
1214
|
+
n.type === e && (t === void 0 || n.callback === t) && n.context === i) !== -1;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Checks whether event of the particular type should be dispatched.
|
|
1218
|
+
*
|
|
1219
|
+
* @param type Event type
|
|
1220
|
+
* @return Dispatch?
|
|
1221
|
+
*/
|
|
1222
|
+
_shouldDispatch(e) {
|
|
1223
|
+
if (this._disposed)
|
|
1224
|
+
throw new Error("EventDispatcher is disposed");
|
|
1225
|
+
const t = this._disabled[e];
|
|
1226
|
+
return v(t) ? (t <= 1 ? delete this._disabled[e] : --this._disabled[e], !1) : this._enabled;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* [_eachListener description]
|
|
1230
|
+
*
|
|
1231
|
+
* All of this extra code is needed when a listener is removed while iterating
|
|
1232
|
+
*
|
|
1233
|
+
* @todo Description
|
|
1234
|
+
* @param fn [description]
|
|
1235
|
+
*/
|
|
1236
|
+
_eachListener(e) {
|
|
1237
|
+
++this._iterating;
|
|
1238
|
+
try {
|
|
1239
|
+
c(this._listeners, e);
|
|
1240
|
+
} finally {
|
|
1241
|
+
--this._iterating, this._iterating === 0 && this._killed.length !== 0 && (c(this._killed, (t) => {
|
|
1242
|
+
this._removeListener(t);
|
|
1243
|
+
}), this._killed.length = 0);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* Dispatches an event immediately without waiting for next cycle.
|
|
1248
|
+
*
|
|
1249
|
+
* @param type Event type
|
|
1250
|
+
* @param event Event object
|
|
1251
|
+
* @todo automatically add in type and target properties if they are missing
|
|
1252
|
+
*/
|
|
1253
|
+
dispatch(e, t) {
|
|
1254
|
+
this._shouldDispatch(e) && this._eachListener((i) => {
|
|
1255
|
+
!i.killed && (i.type === null || i.type === e) && (i._debounceDelay ? (i._debounceTimeout && window.clearTimeout(i._debounceTimeout), i._debounceTimeout = window.setTimeout(() => {
|
|
1256
|
+
i._debounceTimeout = void 0, i.killed || i.dispatch(e, t);
|
|
1257
|
+
}, i._debounceDelay)) : i.dispatch(e, t));
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Shelves the event to be dispatched within next update cycle.
|
|
1262
|
+
*
|
|
1263
|
+
* @param type Event type
|
|
1264
|
+
* @param event Event object
|
|
1265
|
+
* @todo automatically add in type and target properties if they are missing
|
|
1266
|
+
*/
|
|
1267
|
+
/*public dispatchLater<Key extends keyof T>(type: Key, event: T[Key]): void {
|
|
1268
|
+
if (this._shouldDispatch(type)) {
|
|
1269
|
+
this._eachListener((listener) => {
|
|
1270
|
+
// TODO check if it's faster to use an object of listeners rather than a single big array
|
|
1271
|
+
if (!listener.killed && (listener.type === null || listener.type === type)) {
|
|
1272
|
+
// TODO if the function throws, maybe it should keep going ?
|
|
1273
|
+
// TODO dispatch during the update cycle, rather than using whenIdle
|
|
1274
|
+
$async.whenIdle(() => {
|
|
1275
|
+
if (!listener.killed) {
|
|
1276
|
+
listener.dispatch(type, event);
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
}*/
|
|
1283
|
+
/**
|
|
1284
|
+
* Creates, catalogs and returns an [[EventListener]].
|
|
1285
|
+
*
|
|
1286
|
+
* Event listener can be disposed.
|
|
1287
|
+
*
|
|
1288
|
+
* @param once Listener's once setting
|
|
1289
|
+
* @param type Listener's type
|
|
1290
|
+
* @param callback Callback function
|
|
1291
|
+
* @param context Callback context
|
|
1292
|
+
* @param shouldClone Whether the listener should be copied when the EventDispatcher is copied
|
|
1293
|
+
* @param dispatch
|
|
1294
|
+
* @returns An event listener
|
|
1295
|
+
*/
|
|
1296
|
+
_on(e, t, i, r, n, a, u) {
|
|
1297
|
+
if (this._disposed)
|
|
1298
|
+
throw new Error("EventDispatcher is disposed");
|
|
1299
|
+
this._removeExistingListener(e, t, i, r);
|
|
1300
|
+
const o = {
|
|
1301
|
+
type: t,
|
|
1302
|
+
callback: i,
|
|
1303
|
+
context: r,
|
|
1304
|
+
shouldClone: n,
|
|
1305
|
+
dispatch: a,
|
|
1306
|
+
killed: !1,
|
|
1307
|
+
once: e,
|
|
1308
|
+
disposer: new w(() => {
|
|
1309
|
+
o.killed = !0, o._debounceTimeout && window.clearTimeout(o._debounceTimeout), this._removeListener(o);
|
|
1310
|
+
}),
|
|
1311
|
+
_debounceDelay: u
|
|
1312
|
+
};
|
|
1313
|
+
return this._listeners.push(o), o;
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Creates an event listener to be invoked on **any** event.
|
|
1317
|
+
*
|
|
1318
|
+
* @param callback Callback function
|
|
1319
|
+
* @param context Callback context
|
|
1320
|
+
* @param shouldClone Whether the listener should be copied when the EventDispatcher is copied
|
|
1321
|
+
* @returns A disposable event listener
|
|
1322
|
+
*/
|
|
1323
|
+
onAll(e, t, i = !0) {
|
|
1324
|
+
return this._on(!1, null, e, t, i, (r, n) => e.call(t, n)).disposer;
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Creates an event listener to be invoked on a specific event type.
|
|
1328
|
+
*
|
|
1329
|
+
* ```TypeScript
|
|
1330
|
+
* button.events.once("click", (ev) => {
|
|
1331
|
+
* console.log("Button clicked");
|
|
1332
|
+
* }, this);
|
|
1333
|
+
* ```
|
|
1334
|
+
* ```JavaScript
|
|
1335
|
+
* button.events.once("click", function(ev) {
|
|
1336
|
+
* console.log("Button clicked");
|
|
1337
|
+
* }, this);
|
|
1338
|
+
* ```
|
|
1339
|
+
*
|
|
1340
|
+
* The above will invoke our custom event handler whenever series we put
|
|
1341
|
+
* event on is hidden.
|
|
1342
|
+
*
|
|
1343
|
+
* @param type Listener's type
|
|
1344
|
+
* @param callback Callback function
|
|
1345
|
+
* @param context Callback context
|
|
1346
|
+
* @param shouldClone Whether the listener should be copied when the EventDispatcher is copied
|
|
1347
|
+
* @returns A disposable event listener
|
|
1348
|
+
*/
|
|
1349
|
+
on(e, t, i, r = !0) {
|
|
1350
|
+
return this._on(!1, e, t, i, r, (n, a) => t.call(i, a)).disposer;
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Creates a debounced event listener to be invoked on a specific event type.
|
|
1354
|
+
*
|
|
1355
|
+
* ```TypeScript
|
|
1356
|
+
* button.events.onDebounced("click", (ev) => {
|
|
1357
|
+
* console.log("Button clicked");
|
|
1358
|
+
* }, 500, this);
|
|
1359
|
+
* ```
|
|
1360
|
+
* ```JavaScript
|
|
1361
|
+
* button.events.onDebounced("click", function(ev) {
|
|
1362
|
+
* console.log("Button clicked");
|
|
1363
|
+
* }, 500, this);
|
|
1364
|
+
* ```
|
|
1365
|
+
*
|
|
1366
|
+
* The above will invoke our custom event handler whenever series we put
|
|
1367
|
+
* event on is hidden.
|
|
1368
|
+
*
|
|
1369
|
+
* @param type Listener's type
|
|
1370
|
+
* @param callback Callback function
|
|
1371
|
+
* @param debounceDelay Debounce delay in milliseconds
|
|
1372
|
+
* @param context Callback context
|
|
1373
|
+
* @param shouldClone Whether the listener should be copied when the EventDispatcher is copied
|
|
1374
|
+
* @returns A disposable event listener
|
|
1375
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/events/#Debounced_events} for more info
|
|
1376
|
+
* @since 5.14.0
|
|
1377
|
+
*/
|
|
1378
|
+
onDebounced(e, t, i, r, n = !0) {
|
|
1379
|
+
return this._on(!1, e, t, r, n, (a, u) => t.call(r, u), i).disposer;
|
|
1380
|
+
}
|
|
1381
|
+
/**
|
|
1382
|
+
* Creates an event listener to be invoked on a specific event type once.
|
|
1383
|
+
*
|
|
1384
|
+
* Once the event listener is invoked, it is automatically disposed.
|
|
1385
|
+
*
|
|
1386
|
+
* ```TypeScript
|
|
1387
|
+
* button.events.once("click", (ev) => {
|
|
1388
|
+
* console.log("Button clicked");
|
|
1389
|
+
* }, this);
|
|
1390
|
+
* ```
|
|
1391
|
+
* ```JavaScript
|
|
1392
|
+
* button.events.once("click", function(ev) {
|
|
1393
|
+
* console.log("Button clicked");
|
|
1394
|
+
* }, this);
|
|
1395
|
+
* ```
|
|
1396
|
+
*
|
|
1397
|
+
* The above will invoke our custom event handler the first time series we
|
|
1398
|
+
* put event on is hidden.
|
|
1399
|
+
*
|
|
1400
|
+
* @param type Listener's type
|
|
1401
|
+
* @param callback Callback function
|
|
1402
|
+
* @param context Callback context
|
|
1403
|
+
* @param shouldClone Whether the listener should be copied when the EventDispatcher is copied
|
|
1404
|
+
* @returns A disposable event listener
|
|
1405
|
+
*/
|
|
1406
|
+
once(e, t, i, r = !0) {
|
|
1407
|
+
const n = this._on(!0, e, t, i, r, (a, u) => {
|
|
1408
|
+
n.disposer.dispose(), t.call(i, u);
|
|
1409
|
+
});
|
|
1410
|
+
return n.disposer;
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Removes the event listener with specific parameters.
|
|
1414
|
+
*
|
|
1415
|
+
* @param type Listener's type
|
|
1416
|
+
* @param callback Callback function
|
|
1417
|
+
* @param context Callback context
|
|
1418
|
+
*/
|
|
1419
|
+
off(e, t, i) {
|
|
1420
|
+
this._removeExistingListener(!1, e, t, i);
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Copies all dispatcher parameters, including listeners, from another event
|
|
1424
|
+
* dispatcher.
|
|
1425
|
+
*
|
|
1426
|
+
* @param source Source event dispatcher
|
|
1427
|
+
* @ignore
|
|
1428
|
+
*/
|
|
1429
|
+
copyFrom(e) {
|
|
1430
|
+
if (this._disposed)
|
|
1431
|
+
throw new Error("EventDispatcher is disposed");
|
|
1432
|
+
if (e === this)
|
|
1433
|
+
throw new Error("Cannot copyFrom the same TargetedEventDispatcher");
|
|
1434
|
+
const t = [];
|
|
1435
|
+
return c(e._listeners, (i) => {
|
|
1436
|
+
!i.killed && i.shouldClone && (i.type === null ? t.push(this.onAll(i.callback, i.context)) : i.once ? t.push(this.once(i.type, i.callback, i.context)) : t.push(this.on(i.type, i.callback, i.context)));
|
|
1437
|
+
}), new le(t);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
function It(s) {
|
|
1441
|
+
return Q(this, void 0, void 0, function* () {
|
|
1442
|
+
if (s !== void 0) {
|
|
1443
|
+
const e = [];
|
|
1444
|
+
p(s, (t, i) => {
|
|
1445
|
+
e.push(i.waitForStop());
|
|
1446
|
+
}), yield Promise.all(e);
|
|
1447
|
+
}
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
function b(s, e, t) {
|
|
1451
|
+
return e + s * (t - e);
|
|
1452
|
+
}
|
|
1453
|
+
function we(s, e, t) {
|
|
1454
|
+
return s >= 1 ? t : e;
|
|
1455
|
+
}
|
|
1456
|
+
function ye(s, e, t) {
|
|
1457
|
+
return new g(b(s, e.percent, t.percent));
|
|
1458
|
+
}
|
|
1459
|
+
function Pe(s, e, t) {
|
|
1460
|
+
return h.interpolate(s, e, t);
|
|
1461
|
+
}
|
|
1462
|
+
function Te(s, e) {
|
|
1463
|
+
return typeof s == "number" && typeof e == "number" ? b : s instanceof g && e instanceof g ? ye : s instanceof h && e instanceof h ? Pe : we;
|
|
1464
|
+
}
|
|
1465
|
+
var T;
|
|
1466
|
+
(function(s) {
|
|
1467
|
+
s[s.Stopped = 0] = "Stopped", s[s.Playing = 1] = "Playing", s[s.Paused = 2] = "Paused";
|
|
1468
|
+
})(T || (T = {}));
|
|
1469
|
+
function z(s) {
|
|
1470
|
+
return s;
|
|
1471
|
+
}
|
|
1472
|
+
function Se(s) {
|
|
1473
|
+
return s * s * s;
|
|
1474
|
+
}
|
|
1475
|
+
function Lt(s) {
|
|
1476
|
+
return function(e) {
|
|
1477
|
+
return 1 - s(1 - e);
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
class De {
|
|
1481
|
+
constructor(e, t) {
|
|
1482
|
+
Object.defineProperty(this, "_entity", {
|
|
1483
|
+
enumerable: !0,
|
|
1484
|
+
configurable: !0,
|
|
1485
|
+
writable: !0,
|
|
1486
|
+
value: void 0
|
|
1487
|
+
}), Object.defineProperty(this, "_settings", {
|
|
1488
|
+
enumerable: !0,
|
|
1489
|
+
configurable: !0,
|
|
1490
|
+
writable: !0,
|
|
1491
|
+
value: void 0
|
|
1492
|
+
}), Object.defineProperty(this, "_userSettings", {
|
|
1493
|
+
enumerable: !0,
|
|
1494
|
+
configurable: !0,
|
|
1495
|
+
writable: !0,
|
|
1496
|
+
value: {}
|
|
1497
|
+
}), this._entity = e, this._settings = t, p(t, (i) => {
|
|
1498
|
+
this._userSettings[i] = !0;
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1501
|
+
get(e, t) {
|
|
1502
|
+
const i = this._settings[e];
|
|
1503
|
+
return i !== void 0 ? i : t;
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* @ignore
|
|
1507
|
+
*/
|
|
1508
|
+
setRaw(e, t) {
|
|
1509
|
+
this._settings[e] = t;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Sets a setting `value` for the specified `key` to be set when the state
|
|
1513
|
+
* is applied.
|
|
1514
|
+
*
|
|
1515
|
+
* @param key Setting key
|
|
1516
|
+
* @param value Setting value
|
|
1517
|
+
* @return Setting value
|
|
1518
|
+
*/
|
|
1519
|
+
set(e, t) {
|
|
1520
|
+
this._userSettings[e] = !0, this.setRaw(e, t);
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Removes a setting value for the specified `key`.
|
|
1524
|
+
*
|
|
1525
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
1526
|
+
* @param key Setting key
|
|
1527
|
+
*/
|
|
1528
|
+
remove(e) {
|
|
1529
|
+
delete this._userSettings[e], delete this._settings[e];
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Sets multiple settings at once.
|
|
1533
|
+
*
|
|
1534
|
+
* `settings` must be an object with key: value pairs.
|
|
1535
|
+
*
|
|
1536
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
1537
|
+
* @param settings Settings
|
|
1538
|
+
*/
|
|
1539
|
+
setAll(e) {
|
|
1540
|
+
y(e).forEach((t) => {
|
|
1541
|
+
this.set(t, e[t]);
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
_eachSetting(e) {
|
|
1545
|
+
p(this._settings, e);
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Applies the state to the target element.
|
|
1549
|
+
*
|
|
1550
|
+
* All setting values are set immediately.
|
|
1551
|
+
*/
|
|
1552
|
+
apply() {
|
|
1553
|
+
const e = {};
|
|
1554
|
+
e.stateAnimationEasing = !0, e.stateAnimationDuration = !0;
|
|
1555
|
+
const t = this._entity.states.lookup("default");
|
|
1556
|
+
this._eachSetting((i, r) => {
|
|
1557
|
+
e[i] || (e[i] = !0, this !== t && (i in t._settings || (t._settings[i] = this._entity.get(i))), this._entity.set(i, r));
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Applies the state to the target element.
|
|
1562
|
+
*
|
|
1563
|
+
* Returns an object representing all [[Animation]] objects created for
|
|
1564
|
+
* each setting key transition.
|
|
1565
|
+
*
|
|
1566
|
+
* @return Animations
|
|
1567
|
+
*/
|
|
1568
|
+
applyAnimate(e) {
|
|
1569
|
+
e == null && (e = this._settings.stateAnimationDuration), e == null && (e = this.get("stateAnimationDuration", this._entity.get("stateAnimationDuration", 0)));
|
|
1570
|
+
let t = this._settings.stateAnimationEasing;
|
|
1571
|
+
t == null && (t = this.get("stateAnimationEasing", this._entity.get("stateAnimationEasing", Se)));
|
|
1572
|
+
const i = this._entity.states.lookup("default"), r = {};
|
|
1573
|
+
r.stateAnimationEasing = !0, r.stateAnimationDuration = !0;
|
|
1574
|
+
const n = {};
|
|
1575
|
+
return this._eachSetting((a, u) => {
|
|
1576
|
+
if (!r[a]) {
|
|
1577
|
+
r[a] = !0, this != i && (a in i._settings || (i._settings[a] = this._entity.get(a)));
|
|
1578
|
+
const o = this._entity.animate({
|
|
1579
|
+
key: a,
|
|
1580
|
+
to: u,
|
|
1581
|
+
duration: e,
|
|
1582
|
+
easing: t
|
|
1583
|
+
});
|
|
1584
|
+
o && (n[a] = o);
|
|
1585
|
+
}
|
|
1586
|
+
}), n;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
class Oe {
|
|
1590
|
+
constructor(e) {
|
|
1591
|
+
Object.defineProperty(this, "_states", {
|
|
1592
|
+
enumerable: !0,
|
|
1593
|
+
configurable: !0,
|
|
1594
|
+
writable: !0,
|
|
1595
|
+
value: {}
|
|
1596
|
+
}), Object.defineProperty(this, "_entity", {
|
|
1597
|
+
enumerable: !0,
|
|
1598
|
+
configurable: !0,
|
|
1599
|
+
writable: !0,
|
|
1600
|
+
value: void 0
|
|
1601
|
+
}), this._entity = e;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Checks if a state by `name` exists. Returns it there is one.
|
|
1605
|
+
*
|
|
1606
|
+
* @param name State name
|
|
1607
|
+
* @return State
|
|
1608
|
+
*/
|
|
1609
|
+
lookup(e) {
|
|
1610
|
+
return this._states[e];
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Sets supplied `settings` on a state by the `name`.
|
|
1614
|
+
*
|
|
1615
|
+
* If such state does not yet exists, it is created.
|
|
1616
|
+
*
|
|
1617
|
+
* @param name State name
|
|
1618
|
+
* @param settings Settings
|
|
1619
|
+
* @return New State
|
|
1620
|
+
*/
|
|
1621
|
+
create(e, t) {
|
|
1622
|
+
const i = this._states[e];
|
|
1623
|
+
if (i)
|
|
1624
|
+
return i.setAll(t), i;
|
|
1625
|
+
{
|
|
1626
|
+
const r = new De(this._entity, t);
|
|
1627
|
+
return this._states[e] = r, r;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* Removes the state called `name`.
|
|
1632
|
+
*
|
|
1633
|
+
* @param name State name
|
|
1634
|
+
*/
|
|
1635
|
+
remove(e) {
|
|
1636
|
+
delete this._states[e];
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Applies a named state to the target element.
|
|
1640
|
+
*
|
|
1641
|
+
* @param newState State name
|
|
1642
|
+
*/
|
|
1643
|
+
apply(e) {
|
|
1644
|
+
const t = this._states[e];
|
|
1645
|
+
t && t.apply(), this._entity._applyState(e);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Applies a named state to the element.
|
|
1649
|
+
*
|
|
1650
|
+
* Returns an object representing all [[Animation]] objects created for
|
|
1651
|
+
* each setting key transition.
|
|
1652
|
+
*
|
|
1653
|
+
* @param newState State name
|
|
1654
|
+
* @return Animations
|
|
1655
|
+
*/
|
|
1656
|
+
applyAnimate(e, t) {
|
|
1657
|
+
let i;
|
|
1658
|
+
const r = this._states[e];
|
|
1659
|
+
return r && (i = r.applyAnimate(t)), this._entity._applyStateAnimated(e, t), i;
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
class Ee {
|
|
1663
|
+
constructor() {
|
|
1664
|
+
Object.defineProperty(this, "version", {
|
|
1665
|
+
enumerable: !0,
|
|
1666
|
+
configurable: !0,
|
|
1667
|
+
writable: !0,
|
|
1668
|
+
value: "5.14.4"
|
|
1669
|
+
}), Object.defineProperty(this, "licenses", {
|
|
1670
|
+
enumerable: !0,
|
|
1671
|
+
configurable: !0,
|
|
1672
|
+
writable: !0,
|
|
1673
|
+
value: []
|
|
1674
|
+
}), Object.defineProperty(this, "entitiesById", {
|
|
1675
|
+
enumerable: !0,
|
|
1676
|
+
configurable: !0,
|
|
1677
|
+
writable: !0,
|
|
1678
|
+
value: {}
|
|
1679
|
+
}), Object.defineProperty(this, "rootElements", {
|
|
1680
|
+
enumerable: !0,
|
|
1681
|
+
configurable: !0,
|
|
1682
|
+
writable: !0,
|
|
1683
|
+
value: []
|
|
1684
|
+
}), Object.defineProperty(this, "autoDispose", {
|
|
1685
|
+
enumerable: !0,
|
|
1686
|
+
configurable: !0,
|
|
1687
|
+
writable: !0,
|
|
1688
|
+
value: !1
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
const C = new Ee();
|
|
1693
|
+
function L(s, e) {
|
|
1694
|
+
return s === e ? 0 : s < e ? -1 : 1;
|
|
1695
|
+
}
|
|
1696
|
+
function je(s, e, t) {
|
|
1697
|
+
const i = s.length, r = e.length, n = Math.min(i, r);
|
|
1698
|
+
for (let a = 0; a < n; ++a) {
|
|
1699
|
+
const u = t(s[a], e[a]);
|
|
1700
|
+
if (u !== 0)
|
|
1701
|
+
return u;
|
|
1702
|
+
}
|
|
1703
|
+
return L(i, r);
|
|
1704
|
+
}
|
|
1705
|
+
function Ft(s, e) {
|
|
1706
|
+
return s === e ? 0 : s < e ? -1 : 1;
|
|
1707
|
+
}
|
|
1708
|
+
class xe {
|
|
1709
|
+
constructor(e) {
|
|
1710
|
+
Object.defineProperty(this, "_entity", {
|
|
1711
|
+
enumerable: !0,
|
|
1712
|
+
configurable: !0,
|
|
1713
|
+
writable: !0,
|
|
1714
|
+
value: void 0
|
|
1715
|
+
}), Object.defineProperty(this, "_callbacks", {
|
|
1716
|
+
enumerable: !0,
|
|
1717
|
+
configurable: !0,
|
|
1718
|
+
writable: !0,
|
|
1719
|
+
value: {}
|
|
1720
|
+
}), Object.defineProperty(this, "_disabled", {
|
|
1721
|
+
enumerable: !0,
|
|
1722
|
+
configurable: !0,
|
|
1723
|
+
writable: !0,
|
|
1724
|
+
value: {}
|
|
1725
|
+
}), this._entity = e;
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Add a function (`callback`) that will modify value for setting `key`.
|
|
1729
|
+
*
|
|
1730
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/adapters/} for more info
|
|
1731
|
+
*/
|
|
1732
|
+
add(e, t) {
|
|
1733
|
+
let i = this._callbacks[e];
|
|
1734
|
+
return i === void 0 && (i = this._callbacks[e] = []), i.push(t), this._entity._markDirtyKey(e), new w(() => {
|
|
1735
|
+
P(i, t) && this._entity._markDirtyKey(e);
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Removes all adapters for the specific key.
|
|
1740
|
+
*
|
|
1741
|
+
* @since 5.1.0
|
|
1742
|
+
*/
|
|
1743
|
+
remove(e) {
|
|
1744
|
+
const t = this._callbacks[e];
|
|
1745
|
+
t !== void 0 && (delete this._callbacks[e], t.length !== 0 && this._entity._markDirtyKey(e));
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* Enables (previously disabled) adapters for specific key.
|
|
1749
|
+
*
|
|
1750
|
+
* @since 5.1.0
|
|
1751
|
+
*/
|
|
1752
|
+
enable(e) {
|
|
1753
|
+
this._disabled[e] && (delete this._disabled[e], this._entity._markDirtyKey(e));
|
|
1754
|
+
}
|
|
1755
|
+
/**
|
|
1756
|
+
* Disables all adapters for specific key.
|
|
1757
|
+
*
|
|
1758
|
+
* @since 5.1.0
|
|
1759
|
+
*/
|
|
1760
|
+
disable(e) {
|
|
1761
|
+
this._disabled[e] || (this._disabled[e] = !0, this._entity._markDirtyKey(e));
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* @ignore
|
|
1765
|
+
*/
|
|
1766
|
+
fold(e, t) {
|
|
1767
|
+
if (!this._disabled[e]) {
|
|
1768
|
+
const i = this._callbacks[e];
|
|
1769
|
+
if (i !== void 0)
|
|
1770
|
+
for (let r = 0, n = i.length; r < n; ++r)
|
|
1771
|
+
t = i[r](t, this._entity, e);
|
|
1772
|
+
}
|
|
1773
|
+
return t;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
class S {
|
|
1777
|
+
constructor(e, t, i, r, n, a, u) {
|
|
1778
|
+
Object.defineProperty(this, "_animation", {
|
|
1779
|
+
enumerable: !0,
|
|
1780
|
+
configurable: !0,
|
|
1781
|
+
writable: !0,
|
|
1782
|
+
value: void 0
|
|
1783
|
+
}), Object.defineProperty(this, "_from", {
|
|
1784
|
+
enumerable: !0,
|
|
1785
|
+
configurable: !0,
|
|
1786
|
+
writable: !0,
|
|
1787
|
+
value: void 0
|
|
1788
|
+
}), Object.defineProperty(this, "_to", {
|
|
1789
|
+
enumerable: !0,
|
|
1790
|
+
configurable: !0,
|
|
1791
|
+
writable: !0,
|
|
1792
|
+
value: void 0
|
|
1793
|
+
}), Object.defineProperty(this, "_duration", {
|
|
1794
|
+
enumerable: !0,
|
|
1795
|
+
configurable: !0,
|
|
1796
|
+
writable: !0,
|
|
1797
|
+
value: void 0
|
|
1798
|
+
}), Object.defineProperty(this, "_easing", {
|
|
1799
|
+
enumerable: !0,
|
|
1800
|
+
configurable: !0,
|
|
1801
|
+
writable: !0,
|
|
1802
|
+
value: void 0
|
|
1803
|
+
}), Object.defineProperty(this, "_loops", {
|
|
1804
|
+
enumerable: !0,
|
|
1805
|
+
configurable: !0,
|
|
1806
|
+
writable: !0,
|
|
1807
|
+
value: void 0
|
|
1808
|
+
}), Object.defineProperty(this, "_interpolate", {
|
|
1809
|
+
enumerable: !0,
|
|
1810
|
+
configurable: !0,
|
|
1811
|
+
writable: !0,
|
|
1812
|
+
value: void 0
|
|
1813
|
+
}), Object.defineProperty(this, "_oldTime", {
|
|
1814
|
+
enumerable: !0,
|
|
1815
|
+
configurable: !0,
|
|
1816
|
+
writable: !0,
|
|
1817
|
+
value: void 0
|
|
1818
|
+
}), Object.defineProperty(this, "_time", {
|
|
1819
|
+
enumerable: !0,
|
|
1820
|
+
configurable: !0,
|
|
1821
|
+
writable: !0,
|
|
1822
|
+
value: 0
|
|
1823
|
+
}), Object.defineProperty(this, "_stopped", {
|
|
1824
|
+
enumerable: !0,
|
|
1825
|
+
configurable: !0,
|
|
1826
|
+
writable: !0,
|
|
1827
|
+
value: !1
|
|
1828
|
+
}), Object.defineProperty(this, "_playing", {
|
|
1829
|
+
enumerable: !0,
|
|
1830
|
+
configurable: !0,
|
|
1831
|
+
writable: !0,
|
|
1832
|
+
value: !0
|
|
1833
|
+
}), Object.defineProperty(this, "events", {
|
|
1834
|
+
enumerable: !0,
|
|
1835
|
+
configurable: !0,
|
|
1836
|
+
writable: !0,
|
|
1837
|
+
value: new J()
|
|
1838
|
+
}), this._animation = e, this._from = t, this._to = i, this._duration = r, this._easing = n, this._loops = a, this._interpolate = Te(t, i), this._oldTime = u;
|
|
1839
|
+
}
|
|
1840
|
+
get to() {
|
|
1841
|
+
return this._to;
|
|
1842
|
+
}
|
|
1843
|
+
get from() {
|
|
1844
|
+
return this._from;
|
|
1845
|
+
}
|
|
1846
|
+
get playing() {
|
|
1847
|
+
return this._playing;
|
|
1848
|
+
}
|
|
1849
|
+
get stopped() {
|
|
1850
|
+
return this._stopped;
|
|
1851
|
+
}
|
|
1852
|
+
stop() {
|
|
1853
|
+
this._stopped || (this._stopped = !0, this._playing = !1, this.events.isEnabled("stopped") && this.events.dispatch("stopped", {
|
|
1854
|
+
type: "stopped",
|
|
1855
|
+
target: this
|
|
1856
|
+
}));
|
|
1857
|
+
}
|
|
1858
|
+
pause() {
|
|
1859
|
+
this._playing = !1, this._oldTime = null;
|
|
1860
|
+
}
|
|
1861
|
+
play() {
|
|
1862
|
+
!this._stopped && !this._playing && (this._playing = !0, this._animation._startAnimation());
|
|
1863
|
+
}
|
|
1864
|
+
get percentage() {
|
|
1865
|
+
return this._time / this._duration;
|
|
1866
|
+
}
|
|
1867
|
+
waitForStop() {
|
|
1868
|
+
return new Promise((e, t) => {
|
|
1869
|
+
if (this._stopped)
|
|
1870
|
+
e();
|
|
1871
|
+
else {
|
|
1872
|
+
const i = () => {
|
|
1873
|
+
r.dispose(), e();
|
|
1874
|
+
}, r = this.events.on("stopped", i);
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
_checkEnded() {
|
|
1879
|
+
return this._loops > 1 ? (--this._loops, !1) : !0;
|
|
1880
|
+
}
|
|
1881
|
+
_run(e) {
|
|
1882
|
+
this._oldTime !== null && (this._time += e - this._oldTime, this._time > this._duration && (this._time = this._duration)), this._oldTime = e;
|
|
1883
|
+
}
|
|
1884
|
+
_reset(e) {
|
|
1885
|
+
this._oldTime = e, this._time = 0;
|
|
1886
|
+
}
|
|
1887
|
+
_value(e) {
|
|
1888
|
+
return this._interpolate(this._easing(e), this._from, this._to);
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
let Ae = 0;
|
|
1892
|
+
class Ce {
|
|
1893
|
+
constructor(e) {
|
|
1894
|
+
Object.defineProperty(this, "uid", {
|
|
1895
|
+
enumerable: !0,
|
|
1896
|
+
configurable: !0,
|
|
1897
|
+
writable: !0,
|
|
1898
|
+
value: ++Ae
|
|
1899
|
+
}), Object.defineProperty(this, "_settings", {
|
|
1900
|
+
enumerable: !0,
|
|
1901
|
+
configurable: !0,
|
|
1902
|
+
writable: !0,
|
|
1903
|
+
value: void 0
|
|
1904
|
+
}), Object.defineProperty(this, "_privateSettings", {
|
|
1905
|
+
enumerable: !0,
|
|
1906
|
+
configurable: !0,
|
|
1907
|
+
writable: !0,
|
|
1908
|
+
value: {}
|
|
1909
|
+
}), Object.defineProperty(this, "_settingEvents", {
|
|
1910
|
+
enumerable: !0,
|
|
1911
|
+
configurable: !0,
|
|
1912
|
+
writable: !0,
|
|
1913
|
+
value: {}
|
|
1914
|
+
}), Object.defineProperty(this, "_privateSettingEvents", {
|
|
1915
|
+
enumerable: !0,
|
|
1916
|
+
configurable: !0,
|
|
1917
|
+
writable: !0,
|
|
1918
|
+
value: {}
|
|
1919
|
+
}), Object.defineProperty(this, "_prevSettings", {
|
|
1920
|
+
enumerable: !0,
|
|
1921
|
+
configurable: !0,
|
|
1922
|
+
writable: !0,
|
|
1923
|
+
value: {}
|
|
1924
|
+
}), Object.defineProperty(this, "_prevPrivateSettings", {
|
|
1925
|
+
enumerable: !0,
|
|
1926
|
+
configurable: !0,
|
|
1927
|
+
writable: !0,
|
|
1928
|
+
value: {}
|
|
1929
|
+
}), Object.defineProperty(this, "_animatingSettings", {
|
|
1930
|
+
enumerable: !0,
|
|
1931
|
+
configurable: !0,
|
|
1932
|
+
writable: !0,
|
|
1933
|
+
value: {}
|
|
1934
|
+
}), Object.defineProperty(this, "_animatingPrivateSettings", {
|
|
1935
|
+
enumerable: !0,
|
|
1936
|
+
configurable: !0,
|
|
1937
|
+
writable: !0,
|
|
1938
|
+
value: {}
|
|
1939
|
+
}), Object.defineProperty(this, "_disposed", {
|
|
1940
|
+
enumerable: !0,
|
|
1941
|
+
configurable: !0,
|
|
1942
|
+
writable: !0,
|
|
1943
|
+
value: !1
|
|
1944
|
+
}), Object.defineProperty(this, "_userProperties", {
|
|
1945
|
+
enumerable: !0,
|
|
1946
|
+
configurable: !0,
|
|
1947
|
+
writable: !0,
|
|
1948
|
+
value: {}
|
|
1949
|
+
}), Object.defineProperty(this, "enableDispose", {
|
|
1950
|
+
enumerable: !0,
|
|
1951
|
+
configurable: !0,
|
|
1952
|
+
writable: !0,
|
|
1953
|
+
value: !0
|
|
1954
|
+
}), this._settings = e;
|
|
1955
|
+
}
|
|
1956
|
+
_checkDirty() {
|
|
1957
|
+
y(this._settings).forEach((e) => {
|
|
1958
|
+
this._userProperties[e] = !0, this._markDirtyKey(e);
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
/**
|
|
1962
|
+
* @ignore
|
|
1963
|
+
*/
|
|
1964
|
+
resetUserSettings() {
|
|
1965
|
+
this._userProperties = {};
|
|
1966
|
+
}
|
|
1967
|
+
_runAnimation(e) {
|
|
1968
|
+
let t = T.Stopped;
|
|
1969
|
+
if (!this.isDisposed()) {
|
|
1970
|
+
let i = !1, r = !1;
|
|
1971
|
+
p(this._animatingSettings, (n, a) => {
|
|
1972
|
+
if (a.stopped)
|
|
1973
|
+
this._stopAnimation(n);
|
|
1974
|
+
else if (a.playing) {
|
|
1975
|
+
a._run(e);
|
|
1976
|
+
const u = a.percentage;
|
|
1977
|
+
u >= 1 ? a._checkEnded() ? this.set(n, a._value(1)) : (i = !0, a._reset(e), this._set(n, a._value(1))) : (i = !0, this._set(n, a._value(u)));
|
|
1978
|
+
} else
|
|
1979
|
+
r = !0;
|
|
1980
|
+
}), p(this._animatingPrivateSettings, (n, a) => {
|
|
1981
|
+
if (a.stopped)
|
|
1982
|
+
this._stopAnimationPrivate(n);
|
|
1983
|
+
else if (a.playing) {
|
|
1984
|
+
a._run(e);
|
|
1985
|
+
const u = a.percentage;
|
|
1986
|
+
u >= 1 ? a._checkEnded() ? this.setPrivate(n, a._value(1)) : (i = !0, a._reset(e), this._setPrivate(n, a._value(1))) : (i = !0, this._setPrivate(n, a._value(u)));
|
|
1987
|
+
} else
|
|
1988
|
+
r = !0;
|
|
1989
|
+
}), i ? t = T.Playing : r && (t = T.Paused);
|
|
1990
|
+
}
|
|
1991
|
+
return t;
|
|
1992
|
+
}
|
|
1993
|
+
_markDirtyKey(e) {
|
|
1994
|
+
this.markDirty();
|
|
1995
|
+
}
|
|
1996
|
+
_markDirtyPrivateKey(e) {
|
|
1997
|
+
this.markDirty();
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Sets a callback function to invoke when specific key of settings changes
|
|
2001
|
+
* or is set.
|
|
2002
|
+
*
|
|
2003
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/events/#Settings_value_change} for more info
|
|
2004
|
+
* @param key Settings key
|
|
2005
|
+
* @param callback Callback
|
|
2006
|
+
* @return Disposer for event
|
|
2007
|
+
*/
|
|
2008
|
+
on(e, t) {
|
|
2009
|
+
let i = this._settingEvents[e];
|
|
2010
|
+
return i === void 0 && (i = this._settingEvents[e] = []), i.push(t), new w(() => {
|
|
2011
|
+
P(i, t), i.length === 0 && delete this._settingEvents[e];
|
|
2012
|
+
});
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* Removes a callback for when value of a setting changes.
|
|
2016
|
+
*
|
|
2017
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/events/#Settings_value_change} for more info
|
|
2018
|
+
* @param key Private settings key
|
|
2019
|
+
* @param callback Callback
|
|
2020
|
+
* @since 5.9.2
|
|
2021
|
+
*/
|
|
2022
|
+
off(e, t) {
|
|
2023
|
+
let i = this._settingEvents[e];
|
|
2024
|
+
i !== void 0 && t !== void 0 ? P(i, t) : delete this._settingEvents[e];
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* Sets a callback function to invoke when specific key of private settings
|
|
2028
|
+
* changes or is set.
|
|
2029
|
+
*
|
|
2030
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/events/#Settings_value_change} for more info
|
|
2031
|
+
* @param key Private settings key
|
|
2032
|
+
* @param callback Callback
|
|
2033
|
+
* @return Disposer for event
|
|
2034
|
+
*/
|
|
2035
|
+
onPrivate(e, t) {
|
|
2036
|
+
let i = this._privateSettingEvents[e];
|
|
2037
|
+
return i === void 0 && (i = this._privateSettingEvents[e] = []), i.push(t), new w(() => {
|
|
2038
|
+
P(i, t), i.length === 0 && delete this._privateSettingEvents[e];
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* Removes a callback for when value of a private setting changes.
|
|
2043
|
+
*
|
|
2044
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/events/#Settings_value_change} for more info
|
|
2045
|
+
* @param key Private settings key
|
|
2046
|
+
* @param callback Callback
|
|
2047
|
+
* @since 5.9.2
|
|
2048
|
+
*/
|
|
2049
|
+
offPrivate(e, t) {
|
|
2050
|
+
let i = this._privateSettingEvents[e];
|
|
2051
|
+
i !== void 0 && t !== void 0 ? P(i, t) : delete this._privateSettingEvents[e];
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* @ignore
|
|
2055
|
+
*/
|
|
2056
|
+
getRaw(e, t) {
|
|
2057
|
+
const i = this._settings[e];
|
|
2058
|
+
return i !== void 0 ? i : t;
|
|
2059
|
+
}
|
|
2060
|
+
/**
|
|
2061
|
+
* Returns `true` if the setting exists.
|
|
2062
|
+
*
|
|
2063
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2064
|
+
* @param key Settings key
|
|
2065
|
+
* @return {boolean} Key exists
|
|
2066
|
+
*/
|
|
2067
|
+
has(e) {
|
|
2068
|
+
return e in this._settings;
|
|
2069
|
+
}
|
|
2070
|
+
get(e, t) {
|
|
2071
|
+
return this.getRaw(e, t);
|
|
2072
|
+
}
|
|
2073
|
+
_sendKeyEvent(e, t) {
|
|
2074
|
+
const i = this._settingEvents[e];
|
|
2075
|
+
i !== void 0 && c(i, (r) => {
|
|
2076
|
+
r(t, this, e);
|
|
2077
|
+
});
|
|
2078
|
+
}
|
|
2079
|
+
_sendPrivateKeyEvent(e, t) {
|
|
2080
|
+
const i = this._privateSettingEvents[e];
|
|
2081
|
+
i !== void 0 && c(i, (r) => {
|
|
2082
|
+
r(t, this, e);
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
/**
|
|
2086
|
+
* @ignore
|
|
2087
|
+
*/
|
|
2088
|
+
_setRaw(e, t, i) {
|
|
2089
|
+
this._prevSettings[e] = t, this._sendKeyEvent(e, i);
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* @ignore
|
|
2093
|
+
*/
|
|
2094
|
+
setRaw(e, t) {
|
|
2095
|
+
const i = this._settings[e];
|
|
2096
|
+
this._settings[e] = t, i !== t && this._setRaw(e, i, t);
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* @ignore
|
|
2100
|
+
*/
|
|
2101
|
+
_set(e, t) {
|
|
2102
|
+
const i = this._settings[e];
|
|
2103
|
+
this._settings[e] = t, i !== t && (this._setRaw(e, i, t), this._markDirtyKey(e));
|
|
2104
|
+
}
|
|
2105
|
+
_stopAnimation(e) {
|
|
2106
|
+
const t = this._animatingSettings[e];
|
|
2107
|
+
t && (delete this._animatingSettings[e], t.stop());
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* Sets a setting `value` for the specified `key`, and returns the same `value`.
|
|
2111
|
+
*
|
|
2112
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2113
|
+
* @param key Setting key
|
|
2114
|
+
* @param value Setting value
|
|
2115
|
+
* @return Setting value
|
|
2116
|
+
*/
|
|
2117
|
+
set(e, t) {
|
|
2118
|
+
return this._set(e, t), this._stopAnimation(e), t;
|
|
2119
|
+
}
|
|
2120
|
+
/**
|
|
2121
|
+
* Removes a setting value for the specified `key`;
|
|
2122
|
+
*
|
|
2123
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2124
|
+
* @param key Setting key
|
|
2125
|
+
*/
|
|
2126
|
+
remove(e) {
|
|
2127
|
+
e in this._settings && (this._prevSettings[e] = this._settings[e], delete this._settings[e], this._sendKeyEvent(e, void 0), this._markDirtyKey(e)), this._stopAnimation(e);
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Removes all keys;
|
|
2131
|
+
*
|
|
2132
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2133
|
+
*/
|
|
2134
|
+
removeAll() {
|
|
2135
|
+
c(y(this._settings), (e) => {
|
|
2136
|
+
this.remove(e);
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
/**
|
|
2140
|
+
* Returns a value of a private setting.
|
|
2141
|
+
*
|
|
2142
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/#Private_settings} for more info
|
|
2143
|
+
*/
|
|
2144
|
+
getPrivate(e, t) {
|
|
2145
|
+
const i = this._privateSettings[e];
|
|
2146
|
+
return i !== void 0 ? i : t;
|
|
2147
|
+
}
|
|
2148
|
+
/**
|
|
2149
|
+
* @ignore
|
|
2150
|
+
*/
|
|
2151
|
+
_setPrivateRaw(e, t, i) {
|
|
2152
|
+
this._prevPrivateSettings[e] = t, this._sendPrivateKeyEvent(e, i);
|
|
2153
|
+
}
|
|
2154
|
+
/**
|
|
2155
|
+
* @ignore
|
|
2156
|
+
*/
|
|
2157
|
+
setPrivateRaw(e, t) {
|
|
2158
|
+
const i = this._privateSettings[e];
|
|
2159
|
+
this._privateSettings[e] = t, i !== t && this._setPrivateRaw(e, i, t);
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* @ignore
|
|
2163
|
+
*/
|
|
2164
|
+
_setPrivate(e, t) {
|
|
2165
|
+
const i = this._privateSettings[e];
|
|
2166
|
+
this._privateSettings[e] = t, i !== t && (this._setPrivateRaw(e, i, t), this._markDirtyPrivateKey(e));
|
|
2167
|
+
}
|
|
2168
|
+
_stopAnimationPrivate(e) {
|
|
2169
|
+
const t = this._animatingPrivateSettings[e];
|
|
2170
|
+
t && (t.stop(), delete this._animatingPrivateSettings[e]);
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* @ignore
|
|
2174
|
+
*/
|
|
2175
|
+
setPrivate(e, t) {
|
|
2176
|
+
return this._setPrivate(e, t), this._stopAnimationPrivate(e), t;
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* @ignore
|
|
2180
|
+
*/
|
|
2181
|
+
removePrivate(e) {
|
|
2182
|
+
e in this._privateSettings && (this._prevPrivateSettings[e] = this._privateSettings[e], delete this._privateSettings[e], this._markDirtyPrivateKey(e)), this._stopAnimationPrivate(e);
|
|
2183
|
+
}
|
|
2184
|
+
/**
|
|
2185
|
+
* Sets multiple settings at once.
|
|
2186
|
+
*
|
|
2187
|
+
* `settings` must be an object with key: value pairs.
|
|
2188
|
+
*
|
|
2189
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2190
|
+
* @param settings Settings
|
|
2191
|
+
*/
|
|
2192
|
+
setAll(e) {
|
|
2193
|
+
p(e, (t, i) => {
|
|
2194
|
+
this.set(t, i);
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Animates setting values from current/start values to new ones.
|
|
2199
|
+
*
|
|
2200
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Animating_settings} for more info
|
|
2201
|
+
* @param options Animation options
|
|
2202
|
+
* @return Animation object
|
|
2203
|
+
*/
|
|
2204
|
+
animate(e) {
|
|
2205
|
+
const t = e.key, i = e.to, r = e.duration || 0, n = e.loops || 1, a = e.from === void 0 ? this.get(t) : e.from, u = e.easing === void 0 ? z : e.easing;
|
|
2206
|
+
if (r === 0)
|
|
2207
|
+
this.set(t, i);
|
|
2208
|
+
else if (a === void 0 || a === i)
|
|
2209
|
+
this.set(t, i);
|
|
2210
|
+
else {
|
|
2211
|
+
this.set(t, a);
|
|
2212
|
+
const l = this._animatingSettings[t] = new S(this, a, i, r, u, n, this._animationTime());
|
|
2213
|
+
return this._startAnimation(), l;
|
|
2214
|
+
}
|
|
2215
|
+
const o = new S(this, a, i, r, u, n, null);
|
|
2216
|
+
return o.stop(), o;
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* @ignore
|
|
2220
|
+
*/
|
|
2221
|
+
animatePrivate(e) {
|
|
2222
|
+
const t = e.key, i = e.to, r = e.duration || 0, n = e.loops || 1, a = e.from === void 0 ? this.getPrivate(t) : e.from, u = e.easing === void 0 ? z : e.easing;
|
|
2223
|
+
if (r === 0)
|
|
2224
|
+
this.setPrivate(t, i);
|
|
2225
|
+
else if (a === void 0 || a === i)
|
|
2226
|
+
this.setPrivate(t, i);
|
|
2227
|
+
else {
|
|
2228
|
+
this.setPrivate(t, a);
|
|
2229
|
+
const l = this._animatingPrivateSettings[t] = new S(this, a, i, r, u, n, this._animationTime());
|
|
2230
|
+
return this._startAnimation(), l;
|
|
2231
|
+
}
|
|
2232
|
+
const o = new S(this, a, i, r, u, n, null);
|
|
2233
|
+
return o.stop(), o;
|
|
2234
|
+
}
|
|
2235
|
+
_dispose() {
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* Returns `true` if this element is disposed.
|
|
2239
|
+
*
|
|
2240
|
+
* @return Disposed
|
|
2241
|
+
*/
|
|
2242
|
+
isDisposed() {
|
|
2243
|
+
return this._disposed;
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* Disposes this object.
|
|
2247
|
+
*/
|
|
2248
|
+
dispose() {
|
|
2249
|
+
this.enableDispose && !this._disposed && (this._disposed = !0, this._dispose());
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
class O extends Ce {
|
|
2253
|
+
/**
|
|
2254
|
+
* IMPORTANT! Do not instantiate this class via `new Class()` syntax.
|
|
2255
|
+
*
|
|
2256
|
+
* Use static method `Class.new()` instead.
|
|
2257
|
+
*
|
|
2258
|
+
* @see {@link https://www.amcharts.com/docs/v5/getting-started/#New_element_syntax} for more info
|
|
2259
|
+
* @ignore
|
|
2260
|
+
*/
|
|
2261
|
+
constructor(e, t, i, r = []) {
|
|
2262
|
+
if (super(t), Object.defineProperty(this, "_root", {
|
|
2263
|
+
enumerable: !0,
|
|
2264
|
+
configurable: !0,
|
|
2265
|
+
writable: !0,
|
|
2266
|
+
value: void 0
|
|
2267
|
+
}), Object.defineProperty(this, "_user_id", {
|
|
2268
|
+
enumerable: !0,
|
|
2269
|
+
configurable: !0,
|
|
2270
|
+
writable: !0,
|
|
2271
|
+
value: void 0
|
|
2272
|
+
}), Object.defineProperty(this, "states", {
|
|
2273
|
+
enumerable: !0,
|
|
2274
|
+
configurable: !0,
|
|
2275
|
+
writable: !0,
|
|
2276
|
+
value: new Oe(this)
|
|
2277
|
+
}), Object.defineProperty(this, "adapters", {
|
|
2278
|
+
enumerable: !0,
|
|
2279
|
+
configurable: !0,
|
|
2280
|
+
writable: !0,
|
|
2281
|
+
value: new xe(this)
|
|
2282
|
+
}), Object.defineProperty(this, "events", {
|
|
2283
|
+
enumerable: !0,
|
|
2284
|
+
configurable: !0,
|
|
2285
|
+
writable: !0,
|
|
2286
|
+
value: this._createEvents()
|
|
2287
|
+
}), Object.defineProperty(this, "_userPrivateProperties", {
|
|
2288
|
+
enumerable: !0,
|
|
2289
|
+
configurable: !0,
|
|
2290
|
+
writable: !0,
|
|
2291
|
+
value: {}
|
|
2292
|
+
}), Object.defineProperty(this, "_dirty", {
|
|
2293
|
+
enumerable: !0,
|
|
2294
|
+
configurable: !0,
|
|
2295
|
+
writable: !0,
|
|
2296
|
+
value: {}
|
|
2297
|
+
}), Object.defineProperty(this, "_dirtyPrivate", {
|
|
2298
|
+
enumerable: !0,
|
|
2299
|
+
configurable: !0,
|
|
2300
|
+
writable: !0,
|
|
2301
|
+
value: {}
|
|
2302
|
+
}), Object.defineProperty(this, "_template", {
|
|
2303
|
+
enumerable: !0,
|
|
2304
|
+
configurable: !0,
|
|
2305
|
+
writable: !0,
|
|
2306
|
+
value: void 0
|
|
2307
|
+
}), Object.defineProperty(this, "_templates", {
|
|
2308
|
+
enumerable: !0,
|
|
2309
|
+
configurable: !0,
|
|
2310
|
+
writable: !0,
|
|
2311
|
+
value: []
|
|
2312
|
+
}), Object.defineProperty(this, "_internalTemplates", {
|
|
2313
|
+
enumerable: !0,
|
|
2314
|
+
configurable: !0,
|
|
2315
|
+
writable: !0,
|
|
2316
|
+
value: void 0
|
|
2317
|
+
}), Object.defineProperty(this, "_defaultThemes", {
|
|
2318
|
+
enumerable: !0,
|
|
2319
|
+
configurable: !0,
|
|
2320
|
+
writable: !0,
|
|
2321
|
+
value: []
|
|
2322
|
+
}), Object.defineProperty(this, "_templateDisposers", {
|
|
2323
|
+
enumerable: !0,
|
|
2324
|
+
configurable: !0,
|
|
2325
|
+
writable: !0,
|
|
2326
|
+
value: []
|
|
2327
|
+
}), Object.defineProperty(this, "_disposers", {
|
|
2328
|
+
enumerable: !0,
|
|
2329
|
+
configurable: !0,
|
|
2330
|
+
writable: !0,
|
|
2331
|
+
value: []
|
|
2332
|
+
}), Object.defineProperty(this, "_runSetup", {
|
|
2333
|
+
enumerable: !0,
|
|
2334
|
+
configurable: !0,
|
|
2335
|
+
writable: !0,
|
|
2336
|
+
value: !0
|
|
2337
|
+
}), Object.defineProperty(this, "_disposerProperties", {
|
|
2338
|
+
enumerable: !0,
|
|
2339
|
+
configurable: !0,
|
|
2340
|
+
writable: !0,
|
|
2341
|
+
value: {}
|
|
2342
|
+
}), !i)
|
|
2343
|
+
throw new Error("You cannot use `new Class()`, instead use `Class.new()`");
|
|
2344
|
+
this._root = e, this._internalTemplates = r, t.id && this._registerId(t.id);
|
|
2345
|
+
}
|
|
2346
|
+
/**
|
|
2347
|
+
* Use this method to create an instance of this class.
|
|
2348
|
+
*
|
|
2349
|
+
* @see {@link https://www.amcharts.com/docs/v5/getting-started/#New_element_syntax} for more info
|
|
2350
|
+
* @param root Root element
|
|
2351
|
+
* @param settings Settings
|
|
2352
|
+
* @param template Template
|
|
2353
|
+
* @return Instantiated object
|
|
2354
|
+
*/
|
|
2355
|
+
static new(e, t, i) {
|
|
2356
|
+
const r = new this(e, t, !0);
|
|
2357
|
+
return r._template = i, r._afterNew(), r;
|
|
2358
|
+
}
|
|
2359
|
+
static _new(e, t, i = []) {
|
|
2360
|
+
const r = new this(e, t, !0, i);
|
|
2361
|
+
return r._afterNew(), r;
|
|
2362
|
+
}
|
|
2363
|
+
_afterNew() {
|
|
2364
|
+
this._checkDirty();
|
|
2365
|
+
let e = !1;
|
|
2366
|
+
const t = this._template;
|
|
2367
|
+
t && (e = !0, t._setObjectTemplate(this)), c(this._internalTemplates, (i) => {
|
|
2368
|
+
e = !0, i._setObjectTemplate(this);
|
|
2369
|
+
}), e && this._applyTemplates(!1), this.states.create("default", {}), this._setDefaults();
|
|
2370
|
+
}
|
|
2371
|
+
// This is the same as _afterNew, except it also applies the themes.
|
|
2372
|
+
// This should only be used for classes which don't have a parent (because they extend from Entity and not Sprite).
|
|
2373
|
+
_afterNewApplyThemes() {
|
|
2374
|
+
this._checkDirty();
|
|
2375
|
+
const e = this._template;
|
|
2376
|
+
e && e._setObjectTemplate(this), c(this._internalTemplates, (t) => {
|
|
2377
|
+
t._setObjectTemplate(this);
|
|
2378
|
+
}), this.states.create("default", {}), this._setDefaults(), this._applyThemes();
|
|
2379
|
+
}
|
|
2380
|
+
_createEvents() {
|
|
2381
|
+
return new J();
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* @ignore
|
|
2385
|
+
*/
|
|
2386
|
+
get classNames() {
|
|
2387
|
+
return this.constructor.classNames;
|
|
2388
|
+
}
|
|
2389
|
+
/**
|
|
2390
|
+
* @ignore
|
|
2391
|
+
*/
|
|
2392
|
+
get className() {
|
|
2393
|
+
return this.constructor.className;
|
|
2394
|
+
}
|
|
2395
|
+
_setDefaults() {
|
|
2396
|
+
}
|
|
2397
|
+
_setDefaultFn(e, t) {
|
|
2398
|
+
const i = this.get(e);
|
|
2399
|
+
if (i)
|
|
2400
|
+
return i;
|
|
2401
|
+
{
|
|
2402
|
+
const r = t();
|
|
2403
|
+
return this.set(e, r), r;
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
_setDefault(e, t) {
|
|
2407
|
+
this.has(e) || super.set(e, t);
|
|
2408
|
+
}
|
|
2409
|
+
_setRawDefault(e, t) {
|
|
2410
|
+
this.has(e) || super.setRaw(e, t);
|
|
2411
|
+
}
|
|
2412
|
+
_clearDirty() {
|
|
2413
|
+
y(this._dirty).forEach((e) => {
|
|
2414
|
+
this._dirty[e] = !1;
|
|
2415
|
+
}), y(this._dirtyPrivate).forEach((e) => {
|
|
2416
|
+
this._dirtyPrivate[e] = !1;
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
/**
|
|
2420
|
+
* @ignore
|
|
2421
|
+
*/
|
|
2422
|
+
isDirty(e) {
|
|
2423
|
+
return !!this._dirty[e];
|
|
2424
|
+
}
|
|
2425
|
+
/**
|
|
2426
|
+
* @ignore
|
|
2427
|
+
*/
|
|
2428
|
+
isPrivateDirty(e) {
|
|
2429
|
+
return !!this._dirtyPrivate[e];
|
|
2430
|
+
}
|
|
2431
|
+
_markDirtyKey(e) {
|
|
2432
|
+
this._dirty[e] = !0, super._markDirtyKey(e);
|
|
2433
|
+
}
|
|
2434
|
+
_markDirtyPrivateKey(e) {
|
|
2435
|
+
this._dirtyPrivate[e] = !0, super._markDirtyKey(e);
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Checks if element is of certain class (or inherits one).
|
|
2439
|
+
*
|
|
2440
|
+
* @param type Class name to check
|
|
2441
|
+
* @return {boolean} Is of class?
|
|
2442
|
+
*/
|
|
2443
|
+
isType(e) {
|
|
2444
|
+
return this.classNames.indexOf(e) !== -1;
|
|
2445
|
+
}
|
|
2446
|
+
_pushPropertyDisposer(e, t) {
|
|
2447
|
+
let i = this._disposerProperties[e];
|
|
2448
|
+
return i === void 0 && (i = this._disposerProperties[e] = []), i.push(t), t;
|
|
2449
|
+
}
|
|
2450
|
+
_disposeProperty(e) {
|
|
2451
|
+
const t = this._disposerProperties[e];
|
|
2452
|
+
t !== void 0 && (c(t, (i) => {
|
|
2453
|
+
i.dispose();
|
|
2454
|
+
}), delete this._disposerProperties[e]);
|
|
2455
|
+
}
|
|
2456
|
+
/**
|
|
2457
|
+
* @todo needs description
|
|
2458
|
+
* @param value Template
|
|
2459
|
+
*/
|
|
2460
|
+
set template(e) {
|
|
2461
|
+
const t = this._template;
|
|
2462
|
+
t !== e && (this._template = e, t && t._removeObjectTemplate(this), e && e._setObjectTemplate(this), this._applyTemplates());
|
|
2463
|
+
}
|
|
2464
|
+
get template() {
|
|
2465
|
+
return this._template;
|
|
2466
|
+
}
|
|
2467
|
+
/**
|
|
2468
|
+
* @ignore
|
|
2469
|
+
*/
|
|
2470
|
+
markDirty() {
|
|
2471
|
+
this._root._addDirtyEntity(this);
|
|
2472
|
+
}
|
|
2473
|
+
_startAnimation() {
|
|
2474
|
+
this._root._addAnimation(this);
|
|
2475
|
+
}
|
|
2476
|
+
_animationTime() {
|
|
2477
|
+
return this._root.animationTime;
|
|
2478
|
+
}
|
|
2479
|
+
_applyState(e) {
|
|
2480
|
+
}
|
|
2481
|
+
_applyStateAnimated(e, t) {
|
|
2482
|
+
}
|
|
2483
|
+
get(e, t) {
|
|
2484
|
+
const i = this.adapters.fold(e, this._settings[e]);
|
|
2485
|
+
return i !== void 0 ? i : t;
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* @ignore
|
|
2489
|
+
*/
|
|
2490
|
+
isUserSetting(e) {
|
|
2491
|
+
return this._userProperties[e] || !1;
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2494
|
+
* Sets a setting `value` for the specified `key`, and returns the same `value`.
|
|
2495
|
+
*
|
|
2496
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2497
|
+
* @param key Setting key
|
|
2498
|
+
* @param value Setting value
|
|
2499
|
+
* @return Setting value
|
|
2500
|
+
*/
|
|
2501
|
+
set(e, t) {
|
|
2502
|
+
return this._userProperties[e] = !0, super.set(e, t);
|
|
2503
|
+
}
|
|
2504
|
+
/**
|
|
2505
|
+
* @ignore
|
|
2506
|
+
*/
|
|
2507
|
+
setRaw(e, t) {
|
|
2508
|
+
this._userProperties[e] = !0, super.setRaw(e, t);
|
|
2509
|
+
}
|
|
2510
|
+
/**
|
|
2511
|
+
* Sets a setting `value` for the specified `key` only if the value for this key was not set previously using set method, and returns the same `value`.
|
|
2512
|
+
*
|
|
2513
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2514
|
+
* @param key Setting key
|
|
2515
|
+
* @param value Setting value
|
|
2516
|
+
* @return Setting value
|
|
2517
|
+
*/
|
|
2518
|
+
_setSoft(e, t) {
|
|
2519
|
+
return this._userProperties[e] ? t : super.set(e, t);
|
|
2520
|
+
}
|
|
2521
|
+
/**
|
|
2522
|
+
* Removes a setting value for the specified `key`.
|
|
2523
|
+
*
|
|
2524
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info
|
|
2525
|
+
* @param key Setting key
|
|
2526
|
+
*/
|
|
2527
|
+
remove(e) {
|
|
2528
|
+
delete this._userProperties[e], this._removeTemplateProperty(e);
|
|
2529
|
+
}
|
|
2530
|
+
/**
|
|
2531
|
+
* @ignore
|
|
2532
|
+
*/
|
|
2533
|
+
setPrivate(e, t) {
|
|
2534
|
+
return this._userPrivateProperties[e] = !0, super.setPrivate(e, t);
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
* @ignore
|
|
2538
|
+
*/
|
|
2539
|
+
setPrivateRaw(e, t) {
|
|
2540
|
+
this._userPrivateProperties[e] = !0, super.setPrivateRaw(e, t);
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* @ignore
|
|
2544
|
+
*/
|
|
2545
|
+
removePrivate(e) {
|
|
2546
|
+
delete this._userPrivateProperties[e], this._removeTemplatePrivateProperty(e);
|
|
2547
|
+
}
|
|
2548
|
+
_setTemplateProperty(e, t, i) {
|
|
2549
|
+
if (!this._userProperties[t]) {
|
|
2550
|
+
const r = this._findTemplateByKey(t);
|
|
2551
|
+
e === r && super.set(t, i);
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
_setTemplatePrivateProperty(e, t, i) {
|
|
2555
|
+
if (!this._userPrivateProperties[t]) {
|
|
2556
|
+
const r = this._findTemplateByPrivateKey(t);
|
|
2557
|
+
e === r && super.setPrivate(t, i);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
_removeTemplateProperty(e) {
|
|
2561
|
+
if (!this._userProperties[e]) {
|
|
2562
|
+
const t = this._findTemplateByKey(e);
|
|
2563
|
+
t ? super.set(e, t._settings[e]) : super.remove(e);
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
_removeTemplatePrivateProperty(e) {
|
|
2567
|
+
if (!this._userPrivateProperties[e]) {
|
|
2568
|
+
const t = this._findTemplateByPrivateKey(e);
|
|
2569
|
+
t ? super.setPrivate(e, t._privateSettings[e]) : super.removePrivate(e);
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
_walkParents(e) {
|
|
2573
|
+
e(this._root._rootContainer), e(this);
|
|
2574
|
+
}
|
|
2575
|
+
// TODO faster version of this method which is specialized to just 1 key
|
|
2576
|
+
_applyStateByKey(e) {
|
|
2577
|
+
const t = this.states.create(e, {}), i = {};
|
|
2578
|
+
this._eachTemplate((r) => {
|
|
2579
|
+
const n = r.states.lookup(e);
|
|
2580
|
+
n && n._apply(t, i);
|
|
2581
|
+
}), p(t._settings, (r) => {
|
|
2582
|
+
!i[r] && !t._userSettings[r] && t.remove(r);
|
|
2583
|
+
});
|
|
2584
|
+
}
|
|
2585
|
+
_applyTemplate(e, t) {
|
|
2586
|
+
this._templateDisposers.push(e._apply(this, t)), p(e._settings, (i, r) => {
|
|
2587
|
+
!t.settings[i] && !this._userProperties[i] && (t.settings[i] = !0, super.set(i, r));
|
|
2588
|
+
}), p(e._privateSettings, (i, r) => {
|
|
2589
|
+
!t.privateSettings[i] && !this._userPrivateProperties[i] && (t.privateSettings[i] = !0, super.setPrivate(i, r));
|
|
2590
|
+
}), this._runSetup && e.setup && (this._runSetup = !1, e.setup(this));
|
|
2591
|
+
}
|
|
2592
|
+
/**
|
|
2593
|
+
* Calls the closure with each template and returns the first template which is true
|
|
2594
|
+
*/
|
|
2595
|
+
_findStaticTemplate(e) {
|
|
2596
|
+
if (this._template && e(this._template))
|
|
2597
|
+
return this._template;
|
|
2598
|
+
}
|
|
2599
|
+
_eachTemplate(e) {
|
|
2600
|
+
this._findStaticTemplate((t) => (e(t), !1)), j(this._internalTemplates, e), c(this._templates, e);
|
|
2601
|
+
}
|
|
2602
|
+
_applyTemplates(e = !0) {
|
|
2603
|
+
e && this._disposeTemplates();
|
|
2604
|
+
const t = {
|
|
2605
|
+
settings: {},
|
|
2606
|
+
privateSettings: {},
|
|
2607
|
+
states: {}
|
|
2608
|
+
};
|
|
2609
|
+
this._eachTemplate((i) => {
|
|
2610
|
+
this._applyTemplate(i, t);
|
|
2611
|
+
}), e && (p(this._settings, (i) => {
|
|
2612
|
+
!this._userProperties[i] && !t.settings[i] && super.remove(i);
|
|
2613
|
+
}), p(this._privateSettings, (i) => {
|
|
2614
|
+
!this._userPrivateProperties[i] && !t.privateSettings[i] && super.removePrivate(i);
|
|
2615
|
+
}));
|
|
2616
|
+
}
|
|
2617
|
+
_findTemplate(e) {
|
|
2618
|
+
const t = this._findStaticTemplate(e);
|
|
2619
|
+
if (t === void 0) {
|
|
2620
|
+
const i = ae(this._internalTemplates, e);
|
|
2621
|
+
return i === void 0 ? ne(this._templates, e) : i;
|
|
2622
|
+
} else
|
|
2623
|
+
return t;
|
|
2624
|
+
}
|
|
2625
|
+
_findTemplateByKey(e) {
|
|
2626
|
+
return this._findTemplate((t) => e in t._settings);
|
|
2627
|
+
}
|
|
2628
|
+
_findTemplateByPrivateKey(e) {
|
|
2629
|
+
return this._findTemplate((t) => e in t._privateSettings);
|
|
2630
|
+
}
|
|
2631
|
+
_disposeTemplates() {
|
|
2632
|
+
c(this._templateDisposers, (e) => {
|
|
2633
|
+
e.dispose();
|
|
2634
|
+
}), this._templateDisposers.length = 0;
|
|
2635
|
+
}
|
|
2636
|
+
_removeTemplates() {
|
|
2637
|
+
c(this._templates, (e) => {
|
|
2638
|
+
e._removeObjectTemplate(this);
|
|
2639
|
+
}), this._templates.length = 0;
|
|
2640
|
+
}
|
|
2641
|
+
_applyThemes(e = !1) {
|
|
2642
|
+
let t = !1;
|
|
2643
|
+
const i = [];
|
|
2644
|
+
let r = [];
|
|
2645
|
+
const n = /* @__PURE__ */ new Set(), a = this.get("themeTagsSelf");
|
|
2646
|
+
return a && c(a, (u) => {
|
|
2647
|
+
n.add(u);
|
|
2648
|
+
}), this._walkParents((u) => {
|
|
2649
|
+
u === this._root._rootContainer && (t = !0), u._defaultThemes.length > 0 && i.push(u._defaultThemes);
|
|
2650
|
+
const o = u.get("themes");
|
|
2651
|
+
o && r.push(o);
|
|
2652
|
+
const l = u.get("themeTags");
|
|
2653
|
+
l && c(l, (f) => {
|
|
2654
|
+
n.add(f);
|
|
2655
|
+
});
|
|
2656
|
+
}), r = i.concat(r), this._removeTemplates(), (t || e) && j(this.classNames, (u) => {
|
|
2657
|
+
const o = [];
|
|
2658
|
+
c(r, (l) => {
|
|
2659
|
+
c(l, (f) => {
|
|
2660
|
+
const d = f._lookupRules(u);
|
|
2661
|
+
d && j(d, (m) => {
|
|
2662
|
+
if (m.tags.every((E) => n.has(E))) {
|
|
2663
|
+
const E = ue(o, (M) => {
|
|
2664
|
+
const N = L(m.tags.length, M.tags.length);
|
|
2665
|
+
return N === 0 ? je(m.tags, M.tags, L) : N;
|
|
2666
|
+
});
|
|
2667
|
+
o.splice(E.index, 0, m);
|
|
2668
|
+
}
|
|
2669
|
+
});
|
|
2670
|
+
});
|
|
2671
|
+
}), c(o, (l) => {
|
|
2672
|
+
this._templates.push(l.template), l.template._setObjectTemplate(this);
|
|
2673
|
+
});
|
|
2674
|
+
}), this._applyTemplates(), (t || e) && (this._runSetup = !1), t || e;
|
|
2675
|
+
}
|
|
2676
|
+
_changed() {
|
|
2677
|
+
}
|
|
2678
|
+
_beforeChanged() {
|
|
2679
|
+
if (this.isDirty("id")) {
|
|
2680
|
+
const e = this.get("id");
|
|
2681
|
+
e && this._registerId(e);
|
|
2682
|
+
const t = this._prevSettings.id;
|
|
2683
|
+
t && (delete this._root.entitiesById[t], delete C.entitiesById[t]);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
_registerId(e) {
|
|
2687
|
+
if (this._root.entitiesById[e] && this._root.entitiesById[e] !== this)
|
|
2688
|
+
throw new Error('An entity with id "' + e + '" already exists.');
|
|
2689
|
+
this._root.entitiesById[e] = this, C.entitiesById[e] = this;
|
|
2690
|
+
}
|
|
2691
|
+
_afterChanged() {
|
|
2692
|
+
}
|
|
2693
|
+
/**
|
|
2694
|
+
* @ignore
|
|
2695
|
+
*/
|
|
2696
|
+
addDisposer(e) {
|
|
2697
|
+
return this._disposers.push(e), e;
|
|
2698
|
+
}
|
|
2699
|
+
_dispose() {
|
|
2700
|
+
super._dispose();
|
|
2701
|
+
const e = this._template;
|
|
2702
|
+
e && e._removeObjectTemplate(this), c(this._internalTemplates, (i) => {
|
|
2703
|
+
i._removeObjectTemplate(this);
|
|
2704
|
+
}), this._removeTemplates(), this._disposeTemplates(), this.events.dispose(), this._disposers.forEach((i) => {
|
|
2705
|
+
i.dispose();
|
|
2706
|
+
}), p(this._disposerProperties, (i, r) => {
|
|
2707
|
+
c(r, (n) => {
|
|
2708
|
+
n.dispose();
|
|
2709
|
+
});
|
|
2710
|
+
});
|
|
2711
|
+
const t = this.get("id");
|
|
2712
|
+
t && (delete this._root.entitiesById[t], delete C.entitiesById[t]);
|
|
2713
|
+
}
|
|
2714
|
+
/**
|
|
2715
|
+
* Creates and returns a "disposable" timeout.
|
|
2716
|
+
*
|
|
2717
|
+
* @param fn Callback
|
|
2718
|
+
* @param delay Delay in milliseconds
|
|
2719
|
+
* @return Timeout disposer
|
|
2720
|
+
*/
|
|
2721
|
+
setTimeout(e, t) {
|
|
2722
|
+
const i = setTimeout(() => {
|
|
2723
|
+
this.removeDispose(r), e();
|
|
2724
|
+
}, t), r = new w(() => {
|
|
2725
|
+
clearTimeout(i);
|
|
2726
|
+
});
|
|
2727
|
+
return this._disposers.push(r), r;
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* @ignore
|
|
2731
|
+
*/
|
|
2732
|
+
removeDispose(e) {
|
|
2733
|
+
if (!this.isDisposed()) {
|
|
2734
|
+
let t = I(this._disposers, e);
|
|
2735
|
+
t > -1 && this._disposers.splice(t, 1);
|
|
2736
|
+
}
|
|
2737
|
+
e.dispose();
|
|
2738
|
+
}
|
|
2739
|
+
/**
|
|
2740
|
+
* @ignore
|
|
2741
|
+
*/
|
|
2742
|
+
hasTag(e) {
|
|
2743
|
+
return I(this.get("themeTags", []), e) !== -1;
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* @ignore
|
|
2747
|
+
*/
|
|
2748
|
+
addTag(e) {
|
|
2749
|
+
if (!this.hasTag(e)) {
|
|
2750
|
+
const t = this.get("themeTags", []);
|
|
2751
|
+
t.push(e), this.set("themeTags", t);
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
/**
|
|
2755
|
+
* @ignore
|
|
2756
|
+
*/
|
|
2757
|
+
removeTag(e) {
|
|
2758
|
+
if (this.hasTag(e)) {
|
|
2759
|
+
const t = this.get("themeTags", []);
|
|
2760
|
+
se(t, e), this.set("themeTags", t);
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
_t(e, t, ...i) {
|
|
2764
|
+
return this._root.language.translate(e, t, ...i);
|
|
2765
|
+
}
|
|
2766
|
+
/**
|
|
2767
|
+
* An instance of [[Root]] object.
|
|
2768
|
+
*
|
|
2769
|
+
* @readonly
|
|
2770
|
+
* @since 5.0.6
|
|
2771
|
+
* @return Root object
|
|
2772
|
+
*/
|
|
2773
|
+
get root() {
|
|
2774
|
+
return this._root;
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
Object.defineProperty(O, "className", {
|
|
2778
|
+
enumerable: !0,
|
|
2779
|
+
configurable: !0,
|
|
2780
|
+
writable: !0,
|
|
2781
|
+
value: "Entity"
|
|
2782
|
+
});
|
|
2783
|
+
Object.defineProperty(O, "classNames", {
|
|
2784
|
+
enumerable: !0,
|
|
2785
|
+
configurable: !0,
|
|
2786
|
+
writable: !0,
|
|
2787
|
+
value: ["Entity"]
|
|
2788
|
+
});
|
|
2789
|
+
class F extends O {
|
|
2790
|
+
//protected _currentPass: number = 0;
|
|
2791
|
+
_afterNew() {
|
|
2792
|
+
super._afterNewApplyThemes(), this._dirty.colors = !1;
|
|
2793
|
+
}
|
|
2794
|
+
_beforeChanged() {
|
|
2795
|
+
this.isDirty("colors") && this.reset();
|
|
2796
|
+
}
|
|
2797
|
+
/**
|
|
2798
|
+
* @ignore
|
|
2799
|
+
*/
|
|
2800
|
+
generateColors() {
|
|
2801
|
+
this.setPrivate("currentPass", this.getPrivate("currentPass", 0) + 1);
|
|
2802
|
+
const e = this.getPrivate("currentPass"), t = this.get("colors", [this.get("baseColor", h.fromHex(16711680))]);
|
|
2803
|
+
this.getPrivate("numColors") || this.setPrivate("numColors", t.length);
|
|
2804
|
+
const i = this.getPrivate("numColors"), r = 0, n = this.get("passOptions"), a = this.get("reuse");
|
|
2805
|
+
for (let u = r; u < i; u++)
|
|
2806
|
+
if (a)
|
|
2807
|
+
t.push(t[u]);
|
|
2808
|
+
else {
|
|
2809
|
+
const o = t[u].toHSL();
|
|
2810
|
+
let l = o.h + (n.hue || 0) * e;
|
|
2811
|
+
for (; l > 1; )
|
|
2812
|
+
l -= 1;
|
|
2813
|
+
let f = o.s + (n.saturation || 0) * e;
|
|
2814
|
+
f > 1 && (f = 1), f < 0 && (f = 0);
|
|
2815
|
+
let d = o.l + (n.lightness || 0) * e;
|
|
2816
|
+
for (; d > 1; )
|
|
2817
|
+
d -= 1;
|
|
2818
|
+
t.push(h.fromHSL(l, f, d));
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
/**
|
|
2822
|
+
* Returns a [[Color]] at specific index.
|
|
2823
|
+
*
|
|
2824
|
+
* If there's no color at this index, a new color is generated.
|
|
2825
|
+
*
|
|
2826
|
+
* @param index Index
|
|
2827
|
+
* @return Color
|
|
2828
|
+
*/
|
|
2829
|
+
getIndex(e) {
|
|
2830
|
+
const t = this.get("colors", []), i = this.get("saturation");
|
|
2831
|
+
return e >= t.length ? (this.generateColors(), this.getIndex(e)) : i != null ? h.saturate(t[e], i) : t[e];
|
|
2832
|
+
}
|
|
2833
|
+
/**
|
|
2834
|
+
* Returns next [[Color]] in the list.
|
|
2835
|
+
*
|
|
2836
|
+
* If the list is out of colors, new ones are generated dynamically.
|
|
2837
|
+
*/
|
|
2838
|
+
next() {
|
|
2839
|
+
let e = this.getPrivate("currentStep", this.get("startIndex", 0));
|
|
2840
|
+
return this.setPrivate("currentStep", e + this.get("step", 1)), this.getIndex(e);
|
|
2841
|
+
}
|
|
2842
|
+
/**
|
|
2843
|
+
* Resets counter to the start of the list, so the next call for `next()` will
|
|
2844
|
+
* return the first color.
|
|
2845
|
+
*/
|
|
2846
|
+
reset() {
|
|
2847
|
+
this.setPrivate("currentStep", this.get("startIndex", 0)), this.setPrivate("currentPass", 0);
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
Object.defineProperty(F, "className", {
|
|
2851
|
+
enumerable: !0,
|
|
2852
|
+
configurable: !0,
|
|
2853
|
+
writable: !0,
|
|
2854
|
+
value: "ColorSet"
|
|
2855
|
+
});
|
|
2856
|
+
Object.defineProperty(F, "classNames", {
|
|
2857
|
+
enumerable: !0,
|
|
2858
|
+
configurable: !0,
|
|
2859
|
+
writable: !0,
|
|
2860
|
+
value: O.classNames.concat([F.className])
|
|
2861
|
+
});
|
|
2862
|
+
export {
|
|
2863
|
+
Re as $,
|
|
2864
|
+
se as A,
|
|
2865
|
+
Ye as B,
|
|
2866
|
+
F as C,
|
|
2867
|
+
Ft as D,
|
|
2868
|
+
O as E,
|
|
2869
|
+
P as F,
|
|
2870
|
+
jt as G,
|
|
2871
|
+
_t as H,
|
|
2872
|
+
Lt as I,
|
|
2873
|
+
Se as J,
|
|
2874
|
+
ze as K,
|
|
2875
|
+
J as L,
|
|
2876
|
+
le as M,
|
|
2877
|
+
I as N,
|
|
2878
|
+
Ze as O,
|
|
2879
|
+
g as P,
|
|
2880
|
+
ie as Q,
|
|
2881
|
+
j as R,
|
|
2882
|
+
w as S,
|
|
2883
|
+
$e as T,
|
|
2884
|
+
st as U,
|
|
2885
|
+
qe as V,
|
|
2886
|
+
ke as W,
|
|
2887
|
+
It as X,
|
|
2888
|
+
Be as Y,
|
|
2889
|
+
B as Z,
|
|
2890
|
+
Q as _,
|
|
2891
|
+
Le as a,
|
|
2892
|
+
ee as a0,
|
|
2893
|
+
gt as a1,
|
|
2894
|
+
tt as a2,
|
|
2895
|
+
Ve as a3,
|
|
2896
|
+
$ as a4,
|
|
2897
|
+
mt as a5,
|
|
2898
|
+
Ue as a6,
|
|
2899
|
+
Me as a7,
|
|
2900
|
+
Et as a8,
|
|
2901
|
+
A as a9,
|
|
2902
|
+
T as aA,
|
|
2903
|
+
Ce as aB,
|
|
2904
|
+
ne as aC,
|
|
2905
|
+
ye as aD,
|
|
2906
|
+
Ot as aa,
|
|
2907
|
+
Dt as ab,
|
|
2908
|
+
yt as ac,
|
|
2909
|
+
Tt as ad,
|
|
2910
|
+
U as ae,
|
|
2911
|
+
Pt as af,
|
|
2912
|
+
St as ag,
|
|
2913
|
+
vt as ah,
|
|
2914
|
+
Qe as ai,
|
|
2915
|
+
He as aj,
|
|
2916
|
+
je as ak,
|
|
2917
|
+
Xe as al,
|
|
2918
|
+
ut as am,
|
|
2919
|
+
nt as an,
|
|
2920
|
+
lt as ao,
|
|
2921
|
+
wt as ap,
|
|
2922
|
+
ot as aq,
|
|
2923
|
+
Z as ar,
|
|
2924
|
+
ct as as,
|
|
2925
|
+
C as at,
|
|
2926
|
+
et as au,
|
|
2927
|
+
bt as av,
|
|
2928
|
+
Fe as aw,
|
|
2929
|
+
dt as ax,
|
|
2930
|
+
it as ay,
|
|
2931
|
+
rt as az,
|
|
2932
|
+
Ie as b,
|
|
2933
|
+
Ct as c,
|
|
2934
|
+
he as d,
|
|
2935
|
+
c as e,
|
|
2936
|
+
v as f,
|
|
2937
|
+
ft as g,
|
|
2938
|
+
Y as h,
|
|
2939
|
+
at as i,
|
|
2940
|
+
Ge as j,
|
|
2941
|
+
y as k,
|
|
2942
|
+
Je as l,
|
|
2943
|
+
xt as m,
|
|
2944
|
+
ue as n,
|
|
2945
|
+
L as o,
|
|
2946
|
+
R as p,
|
|
2947
|
+
Ke as q,
|
|
2948
|
+
p as r,
|
|
2949
|
+
x as s,
|
|
2950
|
+
k as t,
|
|
2951
|
+
h as u,
|
|
2952
|
+
Ne as v,
|
|
2953
|
+
ht as w,
|
|
2954
|
+
pt as x,
|
|
2955
|
+
At as y,
|
|
2956
|
+
We as z
|
|
2957
|
+
};
|