charts-core 1.1.21 → 1.1.23
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/charts-core.js +785 -760
- package/dist/charts-core.js.map +1 -1
- package/dist/charts-core.umd.cjs +12 -12
- package/dist/charts-core.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/charts-core.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ns = (i, e, t) => e in i ?
|
|
1
|
+
var Ls = Object.defineProperty;
|
|
2
|
+
var Ns = (i, e, t) => e in i ? Ls(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var f = (i, e, t) => Ns(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as D from "d3";
|
|
5
5
|
const Fs = (i) => {
|
|
6
6
|
const { svg: e, config: t, y: s, width: n } = i, { margin: a, yAxis: r } = t, { customTicks: o, tickFormat: c, tickValues: h, ticks: u, isShow: g } = r;
|
|
7
7
|
if (!g) return null;
|
|
8
|
-
e.append("g").attr("transform", `translate(${n - a.right},0)`).call((
|
|
9
|
-
let
|
|
10
|
-
o && c ?
|
|
11
|
-
const b = Number(v),
|
|
12
|
-
return Math.abs(b) >= 1e12 ?
|
|
13
|
-
}), o && u && (
|
|
14
|
-
}).call((
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
}).call((
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const v =
|
|
21
|
-
|
|
8
|
+
e.append("g").attr("transform", `translate(${n - a.right},0)`).call((p) => {
|
|
9
|
+
let _ = D.axisRight(s);
|
|
10
|
+
o && c ? _ = _.tickFormat(c) : _ = _.tickFormat((v) => {
|
|
11
|
+
const b = Number(v), x = (C) => C.toString().replace(/\.0+$/, "");
|
|
12
|
+
return Math.abs(b) >= 1e12 ? x(b / 1e12) + "T" : Math.abs(b) >= 1e9 ? x(b / 1e9) + "B" : Math.abs(b) >= 1e6 ? x(b / 1e6) + "M" : Math.abs(b) >= 1e3 ? x(b / 1e3) + "K" : x(b);
|
|
13
|
+
}), o && u && (_ = Array.isArray(u) ? _.ticks(...u) : _.ticks(u)), o && h && (_ = _.tickValues(h)), p.call(_);
|
|
14
|
+
}).call((p) => {
|
|
15
|
+
let _ = [];
|
|
16
|
+
p.selectAll(".tick").each((v) => _.push(v)), i.yTicks = _;
|
|
17
|
+
}).call((p) => p.select(".domain").remove()).call((p) => p.selectAll(".tick line").remove()).call((p) => {
|
|
18
|
+
const _ = p.selectAll(".tick text");
|
|
19
|
+
_.classed("sc-charts__y-axis-tick", !0).attr("text-anchor", "start");
|
|
20
|
+
const v = _.nodes().map((x) => x.getBBox().width), b = Math.max(...v);
|
|
21
|
+
p.selectAll(".tick").each(function(x, C) {
|
|
22
22
|
var $;
|
|
23
|
-
const y = D.select(this),
|
|
24
|
-
|
|
23
|
+
const y = D.select(this), w = y.select("text"), S = v[C], L = b - S, R = y.append("g").attr("transform", "translate(10, 0)");
|
|
24
|
+
w.attr("x", L), w.remove(), ($ = R.node()) == null || $.appendChild(w.node());
|
|
25
25
|
});
|
|
26
26
|
}).attr("font-family", "inherit");
|
|
27
27
|
}, Hs = (i) => {
|
|
28
28
|
const { svg: e, config: t, x: s, height: n } = i, { margin: a, xAxis: r } = t, { isShow: o, tickValues: c, tickFormat: h, customTicks: u, ticks: g } = r;
|
|
29
29
|
if (!o) return null;
|
|
30
|
-
e.append("g").attr("transform", `translate(0,${n - a.bottom})`).call((
|
|
31
|
-
let
|
|
32
|
-
u ? (h && (
|
|
33
|
-
}).call((
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
}).call((
|
|
30
|
+
e.append("g").attr("transform", `translate(0,${n - a.bottom})`).call((p) => {
|
|
31
|
+
let _ = D.axisBottom(s);
|
|
32
|
+
u ? (h && (_ = _.tickFormat(h)), g && (_ = Array.isArray(g) ? _.ticks(...g) : _.ticks(g)), c && (_ = _.tickValues(c))) : _.ticks(5), p.call(_);
|
|
33
|
+
}).call((p) => p.select(".domain").remove()).call((p) => {
|
|
34
|
+
let _ = [];
|
|
35
|
+
p.selectAll(".tick").each((v) => _.push(v)), i.xTicks = _;
|
|
36
|
+
}).call((p) => p.selectAll(".tick line").remove()).call((p) => p.selectAll(".tick text").classed("sc-charts__x-axis-tick", !0)).attr("font-family", "inherit");
|
|
37
37
|
}, Bs = (i) => {
|
|
38
38
|
const { svg: e, config: t, y: s, width: n } = i, {
|
|
39
39
|
margin: a,
|
|
@@ -84,66 +84,66 @@ const Fs = (i) => {
|
|
|
84
84
|
return r.append("circle").attr("cx", t).attr("cy", s).attr("r", n).classed("sc-charts__hovered-circles", !0), r.append("circle").attr("cx", t).attr("cy", s).attr("r", n + a).classed("sc-charts__hovered-circles_add", !0), r;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
function
|
|
87
|
+
function Os(i, e, t, s) {
|
|
88
88
|
if (!i) return null;
|
|
89
89
|
const n = i.width / 2, a = e - n, r = e + n;
|
|
90
90
|
return a < t ? t : r > s ? s - i.width : e - n;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const Ut = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e).attr("x2", t).attr("y1", s).attr("y2", n).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1), Ps = (i) => {
|
|
93
93
|
const { svg: e, config: t, x: s, y: n, height: a, data: r, wrapperNode: o } = i, {
|
|
94
94
|
margin: c,
|
|
95
|
-
grid: { verticalStyle: h, tooltipNode: u, hoverCirclesRadius: g, hoverCirclesAdditionalArea:
|
|
95
|
+
grid: { verticalStyle: h, tooltipNode: u, hoverCirclesRadius: g, hoverCirclesAdditionalArea: p }
|
|
96
96
|
} = t;
|
|
97
97
|
if (h !== "none" && (h.startsWith("every-line") && (i.xTicks || s.ticks()).forEach((v) => {
|
|
98
98
|
const b = e.append("line").attr("x1", s(v)).attr("x2", s(v)).attr("y1", c.top).attr("y2", a - c.bottom).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1);
|
|
99
99
|
h === "every-line-dashed" && b.attr("stroke-dasharray", "4 4");
|
|
100
100
|
}), h === "hovered-circles")) {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const { tooltipContainer:
|
|
104
|
-
r.forEach((
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
x:
|
|
109
|
-
y:
|
|
101
|
+
const _ = n.range()[0], v = s(r[0].date), b = s(r[r.length - 1].date);
|
|
102
|
+
Ut(e, { x1: v, x2: b, y1: _, y2: _ });
|
|
103
|
+
const { tooltipContainer: x, tooltip: C, tooltipArrow: y } = Rs(o);
|
|
104
|
+
r.forEach((w, S) => {
|
|
105
|
+
const L = s(w.date), R = n(w.value), $ = r[S - 1], O = S > 0 && $ && w.value === $.value;
|
|
106
|
+
O || Ut(e, { x1: L, x2: L, y1: R, y2: _ });
|
|
107
|
+
const K = $s(e, O, {
|
|
108
|
+
x: L,
|
|
109
|
+
y: _,
|
|
110
110
|
r: g,
|
|
111
|
-
hr:
|
|
111
|
+
hr: p
|
|
112
112
|
});
|
|
113
|
-
u &&
|
|
114
|
-
Is(C),
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
s(
|
|
113
|
+
u && K.on("mouseover", function() {
|
|
114
|
+
Is(C), x.style.display = "block", C.append(u({ date: w.date, value: O ? null : w.value }));
|
|
115
|
+
const j = C.getBoundingClientRect(), P = Os(
|
|
116
|
+
j,
|
|
117
|
+
s(w.date),
|
|
118
118
|
i.config.margin.left - i.config.grid.tooltipArrowSize,
|
|
119
119
|
i.width - i.config.margin.right + i.config.grid.tooltipArrowSize
|
|
120
120
|
);
|
|
121
|
-
C.style.left =
|
|
121
|
+
C.style.left = P + "px", y.style.left = s(w.date) + "px";
|
|
122
122
|
}).on("mouseout", function() {
|
|
123
|
-
|
|
123
|
+
x.style.display = "none";
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
}, zs = (i) => {
|
|
128
|
-
Bs(i),
|
|
128
|
+
Bs(i), Ps(i);
|
|
129
129
|
}, Vs = (i) => {
|
|
130
130
|
const { svg: e, config: t, width: s, height: n } = i, { margin: a, logo: r } = t;
|
|
131
131
|
Hs(i), Fs(i), r && e.append("image").attr("xlink:href", t.theme === "dark" ? r.picDarkTheme : r.picLightTheme).attr("width", r.width).attr("height", r.height).attr("x", r.x ?? (s - a.left - a.right) / 2 - r.width / 2 + a.left).attr("y", r.y ?? (n - a.top - a.bottom) / 2 - r.height / 2 + a.top), zs(i);
|
|
132
|
-
},
|
|
132
|
+
}, Le = (i, e, t) => {
|
|
133
133
|
let s = i.select(`#${e}`);
|
|
134
134
|
return s.empty() && (s = i.append("linearGradient").attr("gradientUnits", "userSpaceOnUse").attr("id", e)), s.attr("x1", t.x1).attr("y1", t.x2).attr("x2", t.y1).attr("y2", t.y2), t.stops.forEach(({ offset: n, stopColor: a }) => {
|
|
135
135
|
s.append("stop").attr("offset", n).attr("stop-color", a);
|
|
136
136
|
}), s;
|
|
137
|
-
},
|
|
137
|
+
}, pe = (i) => {
|
|
138
138
|
const e = D.select(i).select("defs");
|
|
139
139
|
return e.empty() ? D.select(i).append("defs") : e;
|
|
140
|
-
},
|
|
140
|
+
}, gi = (i) => {
|
|
141
141
|
const {
|
|
142
142
|
y: e,
|
|
143
143
|
config: { margin: t }
|
|
144
144
|
} = i, s = e.range()[0] - e(0), n = e.range()[0] - s >= 0 ? e.range()[0] - s : 0, a = s + t.bottom >= 0 ? s + t.bottom : 0;
|
|
145
145
|
return { x: 0, y: n, width: "100%", height: a };
|
|
146
|
-
},
|
|
146
|
+
}, Gt = (i, e) => ({
|
|
147
147
|
...i,
|
|
148
148
|
...e,
|
|
149
149
|
margin: {
|
|
@@ -178,8 +178,8 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
|
|
|
178
178
|
...i.selection,
|
|
179
179
|
...e == null ? void 0 : e.selection
|
|
180
180
|
}
|
|
181
|
-
}),
|
|
182
|
-
const t = i.node(), s =
|
|
181
|
+
}), Zt = (i, e = {}) => {
|
|
182
|
+
const t = i.node(), s = pe(t), n = (o, c) => Le(s, o, {
|
|
183
183
|
x1: "0%",
|
|
184
184
|
y1: "0%",
|
|
185
185
|
x2: "0%",
|
|
@@ -204,7 +204,7 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
|
|
|
204
204
|
r.remove();
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
},
|
|
207
|
+
}, gt = (i, e = {}) => {
|
|
208
208
|
const t = i.append("circle").attr("r", e.radius || 4).style("display", e.hidden ? "none" : "block"), s = e.className || "";
|
|
209
209
|
return s && t.classed(s, !0), {
|
|
210
210
|
className(n, a) {
|
|
@@ -217,9 +217,9 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
|
|
|
217
217
|
t.remove();
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
|
-
},
|
|
221
|
-
const t = "sc-charts__hover-line", s = i.append("line").style("display", e.hidden ? "none" : "block").classed(t, !0), n = i.node(), a =
|
|
222
|
-
return ((o, c) =>
|
|
220
|
+
}, Ys = (i, e = {}) => {
|
|
221
|
+
const t = "sc-charts__hover-line", s = i.append("line").style("display", e.hidden ? "none" : "block").classed(t, !0), n = i.node(), a = pe(n);
|
|
222
|
+
return ((o, c) => Le(a, o, {
|
|
223
223
|
x1: "0%",
|
|
224
224
|
y1: "0%",
|
|
225
225
|
x2: "0%",
|
|
@@ -241,19 +241,19 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
|
|
|
241
241
|
s.remove();
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
-
},
|
|
244
|
+
}, ue = "sc-charts__range-tooltip", qt = D.timeFormat("%b %e, %I:%M %p"), Ws = (i) => {
|
|
245
245
|
const e = D.format(",.2f");
|
|
246
246
|
return `${i < 0 ? "-" : ""}$${e(Math.abs(i))}`;
|
|
247
247
|
};
|
|
248
|
-
function
|
|
248
|
+
function js(i) {
|
|
249
249
|
const e = "http://www.w3.org/2000/svg", t = document.createElement("div");
|
|
250
|
-
t.className =
|
|
250
|
+
t.className = ue, t.style.position = "absolute", t.style.top = "0", t.style.pointerEvents = "none", t.style.display = "none", i.append(t);
|
|
251
251
|
const s = document.createElement("div");
|
|
252
|
-
s.className = `${
|
|
252
|
+
s.className = `${ue}-container`, t.append(s);
|
|
253
253
|
const n = document.createElement("div");
|
|
254
|
-
n.className = `${
|
|
254
|
+
n.className = `${ue}-sum`, s.append(n);
|
|
255
255
|
const a = document.createElement("div");
|
|
256
|
-
a.className = `${
|
|
256
|
+
a.className = `${ue}-sum-icon`;
|
|
257
257
|
const r = document.createElementNS(e, "svg");
|
|
258
258
|
r.setAttribute("width", "14"), r.setAttribute("height", "14"), r.setAttribute("viewBox", "0 0 14 14"), r.setAttribute("fill", "none"), r.setAttribute("xmlns", e);
|
|
259
259
|
const o = document.createElementNS(e, "path");
|
|
@@ -264,29 +264,29 @@ function Ws(i) {
|
|
|
264
264
|
const c = document.createElement("div");
|
|
265
265
|
n.append(c);
|
|
266
266
|
const h = document.createElement("div");
|
|
267
|
-
return h.className = `${
|
|
267
|
+
return h.className = `${ue}-time`, s.append(h), { wrapper: t, sumNode: c, timeNode: h };
|
|
268
268
|
}
|
|
269
269
|
const Xs = (i) => {
|
|
270
|
-
const { wrapper: e, sumNode: t, timeNode: s } =
|
|
270
|
+
const { wrapper: e, sumNode: t, timeNode: s } = js(i.wrapperNode);
|
|
271
271
|
return {
|
|
272
272
|
className(n, a) {
|
|
273
|
-
n === "remove" ? e.classList.remove(`${
|
|
273
|
+
n === "remove" ? e.classList.remove(`${ue}${a}`) : e.classList.add(`${ue}${a}`);
|
|
274
274
|
},
|
|
275
275
|
update({ leftPoint: n, rightPoint: a, x: r, y: o, hidden: c, closest: h }) {
|
|
276
276
|
if (n && a && h && r !== void 0) {
|
|
277
|
-
const u = a.value - n.value, { sumFormatter: g, timeFormatter:
|
|
278
|
-
let b = "",
|
|
277
|
+
const u = a.value - n.value, { sumFormatter: g, timeFormatter: p } = i.config.selection, _ = (i.x(a.date) + i.x(n.date)) / 2, v = i.x(h.date) < _ ? "left" : "right";
|
|
278
|
+
let b = "", x = "";
|
|
279
279
|
if (g)
|
|
280
280
|
b = g({ left: n.value, right: a.value, direction: v });
|
|
281
281
|
else {
|
|
282
282
|
const C = (u / Math.abs(n.value) * 100).toFixed(2);
|
|
283
|
-
b = `${
|
|
283
|
+
b = `${Ws(u)} (${C}%)`;
|
|
284
284
|
}
|
|
285
|
-
|
|
286
|
-
const C = e.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(),
|
|
287
|
-
let R = (
|
|
288
|
-
const $ = 0,
|
|
289
|
-
R < $ && (R = $), R >
|
|
285
|
+
p ? x = p({ left: n.date, right: a.date, direction: v }) : x = `${qt(n.date)} to ${qt(a.date)}`, t.textContent = b, s.textContent = x, requestAnimationFrame(() => {
|
|
286
|
+
const C = e.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(), w = i.x(n.date), S = i.x(a.date);
|
|
287
|
+
let R = (w + S) / 2 - C.width / 2;
|
|
288
|
+
const $ = 0, O = y.width - C.width;
|
|
289
|
+
R < $ && (R = $), R > O && (R = O), e.style.left = `${R}px`, e.style.top = `${o}px`;
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
c !== void 0 && (e.style.display = c ? "none" : "block");
|
|
@@ -295,26 +295,26 @@ const Xs = (i) => {
|
|
|
295
295
|
e.remove();
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
|
-
},
|
|
298
|
+
}, Ee = "sc-charts__hover-tooltip", mt = 16, Us = D.timeFormat("%a, %b %d, %-I:%M %p"), Gs = (i) => {
|
|
299
299
|
const e = D.format(",.2f");
|
|
300
300
|
return `${i < 0 ? "-" : ""}$${e(Math.abs(i))}`;
|
|
301
301
|
};
|
|
302
302
|
function Zs(i) {
|
|
303
303
|
const e = document.createElement("div");
|
|
304
|
-
e.className = `${
|
|
304
|
+
e.className = `${Ee}-container`, e.style.position = "absolute", e.style.top = "0", e.style.pointerEvents = "none", e.style.display = "none", i.appendChild(e);
|
|
305
305
|
const t = document.createElement("div");
|
|
306
|
-
t.className = `${
|
|
306
|
+
t.className = `${Ee}-sum`, e.appendChild(t);
|
|
307
307
|
const s = document.createElement("div");
|
|
308
|
-
return s.className = `${
|
|
308
|
+
return s.className = `${Ee}-time`, e.appendChild(s), { wrapper: e, sumNode: t, timeNode: s };
|
|
309
309
|
}
|
|
310
310
|
function qs(i, e, t) {
|
|
311
|
-
return i ? e +
|
|
311
|
+
return i ? e + mt + i.width < t ? e + mt : e - mt - i.width : null;
|
|
312
312
|
}
|
|
313
313
|
const Js = (i) => {
|
|
314
314
|
const { wrapper: e, sumNode: t, timeNode: s } = Zs(i.wrapperNode);
|
|
315
315
|
return {
|
|
316
316
|
className(n, a) {
|
|
317
|
-
n === "remove" ? e.classList.remove(`${
|
|
317
|
+
n === "remove" ? e.classList.remove(`${Ee}${a}`) : e.classList.add(`${Ee}${a}`);
|
|
318
318
|
},
|
|
319
319
|
update({ hidden: n, dataItem: a }) {
|
|
320
320
|
if (a) {
|
|
@@ -385,9 +385,9 @@ const Js = (i) => {
|
|
|
385
385
|
},
|
|
386
386
|
enableBelowZeroLine: !1,
|
|
387
387
|
curveTension: 1
|
|
388
|
-
},
|
|
389
|
-
const { svg: e, data: t, x: s, y: n, config: a } = i, r = e.node(), o =
|
|
390
|
-
|
|
388
|
+
}, Qe = (i) => D.curveCardinal.tension(i.config.curveTension), Ks = (i) => {
|
|
389
|
+
const { svg: e, data: t, x: s, y: n, config: a } = i, r = e.node(), o = pe(r);
|
|
390
|
+
Le(o, "main-line-area-gradient", {
|
|
391
391
|
x1: "0%",
|
|
392
392
|
y1: "0%",
|
|
393
393
|
x2: "0%",
|
|
@@ -397,15 +397,15 @@ const Js = (i) => {
|
|
|
397
397
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
398
398
|
]
|
|
399
399
|
});
|
|
400
|
-
const h = D.area().x((
|
|
400
|
+
const h = D.area().x((p) => s(p.date)).y0(n.range()[0]).y1((p) => n(p.value)).curve(Qe(i)), u = "sc-charts__main-line-area", g = e.append("path").datum(t).attr("d", h).attr("class", u).classed(`${u}_hidden`, !a.hasMainLineArea);
|
|
401
401
|
return {
|
|
402
|
-
className(
|
|
403
|
-
|
|
402
|
+
className(p, _) {
|
|
403
|
+
p === "remove" ? g.classed(`${u}${_}`, !1) : g.classed(`${u}${_}`, !0);
|
|
404
404
|
},
|
|
405
|
-
update({ data:
|
|
406
|
-
if (
|
|
405
|
+
update({ data: p, hidden: _ }) {
|
|
406
|
+
if (p !== void 0 && g.datum(p).attr("d", h), _ !== void 0) {
|
|
407
407
|
if (!a.hasMainLineArea) return null;
|
|
408
|
-
g.classed(`${u}_hidden`,
|
|
408
|
+
g.classed(`${u}_hidden`, _);
|
|
409
409
|
}
|
|
410
410
|
},
|
|
411
411
|
destroy() {
|
|
@@ -413,8 +413,8 @@ const Js = (i) => {
|
|
|
413
413
|
}
|
|
414
414
|
};
|
|
415
415
|
}, en = (i, e = {}) => {
|
|
416
|
-
const t = "sc-charts__range-line-area", { svg: s, x: n, y: a, config: r, data: o, chartId: c } = i, { clip: h } = e, u = s.node(), g =
|
|
417
|
-
|
|
416
|
+
const t = "sc-charts__range-line-area", { svg: s, x: n, y: a, config: r, data: o, chartId: c } = i, { clip: h } = e, u = s.node(), g = pe(u), p = "range-line-area-gradient";
|
|
417
|
+
Le(g, p + "_up", {
|
|
418
418
|
x1: "0%",
|
|
419
419
|
y1: "0%",
|
|
420
420
|
x2: "0%",
|
|
@@ -423,7 +423,7 @@ const Js = (i) => {
|
|
|
423
423
|
{ offset: "0%", stopColor: "var(--sc-color-selection-up)" },
|
|
424
424
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
425
425
|
]
|
|
426
|
-
}),
|
|
426
|
+
}), Le(g, p + "_down", {
|
|
427
427
|
x1: "0%",
|
|
428
428
|
y1: "0%",
|
|
429
429
|
x2: "0%",
|
|
@@ -433,39 +433,39 @@ const Js = (i) => {
|
|
|
433
433
|
{ offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
|
|
434
434
|
]
|
|
435
435
|
});
|
|
436
|
-
const
|
|
436
|
+
const _ = D.area().x((y) => n(y.date)).y0(a.range()[0]).y1((y) => a(y.value)).curve(Qe(i)), v = `${c}-clip-${t}`, x = g.append("clipPath").attr("id", v).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), C = s.append("path").datum(o).attr("d", _).attr("class", t).classed(`${t}_hidden`, !r.hasMainLineArea).attr("clip-path", `url(#${v})`);
|
|
437
437
|
return {
|
|
438
|
-
className(y,
|
|
439
|
-
y === "remove" ? C.classed(`${t}${
|
|
438
|
+
className(y, w) {
|
|
439
|
+
y === "remove" ? C.classed(`${t}${w}`, !1) : C.classed(`${t}${w}`, !0);
|
|
440
440
|
},
|
|
441
|
-
update({ data: y, hidden:
|
|
442
|
-
y !== void 0 && C.datum(y).attr("d",
|
|
441
|
+
update({ data: y, hidden: w, clip: S }) {
|
|
442
|
+
y !== void 0 && C.datum(y).attr("d", _), w !== void 0 && C.classed(`${t}_hidden`, w), S !== void 0 && x.attr("x", S.x).attr("y", S.y).attr("width", S.width).attr("height", S.height);
|
|
443
443
|
},
|
|
444
444
|
destroy() {
|
|
445
445
|
C.remove();
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
|
-
},
|
|
449
|
-
const { svg: t, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = e, u = t.node(), g =
|
|
448
|
+
}, _t = (i, e) => {
|
|
449
|
+
const { svg: t, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = e, u = t.node(), g = pe(u), p = D.line().x((C) => n(C.date)).y((C) => a(C.value)).curve(Qe(i)), _ = `${r}-clip-${o}`, b = g.append("clipPath").attr("id", _).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), x = t.append("path").classed(o, !0).datum(s).attr("d", p).attr("id", c).attr("clip-path", `url(#${_})`);
|
|
450
450
|
return {
|
|
451
451
|
className(C, y) {
|
|
452
|
-
C === "remove" ?
|
|
452
|
+
C === "remove" ? x.classed(`${o}${y}`, !1) : x.classed(`${o}${y}`, !0);
|
|
453
453
|
},
|
|
454
|
-
update({ data: C, clip: y, hidden:
|
|
455
|
-
C !== void 0 &&
|
|
454
|
+
update({ data: C, clip: y, hidden: w }) {
|
|
455
|
+
C !== void 0 && x.datum(C).attr("d", p), w !== void 0 && x.classed(`${o}_hidden`, w), y !== void 0 && b.attr("x", y.x).attr("y", y.y).attr("width", y.width).attr("height", y.height);
|
|
456
456
|
},
|
|
457
457
|
destroy() {
|
|
458
|
-
|
|
458
|
+
x.remove();
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
461
|
}, tn = (i, e) => {
|
|
462
|
-
const { svg: t, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: u } = e, g = t.node(),
|
|
462
|
+
const { svg: t, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: u } = e, g = t.node(), p = pe(g), _ = D.line().x((y) => n(y.date)).y((y) => a(y.value)).curve(Qe(i)), v = `${r}-clip-${c}`, x = p.append("clipPath").attr("id", v).append("rect").attr("x", (u == null ? void 0 : u.x) || 0).attr("y", (u == null ? void 0 : u.y) || 0).attr("width", (u == null ? void 0 : u.width) || "100%").attr("height", (u == null ? void 0 : u.height) || "100%"), C = t.append("path").classed(c, !0).datum(s).attr("d", _).attr("id", h).attr("clip-path", `url(#${v})`);
|
|
463
463
|
return {
|
|
464
|
-
className(y,
|
|
465
|
-
y === "remove" ? C.classed(`${c}${
|
|
464
|
+
className(y, w) {
|
|
465
|
+
y === "remove" ? C.classed(`${c}${w}`, !1) : C.classed(`${c}${w}`, !0);
|
|
466
466
|
},
|
|
467
|
-
update({ data: y, clip:
|
|
468
|
-
y !== void 0 && C.datum(y).attr("d",
|
|
467
|
+
update({ data: y, clip: w, hidden: S }) {
|
|
468
|
+
y !== void 0 && C.datum(y).attr("d", _), S !== void 0 && C.classed(`${c}_hidden`, S), w !== void 0 && (o.hover.transitionName === "default" ? x.transition().duration(o.hover.transitionDuration).attr("x", w.x).attr("y", w.y).attr("width", w.width).attr("height", w.height).ease(D.easeLinear) : x.attr("x", w.x).attr("y", w.y).attr("width", w.width).attr("height", w.height));
|
|
469
469
|
},
|
|
470
470
|
destroy() {
|
|
471
471
|
C.remove();
|
|
@@ -479,13 +479,13 @@ const Js = (i) => {
|
|
|
479
479
|
const { svg: t, data: s, x: n, y: a } = i, { baseClassName: r } = e, o = t.append("g").classed(r, !0), c = o.append("circle").attr("r", 5).classed(`${r}-circle`, !0), h = o.append("text").attr("text-anchor", "middle").attr("dy", "-9px").classed(`${r}-label`, !0);
|
|
480
480
|
return ((g) => {
|
|
481
481
|
if (!g || g.length === 0) return;
|
|
482
|
-
const
|
|
483
|
-
c.attr("cx",
|
|
482
|
+
const p = g[g.length - 1], _ = n(p.date), v = a(p.value);
|
|
483
|
+
c.attr("cx", _).attr("cy", v);
|
|
484
484
|
const b = i.config.extremePointFormatter || sn;
|
|
485
|
-
h.attr("x",
|
|
485
|
+
h.attr("x", _).attr("y", v).text(b(p.value));
|
|
486
486
|
})(s), {
|
|
487
|
-
className(g,
|
|
488
|
-
g === "remove" ? o.classed(`${r}${
|
|
487
|
+
className(g, p) {
|
|
488
|
+
g === "remove" ? o.classed(`${r}${p}`, !1) : o.classed(`${r}${p}`, !0);
|
|
489
489
|
},
|
|
490
490
|
update({ hidden: g }) {
|
|
491
491
|
g !== void 0 && o.classed(`${r}_hidden`, g);
|
|
@@ -495,7 +495,7 @@ const Js = (i) => {
|
|
|
495
495
|
}
|
|
496
496
|
};
|
|
497
497
|
}, an = (i) => {
|
|
498
|
-
const e =
|
|
498
|
+
const e = _t(i, {
|
|
499
499
|
baseClassName: "sc-charts__main-line",
|
|
500
500
|
id: `${i.chartId}-sc-charts__main-line`
|
|
501
501
|
}), t = Ks(i);
|
|
@@ -503,31 +503,31 @@ const Js = (i) => {
|
|
|
503
503
|
i.config.hasExtremePoint && (s = nn(i, {
|
|
504
504
|
baseClassName: "sc-charts__extreme-point"
|
|
505
505
|
}));
|
|
506
|
-
const n =
|
|
506
|
+
const n = Ys(i.svg), a = tn(i, {
|
|
507
507
|
baseClassName: "sc-charts__highlight-line",
|
|
508
508
|
id: `${i.chartId}-sc-charts__highlight-line`,
|
|
509
509
|
clip: { x: 0, y: 0, width: "0", height: "0" }
|
|
510
510
|
});
|
|
511
511
|
let r = null;
|
|
512
|
-
i.config.enableBelowZeroLine && (r =
|
|
512
|
+
i.config.enableBelowZeroLine && (r = _t(i, {
|
|
513
513
|
baseClassName: "sc-charts__below-zero-line",
|
|
514
514
|
id: `${i.chartId}-sc-charts__below-zero-line`,
|
|
515
|
-
clip:
|
|
515
|
+
clip: gi(i)
|
|
516
516
|
}));
|
|
517
|
-
const o =
|
|
517
|
+
const o = gt(i.svg, {
|
|
518
518
|
className: "sc-charts__hover-circle",
|
|
519
519
|
hidden: !0
|
|
520
|
-
}), c =
|
|
520
|
+
}), c = Zt(i.svg), h = Zt(i.svg), u = _t(i, {
|
|
521
521
|
baseClassName: "sc-charts__range-line",
|
|
522
522
|
id: `${i.chartId}-sc-charts__range-line`,
|
|
523
523
|
clip: { x: 0, y: 0, width: "0", height: "0" }
|
|
524
|
-
}), g =
|
|
524
|
+
}), g = gt(i.svg, {
|
|
525
525
|
className: "sc-charts__range-circle-left",
|
|
526
526
|
hidden: !0
|
|
527
|
-
}),
|
|
527
|
+
}), p = gt(i.svg, {
|
|
528
528
|
className: "sc-charts__range-circle-right",
|
|
529
529
|
hidden: !0
|
|
530
|
-
}),
|
|
530
|
+
}), _ = Xs(i), v = Js(i), b = en(i);
|
|
531
531
|
return {
|
|
532
532
|
hoverLine: n,
|
|
533
533
|
hoverCircle: o,
|
|
@@ -536,9 +536,9 @@ const Js = (i) => {
|
|
|
536
536
|
rangeLine: u,
|
|
537
537
|
rangeLineArea: b,
|
|
538
538
|
rangeCircleLeft: g,
|
|
539
|
-
rangeCircleRight:
|
|
539
|
+
rangeCircleRight: p,
|
|
540
540
|
mainLine: e,
|
|
541
|
-
rangeTooltip:
|
|
541
|
+
rangeTooltip: _,
|
|
542
542
|
highlightLine: a,
|
|
543
543
|
hoverTooltip: v,
|
|
544
544
|
mainLineArea: t,
|
|
@@ -583,11 +583,11 @@ const Js = (i) => {
|
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
585
|
if (e >= h && e < u) {
|
|
586
|
-
const g = t(h),
|
|
586
|
+
const g = t(h), p = t(u);
|
|
587
587
|
return {
|
|
588
588
|
x: g,
|
|
589
589
|
y: 0,
|
|
590
|
-
width:
|
|
590
|
+
width: p - g,
|
|
591
591
|
height: "100%"
|
|
592
592
|
};
|
|
593
593
|
}
|
|
@@ -612,11 +612,11 @@ const Js = (i) => {
|
|
|
612
612
|
u = new Date(c.getFullYear(), c.getMonth() - r, 1);
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
|
-
const g = t(u),
|
|
615
|
+
const g = t(u), p = t(c);
|
|
616
616
|
return {
|
|
617
617
|
x: g,
|
|
618
618
|
y: 0,
|
|
619
|
-
width:
|
|
619
|
+
width: p - g,
|
|
620
620
|
height: "100%"
|
|
621
621
|
};
|
|
622
622
|
}
|
|
@@ -626,7 +626,7 @@ const Js = (i) => {
|
|
|
626
626
|
width: "100%",
|
|
627
627
|
height: "100%"
|
|
628
628
|
};
|
|
629
|
-
},
|
|
629
|
+
}, Jt = (i, e) => {
|
|
630
630
|
var h;
|
|
631
631
|
const {
|
|
632
632
|
x: t,
|
|
@@ -662,11 +662,11 @@ const Js = (i) => {
|
|
|
662
662
|
height: c
|
|
663
663
|
}
|
|
664
664
|
})), n.mainLine.className("add", "_muted");
|
|
665
|
-
},
|
|
665
|
+
}, Qt = (i) => {
|
|
666
666
|
var t;
|
|
667
667
|
const { elements: e } = i;
|
|
668
668
|
e.hoverLine.update({ hidden: !0 }), e.hoverCircle.update({ hidden: !0 }), e.highlightLine.update({ hidden: !0 }), e.mainLine.className("remove", "_muted"), e.hoverTooltip.update({ hidden: !0 }), i.action !== "selection" && ((t = e.belowZeroLine) == null || t.update({
|
|
669
|
-
clip:
|
|
669
|
+
clip: gi(i)
|
|
670
670
|
}));
|
|
671
671
|
}, on = (i, e) => {
|
|
672
672
|
[
|
|
@@ -688,7 +688,7 @@ const Js = (i) => {
|
|
|
688
688
|
config: { margin: a },
|
|
689
689
|
height: r,
|
|
690
690
|
elements: o
|
|
691
|
-
} = i, c = s(e.date) < s(t.date) ? e : t, h = s(e.date) >= s(t.date) ? e : t, u = h.value - c.value >= 0, g = s(c.date),
|
|
691
|
+
} = i, c = s(e.date) < s(t.date) ? e : t, h = s(e.date) >= s(t.date) ? e : t, u = h.value - c.value >= 0, g = s(c.date), p = s(h.date), _ = p - g;
|
|
692
692
|
o.rangeBorderLeft.update({
|
|
693
693
|
x1: g,
|
|
694
694
|
x2: g,
|
|
@@ -696,8 +696,8 @@ const Js = (i) => {
|
|
|
696
696
|
y2: r - a.bottom,
|
|
697
697
|
hidden: !1
|
|
698
698
|
}), o.rangeBorderRight.update({
|
|
699
|
-
x1:
|
|
700
|
-
x2:
|
|
699
|
+
x1: p,
|
|
700
|
+
x2: p,
|
|
701
701
|
y1: a.top,
|
|
702
702
|
y2: r - a.bottom,
|
|
703
703
|
hidden: !1
|
|
@@ -706,14 +706,14 @@ const Js = (i) => {
|
|
|
706
706
|
cy: n(c.value),
|
|
707
707
|
hidden: !1
|
|
708
708
|
}), o.rangeCircleRight.update({
|
|
709
|
-
cx:
|
|
709
|
+
cx: p,
|
|
710
710
|
cy: n(h.value),
|
|
711
711
|
hidden: !1
|
|
712
712
|
}), o.rangeLine.update({
|
|
713
713
|
clip: {
|
|
714
714
|
x: g,
|
|
715
715
|
y: 0,
|
|
716
|
-
width:
|
|
716
|
+
width: _,
|
|
717
717
|
height: n.range()[0]
|
|
718
718
|
},
|
|
719
719
|
hidden: !1
|
|
@@ -721,7 +721,7 @@ const Js = (i) => {
|
|
|
721
721
|
clip: {
|
|
722
722
|
x: g,
|
|
723
723
|
y: 0,
|
|
724
|
-
width:
|
|
724
|
+
width: _,
|
|
725
725
|
height: n.range()[0]
|
|
726
726
|
},
|
|
727
727
|
hidden: !1
|
|
@@ -729,36 +729,36 @@ const Js = (i) => {
|
|
|
729
729
|
rightPoint: h,
|
|
730
730
|
leftPoint: c,
|
|
731
731
|
closest: t,
|
|
732
|
-
x: g +
|
|
732
|
+
x: g + _ / 2,
|
|
733
733
|
y: 0,
|
|
734
734
|
hidden: !1
|
|
735
735
|
}), (v = o.belowZeroLine) == null || v.update({
|
|
736
736
|
hidden: !0
|
|
737
737
|
}), o.mainLineArea.update({ hidden: !0 }), on(o, u), o.mainLine.className("add", "_selected-muted");
|
|
738
|
-
},
|
|
738
|
+
}, Kt = (i) => {
|
|
739
739
|
var t;
|
|
740
740
|
const { elements: e } = i;
|
|
741
741
|
e.rangeLine.update({ hidden: !0 }), e.rangeLineArea.update({ hidden: !0 }), e.rangeBorderLeft.update({ hidden: !0 }), e.rangeBorderRight.update({ hidden: !0 }), e.rangeCircleLeft.update({ hidden: !0 }), e.rangeCircleRight.update({ hidden: !0 }), e.rangeTooltip.update({ hidden: !0 }), e.mainLine.className("remove", "_selected-muted"), e.mainLineArea.update({ hidden: !1 }), (t = e.belowZeroLine) == null || t.update({ hidden: !1 });
|
|
742
742
|
}, cn = (i) => {
|
|
743
743
|
const { svg: e, data: t, x: s, config: n, width: a, height: r } = i, { margin: o, hover: c, selection: h } = n;
|
|
744
744
|
let u = null, g = !1;
|
|
745
|
-
const
|
|
746
|
-
(b,
|
|
745
|
+
const p = (v) => t.reduce(
|
|
746
|
+
(b, x) => Math.abs(s(b.date) - v) < Math.abs(s(x.date) - v) ? b : x
|
|
747
747
|
);
|
|
748
748
|
e.append("rect").attr("width", a - o.left - o.right).attr("height", r - o.top - o.bottom).attr("x", o.left).attr("y", o.top).attr("fill", "transparent").on("mousemove", function(v) {
|
|
749
|
-
const [b] = D.pointer(v, this),
|
|
750
|
-
!g && c.enable ? (i.action = "hover",
|
|
749
|
+
const [b] = D.pointer(v, this), x = p(b);
|
|
750
|
+
!g && c.enable ? (i.action = "hover", Jt(i, x)) : (i.action = g ? "selection" : "none", Qt(i)), u && h.enable && (i.action = "selection", ln(i, u, x));
|
|
751
751
|
}).on("mouseleave", () => {
|
|
752
|
-
i.action = "none", g = !1, u = null,
|
|
752
|
+
i.action = "none", g = !1, u = null, Qt(i), Kt(i);
|
|
753
753
|
}).on("mousedown", function(v) {
|
|
754
754
|
if (h.enable) {
|
|
755
755
|
g = !0, i.action = "selection";
|
|
756
756
|
const [b] = D.pointer(v, this);
|
|
757
|
-
u =
|
|
757
|
+
u = p(b);
|
|
758
758
|
}
|
|
759
759
|
}).on("mouseup", function(v) {
|
|
760
|
-
const [b] = D.pointer(v, this),
|
|
761
|
-
g = !1, u = null, i.action = "hover", h.enable &&
|
|
760
|
+
const [b] = D.pointer(v, this), x = p(b);
|
|
761
|
+
g = !1, u = null, i.action = "hover", h.enable && Kt(i), c.enable && Jt(i, x);
|
|
762
762
|
});
|
|
763
763
|
}, hn = (i, e, t) => {
|
|
764
764
|
const { margin: s } = e, n = D.scaleTime(), a = D.extent(i, (r) => new Date(r.date));
|
|
@@ -774,21 +774,21 @@ const Js = (i) => {
|
|
|
774
774
|
return console.error(`chartId is required and must be a valid id
|
|
775
775
|
(only letters, numbers or underscores. The first character must be a letter)`), null;
|
|
776
776
|
const s = t.append("div"), n = s.append("svg"), a = t.node();
|
|
777
|
-
let r = a.getBoundingClientRect(), o = r.width, c = r.height, h =
|
|
777
|
+
let r = a.getBoundingClientRect(), o = r.width, c = r.height, h = Gt({ ...Qs }, e.config), u = e.data;
|
|
778
778
|
const g = () => {
|
|
779
|
-
r = a.getBoundingClientRect(), o = r.width, c = r.height,
|
|
779
|
+
r = a.getBoundingClientRect(), o = r.width, c = r.height, p({ data: u, config: h });
|
|
780
780
|
};
|
|
781
781
|
window.addEventListener("resize", g);
|
|
782
|
-
const
|
|
783
|
-
v &&
|
|
784
|
-
const b = u.map((
|
|
782
|
+
const p = (_, v = !1) => {
|
|
783
|
+
v && _.config && (h = Gt(h, _.config)), v && _.data && (u = _.data);
|
|
784
|
+
const b = u.map((S) => ({ date: new Date(S.date), value: S.value })).sort((S, L) => S.date.getTime() - L.date.getTime()), x = hn(b, h, o), C = dn(b, h, c);
|
|
785
785
|
s.attr("class", `sc-charts sc-charts__${h.theme}`), n.attr("preserveAspectRatio", "xMinYMin meet").attr("viewBox", `0 0 ${o} ${c}`).style("width", "100%").style("height", "100%").selectAll("*").remove();
|
|
786
786
|
const y = {
|
|
787
787
|
chartId: e.chartId,
|
|
788
788
|
svg: n,
|
|
789
789
|
wrapperNode: s.node(),
|
|
790
790
|
data: b,
|
|
791
|
-
x
|
|
791
|
+
x,
|
|
792
792
|
y: C,
|
|
793
793
|
config: h,
|
|
794
794
|
action: "none",
|
|
@@ -796,38 +796,38 @@ const Js = (i) => {
|
|
|
796
796
|
height: c
|
|
797
797
|
};
|
|
798
798
|
Vs(y);
|
|
799
|
-
const
|
|
799
|
+
const w = {
|
|
800
800
|
...y,
|
|
801
801
|
elements: an(y)
|
|
802
802
|
};
|
|
803
|
-
cn(
|
|
803
|
+
cn(w);
|
|
804
804
|
};
|
|
805
|
-
return
|
|
806
|
-
update: (
|
|
805
|
+
return p(e), {
|
|
806
|
+
update: (_) => p(_, !0),
|
|
807
807
|
destroy: () => {
|
|
808
808
|
window.removeEventListener("resize", g), n.remove();
|
|
809
809
|
}
|
|
810
810
|
};
|
|
811
811
|
};
|
|
812
|
-
var
|
|
812
|
+
var Xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
813
813
|
function un(i) {
|
|
814
814
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
815
815
|
}
|
|
816
|
-
var
|
|
817
|
-
|
|
818
|
-
var
|
|
816
|
+
var ke = { exports: {} };
|
|
817
|
+
ke.exports;
|
|
818
|
+
var ei;
|
|
819
819
|
function fn() {
|
|
820
|
-
return
|
|
821
|
-
var t = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", u = "[object Boolean]", g = "[object Date]",
|
|
822
|
-
N[
|
|
823
|
-
var
|
|
820
|
+
return ei || (ei = 1, function(i, e) {
|
|
821
|
+
var t = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", u = "[object Boolean]", g = "[object Date]", p = "[object Error]", _ = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", x = "[object Number]", C = "[object Null]", y = "[object Object]", w = "[object Proxy]", S = "[object RegExp]", L = "[object Set]", R = "[object String]", $ = "[object Undefined]", O = "[object WeakMap]", K = "[object ArrayBuffer]", j = "[object DataView]", P = "[object Float32Array]", X = "[object Float64Array]", U = "[object Int8Array]", He = "[object Int16Array]", et = "[object Int32Array]", re = "[object Uint8Array]", ve = "[object Uint8ClampedArray]", be = "[object Uint16Array]", Be = "[object Uint32Array]", Ie = /[\\^$.*+?()[\]{}|]/g, Re = /^\[object .+?Constructor\]$/, tt = /^(?:0|[1-9]\d*)$/, N = {};
|
|
822
|
+
N[P] = N[X] = N[U] = N[He] = N[et] = N[re] = N[ve] = N[be] = N[Be] = !0, N[o] = N[c] = N[K] = N[u] = N[j] = N[g] = N[p] = N[_] = N[b] = N[x] = N[y] = N[S] = N[L] = N[R] = N[O] = !1;
|
|
823
|
+
var z = typeof Xe == "object" && Xe && Xe.Object === Object && Xe, fe = typeof self == "object" && self && self.Object === Object && self, G = z || fe || Function("return this")(), Z = e && !e.nodeType && e, se = Z && !0 && i && !i.nodeType && i, ye = se && se.exports === Z, ge = ye && z.process, we = function() {
|
|
824
824
|
try {
|
|
825
|
-
var l =
|
|
826
|
-
return l ||
|
|
825
|
+
var l = se && se.require && se.require("util").types;
|
|
826
|
+
return l || ge && ge.binding && ge.binding("util");
|
|
827
827
|
} catch {
|
|
828
828
|
}
|
|
829
|
-
}(),
|
|
830
|
-
function
|
|
829
|
+
}(), xe = we && we.isTypedArray;
|
|
830
|
+
function oe(l, d, m) {
|
|
831
831
|
switch (m.length) {
|
|
832
832
|
case 0:
|
|
833
833
|
return l.call(d);
|
|
@@ -840,17 +840,17 @@ function fn() {
|
|
|
840
840
|
}
|
|
841
841
|
return l.apply(d, m);
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
for (var m = -1,
|
|
845
|
-
|
|
846
|
-
return
|
|
843
|
+
function le(l, d) {
|
|
844
|
+
for (var m = -1, A = Array(l); ++m < l; )
|
|
845
|
+
A[m] = d(m);
|
|
846
|
+
return A;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function it(l) {
|
|
849
849
|
return function(d) {
|
|
850
850
|
return l(d);
|
|
851
851
|
};
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function Ce(l, d) {
|
|
854
854
|
return l == null ? void 0 : l[d];
|
|
855
855
|
}
|
|
856
856
|
function xi(l, d) {
|
|
@@ -858,41 +858,41 @@ function fn() {
|
|
|
858
858
|
return l(d(m));
|
|
859
859
|
};
|
|
860
860
|
}
|
|
861
|
-
var Ci = Array.prototype,
|
|
862
|
-
var l = /[^.]+$/.exec(
|
|
861
|
+
var Ci = Array.prototype, Ai = Function.prototype, $e = Object.prototype, st = G["__core-js_shared__"], Oe = Ai.toString, ne = $e.hasOwnProperty, Dt = function() {
|
|
862
|
+
var l = /[^.]+$/.exec(st && st.keys && st.keys.IE_PROTO || "");
|
|
863
863
|
return l ? "Symbol(src)_1." + l : "";
|
|
864
|
-
}(),
|
|
865
|
-
"^" +
|
|
866
|
-
),
|
|
867
|
-
|
|
868
|
-
var
|
|
864
|
+
}(), Et = $e.toString, Mi = Oe.call(Object), Si = RegExp(
|
|
865
|
+
"^" + Oe.call(ne).replace(Ie, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
866
|
+
), Pe = ye ? G.Buffer : void 0, Lt = G.Symbol, Nt = G.Uint8Array;
|
|
867
|
+
Pe && Pe.allocUnsafe;
|
|
868
|
+
var Ft = xi(Object.getPrototypeOf, Object), Ht = Object.create, Ti = $e.propertyIsEnumerable, ki = Ci.splice, ce = Lt ? Lt.toStringTag : void 0, ze = function() {
|
|
869
869
|
try {
|
|
870
|
-
var l =
|
|
870
|
+
var l = rt(Object, "defineProperty");
|
|
871
871
|
return l({}, "", {}), l;
|
|
872
872
|
} catch {
|
|
873
873
|
}
|
|
874
|
-
}(), Di =
|
|
874
|
+
}(), Di = Pe ? Pe.isBuffer : void 0, Bt = Math.max, Ei = Date.now, It = rt(G, "Map"), Ae = rt(Object, "create"), Li = /* @__PURE__ */ function() {
|
|
875
875
|
function l() {
|
|
876
876
|
}
|
|
877
877
|
return function(d) {
|
|
878
|
-
if (!
|
|
878
|
+
if (!de(d))
|
|
879
879
|
return {};
|
|
880
|
-
if (
|
|
881
|
-
return
|
|
880
|
+
if (Ht)
|
|
881
|
+
return Ht(d);
|
|
882
882
|
l.prototype = d;
|
|
883
883
|
var m = new l();
|
|
884
884
|
return l.prototype = void 0, m;
|
|
885
885
|
};
|
|
886
886
|
}();
|
|
887
|
-
function
|
|
887
|
+
function he(l) {
|
|
888
888
|
var d = -1, m = l == null ? 0 : l.length;
|
|
889
889
|
for (this.clear(); ++d < m; ) {
|
|
890
|
-
var
|
|
891
|
-
this.set(
|
|
890
|
+
var A = l[d];
|
|
891
|
+
this.set(A[0], A[1]);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
894
|
function Ni() {
|
|
895
|
-
this.__data__ =
|
|
895
|
+
this.__data__ = Ae ? Ae(null) : {}, this.size = 0;
|
|
896
896
|
}
|
|
897
897
|
function Fi(l) {
|
|
898
898
|
var d = this.has(l) && delete this.__data__[l];
|
|
@@ -900,85 +900,85 @@ function fn() {
|
|
|
900
900
|
}
|
|
901
901
|
function Hi(l) {
|
|
902
902
|
var d = this.__data__;
|
|
903
|
-
if (
|
|
903
|
+
if (Ae) {
|
|
904
904
|
var m = d[l];
|
|
905
905
|
return m === s ? void 0 : m;
|
|
906
906
|
}
|
|
907
|
-
return
|
|
907
|
+
return ne.call(d, l) ? d[l] : void 0;
|
|
908
908
|
}
|
|
909
909
|
function Bi(l) {
|
|
910
910
|
var d = this.__data__;
|
|
911
|
-
return
|
|
911
|
+
return Ae ? d[l] !== void 0 : ne.call(d, l);
|
|
912
912
|
}
|
|
913
913
|
function Ii(l, d) {
|
|
914
914
|
var m = this.__data__;
|
|
915
|
-
return this.size += this.has(l) ? 0 : 1, m[l] =
|
|
915
|
+
return this.size += this.has(l) ? 0 : 1, m[l] = Ae && d === void 0 ? s : d, this;
|
|
916
916
|
}
|
|
917
|
-
|
|
918
|
-
function
|
|
917
|
+
he.prototype.clear = Ni, he.prototype.delete = Fi, he.prototype.get = Hi, he.prototype.has = Bi, he.prototype.set = Ii;
|
|
918
|
+
function ee(l) {
|
|
919
919
|
var d = -1, m = l == null ? 0 : l.length;
|
|
920
920
|
for (this.clear(); ++d < m; ) {
|
|
921
|
-
var
|
|
922
|
-
this.set(
|
|
921
|
+
var A = l[d];
|
|
922
|
+
this.set(A[0], A[1]);
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
925
|
function Ri() {
|
|
926
926
|
this.__data__ = [], this.size = 0;
|
|
927
927
|
}
|
|
928
928
|
function $i(l) {
|
|
929
|
-
var d = this.__data__, m =
|
|
929
|
+
var d = this.__data__, m = Ve(d, l);
|
|
930
930
|
if (m < 0)
|
|
931
931
|
return !1;
|
|
932
|
-
var
|
|
933
|
-
return m ==
|
|
932
|
+
var A = d.length - 1;
|
|
933
|
+
return m == A ? d.pop() : ki.call(d, m, 1), --this.size, !0;
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
var d = this.__data__, m =
|
|
935
|
+
function Oi(l) {
|
|
936
|
+
var d = this.__data__, m = Ve(d, l);
|
|
937
937
|
return m < 0 ? void 0 : d[m][1];
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
return
|
|
939
|
+
function Pi(l) {
|
|
940
|
+
return Ve(this.__data__, l) > -1;
|
|
941
941
|
}
|
|
942
942
|
function zi(l, d) {
|
|
943
|
-
var m = this.__data__,
|
|
944
|
-
return
|
|
943
|
+
var m = this.__data__, A = Ve(m, l);
|
|
944
|
+
return A < 0 ? (++this.size, m.push([l, d])) : m[A][1] = d, this;
|
|
945
945
|
}
|
|
946
|
-
|
|
947
|
-
function
|
|
946
|
+
ee.prototype.clear = Ri, ee.prototype.delete = $i, ee.prototype.get = Oi, ee.prototype.has = Pi, ee.prototype.set = zi;
|
|
947
|
+
function me(l) {
|
|
948
948
|
var d = -1, m = l == null ? 0 : l.length;
|
|
949
949
|
for (this.clear(); ++d < m; ) {
|
|
950
|
-
var
|
|
951
|
-
this.set(
|
|
950
|
+
var A = l[d];
|
|
951
|
+
this.set(A[0], A[1]);
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
function Vi() {
|
|
955
955
|
this.size = 0, this.__data__ = {
|
|
956
|
-
hash: new
|
|
957
|
-
map: new (
|
|
958
|
-
string: new
|
|
956
|
+
hash: new he(),
|
|
957
|
+
map: new (It || ee)(),
|
|
958
|
+
string: new he()
|
|
959
959
|
};
|
|
960
960
|
}
|
|
961
|
-
function ji(l) {
|
|
962
|
-
var d = Me(this, l).delete(l);
|
|
963
|
-
return this.size -= d ? 1 : 0, d;
|
|
964
|
-
}
|
|
965
961
|
function Yi(l) {
|
|
966
|
-
|
|
962
|
+
var d = We(this, l).delete(l);
|
|
963
|
+
return this.size -= d ? 1 : 0, d;
|
|
967
964
|
}
|
|
968
965
|
function Wi(l) {
|
|
969
|
-
return
|
|
966
|
+
return We(this, l).get(l);
|
|
967
|
+
}
|
|
968
|
+
function ji(l) {
|
|
969
|
+
return We(this, l).has(l);
|
|
970
970
|
}
|
|
971
971
|
function Xi(l, d) {
|
|
972
|
-
var m =
|
|
973
|
-
return m.set(l, d), this.size += m.size ==
|
|
972
|
+
var m = We(this, l), A = m.size;
|
|
973
|
+
return m.set(l, d), this.size += m.size == A ? 0 : 1, this;
|
|
974
974
|
}
|
|
975
|
-
|
|
976
|
-
function
|
|
977
|
-
var d = this.__data__ = new
|
|
975
|
+
me.prototype.clear = Vi, me.prototype.delete = Yi, me.prototype.get = Wi, me.prototype.has = ji, me.prototype.set = Xi;
|
|
976
|
+
function _e(l) {
|
|
977
|
+
var d = this.__data__ = new ee(l);
|
|
978
978
|
this.size = d.size;
|
|
979
979
|
}
|
|
980
980
|
function Ui() {
|
|
981
|
-
this.__data__ = new
|
|
981
|
+
this.__data__ = new ee(), this.size = 0;
|
|
982
982
|
}
|
|
983
983
|
function Gi(l) {
|
|
984
984
|
var d = this.__data__, m = d.delete(l);
|
|
@@ -992,40 +992,40 @@ function fn() {
|
|
|
992
992
|
}
|
|
993
993
|
function Ji(l, d) {
|
|
994
994
|
var m = this.__data__;
|
|
995
|
-
if (m instanceof
|
|
996
|
-
var
|
|
997
|
-
if (!
|
|
998
|
-
return
|
|
999
|
-
m = this.__data__ = new
|
|
995
|
+
if (m instanceof ee) {
|
|
996
|
+
var A = m.__data__;
|
|
997
|
+
if (!It || A.length < t - 1)
|
|
998
|
+
return A.push([l, d]), this.size = ++m.size, this;
|
|
999
|
+
m = this.__data__ = new me(A);
|
|
1000
1000
|
}
|
|
1001
1001
|
return m.set(l, d), this.size = m.size, this;
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1003
|
+
_e.prototype.clear = Ui, _e.prototype.delete = Gi, _e.prototype.get = Zi, _e.prototype.has = qi, _e.prototype.set = Ji;
|
|
1004
1004
|
function Qi(l, d) {
|
|
1005
|
-
var m =
|
|
1006
|
-
for (var
|
|
1005
|
+
var m = ct(l), A = !m && lt(l), T = !m && !A && zt(l), F = !m && !A && !T && Yt(l), H = m || A || T || F, E = H ? le(l.length, String) : [], B = E.length;
|
|
1006
|
+
for (var q in l)
|
|
1007
1007
|
H && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1008
|
-
(
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
return
|
|
1008
|
+
(q == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1009
|
+
T && (q == "offset" || q == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1010
|
+
F && (q == "buffer" || q == "byteLength" || q == "byteOffset") || // Skip index properties.
|
|
1011
|
+
Ot(q, B)) || E.push(q);
|
|
1012
|
+
return E;
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1015
|
-
(m !== void 0 && !
|
|
1014
|
+
function nt(l, d, m) {
|
|
1015
|
+
(m !== void 0 && !je(l[d], m) || m === void 0 && !(d in l)) && at(l, d, m);
|
|
1016
1016
|
}
|
|
1017
1017
|
function Ki(l, d, m) {
|
|
1018
|
-
var
|
|
1019
|
-
(!(
|
|
1018
|
+
var A = l[d];
|
|
1019
|
+
(!(ne.call(l, d) && je(A, m)) || m === void 0 && !(d in l)) && at(l, d, m);
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function Ve(l, d) {
|
|
1022
1022
|
for (var m = l.length; m--; )
|
|
1023
|
-
if (
|
|
1023
|
+
if (je(l[m][0], d))
|
|
1024
1024
|
return m;
|
|
1025
1025
|
return -1;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
d == "__proto__" &&
|
|
1027
|
+
function at(l, d, m) {
|
|
1028
|
+
d == "__proto__" && ze ? ze(l, d, {
|
|
1029
1029
|
configurable: !0,
|
|
1030
1030
|
enumerable: !0,
|
|
1031
1031
|
value: m,
|
|
@@ -1033,149 +1033,149 @@ function fn() {
|
|
|
1033
1033
|
}) : l[d] = m;
|
|
1034
1034
|
}
|
|
1035
1035
|
var es = fs();
|
|
1036
|
-
function
|
|
1037
|
-
return l == null ? l === void 0 ? $ : C :
|
|
1036
|
+
function Ye(l) {
|
|
1037
|
+
return l == null ? l === void 0 ? $ : C : ce && ce in Object(l) ? gs(l) : ys(l);
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return
|
|
1039
|
+
function Rt(l) {
|
|
1040
|
+
return Me(l) && Ye(l) == o;
|
|
1041
1041
|
}
|
|
1042
1042
|
function ts(l) {
|
|
1043
|
-
if (!
|
|
1043
|
+
if (!de(l) || vs(l))
|
|
1044
1044
|
return !1;
|
|
1045
|
-
var d =
|
|
1046
|
-
return d.test(
|
|
1045
|
+
var d = dt(l) ? Si : Re;
|
|
1046
|
+
return d.test(As(l));
|
|
1047
1047
|
}
|
|
1048
1048
|
function is(l) {
|
|
1049
|
-
return
|
|
1049
|
+
return Me(l) && Vt(l.length) && !!N[Ye(l)];
|
|
1050
1050
|
}
|
|
1051
1051
|
function ss(l) {
|
|
1052
|
-
if (!
|
|
1052
|
+
if (!de(l))
|
|
1053
1053
|
return bs(l);
|
|
1054
|
-
var d =
|
|
1055
|
-
for (var
|
|
1056
|
-
|
|
1054
|
+
var d = Pt(l), m = [];
|
|
1055
|
+
for (var A in l)
|
|
1056
|
+
A == "constructor" && (d || !ne.call(l, A)) || m.push(A);
|
|
1057
1057
|
return m;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1060
|
-
l !== d && es(d, function(
|
|
1061
|
-
if (
|
|
1062
|
-
ns(l, d, H, m,
|
|
1059
|
+
function $t(l, d, m, A, T) {
|
|
1060
|
+
l !== d && es(d, function(F, H) {
|
|
1061
|
+
if (T || (T = new _e()), de(F))
|
|
1062
|
+
ns(l, d, H, m, $t, A, T);
|
|
1063
1063
|
else {
|
|
1064
|
-
var
|
|
1065
|
-
|
|
1064
|
+
var E = A ? A(ot(l, H), F, H + "", l, d, T) : void 0;
|
|
1065
|
+
E === void 0 && (E = F), nt(l, H, E);
|
|
1066
1066
|
}
|
|
1067
|
-
},
|
|
1067
|
+
}, Wt);
|
|
1068
1068
|
}
|
|
1069
|
-
function ns(l, d, m,
|
|
1070
|
-
var
|
|
1071
|
-
if (
|
|
1072
|
-
|
|
1069
|
+
function ns(l, d, m, A, T, F, H) {
|
|
1070
|
+
var E = ot(l, m), B = ot(d, m), q = H.get(B);
|
|
1071
|
+
if (q) {
|
|
1072
|
+
nt(l, m, q);
|
|
1073
1073
|
return;
|
|
1074
1074
|
}
|
|
1075
|
-
var
|
|
1076
|
-
if (
|
|
1077
|
-
var
|
|
1078
|
-
|
|
1075
|
+
var V = F ? F(E, B, m + "", l, d, H) : void 0, Se = V === void 0;
|
|
1076
|
+
if (Se) {
|
|
1077
|
+
var ut = ct(B), ft = !ut && zt(B), Xt = !ut && !ft && Yt(B);
|
|
1078
|
+
V = B, ut || ft || Xt ? ct(E) ? V = E : Ms(E) ? V = hs(E) : ft ? (Se = !1, V = os(B)) : Xt ? (Se = !1, V = cs(B)) : V = [] : Ss(B) || lt(B) ? (V = E, lt(E) ? V = Ts(E) : (!de(E) || dt(E)) && (V = ms(B))) : Se = !1;
|
|
1079
1079
|
}
|
|
1080
|
-
|
|
1080
|
+
Se && (H.set(B, V), T(V, B, A, F, H), H.delete(B)), nt(l, m, V);
|
|
1081
1081
|
}
|
|
1082
1082
|
function as(l, d) {
|
|
1083
|
-
return xs(ws(l, d,
|
|
1083
|
+
return xs(ws(l, d, jt), l + "");
|
|
1084
1084
|
}
|
|
1085
|
-
var rs =
|
|
1086
|
-
return
|
|
1085
|
+
var rs = ze ? function(l, d) {
|
|
1086
|
+
return ze(l, "toString", {
|
|
1087
1087
|
configurable: !0,
|
|
1088
1088
|
enumerable: !1,
|
|
1089
1089
|
value: Ds(d),
|
|
1090
1090
|
writable: !0
|
|
1091
1091
|
});
|
|
1092
|
-
} :
|
|
1092
|
+
} : jt;
|
|
1093
1093
|
function os(l, d) {
|
|
1094
1094
|
return l.slice();
|
|
1095
1095
|
}
|
|
1096
1096
|
function ls(l) {
|
|
1097
1097
|
var d = new l.constructor(l.byteLength);
|
|
1098
|
-
return new
|
|
1098
|
+
return new Nt(d).set(new Nt(l)), d;
|
|
1099
1099
|
}
|
|
1100
1100
|
function cs(l, d) {
|
|
1101
1101
|
var m = ls(l.buffer);
|
|
1102
1102
|
return new l.constructor(m, l.byteOffset, l.length);
|
|
1103
1103
|
}
|
|
1104
1104
|
function hs(l, d) {
|
|
1105
|
-
var m = -1,
|
|
1106
|
-
for (d || (d = Array(
|
|
1105
|
+
var m = -1, A = l.length;
|
|
1106
|
+
for (d || (d = Array(A)); ++m < A; )
|
|
1107
1107
|
d[m] = l[m];
|
|
1108
1108
|
return d;
|
|
1109
1109
|
}
|
|
1110
|
-
function ds(l, d, m,
|
|
1111
|
-
var
|
|
1110
|
+
function ds(l, d, m, A) {
|
|
1111
|
+
var T = !m;
|
|
1112
1112
|
m || (m = {});
|
|
1113
|
-
for (var
|
|
1114
|
-
var
|
|
1115
|
-
B === void 0 && (B = l[
|
|
1113
|
+
for (var F = -1, H = d.length; ++F < H; ) {
|
|
1114
|
+
var E = d[F], B = void 0;
|
|
1115
|
+
B === void 0 && (B = l[E]), T ? at(m, E, B) : Ki(m, E, B);
|
|
1116
1116
|
}
|
|
1117
1117
|
return m;
|
|
1118
1118
|
}
|
|
1119
1119
|
function us(l) {
|
|
1120
1120
|
return as(function(d, m) {
|
|
1121
|
-
var
|
|
1122
|
-
for (
|
|
1123
|
-
var
|
|
1124
|
-
|
|
1121
|
+
var A = -1, T = m.length, F = T > 1 ? m[T - 1] : void 0, H = T > 2 ? m[2] : void 0;
|
|
1122
|
+
for (F = l.length > 3 && typeof F == "function" ? (T--, F) : void 0, H && _s(m[0], m[1], H) && (F = T < 3 ? void 0 : F, T = 1), d = Object(d); ++A < T; ) {
|
|
1123
|
+
var E = m[A];
|
|
1124
|
+
E && l(d, E, A, F);
|
|
1125
1125
|
}
|
|
1126
1126
|
return d;
|
|
1127
1127
|
});
|
|
1128
1128
|
}
|
|
1129
1129
|
function fs(l) {
|
|
1130
|
-
return function(d, m,
|
|
1131
|
-
for (var
|
|
1132
|
-
var B = H[++
|
|
1133
|
-
if (m(
|
|
1130
|
+
return function(d, m, A) {
|
|
1131
|
+
for (var T = -1, F = Object(d), H = A(d), E = H.length; E--; ) {
|
|
1132
|
+
var B = H[++T];
|
|
1133
|
+
if (m(F[B], B, F) === !1)
|
|
1134
1134
|
break;
|
|
1135
1135
|
}
|
|
1136
1136
|
return d;
|
|
1137
1137
|
};
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function We(l, d) {
|
|
1140
1140
|
var m = l.__data__;
|
|
1141
1141
|
return ps(d) ? m[typeof d == "string" ? "string" : "hash"] : m.map;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1144
|
-
var m =
|
|
1143
|
+
function rt(l, d) {
|
|
1144
|
+
var m = Ce(l, d);
|
|
1145
1145
|
return ts(m) ? m : void 0;
|
|
1146
1146
|
}
|
|
1147
1147
|
function gs(l) {
|
|
1148
|
-
var d =
|
|
1148
|
+
var d = ne.call(l, ce), m = l[ce];
|
|
1149
1149
|
try {
|
|
1150
|
-
l[
|
|
1151
|
-
var
|
|
1150
|
+
l[ce] = void 0;
|
|
1151
|
+
var A = !0;
|
|
1152
1152
|
} catch {
|
|
1153
1153
|
}
|
|
1154
|
-
var
|
|
1155
|
-
return
|
|
1154
|
+
var T = Et.call(l);
|
|
1155
|
+
return A && (d ? l[ce] = m : delete l[ce]), T;
|
|
1156
1156
|
}
|
|
1157
1157
|
function ms(l) {
|
|
1158
|
-
return typeof l.constructor == "function" && !
|
|
1158
|
+
return typeof l.constructor == "function" && !Pt(l) ? Li(Ft(l)) : {};
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1160
|
+
function Ot(l, d) {
|
|
1161
1161
|
var m = typeof l;
|
|
1162
|
-
return d = d ?? r, !!d && (m == "number" || m != "symbol" &&
|
|
1162
|
+
return d = d ?? r, !!d && (m == "number" || m != "symbol" && tt.test(l)) && l > -1 && l % 1 == 0 && l < d;
|
|
1163
1163
|
}
|
|
1164
1164
|
function _s(l, d, m) {
|
|
1165
|
-
if (!
|
|
1165
|
+
if (!de(m))
|
|
1166
1166
|
return !1;
|
|
1167
|
-
var
|
|
1168
|
-
return (
|
|
1167
|
+
var A = typeof d;
|
|
1168
|
+
return (A == "number" ? ht(m) && Ot(d, m.length) : A == "string" && d in m) ? je(m[d], l) : !1;
|
|
1169
1169
|
}
|
|
1170
1170
|
function ps(l) {
|
|
1171
1171
|
var d = typeof l;
|
|
1172
1172
|
return d == "string" || d == "number" || d == "symbol" || d == "boolean" ? l !== "__proto__" : l === null;
|
|
1173
1173
|
}
|
|
1174
1174
|
function vs(l) {
|
|
1175
|
-
return !!
|
|
1175
|
+
return !!Dt && Dt in l;
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1178
|
-
var d = l && l.constructor, m = typeof d == "function" && d.prototype ||
|
|
1177
|
+
function Pt(l) {
|
|
1178
|
+
var d = l && l.constructor, m = typeof d == "function" && d.prototype || $e;
|
|
1179
1179
|
return l === m;
|
|
1180
1180
|
}
|
|
1181
1181
|
function bs(l) {
|
|
@@ -1186,19 +1186,19 @@ function fn() {
|
|
|
1186
1186
|
return d;
|
|
1187
1187
|
}
|
|
1188
1188
|
function ys(l) {
|
|
1189
|
-
return
|
|
1189
|
+
return Et.call(l);
|
|
1190
1190
|
}
|
|
1191
1191
|
function ws(l, d, m) {
|
|
1192
|
-
return d =
|
|
1193
|
-
for (var
|
|
1194
|
-
H[
|
|
1195
|
-
|
|
1196
|
-
for (var
|
|
1197
|
-
|
|
1198
|
-
return
|
|
1192
|
+
return d = Bt(d === void 0 ? l.length - 1 : d, 0), function() {
|
|
1193
|
+
for (var A = arguments, T = -1, F = Bt(A.length - d, 0), H = Array(F); ++T < F; )
|
|
1194
|
+
H[T] = A[d + T];
|
|
1195
|
+
T = -1;
|
|
1196
|
+
for (var E = Array(d + 1); ++T < d; )
|
|
1197
|
+
E[T] = A[T];
|
|
1198
|
+
return E[d] = m(H), oe(l, this, E);
|
|
1199
1199
|
};
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function ot(l, d) {
|
|
1202
1202
|
if (!(d === "constructor" && typeof l[d] == "function") && d != "__proto__")
|
|
1203
1203
|
return l[d];
|
|
1204
1204
|
}
|
|
@@ -1206,8 +1206,8 @@ function fn() {
|
|
|
1206
1206
|
function Cs(l) {
|
|
1207
1207
|
var d = 0, m = 0;
|
|
1208
1208
|
return function() {
|
|
1209
|
-
var
|
|
1210
|
-
if (m =
|
|
1209
|
+
var A = Ei(), T = a - (A - m);
|
|
1210
|
+
if (m = A, T > 0) {
|
|
1211
1211
|
if (++d >= n)
|
|
1212
1212
|
return arguments[0];
|
|
1213
1213
|
} else
|
|
@@ -1215,10 +1215,10 @@ function fn() {
|
|
|
1215
1215
|
return l.apply(void 0, arguments);
|
|
1216
1216
|
};
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1218
|
+
function As(l) {
|
|
1219
1219
|
if (l != null) {
|
|
1220
1220
|
try {
|
|
1221
|
-
return
|
|
1221
|
+
return Oe.call(l);
|
|
1222
1222
|
} catch {
|
|
1223
1223
|
}
|
|
1224
1224
|
try {
|
|
@@ -1228,78 +1228,78 @@ function fn() {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
return "";
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1231
|
+
function je(l, d) {
|
|
1232
1232
|
return l === d || l !== l && d !== d;
|
|
1233
1233
|
}
|
|
1234
|
-
var
|
|
1234
|
+
var lt = Rt(/* @__PURE__ */ function() {
|
|
1235
1235
|
return arguments;
|
|
1236
|
-
}()) ?
|
|
1237
|
-
return
|
|
1238
|
-
},
|
|
1239
|
-
function
|
|
1240
|
-
return l != null &&
|
|
1236
|
+
}()) ? Rt : function(l) {
|
|
1237
|
+
return Me(l) && ne.call(l, "callee") && !Ti.call(l, "callee");
|
|
1238
|
+
}, ct = Array.isArray;
|
|
1239
|
+
function ht(l) {
|
|
1240
|
+
return l != null && Vt(l.length) && !dt(l);
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1243
|
-
return
|
|
1242
|
+
function Ms(l) {
|
|
1243
|
+
return Me(l) && ht(l);
|
|
1244
1244
|
}
|
|
1245
|
-
var
|
|
1246
|
-
function
|
|
1247
|
-
if (!
|
|
1245
|
+
var zt = Di || Es;
|
|
1246
|
+
function dt(l) {
|
|
1247
|
+
if (!de(l))
|
|
1248
1248
|
return !1;
|
|
1249
|
-
var d =
|
|
1250
|
-
return d ==
|
|
1249
|
+
var d = Ye(l);
|
|
1250
|
+
return d == _ || d == v || d == h || d == w;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function Vt(l) {
|
|
1253
1253
|
return typeof l == "number" && l > -1 && l % 1 == 0 && l <= r;
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function de(l) {
|
|
1256
1256
|
var d = typeof l;
|
|
1257
1257
|
return l != null && (d == "object" || d == "function");
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1259
|
+
function Me(l) {
|
|
1260
1260
|
return l != null && typeof l == "object";
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1263
|
-
if (!
|
|
1262
|
+
function Ss(l) {
|
|
1263
|
+
if (!Me(l) || Ye(l) != y)
|
|
1264
1264
|
return !1;
|
|
1265
|
-
var d =
|
|
1265
|
+
var d = Ft(l);
|
|
1266
1266
|
if (d === null)
|
|
1267
1267
|
return !0;
|
|
1268
|
-
var m =
|
|
1269
|
-
return typeof m == "function" && m instanceof m &&
|
|
1268
|
+
var m = ne.call(d, "constructor") && d.constructor;
|
|
1269
|
+
return typeof m == "function" && m instanceof m && Oe.call(m) == Mi;
|
|
1270
1270
|
}
|
|
1271
|
-
var
|
|
1272
|
-
function
|
|
1273
|
-
return ds(l,
|
|
1271
|
+
var Yt = xe ? it(xe) : is;
|
|
1272
|
+
function Ts(l) {
|
|
1273
|
+
return ds(l, Wt(l));
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return
|
|
1275
|
+
function Wt(l) {
|
|
1276
|
+
return ht(l) ? Qi(l) : ss(l);
|
|
1277
1277
|
}
|
|
1278
1278
|
var ks = us(function(l, d, m) {
|
|
1279
|
-
|
|
1279
|
+
$t(l, d, m);
|
|
1280
1280
|
});
|
|
1281
1281
|
function Ds(l) {
|
|
1282
1282
|
return function() {
|
|
1283
1283
|
return l;
|
|
1284
1284
|
};
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1286
|
+
function jt(l) {
|
|
1287
1287
|
return l;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function Es() {
|
|
1290
1290
|
return !1;
|
|
1291
1291
|
}
|
|
1292
1292
|
i.exports = ks;
|
|
1293
|
-
}(
|
|
1293
|
+
}(ke, ke.exports)), ke.exports;
|
|
1294
1294
|
}
|
|
1295
1295
|
var gn = fn();
|
|
1296
|
-
const
|
|
1296
|
+
const Ze = /* @__PURE__ */ un(gn), ti = 12, mn = {
|
|
1297
1297
|
candles: {
|
|
1298
1298
|
direction: "right",
|
|
1299
|
-
offset: `${Math.round(
|
|
1299
|
+
offset: `${Math.round(ti / 2)}px`,
|
|
1300
1300
|
style: "filled",
|
|
1301
1301
|
strokeWidth: 1,
|
|
1302
|
-
baseWidth:
|
|
1302
|
+
baseWidth: ti,
|
|
1303
1303
|
bodyRatio: 0.7,
|
|
1304
1304
|
zoomOnWheel: "both",
|
|
1305
1305
|
scaleSensitivity: 2e-3,
|
|
@@ -1347,11 +1347,11 @@ class _n {
|
|
|
1347
1347
|
f(this, "_yAxis");
|
|
1348
1348
|
f(this, "_guides");
|
|
1349
1349
|
f(this, "_trade");
|
|
1350
|
-
const t =
|
|
1350
|
+
const t = Ze({}, mn, e);
|
|
1351
1351
|
this._candles = t.candles, this._xAxis = t.xAxis, this._yAxis = t.yAxis, this._guides = t.guides, this._trade = t.trade;
|
|
1352
1352
|
}
|
|
1353
1353
|
update(e) {
|
|
1354
|
-
const t =
|
|
1354
|
+
const t = Ze(
|
|
1355
1355
|
{},
|
|
1356
1356
|
{
|
|
1357
1357
|
candles: this._candles,
|
|
@@ -1380,7 +1380,7 @@ class _n {
|
|
|
1380
1380
|
return this._trade;
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
|
-
class
|
|
1383
|
+
class W {
|
|
1384
1384
|
constructor(e) {
|
|
1385
1385
|
f(this, "x");
|
|
1386
1386
|
f(this, "y");
|
|
@@ -1423,32 +1423,32 @@ class V {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
class pn {
|
|
1425
1425
|
constructor(e, t) {
|
|
1426
|
-
f(this, "_chart", new
|
|
1427
|
-
f(this, "_area", new
|
|
1428
|
-
f(this, "_xAxis", new
|
|
1429
|
-
f(this, "_yAxis", new
|
|
1430
|
-
f(this, "_axisIntersection", new
|
|
1426
|
+
f(this, "_chart", new W());
|
|
1427
|
+
f(this, "_area", new W());
|
|
1428
|
+
f(this, "_xAxis", new W());
|
|
1429
|
+
f(this, "_yAxis", new W());
|
|
1430
|
+
f(this, "_axisIntersection", new W());
|
|
1431
1431
|
const { xAxis: s, yAxis: n } = t;
|
|
1432
|
-
this._chart = new
|
|
1432
|
+
this._chart = new W(e), this._calc(s, n);
|
|
1433
1433
|
}
|
|
1434
1434
|
_calc(e, t) {
|
|
1435
1435
|
const s = e.isShow ? e.height : 0, n = t.isShow ? t.width : 0, a = this._chart.height - s, r = this._chart.width - n;
|
|
1436
|
-
this._area = new
|
|
1436
|
+
this._area = new W({
|
|
1437
1437
|
x: t.position === "left" ? n : 0,
|
|
1438
1438
|
y: e.position === "top" ? s : 0,
|
|
1439
1439
|
width: r,
|
|
1440
1440
|
height: a
|
|
1441
|
-
}), this._xAxis = new
|
|
1441
|
+
}), this._xAxis = new W({
|
|
1442
1442
|
y: e.position === "top" ? 0 : a,
|
|
1443
1443
|
x: t.position === "left" ? n : 0,
|
|
1444
1444
|
height: s,
|
|
1445
1445
|
width: r
|
|
1446
|
-
}), this._yAxis = new
|
|
1446
|
+
}), this._yAxis = new W({
|
|
1447
1447
|
y: e.position === "top" ? s : 0,
|
|
1448
1448
|
x: t.position === "left" ? 0 : r,
|
|
1449
1449
|
width: n,
|
|
1450
1450
|
height: a
|
|
1451
|
-
}), this._axisIntersection = new
|
|
1451
|
+
}), this._axisIntersection = new W({
|
|
1452
1452
|
y: e.position === "top" ? 0 : a,
|
|
1453
1453
|
x: t.position === "left" ? 0 : r,
|
|
1454
1454
|
width: n,
|
|
@@ -1461,7 +1461,7 @@ class pn {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
update(e) {
|
|
1463
1463
|
const { xAxis: t, yAxis: s } = e.config;
|
|
1464
|
-
this._chart = new
|
|
1464
|
+
this._chart = new W(e.container), this._calc(t, s);
|
|
1465
1465
|
}
|
|
1466
1466
|
get area() {
|
|
1467
1467
|
return this._area;
|
|
@@ -1494,7 +1494,7 @@ function bn(i, e) {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
return t;
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function ii(i, e) {
|
|
1498
1498
|
const t = vn(i[0]), s = bn(i, t), n = [];
|
|
1499
1499
|
return s.forEach((a) => {
|
|
1500
1500
|
if (a.length === 0) return;
|
|
@@ -1505,19 +1505,19 @@ function Ot(i, e) {
|
|
|
1505
1505
|
throw new Error("[CS_Data] error while creating missing data");
|
|
1506
1506
|
const c = r.close, h = o.open;
|
|
1507
1507
|
let u = c;
|
|
1508
|
-
a.forEach((g,
|
|
1509
|
-
const
|
|
1510
|
-
let v = u +
|
|
1511
|
-
const
|
|
1512
|
-
let C = Math.max(v, b) +
|
|
1508
|
+
a.forEach((g, p) => {
|
|
1509
|
+
const _ = (h - u) / a.length;
|
|
1510
|
+
let v = u + _ * p, b = v + _;
|
|
1511
|
+
const x = Math.abs(v - b);
|
|
1512
|
+
let C = Math.max(v, b) + x / 2, y = Math.min(v, b) - x / 2;
|
|
1513
1513
|
if (e.trade) {
|
|
1514
|
-
const
|
|
1515
|
-
const R =
|
|
1514
|
+
const S = [...e.trade.entries, ...e.trade.exits].find((L) => {
|
|
1515
|
+
const R = L.time.getTime();
|
|
1516
1516
|
return R >= g && R < g + t;
|
|
1517
1517
|
});
|
|
1518
|
-
|
|
1518
|
+
S && (S.type === "buy" ? (y = S.price, b = Math.max(y, b), v = b + x, C = Math.max(v, b) + x / 2, u = v) : S.type === "sell" && (C = S.price, b = Math.min(C, b), v = b - x, y = Math.min(v, b) - x / 2, u = v));
|
|
1519
1519
|
}
|
|
1520
|
-
const
|
|
1520
|
+
const w = {
|
|
1521
1521
|
open_time: new Date(g),
|
|
1522
1522
|
close_time: new Date(g + t),
|
|
1523
1523
|
open: v,
|
|
@@ -1525,11 +1525,11 @@ function Ot(i, e) {
|
|
|
1525
1525
|
high: C,
|
|
1526
1526
|
low: y
|
|
1527
1527
|
};
|
|
1528
|
-
n.push(
|
|
1528
|
+
n.push(w);
|
|
1529
1529
|
});
|
|
1530
1530
|
}), n;
|
|
1531
1531
|
}
|
|
1532
|
-
class
|
|
1532
|
+
class Mt {
|
|
1533
1533
|
constructor(e, t) {
|
|
1534
1534
|
f(this, "_initialData", []);
|
|
1535
1535
|
f(this, "_preparedData", []);
|
|
@@ -1543,10 +1543,10 @@ class nt {
|
|
|
1543
1543
|
return e.map((t) => ({ ...t, open_time: new Date(t.open_time), close_time: new Date(t.close_time) })).sort((t, s) => t.open_time.getTime() - s.open_time.getTime());
|
|
1544
1544
|
}
|
|
1545
1545
|
update(e) {
|
|
1546
|
-
this._initialData = e, this._preparedData = this._prepare(e), this._missingData =
|
|
1546
|
+
this._initialData = e, this._preparedData = this._prepare(e), this._missingData = ii(this._preparedData, this._model), this._count = this._preparedData.length + this._missingData.length, this._interval = new Date(e[0].close_time).getTime() - new Date(e[0].open_time).getTime();
|
|
1547
1547
|
}
|
|
1548
1548
|
updateMissingCandles() {
|
|
1549
|
-
this._missingData =
|
|
1549
|
+
this._missingData = ii(this._preparedData, this._model);
|
|
1550
1550
|
}
|
|
1551
1551
|
get initialData() {
|
|
1552
1552
|
return this._initialData;
|
|
@@ -1589,7 +1589,7 @@ class yn {
|
|
|
1589
1589
|
});
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
|
-
class
|
|
1592
|
+
class mi {
|
|
1593
1593
|
constructor() {
|
|
1594
1594
|
f(this, "_scale");
|
|
1595
1595
|
}
|
|
@@ -1625,17 +1625,17 @@ class Kt {
|
|
|
1625
1625
|
return this._scale(e);
|
|
1626
1626
|
}
|
|
1627
1627
|
}
|
|
1628
|
-
class
|
|
1628
|
+
class _i extends mi {
|
|
1629
1629
|
constructor() {
|
|
1630
1630
|
super(), this._scale = D.scaleTime();
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
1633
|
-
class wn extends
|
|
1633
|
+
class wn extends mi {
|
|
1634
1634
|
constructor() {
|
|
1635
1635
|
super(), this._scale = D.scaleLinear();
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
|
-
const
|
|
1638
|
+
const si = { x: 0.2, y: 0.2 }, ni = 1e-3, xn = {
|
|
1639
1639
|
s: 1e3,
|
|
1640
1640
|
M: 1e3 * 60,
|
|
1641
1641
|
h: 1e3 * 60 * 60,
|
|
@@ -1645,7 +1645,7 @@ const zt = { x: 0.2, y: 0.2 }, Vt = 1e-3, xn = {
|
|
|
1645
1645
|
const e = i.match(/^(\d+)([a-zA-Z]+)$/);
|
|
1646
1646
|
if (!e) throw new Error(`Invalid offset format: "${i}"`);
|
|
1647
1647
|
return [parseInt(e[1]), e[2]];
|
|
1648
|
-
},
|
|
1648
|
+
}, An = (i, e) => {
|
|
1649
1649
|
const [t, s] = e.domain().map((o) => o.getTime()), n = i.filter((o) => {
|
|
1650
1650
|
const c = o.open_time.getTime();
|
|
1651
1651
|
return c >= t && c <= s;
|
|
@@ -1653,7 +1653,7 @@ const zt = { x: 0.2, y: 0.2 }, Vt = 1e-3, xn = {
|
|
|
1653
1653
|
if (a == null || r == null) throw new Error("Invalid Y data");
|
|
1654
1654
|
return [a, r];
|
|
1655
1655
|
};
|
|
1656
|
-
class
|
|
1656
|
+
class Mn {
|
|
1657
1657
|
constructor(e) {
|
|
1658
1658
|
this.model = e;
|
|
1659
1659
|
}
|
|
@@ -1663,14 +1663,14 @@ class An {
|
|
|
1663
1663
|
e.setDomain(s), this.setRange(e, this.model.layout.xAxis), this.setDefaultXDomain(e), this.applyOffset(e);
|
|
1664
1664
|
}
|
|
1665
1665
|
initY(e, t) {
|
|
1666
|
-
const s =
|
|
1666
|
+
const s = An(this.model.candles.preparedData, t);
|
|
1667
1667
|
e.setDomain(s), this.setRange(e, this.model.layout.yAxis);
|
|
1668
1668
|
}
|
|
1669
1669
|
init(e) {
|
|
1670
1670
|
this.initX(e.x), this.initY(e.y, e.x);
|
|
1671
1671
|
}
|
|
1672
1672
|
setRange(e, { x: t, y: s, width: n, height: a }) {
|
|
1673
|
-
e instanceof
|
|
1673
|
+
e instanceof _i ? e.setRange([t, t + n]) : e.setRange([s + a, s]);
|
|
1674
1674
|
}
|
|
1675
1675
|
setDefaultXDomain(e) {
|
|
1676
1676
|
const {
|
|
@@ -1679,8 +1679,8 @@ class An {
|
|
|
1679
1679
|
config: {
|
|
1680
1680
|
candles: { baseWidth: n, bodyRatio: a, direction: r }
|
|
1681
1681
|
}
|
|
1682
|
-
} = this.model, [o, c] = e.domain().map((
|
|
1683
|
-
e.setDomain(
|
|
1682
|
+
} = this.model, [o, c] = e.domain().map((_) => _.getTime()), h = c - o, u = n / a * t, g = h * (s.width / u), p = r === "left" ? [new Date(o), new Date(o + g)] : [new Date(c - g), new Date(c)];
|
|
1683
|
+
e.setDomain(p);
|
|
1684
1684
|
}
|
|
1685
1685
|
applyOffset(e) {
|
|
1686
1686
|
const {
|
|
@@ -1692,7 +1692,7 @@ class An {
|
|
|
1692
1692
|
e.setDomain([new Date(h.getTime() + c), new Date(u.getTime() + c)]);
|
|
1693
1693
|
}
|
|
1694
1694
|
}
|
|
1695
|
-
class
|
|
1695
|
+
class Sn {
|
|
1696
1696
|
constructor(e) {
|
|
1697
1697
|
f(this, "_model");
|
|
1698
1698
|
f(this, "_scaleX");
|
|
@@ -1704,7 +1704,7 @@ class Tn {
|
|
|
1704
1704
|
});
|
|
1705
1705
|
f(this, "scaleFactor", { x: 1, y: 1 });
|
|
1706
1706
|
f(this, "panOffset", { x: 0, y: 0 });
|
|
1707
|
-
this._model = e, this._scaleX = new
|
|
1707
|
+
this._model = e, this._scaleX = new _i(), this._scaleY = new wn(), this._initializer = new Mn(e), this._initializer.init({ x: this._scaleX, y: this._scaleY }), this._baseDomain = {
|
|
1708
1708
|
x: this._scaleX.domain(),
|
|
1709
1709
|
y: this._scaleY.domain()
|
|
1710
1710
|
};
|
|
@@ -1745,12 +1745,12 @@ class Tn {
|
|
|
1745
1745
|
}
|
|
1746
1746
|
scale(e, t, s = "delta") {
|
|
1747
1747
|
if (s === "absolute") {
|
|
1748
|
-
const n = Math.max(
|
|
1749
|
-
if (Math.abs(n - this.scaleFactor[e]) <
|
|
1748
|
+
const n = Math.max(si[e], t);
|
|
1749
|
+
if (Math.abs(n - this.scaleFactor[e]) < ni) return;
|
|
1750
1750
|
this.scaleFactor[e] = n;
|
|
1751
1751
|
} else {
|
|
1752
1752
|
const n = this.scaleFactor[e], a = n + t * this._model.config.candles.scaleSensitivity;
|
|
1753
|
-
if (a <
|
|
1753
|
+
if (a < si[e] || Math.abs(a - n) < ni) return;
|
|
1754
1754
|
this.scaleFactor[e] = a;
|
|
1755
1755
|
}
|
|
1756
1756
|
this._updateDomain(e);
|
|
@@ -1776,7 +1776,7 @@ class Tn {
|
|
|
1776
1776
|
this._model.eventBus.emit("scale_event");
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
1779
|
-
class
|
|
1779
|
+
class Tn {
|
|
1780
1780
|
constructor(e, { entry: t = [], exit: s = [] }) {
|
|
1781
1781
|
f(this, "_model");
|
|
1782
1782
|
f(this, "_rawEntry");
|
|
@@ -1976,10 +1976,10 @@ const Dn = {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
1978
|
};
|
|
1979
|
-
class
|
|
1979
|
+
class En {
|
|
1980
1980
|
constructor(e) {
|
|
1981
1981
|
f(this, "_scheme");
|
|
1982
|
-
this._scheme =
|
|
1982
|
+
this._scheme = Ze({}, Dn, e), Object.keys(this._scheme).forEach((t) => {
|
|
1983
1983
|
Object.defineProperty(this, t, {
|
|
1984
1984
|
get: () => this._scheme[t],
|
|
1985
1985
|
enumerable: !0
|
|
@@ -1987,10 +1987,10 @@ class Ln {
|
|
|
1987
1987
|
});
|
|
1988
1988
|
}
|
|
1989
1989
|
update(e) {
|
|
1990
|
-
this._scheme =
|
|
1990
|
+
this._scheme = Ze({}, this._scheme, e);
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
class
|
|
1993
|
+
class Ln {
|
|
1994
1994
|
constructor(e, t) {
|
|
1995
1995
|
f(this, "_data");
|
|
1996
1996
|
f(this, "_callbacks", {
|
|
@@ -2008,7 +2008,7 @@ class En {
|
|
|
2008
2008
|
_updateGroups() {
|
|
2009
2009
|
this._grouped = {};
|
|
2010
2010
|
for (const e of this._data) {
|
|
2011
|
-
const t =
|
|
2011
|
+
const t = Mt.findByDate(new Date(e.date), this._model.candles.allData);
|
|
2012
2012
|
if (!t) continue;
|
|
2013
2013
|
const s = t.open_time.getTime();
|
|
2014
2014
|
this._grouped[s] || (this._grouped[s] = []), this._grouped[s].push({ ...e, candle: t });
|
|
@@ -2055,7 +2055,7 @@ class Nn {
|
|
|
2055
2055
|
f(this, "trade");
|
|
2056
2056
|
f(this, "userMarkers");
|
|
2057
2057
|
f(this, "comments");
|
|
2058
|
-
this.chartId = e, this.container = t, this.candles = new
|
|
2058
|
+
this.chartId = e, this.container = t, this.candles = new Mt(s, this), this.config = new _n(n), this.colorScheme = new En(o), this.layout = new pn(t, this.config), this.scales = new Sn(this), this.trade = new Tn(this, a), this.candles.updateMissingCandles(), this.trade.recalculate(), this.userMarkers = new kn(this, r), this.comments = new Ln(c, this);
|
|
2059
2059
|
}
|
|
2060
2060
|
init() {
|
|
2061
2061
|
this.eventBus.emit("init_model");
|
|
@@ -2085,7 +2085,7 @@ class Nn {
|
|
|
2085
2085
|
this.eventBus.emit("update_comments", e);
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
|
-
const
|
|
2088
|
+
const Ue = window.devicePixelRatio || 2;
|
|
2089
2089
|
class k {
|
|
2090
2090
|
constructor({ tag: e, className: t, id: s, textContent: n }) {
|
|
2091
2091
|
f(this, "_tag");
|
|
@@ -2124,7 +2124,7 @@ class k {
|
|
|
2124
2124
|
this.node.style.opacity = e ? "1" : "0", this.node.style.visibility = e ? "visible" : "hidden";
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
|
-
class
|
|
2127
|
+
class Ne extends k {
|
|
2128
2128
|
constructor({ className: t, id: s, width: n, height: a, isMain: r }) {
|
|
2129
2129
|
super({
|
|
2130
2130
|
tag: "canvas",
|
|
@@ -2138,10 +2138,10 @@ class _e extends k {
|
|
|
2138
2138
|
this._width = n, this._height = a, this.updateSize({ width: n, height: a });
|
|
2139
2139
|
const o = this._node.getContext("2d");
|
|
2140
2140
|
if (!o) throw new Error("Failed to get 2D context");
|
|
2141
|
-
o.scale(
|
|
2141
|
+
o.scale(Ue, Ue), this._ctx = o;
|
|
2142
2142
|
}
|
|
2143
2143
|
updateSize({ width: t, height: s }) {
|
|
2144
|
-
t && (this._node.width = t *
|
|
2144
|
+
t && (this._node.width = t * Ue, this._node.style.width = `${t}px`, this._width = t), s && (this._node.height = s * Ue, this._node.style.height = `${s}px`, this._height = s);
|
|
2145
2145
|
}
|
|
2146
2146
|
clear() {
|
|
2147
2147
|
this.background ? (this._ctx.save(), this._ctx.fillStyle = this.background, this._ctx.fillRect(0, 0, this._width, this._height), this._ctx.restore()) : this._ctx.clearRect(0, 0, this._width, this._height);
|
|
@@ -2165,8 +2165,8 @@ function Hn(i, e) {
|
|
|
2165
2165
|
scales: a
|
|
2166
2166
|
} = e, r = a.x.ticks(Fn), o = (u) => u.getHours() === 0 && u.getMinutes() === 0, c = D.timeFormat("%d %b"), h = D.timeFormat("%H:%M");
|
|
2167
2167
|
i.save(), i.fillStyle = s.bg, i.fillRect(t.x, t.y, t.width, t.height), i.restore(), i.fillStyle = s.text, i.font = `${n.text.fontSize} ${n.text.font}`, i.textAlign = "center", i.textBaseline = "middle", r.forEach((u) => {
|
|
2168
|
-
const g = a.x.convert(u),
|
|
2169
|
-
i.fillText(
|
|
2168
|
+
const g = a.x.convert(u), p = o(u) ? c(u) : h(u);
|
|
2169
|
+
i.fillText(p, g, t.y + t.height / 2);
|
|
2170
2170
|
});
|
|
2171
2171
|
}
|
|
2172
2172
|
function Bn(i, e) {
|
|
@@ -2193,7 +2193,7 @@ const In = (i, e) => {
|
|
|
2193
2193
|
t.height
|
|
2194
2194
|
), i.restore();
|
|
2195
2195
|
};
|
|
2196
|
-
class
|
|
2196
|
+
class pt {
|
|
2197
2197
|
static xAxis(e, t) {
|
|
2198
2198
|
Hn(e, t);
|
|
2199
2199
|
}
|
|
@@ -2231,38 +2231,38 @@ class Rn {
|
|
|
2231
2231
|
this._target.addEventListener("contextmenu", e);
|
|
2232
2232
|
}
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function qe(i) {
|
|
2235
2235
|
return i * 0.1875;
|
|
2236
2236
|
}
|
|
2237
2237
|
const $n = (i, { mainColor: e, textColor: t, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
|
|
2238
|
-
const g = r / 16,
|
|
2239
|
-
i.save(), i.translate(
|
|
2240
|
-
const b = a + g * 3 + 0.5,
|
|
2238
|
+
const g = r / 16, p = 16 * g, _ = n - p / 2, v = a;
|
|
2239
|
+
i.save(), i.translate(_, v), i.scale(g, g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "top", i.textAlign = "center", i.textBaseline = "middle";
|
|
2240
|
+
const b = a + g * 3 + 0.5, x = g * 16, C = b + x / 2;
|
|
2241
2241
|
i.fillStyle = t, i.fillText(s, n, C), i.restore();
|
|
2242
|
-
},
|
|
2243
|
-
const g = r / 16,
|
|
2244
|
-
i.save(), i.translate(
|
|
2245
|
-
const b = g * 16,
|
|
2246
|
-
i.fillStyle = t, i.fillText(s, n,
|
|
2242
|
+
}, On = (i, { mainColor: e, textColor: t, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
|
|
2243
|
+
const g = r / 16, p = 16 * g, _ = n - p / 2, v = a;
|
|
2244
|
+
i.save(), i.translate(_, v), i.scale(g, -g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle";
|
|
2245
|
+
const b = g * 16, x = a - g * 19 + b / 2;
|
|
2246
|
+
i.fillStyle = t, i.fillText(s, n, x), i.restore();
|
|
2247
2247
|
};
|
|
2248
|
-
function
|
|
2248
|
+
function Je(i) {
|
|
2249
2249
|
"@babel/helpers - typeof";
|
|
2250
|
-
return
|
|
2250
|
+
return Je = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2251
2251
|
return typeof e;
|
|
2252
2252
|
} : function(e) {
|
|
2253
2253
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2254
|
-
},
|
|
2254
|
+
}, Je(i);
|
|
2255
2255
|
}
|
|
2256
|
-
var
|
|
2257
|
-
function
|
|
2258
|
-
if (i = i || "", e = e || {}, i instanceof
|
|
2256
|
+
var Pn = /^\s+/, zn = /\s+$/;
|
|
2257
|
+
function M(i, e) {
|
|
2258
|
+
if (i = i || "", e = e || {}, i instanceof M)
|
|
2259
2259
|
return i;
|
|
2260
|
-
if (!(this instanceof
|
|
2261
|
-
return new
|
|
2260
|
+
if (!(this instanceof M))
|
|
2261
|
+
return new M(i, e);
|
|
2262
2262
|
var t = Vn(i);
|
|
2263
2263
|
this._originalInput = i, this._r = t.r, this._g = t.g, this._b = t.b, this._a = t.a, this._roundA = Math.round(100 * this._a) / 100, this._format = e.format || t.format, this._gradientType = e.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = t.ok;
|
|
2264
2264
|
}
|
|
2265
|
-
|
|
2265
|
+
M.prototype = {
|
|
2266
2266
|
isDark: function() {
|
|
2267
2267
|
return this.getBrightness() < 128;
|
|
2268
2268
|
},
|
|
@@ -2290,10 +2290,10 @@ A.prototype = {
|
|
|
2290
2290
|
return t = e.r / 255, s = e.g / 255, n = e.b / 255, t <= 0.03928 ? a = t / 12.92 : a = Math.pow((t + 0.055) / 1.055, 2.4), s <= 0.03928 ? r = s / 12.92 : r = Math.pow((s + 0.055) / 1.055, 2.4), n <= 0.03928 ? o = n / 12.92 : o = Math.pow((n + 0.055) / 1.055, 2.4), 0.2126 * a + 0.7152 * r + 0.0722 * o;
|
|
2291
2291
|
},
|
|
2292
2292
|
setAlpha: function(e) {
|
|
2293
|
-
return this._a =
|
|
2293
|
+
return this._a = pi(e), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
2294
2294
|
},
|
|
2295
2295
|
toHsv: function() {
|
|
2296
|
-
var e =
|
|
2296
|
+
var e = ri(this._r, this._g, this._b);
|
|
2297
2297
|
return {
|
|
2298
2298
|
h: e.h * 360,
|
|
2299
2299
|
s: e.s,
|
|
@@ -2302,11 +2302,11 @@ A.prototype = {
|
|
|
2302
2302
|
};
|
|
2303
2303
|
},
|
|
2304
2304
|
toHsvString: function() {
|
|
2305
|
-
var e =
|
|
2305
|
+
var e = ri(this._r, this._g, this._b), t = Math.round(e.h * 360), s = Math.round(e.s * 100), n = Math.round(e.v * 100);
|
|
2306
2306
|
return this._a == 1 ? "hsv(" + t + ", " + s + "%, " + n + "%)" : "hsva(" + t + ", " + s + "%, " + n + "%, " + this._roundA + ")";
|
|
2307
2307
|
},
|
|
2308
2308
|
toHsl: function() {
|
|
2309
|
-
var e =
|
|
2309
|
+
var e = ai(this._r, this._g, this._b);
|
|
2310
2310
|
return {
|
|
2311
2311
|
h: e.h * 360,
|
|
2312
2312
|
s: e.s,
|
|
@@ -2315,11 +2315,11 @@ A.prototype = {
|
|
|
2315
2315
|
};
|
|
2316
2316
|
},
|
|
2317
2317
|
toHslString: function() {
|
|
2318
|
-
var e =
|
|
2318
|
+
var e = ai(this._r, this._g, this._b), t = Math.round(e.h * 360), s = Math.round(e.s * 100), n = Math.round(e.l * 100);
|
|
2319
2319
|
return this._a == 1 ? "hsl(" + t + ", " + s + "%, " + n + "%)" : "hsla(" + t + ", " + s + "%, " + n + "%, " + this._roundA + ")";
|
|
2320
2320
|
},
|
|
2321
2321
|
toHex: function(e) {
|
|
2322
|
-
return
|
|
2322
|
+
return oi(this._r, this._g, this._b, e);
|
|
2323
2323
|
},
|
|
2324
2324
|
toHexString: function(e) {
|
|
2325
2325
|
return "#" + this.toHex(e);
|
|
@@ -2353,13 +2353,13 @@ A.prototype = {
|
|
|
2353
2353
|
return this._a == 1 ? "rgb(" + Math.round(I(this._r, 255) * 100) + "%, " + Math.round(I(this._g, 255) * 100) + "%, " + Math.round(I(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(I(this._r, 255) * 100) + "%, " + Math.round(I(this._g, 255) * 100) + "%, " + Math.round(I(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
2354
2354
|
},
|
|
2355
2355
|
toName: function() {
|
|
2356
|
-
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : na[
|
|
2356
|
+
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : na[oi(this._r, this._g, this._b, !0)] || !1;
|
|
2357
2357
|
},
|
|
2358
2358
|
toFilter: function(e) {
|
|
2359
|
-
var t = "#" +
|
|
2359
|
+
var t = "#" + li(this._r, this._g, this._b, this._a), s = t, n = this._gradientType ? "GradientType = 1, " : "";
|
|
2360
2360
|
if (e) {
|
|
2361
|
-
var a =
|
|
2362
|
-
s = "#" +
|
|
2361
|
+
var a = M(e);
|
|
2362
|
+
s = "#" + li(a._r, a._g, a._b, a._a);
|
|
2363
2363
|
}
|
|
2364
2364
|
return "progid:DXImageTransform.Microsoft.gradient(" + n + "startColorstr=" + t + ",endColorstr=" + s + ")";
|
|
2365
2365
|
},
|
|
@@ -2370,7 +2370,7 @@ A.prototype = {
|
|
|
2370
2370
|
return a ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (s = this.toRgbString()), e === "prgb" && (s = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (s = this.toHexString()), e === "hex3" && (s = this.toHexString(!0)), e === "hex4" && (s = this.toHex8String(!0)), e === "hex8" && (s = this.toHex8String()), e === "name" && (s = this.toName()), e === "hsl" && (s = this.toHslString()), e === "hsv" && (s = this.toHsvString()), s || this.toHexString());
|
|
2371
2371
|
},
|
|
2372
2372
|
clone: function() {
|
|
2373
|
-
return
|
|
2373
|
+
return M(this.toString());
|
|
2374
2374
|
},
|
|
2375
2375
|
_applyModification: function(e, t) {
|
|
2376
2376
|
var s = e.apply(null, [this].concat([].slice.call(t)));
|
|
@@ -2417,20 +2417,20 @@ A.prototype = {
|
|
|
2417
2417
|
// return this._applyCombination(polyad, [number]);
|
|
2418
2418
|
// },
|
|
2419
2419
|
triad: function() {
|
|
2420
|
-
return this._applyCombination(
|
|
2420
|
+
return this._applyCombination(ci, [3]);
|
|
2421
2421
|
},
|
|
2422
2422
|
tetrad: function() {
|
|
2423
|
-
return this._applyCombination(
|
|
2423
|
+
return this._applyCombination(ci, [4]);
|
|
2424
2424
|
}
|
|
2425
2425
|
};
|
|
2426
|
-
|
|
2427
|
-
if (
|
|
2426
|
+
M.fromRatio = function(i, e) {
|
|
2427
|
+
if (Je(i) == "object") {
|
|
2428
2428
|
var t = {};
|
|
2429
2429
|
for (var s in i)
|
|
2430
|
-
i.hasOwnProperty(s) && (s === "a" ? t[s] = i[s] : t[s] =
|
|
2430
|
+
i.hasOwnProperty(s) && (s === "a" ? t[s] = i[s] : t[s] = De(i[s]));
|
|
2431
2431
|
i = t;
|
|
2432
2432
|
}
|
|
2433
|
-
return
|
|
2433
|
+
return M(i, e);
|
|
2434
2434
|
};
|
|
2435
2435
|
function Vn(i) {
|
|
2436
2436
|
var e = {
|
|
@@ -2438,7 +2438,7 @@ function Vn(i) {
|
|
|
2438
2438
|
g: 0,
|
|
2439
2439
|
b: 0
|
|
2440
2440
|
}, t = 1, s = null, n = null, a = null, r = !1, o = !1;
|
|
2441
|
-
return typeof i == "string" && (i = la(i)),
|
|
2441
|
+
return typeof i == "string" && (i = la(i)), Je(i) == "object" && (te(i.r) && te(i.g) && te(i.b) ? (e = Yn(i.r, i.g, i.b), r = !0, o = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : te(i.h) && te(i.s) && te(i.v) ? (s = De(i.s), n = De(i.v), e = jn(i.h, s, n), r = !0, o = "hsv") : te(i.h) && te(i.s) && te(i.l) && (s = De(i.s), a = De(i.l), e = Wn(i.h, s, a), r = !0, o = "hsl"), i.hasOwnProperty("a") && (t = i.a)), t = pi(t), {
|
|
2442
2442
|
ok: r,
|
|
2443
2443
|
format: i.format || o,
|
|
2444
2444
|
r: Math.min(255, Math.max(e.r, 0)),
|
|
@@ -2447,14 +2447,14 @@ function Vn(i) {
|
|
|
2447
2447
|
a: t
|
|
2448
2448
|
};
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2450
|
+
function Yn(i, e, t) {
|
|
2451
2451
|
return {
|
|
2452
2452
|
r: I(i, 255) * 255,
|
|
2453
2453
|
g: I(e, 255) * 255,
|
|
2454
2454
|
b: I(t, 255) * 255
|
|
2455
2455
|
};
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2457
|
+
function ai(i, e, t) {
|
|
2458
2458
|
i = I(i, 255), e = I(e, 255), t = I(t, 255);
|
|
2459
2459
|
var s = Math.max(i, e, t), n = Math.min(i, e, t), a, r, o = (s + n) / 2;
|
|
2460
2460
|
if (s == n)
|
|
@@ -2480,7 +2480,7 @@ function jt(i, e, t) {
|
|
|
2480
2480
|
l: o
|
|
2481
2481
|
};
|
|
2482
2482
|
}
|
|
2483
|
-
function
|
|
2483
|
+
function Wn(i, e, t) {
|
|
2484
2484
|
var s, n, a;
|
|
2485
2485
|
i = I(i, 360), e = I(e, 100), t = I(t, 100);
|
|
2486
2486
|
function r(h, u, g) {
|
|
@@ -2498,7 +2498,7 @@ function Yn(i, e, t) {
|
|
|
2498
2498
|
b: a * 255
|
|
2499
2499
|
};
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function ri(i, e, t) {
|
|
2502
2502
|
i = I(i, 255), e = I(e, 255), t = I(t, 255);
|
|
2503
2503
|
var s = Math.max(i, e, t), n = Math.min(i, e, t), a, r, o = s, c = s - n;
|
|
2504
2504
|
if (r = s === 0 ? 0 : c / s, s == n)
|
|
@@ -2523,7 +2523,7 @@ function Yt(i, e, t) {
|
|
|
2523
2523
|
v: o
|
|
2524
2524
|
};
|
|
2525
2525
|
}
|
|
2526
|
-
function
|
|
2526
|
+
function jn(i, e, t) {
|
|
2527
2527
|
i = I(i, 360) * 6, e = I(e, 100), t = I(t, 100);
|
|
2528
2528
|
var s = Math.floor(i), n = i - s, a = t * (1 - e), r = t * (1 - n * e), o = t * (1 - (1 - n) * e), c = s % 6, h = [t, r, a, a, o, t][c], u = [o, t, t, r, a, a][c], g = [a, a, o, t, t, r][c];
|
|
2529
2529
|
return {
|
|
@@ -2532,23 +2532,23 @@ function Wn(i, e, t) {
|
|
|
2532
2532
|
b: g * 255
|
|
2533
2533
|
};
|
|
2534
2534
|
}
|
|
2535
|
-
function
|
|
2536
|
-
var n = [
|
|
2535
|
+
function oi(i, e, t, s) {
|
|
2536
|
+
var n = [Q(Math.round(i).toString(16)), Q(Math.round(e).toString(16)), Q(Math.round(t).toString(16))];
|
|
2537
2537
|
return s && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
|
|
2538
2538
|
}
|
|
2539
2539
|
function Xn(i, e, t, s, n) {
|
|
2540
|
-
var a = [
|
|
2540
|
+
var a = [Q(Math.round(i).toString(16)), Q(Math.round(e).toString(16)), Q(Math.round(t).toString(16)), Q(vi(s))];
|
|
2541
2541
|
return n && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
2542
2542
|
}
|
|
2543
|
-
function
|
|
2544
|
-
var n = [
|
|
2543
|
+
function li(i, e, t, s) {
|
|
2544
|
+
var n = [Q(vi(s)), Q(Math.round(i).toString(16)), Q(Math.round(e).toString(16)), Q(Math.round(t).toString(16))];
|
|
2545
2545
|
return n.join("");
|
|
2546
2546
|
}
|
|
2547
|
-
|
|
2548
|
-
return !i || !e ? !1 :
|
|
2547
|
+
M.equals = function(i, e) {
|
|
2548
|
+
return !i || !e ? !1 : M(i).toRgbString() == M(e).toRgbString();
|
|
2549
2549
|
};
|
|
2550
|
-
|
|
2551
|
-
return
|
|
2550
|
+
M.random = function() {
|
|
2551
|
+
return M.fromRatio({
|
|
2552
2552
|
r: Math.random(),
|
|
2553
2553
|
g: Math.random(),
|
|
2554
2554
|
b: Math.random()
|
|
@@ -2556,45 +2556,45 @@ A.random = function() {
|
|
|
2556
2556
|
};
|
|
2557
2557
|
function Un(i, e) {
|
|
2558
2558
|
e = e === 0 ? 0 : e || 10;
|
|
2559
|
-
var t =
|
|
2560
|
-
return t.s -= e / 100, t.s =
|
|
2559
|
+
var t = M(i).toHsl();
|
|
2560
|
+
return t.s -= e / 100, t.s = Ke(t.s), M(t);
|
|
2561
2561
|
}
|
|
2562
2562
|
function Gn(i, e) {
|
|
2563
2563
|
e = e === 0 ? 0 : e || 10;
|
|
2564
|
-
var t =
|
|
2565
|
-
return t.s += e / 100, t.s =
|
|
2564
|
+
var t = M(i).toHsl();
|
|
2565
|
+
return t.s += e / 100, t.s = Ke(t.s), M(t);
|
|
2566
2566
|
}
|
|
2567
2567
|
function Zn(i) {
|
|
2568
|
-
return
|
|
2568
|
+
return M(i).desaturate(100);
|
|
2569
2569
|
}
|
|
2570
2570
|
function qn(i, e) {
|
|
2571
2571
|
e = e === 0 ? 0 : e || 10;
|
|
2572
|
-
var t =
|
|
2573
|
-
return t.l += e / 100, t.l =
|
|
2572
|
+
var t = M(i).toHsl();
|
|
2573
|
+
return t.l += e / 100, t.l = Ke(t.l), M(t);
|
|
2574
2574
|
}
|
|
2575
2575
|
function Jn(i, e) {
|
|
2576
2576
|
e = e === 0 ? 0 : e || 10;
|
|
2577
|
-
var t =
|
|
2578
|
-
return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))),
|
|
2577
|
+
var t = M(i).toRgb();
|
|
2578
|
+
return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), M(t);
|
|
2579
2579
|
}
|
|
2580
2580
|
function Qn(i, e) {
|
|
2581
2581
|
e = e === 0 ? 0 : e || 10;
|
|
2582
|
-
var t =
|
|
2583
|
-
return t.l -= e / 100, t.l =
|
|
2582
|
+
var t = M(i).toHsl();
|
|
2583
|
+
return t.l -= e / 100, t.l = Ke(t.l), M(t);
|
|
2584
2584
|
}
|
|
2585
2585
|
function Kn(i, e) {
|
|
2586
|
-
var t =
|
|
2587
|
-
return t.h = s < 0 ? 360 + s : s,
|
|
2586
|
+
var t = M(i).toHsl(), s = (t.h + e) % 360;
|
|
2587
|
+
return t.h = s < 0 ? 360 + s : s, M(t);
|
|
2588
2588
|
}
|
|
2589
2589
|
function ea(i) {
|
|
2590
|
-
var e =
|
|
2591
|
-
return e.h = (e.h + 180) % 360,
|
|
2590
|
+
var e = M(i).toHsl();
|
|
2591
|
+
return e.h = (e.h + 180) % 360, M(e);
|
|
2592
2592
|
}
|
|
2593
|
-
function
|
|
2593
|
+
function ci(i, e) {
|
|
2594
2594
|
if (isNaN(e) || e <= 0)
|
|
2595
2595
|
throw new Error("Argument to polyad must be a positive number");
|
|
2596
|
-
for (var t =
|
|
2597
|
-
s.push(
|
|
2596
|
+
for (var t = M(i).toHsl(), s = [M(i)], n = 360 / e, a = 1; a < e; a++)
|
|
2597
|
+
s.push(M({
|
|
2598
2598
|
h: (t.h + a * n) % 360,
|
|
2599
2599
|
s: t.s,
|
|
2600
2600
|
l: t.l
|
|
@@ -2602,12 +2602,12 @@ function Ut(i, e) {
|
|
|
2602
2602
|
return s;
|
|
2603
2603
|
}
|
|
2604
2604
|
function ta(i) {
|
|
2605
|
-
var e =
|
|
2606
|
-
return [
|
|
2605
|
+
var e = M(i).toHsl(), t = e.h;
|
|
2606
|
+
return [M(i), M({
|
|
2607
2607
|
h: (t + 72) % 360,
|
|
2608
2608
|
s: e.s,
|
|
2609
2609
|
l: e.l
|
|
2610
|
-
}),
|
|
2610
|
+
}), M({
|
|
2611
2611
|
h: (t + 216) % 360,
|
|
2612
2612
|
s: e.s,
|
|
2613
2613
|
l: e.l
|
|
@@ -2615,37 +2615,37 @@ function ta(i) {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
function ia(i, e, t) {
|
|
2617
2617
|
e = e || 6, t = t || 30;
|
|
2618
|
-
var s =
|
|
2618
|
+
var s = M(i).toHsl(), n = 360 / t, a = [M(i)];
|
|
2619
2619
|
for (s.h = (s.h - (n * e >> 1) + 720) % 360; --e; )
|
|
2620
|
-
s.h = (s.h + n) % 360, a.push(
|
|
2620
|
+
s.h = (s.h + n) % 360, a.push(M(s));
|
|
2621
2621
|
return a;
|
|
2622
2622
|
}
|
|
2623
2623
|
function sa(i, e) {
|
|
2624
2624
|
e = e || 6;
|
|
2625
|
-
for (var t =
|
|
2626
|
-
r.push(
|
|
2625
|
+
for (var t = M(i).toHsv(), s = t.h, n = t.s, a = t.v, r = [], o = 1 / e; e--; )
|
|
2626
|
+
r.push(M({
|
|
2627
2627
|
h: s,
|
|
2628
2628
|
s: n,
|
|
2629
2629
|
v: a
|
|
2630
2630
|
})), a = (a + o) % 1;
|
|
2631
2631
|
return r;
|
|
2632
2632
|
}
|
|
2633
|
-
|
|
2633
|
+
M.mix = function(i, e, t) {
|
|
2634
2634
|
t = t === 0 ? 0 : t || 50;
|
|
2635
|
-
var s =
|
|
2635
|
+
var s = M(i).toRgb(), n = M(e).toRgb(), a = t / 100, r = {
|
|
2636
2636
|
r: (n.r - s.r) * a + s.r,
|
|
2637
2637
|
g: (n.g - s.g) * a + s.g,
|
|
2638
2638
|
b: (n.b - s.b) * a + s.b,
|
|
2639
2639
|
a: (n.a - s.a) * a + s.a
|
|
2640
2640
|
};
|
|
2641
|
-
return
|
|
2641
|
+
return M(r);
|
|
2642
2642
|
};
|
|
2643
|
-
|
|
2644
|
-
var t =
|
|
2643
|
+
M.readability = function(i, e) {
|
|
2644
|
+
var t = M(i), s = M(e);
|
|
2645
2645
|
return (Math.max(t.getLuminance(), s.getLuminance()) + 0.05) / (Math.min(t.getLuminance(), s.getLuminance()) + 0.05);
|
|
2646
2646
|
};
|
|
2647
|
-
|
|
2648
|
-
var s =
|
|
2647
|
+
M.isReadable = function(i, e, t) {
|
|
2648
|
+
var s = M.readability(i, e), n, a;
|
|
2649
2649
|
switch (a = !1, n = ca(t), n.level + n.size) {
|
|
2650
2650
|
case "AAsmall":
|
|
2651
2651
|
case "AAAlarge":
|
|
@@ -2660,17 +2660,17 @@ A.isReadable = function(i, e, t) {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
return a;
|
|
2662
2662
|
};
|
|
2663
|
-
|
|
2663
|
+
M.mostReadable = function(i, e, t) {
|
|
2664
2664
|
var s = null, n = 0, a, r, o, c;
|
|
2665
2665
|
t = t || {}, r = t.includeFallbackColors, o = t.level, c = t.size;
|
|
2666
2666
|
for (var h = 0; h < e.length; h++)
|
|
2667
|
-
a =
|
|
2668
|
-
return
|
|
2667
|
+
a = M.readability(i, e[h]), a > n && (n = a, s = M(e[h]));
|
|
2668
|
+
return M.isReadable(i, s, {
|
|
2669
2669
|
level: o,
|
|
2670
2670
|
size: c
|
|
2671
|
-
}) || !r ? s : (t.includeFallbackColors = !1,
|
|
2671
|
+
}) || !r ? s : (t.includeFallbackColors = !1, M.mostReadable(i, ["#fff", "#000"], t));
|
|
2672
2672
|
};
|
|
2673
|
-
var
|
|
2673
|
+
var xt = M.names = {
|
|
2674
2674
|
aliceblue: "f0f8ff",
|
|
2675
2675
|
antiquewhite: "faebd7",
|
|
2676
2676
|
aqua: "0ff",
|
|
@@ -2820,14 +2820,14 @@ var tt = A.names = {
|
|
|
2820
2820
|
whitesmoke: "f5f5f5",
|
|
2821
2821
|
yellow: "ff0",
|
|
2822
2822
|
yellowgreen: "9acd32"
|
|
2823
|
-
}, na =
|
|
2823
|
+
}, na = M.hexNames = aa(xt);
|
|
2824
2824
|
function aa(i) {
|
|
2825
2825
|
var e = {};
|
|
2826
2826
|
for (var t in i)
|
|
2827
2827
|
i.hasOwnProperty(t) && (e[i[t]] = t);
|
|
2828
2828
|
return e;
|
|
2829
2829
|
}
|
|
2830
|
-
function
|
|
2830
|
+
function pi(i) {
|
|
2831
2831
|
return i = parseFloat(i), (isNaN(i) || i < 0 || i > 1) && (i = 1), i;
|
|
2832
2832
|
}
|
|
2833
2833
|
function I(i, e) {
|
|
@@ -2835,10 +2835,10 @@ function I(i, e) {
|
|
|
2835
2835
|
var t = oa(i);
|
|
2836
2836
|
return i = Math.min(e, Math.max(0, parseFloat(i))), t && (i = parseInt(i * e, 10) / 100), Math.abs(i - e) < 1e-6 ? 1 : i % e / parseFloat(e);
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function Ke(i) {
|
|
2839
2839
|
return Math.min(1, Math.max(0, i));
|
|
2840
2840
|
}
|
|
2841
|
-
function
|
|
2841
|
+
function Y(i) {
|
|
2842
2842
|
return parseInt(i, 16);
|
|
2843
2843
|
}
|
|
2844
2844
|
function ra(i) {
|
|
@@ -2847,19 +2847,19 @@ function ra(i) {
|
|
|
2847
2847
|
function oa(i) {
|
|
2848
2848
|
return typeof i == "string" && i.indexOf("%") != -1;
|
|
2849
2849
|
}
|
|
2850
|
-
function
|
|
2850
|
+
function Q(i) {
|
|
2851
2851
|
return i.length == 1 ? "0" + i : "" + i;
|
|
2852
2852
|
}
|
|
2853
|
-
function
|
|
2853
|
+
function De(i) {
|
|
2854
2854
|
return i <= 1 && (i = i * 100 + "%"), i;
|
|
2855
2855
|
}
|
|
2856
|
-
function
|
|
2856
|
+
function vi(i) {
|
|
2857
2857
|
return Math.round(parseFloat(i) * 255).toString(16);
|
|
2858
2858
|
}
|
|
2859
|
-
function
|
|
2860
|
-
return
|
|
2859
|
+
function hi(i) {
|
|
2860
|
+
return Y(i) / 255;
|
|
2861
2861
|
}
|
|
2862
|
-
var
|
|
2862
|
+
var J = function() {
|
|
2863
2863
|
var i = "[-\\+]?\\d+%?", e = "[-\\+]?\\d*\\.\\d+%?", t = "(?:" + e + ")|(?:" + i + ")", s = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?", n = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?";
|
|
2864
2864
|
return {
|
|
2865
2865
|
CSS_UNIT: new RegExp(t),
|
|
@@ -2875,14 +2875,14 @@ var W = function() {
|
|
|
2875
2875
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
2876
2876
|
};
|
|
2877
2877
|
}();
|
|
2878
|
-
function
|
|
2879
|
-
return !!
|
|
2878
|
+
function te(i) {
|
|
2879
|
+
return !!J.CSS_UNIT.exec(i);
|
|
2880
2880
|
}
|
|
2881
2881
|
function la(i) {
|
|
2882
|
-
i = i.replace(
|
|
2882
|
+
i = i.replace(Pn, "").replace(zn, "").toLowerCase();
|
|
2883
2883
|
var e = !1;
|
|
2884
|
-
if (
|
|
2885
|
-
i =
|
|
2884
|
+
if (xt[i])
|
|
2885
|
+
i = xt[i], e = !0;
|
|
2886
2886
|
else if (i == "transparent")
|
|
2887
2887
|
return {
|
|
2888
2888
|
r: 0,
|
|
@@ -2892,54 +2892,54 @@ function la(i) {
|
|
|
2892
2892
|
format: "name"
|
|
2893
2893
|
};
|
|
2894
2894
|
var t;
|
|
2895
|
-
return (t =
|
|
2895
|
+
return (t = J.rgb.exec(i)) ? {
|
|
2896
2896
|
r: t[1],
|
|
2897
2897
|
g: t[2],
|
|
2898
2898
|
b: t[3]
|
|
2899
|
-
} : (t =
|
|
2899
|
+
} : (t = J.rgba.exec(i)) ? {
|
|
2900
2900
|
r: t[1],
|
|
2901
2901
|
g: t[2],
|
|
2902
2902
|
b: t[3],
|
|
2903
2903
|
a: t[4]
|
|
2904
|
-
} : (t =
|
|
2904
|
+
} : (t = J.hsl.exec(i)) ? {
|
|
2905
2905
|
h: t[1],
|
|
2906
2906
|
s: t[2],
|
|
2907
2907
|
l: t[3]
|
|
2908
|
-
} : (t =
|
|
2908
|
+
} : (t = J.hsla.exec(i)) ? {
|
|
2909
2909
|
h: t[1],
|
|
2910
2910
|
s: t[2],
|
|
2911
2911
|
l: t[3],
|
|
2912
2912
|
a: t[4]
|
|
2913
|
-
} : (t =
|
|
2913
|
+
} : (t = J.hsv.exec(i)) ? {
|
|
2914
2914
|
h: t[1],
|
|
2915
2915
|
s: t[2],
|
|
2916
2916
|
v: t[3]
|
|
2917
|
-
} : (t =
|
|
2917
|
+
} : (t = J.hsva.exec(i)) ? {
|
|
2918
2918
|
h: t[1],
|
|
2919
2919
|
s: t[2],
|
|
2920
2920
|
v: t[3],
|
|
2921
2921
|
a: t[4]
|
|
2922
|
-
} : (t =
|
|
2923
|
-
r:
|
|
2924
|
-
g:
|
|
2925
|
-
b:
|
|
2926
|
-
a:
|
|
2922
|
+
} : (t = J.hex8.exec(i)) ? {
|
|
2923
|
+
r: Y(t[1]),
|
|
2924
|
+
g: Y(t[2]),
|
|
2925
|
+
b: Y(t[3]),
|
|
2926
|
+
a: hi(t[4]),
|
|
2927
2927
|
format: e ? "name" : "hex8"
|
|
2928
|
-
} : (t =
|
|
2929
|
-
r:
|
|
2930
|
-
g:
|
|
2931
|
-
b:
|
|
2928
|
+
} : (t = J.hex6.exec(i)) ? {
|
|
2929
|
+
r: Y(t[1]),
|
|
2930
|
+
g: Y(t[2]),
|
|
2931
|
+
b: Y(t[3]),
|
|
2932
2932
|
format: e ? "name" : "hex"
|
|
2933
|
-
} : (t =
|
|
2934
|
-
r:
|
|
2935
|
-
g:
|
|
2936
|
-
b:
|
|
2937
|
-
a:
|
|
2933
|
+
} : (t = J.hex4.exec(i)) ? {
|
|
2934
|
+
r: Y(t[1] + "" + t[1]),
|
|
2935
|
+
g: Y(t[2] + "" + t[2]),
|
|
2936
|
+
b: Y(t[3] + "" + t[3]),
|
|
2937
|
+
a: hi(t[4] + "" + t[4]),
|
|
2938
2938
|
format: e ? "name" : "hex8"
|
|
2939
|
-
} : (t =
|
|
2940
|
-
r:
|
|
2941
|
-
g:
|
|
2942
|
-
b:
|
|
2939
|
+
} : (t = J.hex3.exec(i)) ? {
|
|
2940
|
+
r: Y(t[1] + "" + t[1]),
|
|
2941
|
+
g: Y(t[2] + "" + t[2]),
|
|
2942
|
+
b: Y(t[3] + "" + t[3]),
|
|
2943
2943
|
format: e ? "name" : "hex"
|
|
2944
2944
|
} : !1;
|
|
2945
2945
|
}
|
|
@@ -2964,17 +2964,17 @@ function ha(i, e) {
|
|
|
2964
2964
|
} = e;
|
|
2965
2965
|
if (!r) return;
|
|
2966
2966
|
const { trade: o } = a, c = 4;
|
|
2967
|
-
t.forEach(({ isHovered: h, isActive: u, candle: g, trades:
|
|
2968
|
-
const
|
|
2969
|
-
|
|
2970
|
-
const b = v.type === "buy",
|
|
2971
|
-
let
|
|
2972
|
-
h && h[1] && h[0] === v.type && (
|
|
2973
|
-
x:
|
|
2967
|
+
t.forEach(({ isHovered: h, isActive: u, candle: g, trades: p }) => {
|
|
2968
|
+
const _ = s.convert(g.open_time);
|
|
2969
|
+
p.forEach((v) => {
|
|
2970
|
+
const b = v.type === "buy", x = b ? o.buyLabel.text : o.sellLabel.text, C = b ? "B" : "S", y = b ? n.convert(g.low) + c : n.convert(g.high) - c, w = b ? $n : On;
|
|
2971
|
+
let S = b ? o.buyLabel.main : o.sellLabel.main;
|
|
2972
|
+
h && h[1] && h[0] === v.type && (S = M.mix(S, a.bg, 20).toString()), u && u[1] && u[0] === v.type && (S = o.activeLabel), w(i, {
|
|
2973
|
+
x: _,
|
|
2974
2974
|
y,
|
|
2975
2975
|
symbol: C,
|
|
2976
|
-
mainColor:
|
|
2977
|
-
textColor:
|
|
2976
|
+
mainColor: S,
|
|
2977
|
+
textColor: x,
|
|
2978
2978
|
size: 16,
|
|
2979
2979
|
fontSize: 12
|
|
2980
2980
|
});
|
|
@@ -2990,14 +2990,14 @@ function da(i, e) {
|
|
|
2990
2990
|
colorScheme: { trade: h }
|
|
2991
2991
|
} = e;
|
|
2992
2992
|
if (a.length === 0) return;
|
|
2993
|
-
const u = a.map((
|
|
2993
|
+
const u = a.map((p) => p.candle).sort((p, _) => p.open_time.getTime() - _.open_time.getTime()), g = c.baseWidth / 2 * s + c.strokeWidth / 2;
|
|
2994
2994
|
if (i.save(), i.lineWidth = 1, i.strokeStyle = h.tradeBorders, o.length) {
|
|
2995
|
-
const
|
|
2996
|
-
i.beginPath(), i.moveTo(
|
|
2995
|
+
const p = t.convert(u[0].open_time) - g;
|
|
2996
|
+
i.beginPath(), i.moveTo(p, n.y), i.lineTo(p, n.y + n.height), i.stroke();
|
|
2997
2997
|
}
|
|
2998
2998
|
if (r.length) {
|
|
2999
|
-
const
|
|
3000
|
-
i.beginPath(), i.moveTo(
|
|
2999
|
+
const p = t.convert(u[u.length - 1].open_time) + g;
|
|
3000
|
+
i.beginPath(), i.moveTo(p, n.y), i.lineTo(p, n.y + n.height), i.stroke();
|
|
3001
3001
|
}
|
|
3002
3002
|
i.restore();
|
|
3003
3003
|
}
|
|
@@ -3012,16 +3012,16 @@ const ua = (i, e) => {
|
|
|
3012
3012
|
} = e;
|
|
3013
3013
|
if (i.save(), !c) return;
|
|
3014
3014
|
const h = (g) => {
|
|
3015
|
-
var
|
|
3016
|
-
return (
|
|
3017
|
-
(
|
|
3018
|
-
)) == null ? void 0 :
|
|
3019
|
-
}, u = (g,
|
|
3020
|
-
const
|
|
3021
|
-
if (!
|
|
3022
|
-
const b = t.convert(
|
|
3015
|
+
var p;
|
|
3016
|
+
return (p = n.find(
|
|
3017
|
+
(_) => g.getTime() >= _.candle.open_time.getTime() && g.getTime() < _.candle.close_time.getTime()
|
|
3018
|
+
)) == null ? void 0 : p.candle;
|
|
3019
|
+
}, u = (g, p) => {
|
|
3020
|
+
const _ = h(g.time), v = h(p.time);
|
|
3021
|
+
if (!_ || !v) return;
|
|
3022
|
+
const b = t.convert(_.open_time), x = t.convert(v.open_time);
|
|
3023
3023
|
let C, y;
|
|
3024
|
-
g.type === "buy" ? (C = s.convert(
|
|
3024
|
+
g.type === "buy" ? (C = s.convert(_.low), y = s.convert(v.high)) : (C = s.convert(_.high), y = s.convert(v.low)), i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.connectionLine, i.moveTo(b, C), i.lineTo(x, y), i.stroke(), i.setLineDash([]);
|
|
3025
3025
|
};
|
|
3026
3026
|
if (a.length === 1 && r.length > 1)
|
|
3027
3027
|
r.forEach((g) => u(a[0], g));
|
|
@@ -3030,11 +3030,11 @@ const ua = (i, e) => {
|
|
|
3030
3030
|
else if (a.length === 1 && r.length === 1)
|
|
3031
3031
|
u(a[0], r[0]);
|
|
3032
3032
|
else if (a.length > 0 && r.length > 0) {
|
|
3033
|
-
const g = a.reduce((
|
|
3034
|
-
u(g,
|
|
3033
|
+
const g = a.reduce((_, v) => _.time < v.time ? _ : v), p = r.reduce((_, v) => _.time > v.time ? _ : v);
|
|
3034
|
+
u(g, p);
|
|
3035
3035
|
}
|
|
3036
3036
|
i.restore();
|
|
3037
|
-
},
|
|
3037
|
+
}, bi = (i, e) => {
|
|
3038
3038
|
const {
|
|
3039
3039
|
radius: t,
|
|
3040
3040
|
coords: { x: s, y: n },
|
|
@@ -3071,7 +3071,7 @@ function ga(i) {
|
|
|
3071
3071
|
return s.length ? s.join(" ") : "0s";
|
|
3072
3072
|
}
|
|
3073
3073
|
const ma = 10, _a = 6, pa = 4, va = 12, ba = (i, e) => {
|
|
3074
|
-
var
|
|
3074
|
+
var K;
|
|
3075
3075
|
const {
|
|
3076
3076
|
scales: { x: t, y: s },
|
|
3077
3077
|
trade: { entries: n, exits: a, holdTime: r },
|
|
@@ -3083,29 +3083,29 @@ const ma = 10, _a = 6, pa = 4, va = 12, ba = (i, e) => {
|
|
|
3083
3083
|
}
|
|
3084
3084
|
} = e;
|
|
3085
3085
|
if (!c) return;
|
|
3086
|
-
const
|
|
3087
|
-
if (!
|
|
3088
|
-
const v = (
|
|
3089
|
-
i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(b, C), i.lineTo(
|
|
3090
|
-
const y = (b +
|
|
3086
|
+
const p = n.at(0), _ = a.at(-1);
|
|
3087
|
+
if (!p || !_) return;
|
|
3088
|
+
const v = (j) => j ? j instanceof Date ? j : new Date(j) : null, b = t.convert(v(u == null ? void 0 : u[0]) || p.candle.open_time), x = t.convert(v(u == null ? void 0 : u[1]) || _.candle.open_time), C = s.convert(g || (((K = n.at(0)) == null ? void 0 : K.price) ?? 0));
|
|
3089
|
+
i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(b, C), i.lineTo(x, C), i.stroke(), i.setLineDash([]);
|
|
3090
|
+
const y = (b + x) / 2, w = h || `Hold: ${ga(r)}`, L = getComputedStyle(
|
|
3091
3091
|
document.querySelector(".sc-charts-cs") || document.body
|
|
3092
3092
|
).font.replace(/^\s*\S+/, "").trim();
|
|
3093
|
-
i.font = `600 ${ma}px ${
|
|
3094
|
-
const $ = i.measureText(
|
|
3095
|
-
|
|
3093
|
+
i.font = `600 ${ma}px ${L}`;
|
|
3094
|
+
const $ = i.measureText(w).width + _a * 2, O = va + pa * 2;
|
|
3095
|
+
bi(i, {
|
|
3096
3096
|
radius: 4,
|
|
3097
3097
|
coords: {
|
|
3098
3098
|
x: y - $ / 2,
|
|
3099
|
-
y: C -
|
|
3099
|
+
y: C - O / 2
|
|
3100
3100
|
},
|
|
3101
3101
|
width: $,
|
|
3102
|
-
height:
|
|
3102
|
+
height: O,
|
|
3103
3103
|
fillColor: o.main
|
|
3104
|
-
}), i.fillStyle = o.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(
|
|
3104
|
+
}), i.fillStyle = o.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(w, y, C), i.restore();
|
|
3105
3105
|
};
|
|
3106
|
-
class
|
|
3106
|
+
class Fe {
|
|
3107
3107
|
constructor(e, t, {
|
|
3108
|
-
CanvasClass: s =
|
|
3108
|
+
CanvasClass: s = Ne,
|
|
3109
3109
|
noCanvas: n = !1,
|
|
3110
3110
|
noDOM: a = !1
|
|
3111
3111
|
} = {}) {
|
|
@@ -3127,7 +3127,7 @@ const ya = {
|
|
|
3127
3127
|
"left-top": { dx: -1, dy: -1 },
|
|
3128
3128
|
"right-top": { dx: 1, dy: -1 },
|
|
3129
3129
|
"left-bottom": { dx: -1, dy: 1 }
|
|
3130
|
-
},
|
|
3130
|
+
}, St = ({
|
|
3131
3131
|
size: i,
|
|
3132
3132
|
parent: e,
|
|
3133
3133
|
coords: t,
|
|
@@ -3135,35 +3135,35 @@ const ya = {
|
|
|
3135
3135
|
offset: n = 8
|
|
3136
3136
|
}) => {
|
|
3137
3137
|
const { width: a, height: r } = i, o = e.right - e.left, c = e.bottom - e.top, h = (y) => {
|
|
3138
|
-
const { dx:
|
|
3139
|
-
return { x:
|
|
3140
|
-
}, u = ({ x: y, y:
|
|
3141
|
-
const y = t.y < 0,
|
|
3142
|
-
return
|
|
3143
|
-
},
|
|
3138
|
+
const { dx: w, dy: S } = ya[y], L = t.x + (w === 1 ? n : -a - n), R = t.y + (S === 1 ? n : -r - n);
|
|
3139
|
+
return { x: L, y: R, side: y };
|
|
3140
|
+
}, u = ({ x: y, y: w }) => y >= 0 && w >= 0 && y + a <= o && w + r <= c, g = () => {
|
|
3141
|
+
const y = t.y < 0, w = t.y + r > c, S = t.x < 0, L = t.x + a > o;
|
|
3142
|
+
return S && y ? "right-bottom" : S && w ? "right-top" : L && y ? "left-bottom" : L && w ? "left-top" : S ? "right-bottom" : L ? "left-bottom" : y ? "right-bottom" : w ? "right-top" : s;
|
|
3143
|
+
}, _ = [
|
|
3144
3144
|
s,
|
|
3145
3145
|
"right-bottom",
|
|
3146
3146
|
"right-top",
|
|
3147
3147
|
"left-bottom",
|
|
3148
3148
|
"left-top"
|
|
3149
|
-
].filter((y,
|
|
3149
|
+
].filter((y, w, S) => S.indexOf(y) === w), v = g();
|
|
3150
3150
|
let b = null;
|
|
3151
|
-
for (const y of [v, ...
|
|
3152
|
-
const
|
|
3153
|
-
if (u(
|
|
3154
|
-
b =
|
|
3151
|
+
for (const y of [v, ..._]) {
|
|
3152
|
+
const w = h(y);
|
|
3153
|
+
if (u(w)) {
|
|
3154
|
+
b = w;
|
|
3155
3155
|
break;
|
|
3156
3156
|
}
|
|
3157
3157
|
}
|
|
3158
3158
|
b || (b = h(v));
|
|
3159
|
-
const
|
|
3159
|
+
const x = Math.min(Math.max(b.x, n), o - a - n), C = Math.min(Math.max(b.y, n), c - r - n);
|
|
3160
3160
|
return {
|
|
3161
|
-
x
|
|
3161
|
+
x,
|
|
3162
3162
|
y: C,
|
|
3163
3163
|
side: b.side
|
|
3164
3164
|
};
|
|
3165
3165
|
};
|
|
3166
|
-
class
|
|
3166
|
+
class ie extends k {
|
|
3167
3167
|
constructor(t) {
|
|
3168
3168
|
super(t);
|
|
3169
3169
|
f(this, "_state", {});
|
|
@@ -3198,7 +3198,7 @@ class Z extends k {
|
|
|
3198
3198
|
this._scheduleUpdate();
|
|
3199
3199
|
}
|
|
3200
3200
|
}
|
|
3201
|
-
class wa extends
|
|
3201
|
+
class wa extends ie {
|
|
3202
3202
|
constructor(t) {
|
|
3203
3203
|
const s = "label-tooltip";
|
|
3204
3204
|
super({ className: t.cx(s) });
|
|
@@ -3215,7 +3215,7 @@ class wa extends Z {
|
|
|
3215
3215
|
}), this.oneBox = new k({
|
|
3216
3216
|
tag: "div",
|
|
3217
3217
|
className: this.clsx("box_one")
|
|
3218
|
-
}), t.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent:
|
|
3218
|
+
}), t.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent: W.empty() };
|
|
3219
3219
|
}
|
|
3220
3220
|
_createLineNodes(t, s) {
|
|
3221
3221
|
const n = [];
|
|
@@ -3270,7 +3270,7 @@ class wa extends Z {
|
|
|
3270
3270
|
render() {
|
|
3271
3271
|
const { isShow: t, x: s, y: n, parent: a } = this.state;
|
|
3272
3272
|
this.setVisible(t), t && this.updateAbsolutePosition();
|
|
3273
|
-
const r =
|
|
3273
|
+
const r = St({
|
|
3274
3274
|
size: this.absolutePosition,
|
|
3275
3275
|
parent: a,
|
|
3276
3276
|
coords: { x: s, y: n }
|
|
@@ -3278,7 +3278,7 @@ class wa extends Z {
|
|
|
3278
3278
|
this.position(r.x, r.y);
|
|
3279
3279
|
}
|
|
3280
3280
|
}
|
|
3281
|
-
class xa extends
|
|
3281
|
+
class xa extends Fe {
|
|
3282
3282
|
constructor(t) {
|
|
3283
3283
|
super("trade", t);
|
|
3284
3284
|
f(this, "labelTooltip");
|
|
@@ -3293,7 +3293,7 @@ class xa extends pe {
|
|
|
3293
3293
|
function Ca(i, { color: e = "#000000", lineWidth: t = 1, dashed: s, coords: n }) {
|
|
3294
3294
|
i.strokeStyle = e, i.lineWidth = t, s && i.setLineDash(s), i.beginPath(), i.moveTo(n.x1, n.y1), i.lineTo(n.x2, n.y2), i.stroke();
|
|
3295
3295
|
}
|
|
3296
|
-
const
|
|
3296
|
+
const Aa = { text: "#FFFFFF", bg: "#000000" }, Ma = (i, e) => {
|
|
3297
3297
|
const {
|
|
3298
3298
|
coords: t,
|
|
3299
3299
|
text: s,
|
|
@@ -3304,27 +3304,27 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
|
|
|
3304
3304
|
borderRadius: c = 0,
|
|
3305
3305
|
colors: h,
|
|
3306
3306
|
align: u = { x: "left", y: "top" }
|
|
3307
|
-
} = e, g = { ...
|
|
3307
|
+
} = e, g = { ...Aa, ...h }, _ = getComputedStyle(
|
|
3308
3308
|
document.querySelector(".sc-charts-cs") || document.body
|
|
3309
3309
|
).font.replace(/^\s*\S+/, "").trim();
|
|
3310
|
-
i.font = `${a} ${n}px ${
|
|
3311
|
-
const b = i.measureText(s).width + o.x * 2,
|
|
3310
|
+
i.font = `${a} ${n}px ${_}`;
|
|
3311
|
+
const b = i.measureText(s).width + o.x * 2, x = r + o.y * 2;
|
|
3312
3312
|
let C = t.x, y = t.y;
|
|
3313
|
-
u.x === "middle" ? C -= b / 2 : u.x === "right" && (C -= b), u.y === "middle" ? y -=
|
|
3313
|
+
u.x === "middle" ? C -= b / 2 : u.x === "right" && (C -= b), u.y === "middle" ? y -= x / 2 : u.y === "bottom" && (y -= x), bi(i, {
|
|
3314
3314
|
radius: c,
|
|
3315
3315
|
coords: { x: C, y },
|
|
3316
3316
|
width: b,
|
|
3317
|
-
height:
|
|
3317
|
+
height: x,
|
|
3318
3318
|
fillColor: g.bg
|
|
3319
|
-
}), i.fillStyle = g.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(s, C + b / 2, y +
|
|
3320
|
-
},
|
|
3319
|
+
}), i.fillStyle = g.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(s, C + b / 2, y + x / 2);
|
|
3320
|
+
}, di = {
|
|
3321
3321
|
line: "#000000",
|
|
3322
3322
|
text: "#ffffff",
|
|
3323
3323
|
main: "#000000"
|
|
3324
|
-
},
|
|
3324
|
+
}, yi = (i, { text: e, startLineCoords: t, side: s, colors: n = di, dir: a = "h", endMarkerCoords: r }) => {
|
|
3325
3325
|
if (a === "h" && (s === "bottom" || s === "top"))
|
|
3326
3326
|
throw new Error("[drawMarker util]: Incorrect side or dir for this marker");
|
|
3327
|
-
const o = { ...
|
|
3327
|
+
const o = { ...di, ...n };
|
|
3328
3328
|
i.save(), Ca(i, {
|
|
3329
3329
|
color: o.line,
|
|
3330
3330
|
lineWidth: 1,
|
|
@@ -3335,7 +3335,7 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
|
|
|
3335
3335
|
x2: r.x,
|
|
3336
3336
|
y2: r.y
|
|
3337
3337
|
}
|
|
3338
|
-
}),
|
|
3338
|
+
}), Ma(i, {
|
|
3339
3339
|
text: e,
|
|
3340
3340
|
coords: r,
|
|
3341
3341
|
padding: { x: 6, y: 4 },
|
|
@@ -3352,17 +3352,17 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
|
|
|
3352
3352
|
}
|
|
3353
3353
|
}), i.restore();
|
|
3354
3354
|
};
|
|
3355
|
-
class
|
|
3355
|
+
class Sa extends Ne {
|
|
3356
3356
|
constructor(e) {
|
|
3357
3357
|
super(e);
|
|
3358
3358
|
}
|
|
3359
3359
|
drawMarker(e) {
|
|
3360
|
-
|
|
3360
|
+
yi(this.ctx, e);
|
|
3361
3361
|
}
|
|
3362
3362
|
}
|
|
3363
|
-
class
|
|
3363
|
+
class Ta extends Fe {
|
|
3364
3364
|
constructor(e) {
|
|
3365
|
-
if (super("user-markers", e, { CanvasClass:
|
|
3365
|
+
if (super("user-markers", e, { CanvasClass: Sa, noDOM: !0 }), !this.canvas) throw new Error("[CS_V_UserMarkers] this.canvas must be defined");
|
|
3366
3366
|
}
|
|
3367
3367
|
render(e) {
|
|
3368
3368
|
this.canvas.clear();
|
|
@@ -3391,7 +3391,7 @@ class Sa extends pe {
|
|
|
3391
3391
|
}
|
|
3392
3392
|
}
|
|
3393
3393
|
const ka = "sc-charts-cs";
|
|
3394
|
-
class
|
|
3394
|
+
class ae {
|
|
3395
3395
|
constructor(e) {
|
|
3396
3396
|
f(this, "block");
|
|
3397
3397
|
this.block = e;
|
|
@@ -3400,13 +3400,13 @@ class Q {
|
|
|
3400
3400
|
return `${ka}__${this.block}${e ? "-" + e : ""}`;
|
|
3401
3401
|
}
|
|
3402
3402
|
}
|
|
3403
|
-
const
|
|
3403
|
+
const vt = new ae("comment-actions");
|
|
3404
3404
|
class Da extends k {
|
|
3405
3405
|
constructor({ onDelete: e, onUpdate: t }) {
|
|
3406
|
-
super({ className:
|
|
3407
|
-
const s = new k({ tag: "button", className:
|
|
3406
|
+
super({ className: vt.gen() });
|
|
3407
|
+
const s = new k({ tag: "button", className: vt.gen("edit"), textContent: "Edit" }), n = new k({
|
|
3408
3408
|
tag: "button",
|
|
3409
|
-
className:
|
|
3409
|
+
className: vt.gen("delete"),
|
|
3410
3410
|
textContent: "Delete"
|
|
3411
3411
|
});
|
|
3412
3412
|
n.node.addEventListener("click", (a) => {
|
|
@@ -3416,7 +3416,7 @@ class Da extends k {
|
|
|
3416
3416
|
}), this.append(s.node, n.node);
|
|
3417
3417
|
}
|
|
3418
3418
|
}
|
|
3419
|
-
function
|
|
3419
|
+
function Tt(i, e) {
|
|
3420
3420
|
var n;
|
|
3421
3421
|
const t = (a) => {
|
|
3422
3422
|
if (!document.contains(i.node)) return;
|
|
@@ -3433,7 +3433,7 @@ function rt(i, e) {
|
|
|
3433
3433
|
document.removeEventListener("mousedown", t), s == null || s();
|
|
3434
3434
|
}, i;
|
|
3435
3435
|
}
|
|
3436
|
-
class
|
|
3436
|
+
class Ea {
|
|
3437
3437
|
constructor() {
|
|
3438
3438
|
f(this, "node");
|
|
3439
3439
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
|
@@ -3471,31 +3471,31 @@ class La {
|
|
|
3471
3471
|
this.node = t;
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
|
-
const
|
|
3475
|
-
class
|
|
3474
|
+
const Te = new ae("comment-list");
|
|
3475
|
+
class La extends k {
|
|
3476
3476
|
constructor({ onDelete: t, onOpenEditor: s, comment: n, layout: a }) {
|
|
3477
|
-
super({ className:
|
|
3477
|
+
super({ className: Te.gen("item") });
|
|
3478
3478
|
f(this, "actionTooltip");
|
|
3479
3479
|
f(this, "actionsTrigger");
|
|
3480
|
-
const r = new k({ className:
|
|
3481
|
-
className:
|
|
3480
|
+
const r = new k({ className: Te.gen("text"), textContent: n.text }), o = new k({
|
|
3481
|
+
className: Te.gen("created-at"),
|
|
3482
3482
|
textContent: fa(new Date(n.createdAt))
|
|
3483
3483
|
});
|
|
3484
3484
|
this.actionsTrigger = new k({
|
|
3485
3485
|
tag: "button",
|
|
3486
|
-
className:
|
|
3486
|
+
className: Te.gen("action-trigger")
|
|
3487
3487
|
});
|
|
3488
3488
|
const c = new Da({
|
|
3489
3489
|
onDelete: t,
|
|
3490
3490
|
onUpdate: s
|
|
3491
3491
|
});
|
|
3492
|
-
this.actionTooltip =
|
|
3492
|
+
this.actionTooltip = Tt(c, () => {
|
|
3493
3493
|
this.actionTooltip.setVisible(!1);
|
|
3494
3494
|
}), this.actionsTrigger.node.addEventListener("click", () => {
|
|
3495
3495
|
this.actionsTrigger.updateAbsolutePosition(), this.actionTooltip.updateAbsolutePosition(), this.actionTooltip.node.style.top = this.actionsTrigger.absolutePosition.top - a.chart.top + 20 + "px", this.actionTooltip.node.style.left = this.actionsTrigger.absolutePosition.left - a.chart.left - this.actionTooltip.absolutePosition.width + 10 + "px", this.actionTooltip.setVisible(!0);
|
|
3496
3496
|
});
|
|
3497
|
-
const h = new k({ className:
|
|
3498
|
-
this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new
|
|
3497
|
+
const h = new k({ className: Te.gen("text-wrap") });
|
|
3498
|
+
this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new Ea().node), this.append(h.node, o.node);
|
|
3499
3499
|
}
|
|
3500
3500
|
}
|
|
3501
3501
|
class Na {
|
|
@@ -3522,7 +3522,7 @@ class Fa {
|
|
|
3522
3522
|
), s.setAttribute("fill", "currentColor"), t.appendChild(s), this.node = t;
|
|
3523
3523
|
}
|
|
3524
3524
|
}
|
|
3525
|
-
class Ha extends
|
|
3525
|
+
class Ha extends ie {
|
|
3526
3526
|
constructor(t) {
|
|
3527
3527
|
super({ className: "sc-charts-cs__comments-edit" });
|
|
3528
3528
|
f(this, "input");
|
|
@@ -3552,8 +3552,8 @@ class Ha extends Z {
|
|
|
3552
3552
|
this.input.node.value = this.state.inputValue, this.saveBtn.node.disabled = !this.state.inputValue.trim(), this.state.hasInitFocused || (requestAnimationFrame(() => this.input.node.focus()), this.setState({ hasInitFocused: !0 }));
|
|
3553
3553
|
}
|
|
3554
3554
|
}
|
|
3555
|
-
const Ba = new
|
|
3556
|
-
class Ia extends
|
|
3555
|
+
const Ba = new ae("comment-list");
|
|
3556
|
+
class Ia extends ie {
|
|
3557
3557
|
constructor(t, s, n, a = {}) {
|
|
3558
3558
|
super({ tag: "ul", className: Ba.gen(), ...a });
|
|
3559
3559
|
f(this, "_elements", {});
|
|
@@ -3580,7 +3580,7 @@ class Ia extends Z {
|
|
|
3580
3580
|
},
|
|
3581
3581
|
initialValue: t.text
|
|
3582
3582
|
});
|
|
3583
|
-
const s = new
|
|
3583
|
+
const s = new La({
|
|
3584
3584
|
onDelete: () => {
|
|
3585
3585
|
this._model.comments.remove(t.id), s.actionTooltip.setVisible(!1);
|
|
3586
3586
|
},
|
|
@@ -3608,20 +3608,20 @@ class Ra {
|
|
|
3608
3608
|
), s.setAttribute("stroke", "currentColor"), s.setAttribute("stroke-linecap", "round"), s.setAttribute("stroke-linejoin", "round"), t.appendChild(s), this.node = t;
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
const
|
|
3612
|
-
class
|
|
3611
|
+
const Ge = new ae(""), bt = new ae("add-field");
|
|
3612
|
+
class wi extends ie {
|
|
3613
3613
|
constructor({ onAdd: t, blockName: s }) {
|
|
3614
|
-
|
|
3615
|
-
super({ className:
|
|
3614
|
+
Ge.block = s;
|
|
3615
|
+
super({ className: Ge.gen() + " " + bt.gen() });
|
|
3616
3616
|
f(this, "btn");
|
|
3617
3617
|
f(this, "input");
|
|
3618
3618
|
f(this, "_onAdd");
|
|
3619
3619
|
this._onAdd = t, this.state = { inputValue: "" }, this.input = new k({
|
|
3620
3620
|
tag: "input",
|
|
3621
|
-
className:
|
|
3621
|
+
className: Ge.gen("input") + " " + bt.gen("input")
|
|
3622
3622
|
}), this.input.node.setAttribute("placeholder", "Add comment..."), this.btn = new k({
|
|
3623
3623
|
tag: "button",
|
|
3624
|
-
className:
|
|
3624
|
+
className: Ge.gen("btn") + " " + bt.gen("btn")
|
|
3625
3625
|
}), this.btn.append(new Ra().node), this.append(this.input.node, this.btn.node), this._setupListeners(), this.render();
|
|
3626
3626
|
}
|
|
3627
3627
|
_addComment() {
|
|
@@ -3641,8 +3641,8 @@ class ai extends Z {
|
|
|
3641
3641
|
this.btn.node.disabled = !this.state.inputValue.trim();
|
|
3642
3642
|
}
|
|
3643
3643
|
}
|
|
3644
|
-
const $a = new
|
|
3645
|
-
class
|
|
3644
|
+
const $a = new ae("list-tooltip"), yt = 8;
|
|
3645
|
+
class Oa extends ie {
|
|
3646
3646
|
constructor(t, s, n) {
|
|
3647
3647
|
super({ className: $a.gen() });
|
|
3648
3648
|
f(this, "_list");
|
|
@@ -3650,7 +3650,7 @@ class Pa extends Z {
|
|
|
3650
3650
|
f(this, "_size", null);
|
|
3651
3651
|
f(this, "_model");
|
|
3652
3652
|
f(this, "_prevIsShow", !1);
|
|
3653
|
-
this._model = s, this.state = { isShow: !1, comments: t }, this._list = new Ia(t, s, n), this._addField = new
|
|
3653
|
+
this._model = s, this.state = { isShow: !1, comments: t }, this._list = new Ia(t, s, n), this._addField = new wi({
|
|
3654
3654
|
blockName: "list-tooltip-add",
|
|
3655
3655
|
onAdd: (a) => {
|
|
3656
3656
|
const r = t[0].date, o = t[0].price, c = {
|
|
@@ -3666,7 +3666,7 @@ class Pa extends Z {
|
|
|
3666
3666
|
}
|
|
3667
3667
|
render() {
|
|
3668
3668
|
const { isShow: t, comments: s } = this.state, { width: n, height: a } = this._model.layout.area;
|
|
3669
|
-
this._prevIsShow !== t && (this._list.forceUpdate(), this._prevIsShow = t), this.node.style.maxHeight = a / 2 -
|
|
3669
|
+
this._prevIsShow !== t && (this._list.forceUpdate(), this._prevIsShow = t), this.node.style.maxHeight = a / 2 - yt + "px", this.setVisible(t), t && !this._size && (this.updateAbsolutePosition(), this._size = this.absolutePosition, this.position(n / 2 - this._size.width - yt, a / 2 + yt)), this._list.setState({ items: s }), requestAnimationFrame(() => {
|
|
3670
3670
|
this._list.node.scrollTop = this._list.node.scrollHeight;
|
|
3671
3671
|
});
|
|
3672
3672
|
}
|
|
@@ -3674,7 +3674,7 @@ class Pa extends Z {
|
|
|
3674
3674
|
return this._list;
|
|
3675
3675
|
}
|
|
3676
3676
|
}
|
|
3677
|
-
class
|
|
3677
|
+
class Pa {
|
|
3678
3678
|
constructor() {
|
|
3679
3679
|
f(this, "node");
|
|
3680
3680
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
|
@@ -3686,7 +3686,7 @@ class Oa {
|
|
|
3686
3686
|
), s.setAttribute("fill", "currentColor"), t.appendChild(s), this.node = t;
|
|
3687
3687
|
}
|
|
3688
3688
|
}
|
|
3689
|
-
class za extends
|
|
3689
|
+
class za extends ie {
|
|
3690
3690
|
constructor({ x: t, ...s }, n) {
|
|
3691
3691
|
super(s);
|
|
3692
3692
|
f(this, "_colors");
|
|
@@ -3694,7 +3694,7 @@ class za extends Z {
|
|
|
3694
3694
|
x: t,
|
|
3695
3695
|
y: n.layout.xAxis.top,
|
|
3696
3696
|
isActive: !1
|
|
3697
|
-
}, this.node.append(new
|
|
3697
|
+
}, this.node.append(new Pa().node), this.render();
|
|
3698
3698
|
}
|
|
3699
3699
|
render() {
|
|
3700
3700
|
const { x: t, y: s, isActive: n } = this.state;
|
|
@@ -3703,10 +3703,10 @@ class za extends Z {
|
|
|
3703
3703
|
this.node.style.backgroundColor = this._colors[`bg${a}`], this.node.style.color = this._colors[`icon${a}`];
|
|
3704
3704
|
}
|
|
3705
3705
|
}
|
|
3706
|
-
const
|
|
3707
|
-
class Va extends
|
|
3706
|
+
const ui = new ae("comment-box");
|
|
3707
|
+
class Va extends ie {
|
|
3708
3708
|
constructor({ boxId: t, model: s, view: n, comments: a, coords: r, onBoxActivate: o, onBoxDeactivate: c }) {
|
|
3709
|
-
super({ className:
|
|
3709
|
+
super({ className: ui.gen() });
|
|
3710
3710
|
f(this, "pointer", new k({ className: "sc-charts-cs__comments-pointer" }));
|
|
3711
3711
|
f(this, "tooltip");
|
|
3712
3712
|
f(this, "anchor");
|
|
@@ -3717,10 +3717,10 @@ class Va extends Z {
|
|
|
3717
3717
|
isActive: !1,
|
|
3718
3718
|
comments: a,
|
|
3719
3719
|
coords: r
|
|
3720
|
-
}, this.pointer.position(r), this.anchor = new za({ x: r.x, className:
|
|
3720
|
+
}, this.pointer.position(r), this.anchor = new za({ x: r.x, className: ui.gen("anchor") }, s), this.anchor.node.addEventListener("click", () => {
|
|
3721
3721
|
const h = !this.state.isActive;
|
|
3722
3722
|
h ? this._onBoxActivate(this._boxId) : this._onBoxDeactivate(this._boxId), this.setState({ isActive: h });
|
|
3723
|
-
}), this.tooltip =
|
|
3723
|
+
}), this.tooltip = Tt(new Oa(a, s, n), (h) => {
|
|
3724
3724
|
this.state.isActive && (this.anchor.node.contains(h.target) || (this._onBoxDeactivate(this._boxId), this.setState({ isActive: !1 })));
|
|
3725
3725
|
}), this.append(this.pointer.node, this.anchor.node, this.tooltip.node), this.render();
|
|
3726
3726
|
}
|
|
@@ -3729,11 +3729,11 @@ class Va extends Z {
|
|
|
3729
3729
|
this.pointer.position(n), this.pointer.setVisible(t), this.anchor.setState({ x: n.x, isActive: t }), this.tooltip.setState({ comments: s, isShow: t });
|
|
3730
3730
|
}
|
|
3731
3731
|
}
|
|
3732
|
-
class
|
|
3732
|
+
class Ya {
|
|
3733
3733
|
static animateTo(e, t, s, n) {
|
|
3734
|
-
const a = e.scales.panOffsetX + (e.layout.area.width / 2 - t), r = e.scales.panOffsetY + (e.layout.area.height / 2 - s), o = 300, c = performance.now(), h = e.scales.panOffsetX, u = e.scales.panOffsetY, g = (
|
|
3735
|
-
const
|
|
3736
|
-
e.scales.pan("x",
|
|
3734
|
+
const a = e.scales.panOffsetX + (e.layout.area.width / 2 - t), r = e.scales.panOffsetY + (e.layout.area.height / 2 - s), o = 300, c = performance.now(), h = e.scales.panOffsetX, u = e.scales.panOffsetY, g = (p) => {
|
|
3735
|
+
const _ = p - c, v = Math.min(_ / o, 1), b = v * v * (3 - 2 * v), x = h + (a - h) * b, C = u + (r - u) * b;
|
|
3736
|
+
e.scales.pan("x", x, "absolute"), e.scales.pan("y", C, "absolute"), v < 1 ? requestAnimationFrame(g) : n == null || n();
|
|
3737
3737
|
};
|
|
3738
3738
|
requestAnimationFrame(g);
|
|
3739
3739
|
}
|
|
@@ -3742,19 +3742,19 @@ class ja {
|
|
|
3742
3742
|
this.animateTo(e, a, r, n);
|
|
3743
3743
|
}
|
|
3744
3744
|
}
|
|
3745
|
-
const
|
|
3746
|
-
class
|
|
3745
|
+
const wt = new ae("comments-context");
|
|
3746
|
+
class Wa extends ie {
|
|
3747
3747
|
constructor() {
|
|
3748
|
-
super({ className:
|
|
3748
|
+
super({ className: wt.gen() });
|
|
3749
3749
|
f(this, "pointer");
|
|
3750
3750
|
f(this, "addField");
|
|
3751
3751
|
f(this, "menu");
|
|
3752
3752
|
f(this, "_size", null);
|
|
3753
3753
|
f(this, "_model", null);
|
|
3754
3754
|
f(this, "_candle", null);
|
|
3755
|
-
this.state = { candle: null, isShow: !1, model: null }, this.pointer = new k({ className:
|
|
3755
|
+
this.state = { candle: null, isShow: !1, model: null }, this.pointer = new k({ className: wt.gen("pointer") }), this.menu = new k({ className: wt.gen("menu") }), Tt(this.menu, () => {
|
|
3756
3756
|
this.setState({ isShow: !1 });
|
|
3757
|
-
}), this.addField = new
|
|
3757
|
+
}), this.addField = new wi({
|
|
3758
3758
|
blockName: "context-add",
|
|
3759
3759
|
onAdd: (t) => {
|
|
3760
3760
|
!this._model || !this._candle || (this._model.comments.add({
|
|
@@ -3779,7 +3779,7 @@ class Ya extends Z {
|
|
|
3779
3779
|
y: n == null ? void 0 : n.scales.y.convert((t.open + t.close) / 2)
|
|
3780
3780
|
};
|
|
3781
3781
|
this.pointer.position(a), this._size || (this.menu.position(a), this.menu.updateAbsolutePosition());
|
|
3782
|
-
const r =
|
|
3782
|
+
const r = St({
|
|
3783
3783
|
size: this.menu.absolutePosition,
|
|
3784
3784
|
parent: n.layout.area,
|
|
3785
3785
|
offset: 9,
|
|
@@ -3788,14 +3788,14 @@ class Ya extends Z {
|
|
|
3788
3788
|
this._changeInputCorner(r.side), this.menu.position(r.x, r.y);
|
|
3789
3789
|
}
|
|
3790
3790
|
}
|
|
3791
|
-
class
|
|
3791
|
+
class ja extends Fe {
|
|
3792
3792
|
constructor(t) {
|
|
3793
3793
|
super("comments", t, { noCanvas: !0 });
|
|
3794
3794
|
f(this, "boxes", {});
|
|
3795
3795
|
f(this, "contextMenu");
|
|
3796
3796
|
f(this, "_view");
|
|
3797
3797
|
if (!this.dom) throw new Error("[CS_V_Comments] this.dom must be defined");
|
|
3798
|
-
this.contextMenu = new
|
|
3798
|
+
this.contextMenu = new Wa(), this._view = t, t.domElements.append(this.contextMenu.node);
|
|
3799
3799
|
}
|
|
3800
3800
|
_getCandleCoords(t, s) {
|
|
3801
3801
|
return {
|
|
@@ -3812,7 +3812,7 @@ class Wa extends pe {
|
|
|
3812
3812
|
view: this._view,
|
|
3813
3813
|
onBoxActivate: (o) => {
|
|
3814
3814
|
const c = a[0].candle;
|
|
3815
|
-
|
|
3815
|
+
Ya.animateToDataCoords(n, c.open_time, (c.open + c.close) / 2), this.boxes[o].setState({ isActive: !0 });
|
|
3816
3816
|
},
|
|
3817
3817
|
onBoxDeactivate: (o) => this.boxes[o].setState({ isActive: !1 })
|
|
3818
3818
|
});
|
|
@@ -3829,12 +3829,12 @@ class Wa extends pe {
|
|
|
3829
3829
|
});
|
|
3830
3830
|
}
|
|
3831
3831
|
}
|
|
3832
|
-
class Xa extends
|
|
3832
|
+
class Xa extends Ne {
|
|
3833
3833
|
constructor(e) {
|
|
3834
3834
|
super(e);
|
|
3835
3835
|
}
|
|
3836
3836
|
drawMarker({ text: e, startLineCoords: t, endMarkerCoords: s, colors: n, type: a, side: r }) {
|
|
3837
|
-
|
|
3837
|
+
yi(this.ctx, {
|
|
3838
3838
|
text: e,
|
|
3839
3839
|
colors: n,
|
|
3840
3840
|
startLineCoords: t,
|
|
@@ -3844,7 +3844,7 @@ class Xa extends _e {
|
|
|
3844
3844
|
});
|
|
3845
3845
|
}
|
|
3846
3846
|
}
|
|
3847
|
-
class Ua extends
|
|
3847
|
+
class Ua extends Fe {
|
|
3848
3848
|
constructor(e) {
|
|
3849
3849
|
if (super("guides", e, { CanvasClass: Xa, noDOM: !0 }), !this.canvas) throw new Error("[CS_V_Guides] Canvas must be defined");
|
|
3850
3850
|
}
|
|
@@ -3873,17 +3873,17 @@ class Ua extends pe {
|
|
|
3873
3873
|
}
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
3876
|
-
class Ga extends
|
|
3876
|
+
class Ga extends ie {
|
|
3877
3877
|
constructor(t) {
|
|
3878
3878
|
super({ className: t });
|
|
3879
3879
|
f(this, "_isFirstShow", !1);
|
|
3880
3880
|
const s = new k({ tag: "p" });
|
|
3881
|
-
s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent:
|
|
3881
|
+
s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent: W.empty() }, this.render();
|
|
3882
3882
|
}
|
|
3883
3883
|
render() {
|
|
3884
3884
|
const { isShow: t, x: s, y: n, parent: a } = this.state;
|
|
3885
3885
|
t && !this._isFirstShow && (this.updateAbsolutePosition(), this._isFirstShow = !0), this.setVisible(t);
|
|
3886
|
-
const r =
|
|
3886
|
+
const r = St({
|
|
3887
3887
|
size: this.absolutePosition,
|
|
3888
3888
|
parent: a,
|
|
3889
3889
|
coords: { x: s, y: n }
|
|
@@ -3891,7 +3891,7 @@ class Ga extends Z {
|
|
|
3891
3891
|
this.position(r.x, r.y);
|
|
3892
3892
|
}
|
|
3893
3893
|
}
|
|
3894
|
-
class Za extends
|
|
3894
|
+
class Za extends Ne {
|
|
3895
3895
|
constructor(t) {
|
|
3896
3896
|
super(t);
|
|
3897
3897
|
f(this, "domain", null);
|
|
@@ -3916,22 +3916,22 @@ class Za extends _e {
|
|
|
3916
3916
|
}
|
|
3917
3917
|
} = t, h = t.config.candles.style === "filled";
|
|
3918
3918
|
this.domain = t.scales.x.domain(), c || this._getVisible(r).forEach((u, g) => {
|
|
3919
|
-
const
|
|
3919
|
+
const p = s.noDataFill[g % s.noDataFill.length], _ = h ? p : s.noDataStroke;
|
|
3920
3920
|
this.drawSingleCandle({
|
|
3921
3921
|
...this._getBasicCandleProps(t, u),
|
|
3922
|
-
colors: { fill:
|
|
3922
|
+
colors: { fill: p, stroke: _, bg: n }
|
|
3923
3923
|
});
|
|
3924
3924
|
}), this._getVisible(o).forEach((u) => {
|
|
3925
|
-
const g = u.close >= u.open ? "rising" : "falling",
|
|
3925
|
+
const g = u.close >= u.open ? "rising" : "falling", p = s[`${g}Fill`], _ = s[`${g}${h ? "Fill" : "Stroke"}`];
|
|
3926
3926
|
this.drawSingleCandle({
|
|
3927
3927
|
...this._getBasicCandleProps(t, u),
|
|
3928
|
-
colors: { fill:
|
|
3928
|
+
colors: { fill: p, stroke: _, bg: n },
|
|
3929
3929
|
isDim: !!(a.length && !a.includes(u.open_time.getTime()))
|
|
3930
3930
|
});
|
|
3931
3931
|
});
|
|
3932
3932
|
}
|
|
3933
3933
|
_mix(t, s, n) {
|
|
3934
|
-
return n ?
|
|
3934
|
+
return n ? M.mix(t, s).toString() : t;
|
|
3935
3935
|
}
|
|
3936
3936
|
_getBasicCandleProps(t, s) {
|
|
3937
3937
|
return {
|
|
@@ -3947,7 +3947,7 @@ class Za extends _e {
|
|
|
3947
3947
|
};
|
|
3948
3948
|
}
|
|
3949
3949
|
}
|
|
3950
|
-
class qa extends
|
|
3950
|
+
class qa extends Fe {
|
|
3951
3951
|
constructor(t) {
|
|
3952
3952
|
super("candles", t, { CanvasClass: Za });
|
|
3953
3953
|
f(this, "_noDataTooltip", null);
|
|
@@ -3989,15 +3989,15 @@ class Ja {
|
|
|
3989
3989
|
f(this, "candles");
|
|
3990
3990
|
this.container = e, this.wrapper = new k({ tag: "div", className: "sc-charts-cs" }), e.append(this.wrapper.node);
|
|
3991
3991
|
const { width: t, height: s } = e.getBoundingClientRect();
|
|
3992
|
-
this.width = t, this.height = s, this.mainCanvas = new
|
|
3992
|
+
this.width = t, this.height = s, this.mainCanvas = new Ne({
|
|
3993
3993
|
className: "sc-charts-cs__canvas-main",
|
|
3994
3994
|
width: t,
|
|
3995
3995
|
height: s,
|
|
3996
3996
|
isMain: !0
|
|
3997
|
-
}), this.domElements = new k({ tag: "div", className: "sc-charts-cs__dom-elements" }), this.canvasesContainer = new k({ tag: "div", className: "sc-charts-cs__canvases" }), this.canvasesContainer.append(this.mainCanvas.node), this.wrapper.append(this.canvasesContainer.node, this.domElements.node), this.mainCanvas.updateAbsolutePosition(), this.binding = new Rn(this.mainCanvas.node), this.comments = new
|
|
3997
|
+
}), this.domElements = new k({ tag: "div", className: "sc-charts-cs__dom-elements" }), this.canvasesContainer = new k({ tag: "div", className: "sc-charts-cs__canvases" }), this.canvasesContainer.append(this.mainCanvas.node), this.wrapper.append(this.canvasesContainer.node, this.domElements.node), this.mainCanvas.updateAbsolutePosition(), this.binding = new Rn(this.mainCanvas.node), this.comments = new ja(this), this.candles = new qa(this), this.trade = new xa(this), this.guideMarkers = new Ua(this), this.userMarkers = new Ta(this);
|
|
3998
3998
|
}
|
|
3999
3999
|
renderAll(e) {
|
|
4000
|
-
this.mainCanvas.clear(), this.candles.render(e),
|
|
4000
|
+
this.mainCanvas.clear(), this.candles.render(e), pt.xAxis(this.mainCanvas.ctx, e), pt.yAxis(this.mainCanvas.ctx, e), pt.intersection(this.mainCanvas.ctx, e), this.trade.renderAll(e), this.userMarkers.render(e), this.comments.render(e);
|
|
4001
4001
|
}
|
|
4002
4002
|
}
|
|
4003
4003
|
class Qa {
|
|
@@ -4085,7 +4085,7 @@ class Ka {
|
|
|
4085
4085
|
});
|
|
4086
4086
|
}
|
|
4087
4087
|
}
|
|
4088
|
-
class
|
|
4088
|
+
class fi {
|
|
4089
4089
|
constructor() {
|
|
4090
4090
|
f(this, "_map", /* @__PURE__ */ new Map());
|
|
4091
4091
|
}
|
|
@@ -4119,7 +4119,7 @@ class Jt {
|
|
|
4119
4119
|
class er {
|
|
4120
4120
|
constructor() {
|
|
4121
4121
|
f(this, "_elements", []);
|
|
4122
|
-
f(this, "_listeners", new
|
|
4122
|
+
f(this, "_listeners", new fi());
|
|
4123
4123
|
f(this, "_lastHovered", /* @__PURE__ */ new Set());
|
|
4124
4124
|
f(this, "_dragContext", null);
|
|
4125
4125
|
}
|
|
@@ -4133,7 +4133,7 @@ class er {
|
|
|
4133
4133
|
this._elements = this._elements.filter((t) => t !== e), this._listeners.removeAll(e), this._lastHovered.delete(e);
|
|
4134
4134
|
}
|
|
4135
4135
|
clear() {
|
|
4136
|
-
this._elements = [], this._listeners = new
|
|
4136
|
+
this._elements = [], this._listeners = new fi(), this._lastHovered.clear();
|
|
4137
4137
|
}
|
|
4138
4138
|
on(e, t, s) {
|
|
4139
4139
|
this._listeners.add(e, t, s);
|
|
@@ -4275,8 +4275,8 @@ class tr {
|
|
|
4275
4275
|
}
|
|
4276
4276
|
} = this.model;
|
|
4277
4277
|
for (const o of s) {
|
|
4278
|
-
const c = n.convert(o.open_time), h = a.convert(o.high), u = a.convert(o.low), g = c - r / 2,
|
|
4279
|
-
if (e >= g && e <=
|
|
4278
|
+
const c = n.convert(o.open_time), h = a.convert(o.high), u = a.convert(o.low), g = c - r / 2, p = c + r / 2, _ = Math.min(h, u), v = Math.max(h, u);
|
|
4279
|
+
if (e >= g && e <= p && t >= _ && t <= v)
|
|
4280
4280
|
return {
|
|
4281
4281
|
target: this,
|
|
4282
4282
|
x: e,
|
|
@@ -4313,11 +4313,11 @@ class sr {
|
|
|
4313
4313
|
hitTest(e, t) {
|
|
4314
4314
|
const { tradedCandles: s } = this.model.trade, { x: n, y: a } = this.model.scales, r = 16, o = 4;
|
|
4315
4315
|
for (const { candle: c, trades: h } of s) {
|
|
4316
|
-
const g = n.convert(c.open_time) + this.model.config.candles.baseWidth / 2,
|
|
4316
|
+
const g = n.convert(c.open_time) + this.model.config.candles.baseWidth / 2, p = r, _ = r;
|
|
4317
4317
|
for (const v of ["buy", "sell"]) {
|
|
4318
|
-
const b = h.filter((
|
|
4318
|
+
const b = h.filter((w) => w.type === v);
|
|
4319
4319
|
if (!b.length) continue;
|
|
4320
|
-
const
|
|
4320
|
+
const x = v === "buy" ? a.convert(c.low) + o + qe(r) : a.convert(c.high) - o - r - qe(r), C = e >= g - p / 2 && e <= g + p / 2, y = t >= x && t <= x + _;
|
|
4321
4321
|
if (C && y)
|
|
4322
4322
|
return {
|
|
4323
4323
|
target: this,
|
|
@@ -4346,7 +4346,7 @@ class nr {
|
|
|
4346
4346
|
if (!t) return;
|
|
4347
4347
|
const s = this._model.scales.x.convert(t.candle.open_time), n = this._model.scales.y.convert(
|
|
4348
4348
|
t.trades[0].type === "buy" ? t.candle.low : t.candle.high
|
|
4349
|
-
), a = t.trades[0].type === "buy" ? n + 4 +
|
|
4349
|
+
), a = t.trades[0].type === "buy" ? n + 4 + qe(16) + 8 : n - 4 - 16 - qe(16) + 8;
|
|
4350
4350
|
this._model.eventBus.emit("open_trade_label_tooltip", {
|
|
4351
4351
|
trade: { candle: t.candle, trades: t.trades, tradeType: t.tradeType },
|
|
4352
4352
|
x: s,
|
|
@@ -4423,14 +4423,14 @@ function cr(i, e) {
|
|
|
4423
4423
|
}));
|
|
4424
4424
|
};
|
|
4425
4425
|
}
|
|
4426
|
-
function
|
|
4426
|
+
function Ct(i, e) {
|
|
4427
4427
|
const { width: t } = e.candles.limiter.absolutePosition, s = i.config.candles.baseWidth, n = i.config.candles.limiterOffset.left + i.config.candles.limiterOffset.right, r = i.scales.x.convert(i.candles.allData[0].open_time) - t - s / 2 - n;
|
|
4428
4428
|
r > 0 && i.scales.pan("x", -r);
|
|
4429
4429
|
}
|
|
4430
|
-
function
|
|
4430
|
+
function At(i) {
|
|
4431
4431
|
return i.candles.limiter.absolutePosition.width > 0;
|
|
4432
4432
|
}
|
|
4433
|
-
class
|
|
4433
|
+
class kt {
|
|
4434
4434
|
constructor(e, t, s) {
|
|
4435
4435
|
f(this, "_model");
|
|
4436
4436
|
f(this, "_hitManager");
|
|
@@ -4438,7 +4438,7 @@ class ot {
|
|
|
4438
4438
|
this._model = e, this._hitManager = t, this._hit = s, t.register(s);
|
|
4439
4439
|
}
|
|
4440
4440
|
}
|
|
4441
|
-
class hr extends
|
|
4441
|
+
class hr extends kt {
|
|
4442
4442
|
constructor(t, s, n) {
|
|
4443
4443
|
super(t, s, new ar(t));
|
|
4444
4444
|
f(this, "_view");
|
|
@@ -4447,13 +4447,13 @@ class hr extends ot {
|
|
|
4447
4447
|
register() {
|
|
4448
4448
|
this._hitManager.on(this._hit, "drag", (t) => {
|
|
4449
4449
|
const s = t.x - (t.prevX ?? t.x);
|
|
4450
|
-
this._model.scales.scale("x", -s), this._view &&
|
|
4450
|
+
this._model.scales.scale("x", -s), this._view && At(this._view) && Ct(this._model, this._view);
|
|
4451
4451
|
}), this._hitManager.on(this._hit, "dblclick", () => {
|
|
4452
4452
|
this._model.scales.scale("x", 1, "absolute"), this._model.scales.pan("x", 0, "absolute");
|
|
4453
4453
|
});
|
|
4454
4454
|
}
|
|
4455
4455
|
}
|
|
4456
|
-
class dr extends
|
|
4456
|
+
class dr extends kt {
|
|
4457
4457
|
constructor(e, t) {
|
|
4458
4458
|
super(e, t, new or(e));
|
|
4459
4459
|
}
|
|
@@ -4466,7 +4466,7 @@ class dr extends ot {
|
|
|
4466
4466
|
});
|
|
4467
4467
|
}
|
|
4468
4468
|
}
|
|
4469
|
-
class ur extends
|
|
4469
|
+
class ur extends kt {
|
|
4470
4470
|
constructor(t, s, n) {
|
|
4471
4471
|
super(t, n, new rr(t));
|
|
4472
4472
|
f(this, "_view");
|
|
@@ -4485,16 +4485,16 @@ class ur extends ot {
|
|
|
4485
4485
|
this._hit,
|
|
4486
4486
|
"drag",
|
|
4487
4487
|
cr(1, (t) => {
|
|
4488
|
-
this._model.scales.pan("x", t.x - (t.prevX ?? t.x)),
|
|
4488
|
+
this._model.scales.pan("x", t.x - (t.prevX ?? t.x)), At(this._view) && Ct(this._model, this._view), this._model.scales.pan("y", t.y - (t.prevY ?? t.y)), this._view.guideMarkers.render(this._model, { x: t.x, y: t.y });
|
|
4489
4489
|
})
|
|
4490
4490
|
), this._hitManager.on(this._hit, "contextmenu", ({ x: t }) => {
|
|
4491
|
-
const s = this._model.scales.x.invert(t), n =
|
|
4491
|
+
const s = this._model.scales.x.invert(t), n = Mt.findByDate(s, this._model.candles.allData);
|
|
4492
4492
|
n && (this._view.comments.contextMenu.setState({ isShow: !0, candle: n }), this._view.comments.render(this._model));
|
|
4493
4493
|
}), this._hitManager.on(this._hit, "wheel", (t) => {
|
|
4494
4494
|
var a, r;
|
|
4495
4495
|
if (!t.deltaY) return;
|
|
4496
4496
|
const s = -t.deltaY, n = (r = (a = this._model.config) == null ? void 0 : a.candles) == null ? void 0 : r.zoomOnWheel;
|
|
4497
|
-
["x", "both"].includes(n) && (this._model.scales.scale("x", s),
|
|
4497
|
+
["x", "both"].includes(n) && (this._model.scales.scale("x", s), At(this._view) && Ct(this._model, this._view)), ["y", "both"].includes(n) && this._model.scales.scale("y", s);
|
|
4498
4498
|
});
|
|
4499
4499
|
}
|
|
4500
4500
|
}
|
|
@@ -4628,32 +4628,32 @@ class pr {
|
|
|
4628
4628
|
updateComments(e) {
|
|
4629
4629
|
this._model.updateComments(e);
|
|
4630
4630
|
}
|
|
4631
|
-
async _drawHeader(e, t, s) {
|
|
4632
|
-
const
|
|
4633
|
-
e.fillStyle = "#FFFFFF", e.fillRect(0, 0, t,
|
|
4634
|
-
const
|
|
4635
|
-
<path d="M92.6267 1.50666H93.0475C93.3792 1.50666 93.6025 1.31028 93.6025 1.02537C93.6025 0.740457 93.4034 0.561783 93.0426 0.561783C92.706 0.561783 92.4827 0.759773 92.4633 1.06239H91.795C91.8209 0.423351 92.3225 0.00805664 93.075 0.00805664C93.8274 0.00805664 94.2886 0.376671 94.2886 0.928788C94.2886 1.35213 93.9973 1.65797 93.5717 1.73523V1.74972C94.0895 1.79318 94.4229 2.10385 94.4229 2.58192C94.4229 3.20164 93.8581 3.61372 93.0572 3.61372C92.2562 3.61372 91.761 3.18555 91.7271 2.54973H92.4212C92.4423 2.84108 92.6834 3.03263 93.0652 3.03263C93.4471 3.03263 93.6834 2.82981 93.6834 2.53685C93.6834 2.22135 93.4455 2.0298 93.0539 2.0298H92.6251V1.50827L92.6267 1.50666Z" fill="
|
|
4636
|
-
<path d="M95.1182 2.97623C94.9256 2.68488 94.8269 2.29373 94.8269 1.83498C94.8269 0.692113 95.3852 0.00317383 96.2816 0.00317383C96.9434 0.00317383 97.4596 0.392714 97.5567 0.957708H96.8431C96.7735 0.727525 96.5502 0.574607 96.2784 0.574607C95.7945 0.574607 95.5017 1.03658 95.5178 1.81566H95.5324C95.6716 1.47763 96.013 1.25389 96.4564 1.25389C97.1149 1.25389 97.6036 1.73679 97.6036 2.39192C97.6036 3.10179 97.0486 3.61205 96.2719 3.61205C95.7735 3.61205 95.3625 3.3867 95.1198 2.97623H95.1182ZM96.8949 2.41446C96.8949 2.05872 96.6279 1.79796 96.2654 1.79796C95.903 1.79796 95.6311 2.05872 95.6311 2.40802C95.6311 2.75732 95.9078 3.0374 96.2638 3.0374C96.6198 3.0374 96.8965 2.76215 96.8965 2.41607L96.8949 2.41446Z" fill="
|
|
4637
|
-
<path d="M97.998 1.79961C97.998 0.68411 98.5336 0 99.4026 0C100.272 0 100.804 0.6825 100.804 1.79639C100.804 2.91028 100.275 3.60727 99.4026 3.60727C98.5304 3.60727 97.998 2.91672 97.998 1.798V1.79961ZM100.066 1.79961C100.066 1.01892 99.8136 0.579481 99.4026 0.579481C98.9916 0.579481 98.7359 1.02214 98.7359 1.79961C98.7359 2.57708 98.9883 3.0294 99.4026 3.0294C99.8168 3.0294 100.066 2.58674 100.066 1.79961Z" fill="
|
|
4638
|
-
<path d="M101.137 0.809958C101.137 0.381786 101.469 0.048584 101.901 0.048584C102.333 0.048584 102.666 0.381786 102.666 0.809958C102.666 1.23813 102.331 1.57294 101.901 1.57294C101.47 1.57294 101.137 1.23974 101.137 0.809958ZM102.249 0.809958C102.249 0.616798 102.097 0.46066 101.902 0.46066C101.708 0.46066 101.556 0.616798 101.556 0.809958C101.556 1.00312 101.715 1.16087 101.902 1.16087C102.1 1.16087 102.249 0.998289 102.249 0.809958Z" fill="
|
|
4639
|
-
<path d="M42.5486 0.0388184C37.204 0.0388184 33.5098 3.06983 33.5098 7.50447C33.5098 11.9391 37.204 15.02 42.5486 15.02C47.8933 15.02 51.5018 11.9375 51.5018 7.49803C51.5018 3.05856 47.8642 0.0388184 42.5486 0.0388184ZM42.5486 12.2836C39.0227 12.2836 36.5519 10.3327 36.5519 7.4771C36.5519 4.62155 39.0179 2.78331 42.5486 2.78331C46.0794 2.78331 48.4613 4.67789 48.4613 7.4771C48.4613 10.2763 45.9872 12.2787 42.5486 12.2787V12.2852V12.2836Z" fill="
|
|
4640
|
-
<path d="M10.4321 6.17332H5.62948C2.78642 6.17332 2.01943 2.78013 7.93208 2.78013C10.4337 2.78013 12.3949 3.85539 13.2476 4.41878L14.7833 2.10085C13.3318 0.827603 10.7751 0.0356445 7.90457 0.0356445C-1.589 0.0356445 -1.70389 8.85825 5.65861 8.85825H10.4903C13.6166 8.85825 14.1279 12.2804 7.93208 12.2804C4.83336 12.2804 2.38836 10.6402 1.53561 10.0172L0 12.3367C1.45146 13.6084 4.51944 15.0217 7.95797 15.0217C17.9062 15.0152 18.0211 6.17171 10.4321 6.17171V6.17332Z" fill="
|
|
4641
|
-
<path d="M26.0314 12.2771C22.3939 12.2771 20.0346 10.3262 20.0346 7.527C20.0346 4.72779 22.3648 2.7817 26.0023 2.7817C28.0784 2.7817 30.0104 3.85696 31.1755 4.93061L32.9166 2.52737C31.2677 1.22836 28.737 0.0388184 26.0088 0.0388184C20.5508 0.0388184 16.999 3.09397 16.999 7.53344C16.999 11.9729 20.6042 15.02 26.0654 15.02C28.8502 15.02 31.381 13.7757 33.0282 12.4751L31.2386 10.1266C30.0687 11.2067 28.135 12.2771 26.0314 12.2771Z" fill="
|
|
4642
|
-
<path d="M80.9771 0.0372542C75.8605 0.0372542 72.3071 3.09241 72.3071 7.53188C72.3071 11.9714 76.3719 15.0185 81.9156 15.0185C84.8428 15.0185 87.2829 14.0575 88.8218 12.7569L87.0289 10.4148C85.9771 11.5464 84.2732 12.3657 81.8849 12.3657C78.558 12.3657 76.1874 10.9814 75.5013 8.85986H89.592V7.5013C89.5872 3.06182 86.092 0.0356445 80.9755 0.0356445L80.9771 0.0372542ZM80.948 2.69482C83.8768 2.69482 85.88 4.06787 86.4075 6.25702H75.4447C75.9884 4.08718 77.9722 2.69482 80.948 2.69482Z" fill="
|
|
4643
|
-
<path d="M62.7358 0.0372542C60.1921 0.0372542 58.1743 0.925792 56.7875 2.29562C56.4283 1.16563 55.4364 0.462207 54.0917 0.462207H52.2471V3.14875H53.951V20.0004H56.9364V12.8792C58.3151 14.1782 60.273 15.0233 62.739 15.0233C67.485 15.0233 70.7536 11.9408 70.7536 7.5013C70.7536 3.06182 67.4802 0.0356445 62.7342 0.0356445L62.7358 0.0372542ZM62.3652 12.2756C59.1241 12.2756 56.9364 10.3247 56.9364 7.4691C56.9364 4.61355 59.1241 2.7753 62.3652 2.7753C65.6064 2.7753 67.7099 4.66989 67.7099 7.4691C67.7067 10.3311 65.464 12.2756 62.3652 12.2756Z" fill="
|
|
4631
|
+
async _drawHeader(e, t, s, n = !1) {
|
|
4632
|
+
const a = 48 * s, r = 12 * s, o = 20 * s, c = 103 * s;
|
|
4633
|
+
e.fillStyle = n ? "#101011" : "#FFFFFF", e.fillRect(0, 0, t, a), e.strokeStyle = n ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * s, e.beginPath(), e.moveTo(0, a), e.lineTo(t, a), e.stroke();
|
|
4634
|
+
const h = n ? "#FFFFFF" : "#1C2026", u = `<svg width="103" height="20" viewBox="0 0 103 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4635
|
+
<path d="M92.6267 1.50666H93.0475C93.3792 1.50666 93.6025 1.31028 93.6025 1.02537C93.6025 0.740457 93.4034 0.561783 93.0426 0.561783C92.706 0.561783 92.4827 0.759773 92.4633 1.06239H91.795C91.8209 0.423351 92.3225 0.00805664 93.075 0.00805664C93.8274 0.00805664 94.2886 0.376671 94.2886 0.928788C94.2886 1.35213 93.9973 1.65797 93.5717 1.73523V1.74972C94.0895 1.79318 94.4229 2.10385 94.4229 2.58192C94.4229 3.20164 93.8581 3.61372 93.0572 3.61372C92.2562 3.61372 91.761 3.18555 91.7271 2.54973H92.4212C92.4423 2.84108 92.6834 3.03263 93.0652 3.03263C93.4471 3.03263 93.6834 2.82981 93.6834 2.53685C93.6834 2.22135 93.4455 2.0298 93.0539 2.0298H92.6251V1.50827L92.6267 1.50666Z" fill="${h}"/>
|
|
4636
|
+
<path d="M95.1182 2.97623C94.9256 2.68488 94.8269 2.29373 94.8269 1.83498C94.8269 0.692113 95.3852 0.00317383 96.2816 0.00317383C96.9434 0.00317383 97.4596 0.392714 97.5567 0.957708H96.8431C96.7735 0.727525 96.5502 0.574607 96.2784 0.574607C95.7945 0.574607 95.5017 1.03658 95.5178 1.81566H95.5324C95.6716 1.47763 96.013 1.25389 96.4564 1.25389C97.1149 1.25389 97.6036 1.73679 97.6036 2.39192C97.6036 3.10179 97.0486 3.61205 96.2719 3.61205C95.7735 3.61205 95.3625 3.3867 95.1198 2.97623H95.1182ZM96.8949 2.41446C96.8949 2.05872 96.6279 1.79796 96.2654 1.79796C95.903 1.79796 95.6311 2.05872 95.6311 2.40802C95.6311 2.75732 95.9078 3.0374 96.2638 3.0374C96.6198 3.0374 96.8965 2.76215 96.8965 2.41607L96.8949 2.41446Z" fill="${h}"/>
|
|
4637
|
+
<path d="M97.998 1.79961C97.998 0.68411 98.5336 0 99.4026 0C100.272 0 100.804 0.6825 100.804 1.79639C100.804 2.91028 100.275 3.60727 99.4026 3.60727C98.5304 3.60727 97.998 2.91672 97.998 1.798V1.79961ZM100.066 1.79961C100.066 1.01892 99.8136 0.579481 99.4026 0.579481C98.9916 0.579481 98.7359 1.02214 98.7359 1.79961C98.7359 2.57708 98.9883 3.0294 99.4026 3.0294C99.8168 3.0294 100.066 2.58674 100.066 1.79961Z" fill="${h}"/>
|
|
4638
|
+
<path d="M101.137 0.809958C101.137 0.381786 101.469 0.048584 101.901 0.048584C102.333 0.048584 102.666 0.381786 102.666 0.809958C102.666 1.23813 102.331 1.57294 101.901 1.57294C101.47 1.57294 101.137 1.23974 101.137 0.809958ZM102.249 0.809958C102.249 0.616798 102.097 0.46066 101.902 0.46066C101.708 0.46066 101.556 0.616798 101.556 0.809958C101.556 1.00312 101.715 1.16087 101.902 1.16087C102.1 1.16087 102.249 0.998289 102.249 0.809958Z" fill="${h}"/>
|
|
4639
|
+
<path d="M42.5486 0.0388184C37.204 0.0388184 33.5098 3.06983 33.5098 7.50447C33.5098 11.9391 37.204 15.02 42.5486 15.02C47.8933 15.02 51.5018 11.9375 51.5018 7.49803C51.5018 3.05856 47.8642 0.0388184 42.5486 0.0388184ZM42.5486 12.2836C39.0227 12.2836 36.5519 10.3327 36.5519 7.4771C36.5519 4.62155 39.0179 2.78331 42.5486 2.78331C46.0794 2.78331 48.4613 4.67789 48.4613 7.4771C48.4613 10.2763 45.9872 12.2787 42.5486 12.2787V12.2852V12.2836Z" fill="${h}"/>
|
|
4640
|
+
<path d="M10.4321 6.17332H5.62948C2.78642 6.17332 2.01943 2.78013 7.93208 2.78013C10.4337 2.78013 12.3949 3.85539 13.2476 4.41878L14.7833 2.10085C13.3318 0.827603 10.7751 0.0356445 7.90457 0.0356445C-1.589 0.0356445 -1.70389 8.85825 5.65861 8.85825H10.4903C13.6166 8.85825 14.1279 12.2804 7.93208 12.2804C4.83336 12.2804 2.38836 10.6402 1.53561 10.0172L0 12.3367C1.45146 13.6084 4.51944 15.0217 7.95797 15.0217C17.9062 15.0152 18.0211 6.17171 10.4321 6.17171V6.17332Z" fill="${h}"/>
|
|
4641
|
+
<path d="M26.0314 12.2771C22.3939 12.2771 20.0346 10.3262 20.0346 7.527C20.0346 4.72779 22.3648 2.7817 26.0023 2.7817C28.0784 2.7817 30.0104 3.85696 31.1755 4.93061L32.9166 2.52737C31.2677 1.22836 28.737 0.0388184 26.0088 0.0388184C20.5508 0.0388184 16.999 3.09397 16.999 7.53344C16.999 11.9729 20.6042 15.02 26.0654 15.02C28.8502 15.02 31.381 13.7757 33.0282 12.4751L31.2386 10.1266C30.0687 11.2067 28.135 12.2771 26.0314 12.2771Z" fill="${h}"/>
|
|
4642
|
+
<path d="M80.9771 0.0372542C75.8605 0.0372542 72.3071 3.09241 72.3071 7.53188C72.3071 11.9714 76.3719 15.0185 81.9156 15.0185C84.8428 15.0185 87.2829 14.0575 88.8218 12.7569L87.0289 10.4148C85.9771 11.5464 84.2732 12.3657 81.8849 12.3657C78.558 12.3657 76.1874 10.9814 75.5013 8.85986H89.592V7.5013C89.5872 3.06182 86.092 0.0356445 80.9755 0.0356445L80.9771 0.0372542ZM80.948 2.69482C83.8768 2.69482 85.88 4.06787 86.4075 6.25702H75.4447C75.9884 4.08718 77.9722 2.69482 80.948 2.69482Z" fill="${h}"/>
|
|
4643
|
+
<path d="M62.7358 0.0372542C60.1921 0.0372542 58.1743 0.925792 56.7875 2.29562C56.4283 1.16563 55.4364 0.462207 54.0917 0.462207H52.2471V3.14875H53.951V20.0004H56.9364V12.8792C58.3151 14.1782 60.273 15.0233 62.739 15.0233C67.485 15.0233 70.7536 11.9408 70.7536 7.5013C70.7536 3.06182 67.4802 0.0356445 62.7342 0.0356445L62.7358 0.0372542ZM62.3652 12.2756C59.1241 12.2756 56.9364 10.3247 56.9364 7.4691C56.9364 4.61355 59.1241 2.7753 62.3652 2.7753C65.6064 2.7753 67.7099 4.66989 67.7099 7.4691C67.7067 10.3311 65.464 12.2756 62.3652 12.2756Z" fill="${h}"/>
|
|
4644
4644
|
</svg>`;
|
|
4645
4645
|
try {
|
|
4646
|
-
const
|
|
4647
|
-
|
|
4648
|
-
} catch (
|
|
4649
|
-
console.warn("Failed to load logo SVG:",
|
|
4646
|
+
const g = await this._loadSvgAsImage(u);
|
|
4647
|
+
g && e.drawImage(g, r, (a - o) / 2, c, o);
|
|
4648
|
+
} catch (g) {
|
|
4649
|
+
console.warn("Failed to load logo SVG:", g);
|
|
4650
4650
|
}
|
|
4651
4651
|
}
|
|
4652
|
-
_drawHeaderSecondLine(e, t, s, n, a, r) {
|
|
4653
|
-
const
|
|
4654
|
-
e.fillStyle = "#FFFFFF", e.fillRect(0, a, n,
|
|
4655
|
-
const
|
|
4656
|
-
e.fillText(
|
|
4652
|
+
_drawHeaderSecondLine(e, t, s, n, a, r, o = !1) {
|
|
4653
|
+
const c = 20 * r, h = 12 * r, u = 8 * r;
|
|
4654
|
+
e.fillStyle = o ? "#292929" : "#FFFFFF", e.fillRect(0, a, n, c), e.strokeStyle = o ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, a + c), e.lineTo(n, a + c), e.stroke(), e.fillStyle = o ? "#C3C3C5" : "#1C2026", e.font = `500 ${u}px Geist, Arial, sans-serif`, e.textBaseline = "middle", e.textAlign = "left";
|
|
4655
|
+
const g = t ? `${t} created with Scope360, ${s}` : `Scope360, ${s}`;
|
|
4656
|
+
e.fillText(g, h, a + c / 2);
|
|
4657
4657
|
}
|
|
4658
4658
|
_loadSvgAsImage(e) {
|
|
4659
4659
|
return new Promise((t, s) => {
|
|
@@ -4665,24 +4665,25 @@ class pr {
|
|
|
4665
4665
|
}, n.src = r;
|
|
4666
4666
|
});
|
|
4667
4667
|
}
|
|
4668
|
-
_drawFooter(e, t, s, n, a, r) {
|
|
4669
|
-
const
|
|
4670
|
-
e.fillStyle = "#FFFFFF", e.fillRect(0,
|
|
4668
|
+
_drawFooter(e, t, s, n, a, r, o = !1) {
|
|
4669
|
+
const c = 32 * r, h = 12 * r, u = 12 * r, g = 4 * r, p = n + a;
|
|
4670
|
+
e.fillStyle = o ? "#292929" : "#FFFFFF", e.fillRect(0, p, s, c), e.strokeStyle = o ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, p), e.lineTo(s, p), e.stroke(), e.textBaseline = "middle", e.textAlign = "left";
|
|
4671
4671
|
const _ = [];
|
|
4672
4672
|
if (t.pair && _.push({ label: "", value: t.pair }), t.net_pnl !== void 0) {
|
|
4673
4673
|
const w = t.net_pnl.startsWith("+");
|
|
4674
4674
|
_.push({ label: "Net P&L", value: t.net_pnl, valueColor: w ? "#56B683" : "#F18169" });
|
|
4675
4675
|
}
|
|
4676
4676
|
t.type && _.push({ label: "Type", value: t.type }), t.entry_price && _.push({ label: "Entry", value: t.entry_price }), t.exit_price && _.push({ label: "Exit", value: t.exit_price }), t.open_date && _.push({ label: "Open date", value: t.open_date }), t.close_date && _.push({ label: "Close date", value: t.close_date }), t.holdtime && _.push({ label: "Holdtime", value: t.holdtime }), t.rr && _.push({ label: "RR", value: t.rr }), t.volume && _.push({ label: "Volume", value: t.volume });
|
|
4677
|
-
const
|
|
4677
|
+
const v = p + c / 2, b = 24 * r;
|
|
4678
4678
|
if (_.length === 0) return;
|
|
4679
|
-
e.font = `500 ${
|
|
4680
|
-
|
|
4679
|
+
e.font = `500 ${u}px Geist, Arial, sans-serif`;
|
|
4680
|
+
const x = o ? "#878788" : "#8E8E93", C = o ? "#FAFAFA" : "#1C2026";
|
|
4681
|
+
let y = h;
|
|
4681
4682
|
_.forEach((w) => {
|
|
4682
|
-
const
|
|
4683
|
-
e.fillStyle =
|
|
4684
|
-
const
|
|
4685
|
-
e.fillStyle = w.valueColor ||
|
|
4683
|
+
const S = e.measureText(w.label).width, L = e.measureText(w.value).width, R = S + g + L;
|
|
4684
|
+
e.fillStyle = x, e.font = `500 ${u}px Geist, Arial, sans-serif`, e.fillText(w.label, y, v);
|
|
4685
|
+
const $ = y + S + g;
|
|
4686
|
+
e.fillStyle = w.valueColor || C, e.font = `500 ${u}px Geist, Arial, sans-serif`, e.fillText(w.value, $, v), y += R + b;
|
|
4686
4687
|
});
|
|
4687
4688
|
}
|
|
4688
4689
|
async captureScreenshot(e = {}) {
|
|
@@ -4693,44 +4694,68 @@ class pr {
|
|
|
4693
4694
|
hour: "2-digit",
|
|
4694
4695
|
minute: "2-digit",
|
|
4695
4696
|
timeZoneName: "short"
|
|
4696
|
-
}), a = typeof e == "object" ? e : {}, r = a.createdBy, o = a.createdAt || n, c = a.trade,
|
|
4697
|
-
|
|
4697
|
+
}), a = typeof e == "object" ? e : {}, r = a.createdBy, o = a.createdAt || n, c = a.trade, h = a.isDark || !1, { canvasesContainer: u, width: g, height: p } = this._view, _ = Array.from(
|
|
4698
|
+
u.node.querySelectorAll("canvas")
|
|
4698
4699
|
);
|
|
4699
4700
|
if (_.length === 0) {
|
|
4700
4701
|
console.warn("No canvas elements found for screenshot");
|
|
4701
4702
|
return;
|
|
4702
4703
|
}
|
|
4703
|
-
const
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4704
|
+
const v = 1440, b = 900, x = 48, C = 20, y = c ? 32 : 0, w = b - x - C - y, S = v, L = g / p, R = S / w;
|
|
4705
|
+
let $, O, K = 0, j = 0;
|
|
4706
|
+
L > R ? (O = w, $ = O * L, K = 0, j = 0) : ($ = S, O = $ / L, j = (w - O) / 2);
|
|
4707
|
+
const P = window.devicePixelRatio || 1, X = document.createElement("canvas");
|
|
4708
|
+
X.width = v * P, X.height = b * P;
|
|
4709
|
+
const U = X.getContext("2d");
|
|
4710
|
+
if (!U) {
|
|
4707
4711
|
console.error("Failed to get 2D context for merged canvas");
|
|
4708
4712
|
return;
|
|
4709
4713
|
}
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
await this._drawHeader(
|
|
4713
|
-
const
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4714
|
+
U.fillStyle = h ? "#101011" : "#ffffff", U.fillRect(0, 0, X.width, X.height);
|
|
4715
|
+
const He = x * P, et = C * P, re = w * P, ve = S * P, be = He + et;
|
|
4716
|
+
await this._drawHeader(U, X.width, P, h), this._drawHeaderSecondLine(U, r, o, X.width, He, P, h);
|
|
4717
|
+
const Be = this._view.mainCanvas;
|
|
4718
|
+
Be.background && (U.fillStyle = Be.background, U.fillRect(0, be, X.width, re));
|
|
4719
|
+
const Ie = $ * P, Re = O * P, tt = K * P, N = j * P;
|
|
4720
|
+
_.forEach((z) => {
|
|
4721
|
+
let fe = 0, G = 0, Z = z.width, se = z.height, ye = Ie, ge = Re, we = tt, xe = N;
|
|
4722
|
+
if (L > R) {
|
|
4723
|
+
const oe = Re / z.height, le = z.width * oe;
|
|
4724
|
+
le > ve && (fe = (le - ve) / oe, Z = z.width - fe, ye = ve, we = 0);
|
|
4725
|
+
} else {
|
|
4726
|
+
const oe = Ie / z.width, le = z.height * oe;
|
|
4727
|
+
if (le > re) {
|
|
4728
|
+
const Ce = (le - re) / oe;
|
|
4729
|
+
G = Ce / 2, se = z.height - Ce, ge = re, xe = 0;
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
U.drawImage(
|
|
4733
|
+
z,
|
|
4734
|
+
fe,
|
|
4735
|
+
G,
|
|
4736
|
+
Z,
|
|
4737
|
+
se,
|
|
4738
|
+
we,
|
|
4739
|
+
be + xe,
|
|
4740
|
+
ye,
|
|
4741
|
+
ge
|
|
4725
4742
|
);
|
|
4726
|
-
}), c && this._drawFooter(
|
|
4727
|
-
(
|
|
4728
|
-
if (
|
|
4743
|
+
}), c && this._drawFooter(U, c, X.width, be, re, P, h), X.toBlob(
|
|
4744
|
+
async (z) => {
|
|
4745
|
+
if (!z) {
|
|
4729
4746
|
console.error("Failed to create blob from canvas");
|
|
4730
4747
|
return;
|
|
4731
4748
|
}
|
|
4732
|
-
|
|
4733
|
-
|
|
4749
|
+
try {
|
|
4750
|
+
await navigator.clipboard.write([
|
|
4751
|
+
new ClipboardItem({
|
|
4752
|
+
"image/png": z
|
|
4753
|
+
})
|
|
4754
|
+
]);
|
|
4755
|
+
} catch {
|
|
4756
|
+
const G = URL.createObjectURL(z), Z = document.createElement("a");
|
|
4757
|
+
Z.href = G, Z.download = t, document.body.appendChild(Z), Z.click(), document.body.removeChild(Z), URL.revokeObjectURL(G);
|
|
4758
|
+
}
|
|
4734
4759
|
},
|
|
4735
4760
|
"image/png",
|
|
4736
4761
|
1
|