@gearbox-protocol/ui-kit 3.14.0-next.31 → 3.14.0-next.33
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/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/layout/main-aside-layout/main-aside-layout.cjs +1 -1
- package/dist/cjs/configs/tailwind-preset.cjs +1 -1
- package/dist/esm/components/graph/graph.js +462 -341
- package/dist/esm/components/layout/main-aside-layout/main-aside-layout.js +67 -41
- package/dist/esm/configs/tailwind-preset.js +1 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/graph/graph.d.ts +57 -2
- package/dist/types/components/graph/index.d.ts +1 -1
- package/dist/types/components/layout/main-aside-layout/main-aside-layout.d.ts +18 -0
- package/dist/types/configs/tailwind-preset.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/base.css +2 -0
- package/src/styles/theme.css +1 -0
|
@@ -1,30 +1,79 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createChart as
|
|
3
|
-
import * as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useIsMobile as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { resolveCSSColor as
|
|
8
|
-
import { getDefaultOptions as
|
|
9
|
-
import { getXFormatters as
|
|
10
|
-
import { GraphCurrentValue as
|
|
11
|
-
import { GraphTooltip as
|
|
12
|
-
import { VertLine as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsxs as U, jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { createChart as He, CrosshairMode as Xe, AreaSeries as qe, LineStyle as Ze } from "lightweight-charts";
|
|
3
|
+
import * as ge from "react";
|
|
4
|
+
import { useRef as I, useState as be, useEffect as L } from "react";
|
|
5
|
+
import { useIsMobile as Ke } from "../../hooks/use-media-query.js";
|
|
6
|
+
import { cn as Ce } from "../../utils/cn.js";
|
|
7
|
+
import { resolveCSSColor as O, generateColorsFromBase as ne, hslToHex as Je } from "../../utils/colors.js";
|
|
8
|
+
import { getDefaultOptions as De, getDefaultSeries as Qe, getDefaultVerticalLine as Oe } from "./default-config.js";
|
|
9
|
+
import { getXFormatters as Be, createAdaptiveYAxisFormatter as Ue, formatExactValue as pe } from "./formatters.js";
|
|
10
|
+
import { GraphCurrentValue as et } from "./graph-current-value.js";
|
|
11
|
+
import { GraphTooltip as tt } from "./graph-tooltip.js";
|
|
12
|
+
import { VertLine as ot } from "./plugins/vertical-line.js";
|
|
13
|
+
class rt {
|
|
14
|
+
_yTop;
|
|
15
|
+
_yBottom;
|
|
16
|
+
_color;
|
|
17
|
+
constructor(c, s, b) {
|
|
18
|
+
this._yTop = c, this._yBottom = s, this._color = b;
|
|
19
|
+
}
|
|
20
|
+
draw(c) {
|
|
21
|
+
c.useBitmapCoordinateSpace((s) => {
|
|
22
|
+
const b = s.context, h = s.verticalPixelRatio, y = this._yTop === null ? 0 : this._yTop * h, z = this._yBottom === null ? s.bitmapSize.height : this._yBottom * h, p = Math.min(y, z), R = Math.max(y, z);
|
|
23
|
+
b.fillStyle = this._color, b.fillRect(0, p, s.bitmapSize.width, R - p);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class nt {
|
|
28
|
+
_source;
|
|
29
|
+
_yTop = null;
|
|
30
|
+
_yBottom = null;
|
|
31
|
+
constructor(c) {
|
|
32
|
+
this._source = c;
|
|
33
|
+
}
|
|
34
|
+
update() {
|
|
35
|
+
const c = this._source.series;
|
|
36
|
+
this._yTop = this._source.priceTop === void 0 ? null : c.priceToCoordinate(this._source.priceTop), this._yBottom = this._source.priceBottom === void 0 ? null : c.priceToCoordinate(this._source.priceBottom);
|
|
37
|
+
}
|
|
38
|
+
/** Draw beneath the series line/area so the data stays readable. */
|
|
39
|
+
zOrder() {
|
|
40
|
+
return "bottom";
|
|
41
|
+
}
|
|
42
|
+
renderer() {
|
|
43
|
+
return new rt(this._yTop, this._yBottom, this._source.color);
|
|
44
|
+
}
|
|
20
45
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
46
|
+
class at {
|
|
47
|
+
series;
|
|
48
|
+
priceTop;
|
|
49
|
+
priceBottom;
|
|
50
|
+
color;
|
|
51
|
+
_paneViews;
|
|
52
|
+
constructor(c, s, b, h) {
|
|
53
|
+
this.series = c, this.priceTop = s, this.priceBottom = b, this.color = h, this._paneViews = [new nt(this)];
|
|
54
|
+
}
|
|
55
|
+
updateAllViews() {
|
|
56
|
+
for (const c of this._paneViews) c.update();
|
|
57
|
+
}
|
|
58
|
+
paneViews() {
|
|
59
|
+
return this._paneViews;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function lt(t, c, s) {
|
|
63
|
+
const b = t.labelText ?? "", h = t.value, y = h === void 0 ? "" : typeof h == "number" ? c === "$" ? `$${pe(h, void 0, s)}` : c === "%" ? `${pe(h, void 0, s)}%` : pe(
|
|
64
|
+
h,
|
|
65
|
+
c !== "none" && c !== "%" && c !== "$" ? c : void 0,
|
|
66
|
+
s
|
|
67
|
+
) : String(h);
|
|
68
|
+
return { labelText: b, valueStr: y };
|
|
69
|
+
}
|
|
70
|
+
function it(t, c) {
|
|
71
|
+
for (let s = t.length - 1; s >= 0; s--)
|
|
72
|
+
if (Number(t[s].time) <= c)
|
|
73
|
+
return t[s].value;
|
|
25
74
|
return 0;
|
|
26
75
|
}
|
|
27
|
-
const
|
|
76
|
+
const ve = [
|
|
28
77
|
// 0 green (emerald)
|
|
29
78
|
{
|
|
30
79
|
line: "#02c39a",
|
|
@@ -139,65 +188,67 @@ const me = [
|
|
|
139
188
|
top: "rgba(71, 85, 105, 0.56)",
|
|
140
189
|
bottom: "rgba(71, 85, 105, 0.04)"
|
|
141
190
|
}
|
|
142
|
-
],
|
|
143
|
-
function
|
|
144
|
-
if (t <
|
|
145
|
-
return
|
|
146
|
-
const
|
|
147
|
-
return { line:
|
|
191
|
+
], st = 137.5;
|
|
192
|
+
function Fe(t) {
|
|
193
|
+
if (t < ve.length)
|
|
194
|
+
return ve[t];
|
|
195
|
+
const s = (t - ve.length) * st % 360, b = Je(s, 70, 50), { topColor: h, bottomColor: y } = ne(b);
|
|
196
|
+
return { line: b, top: h, bottom: y };
|
|
148
197
|
}
|
|
149
|
-
function
|
|
198
|
+
function Nt({
|
|
150
199
|
series: t,
|
|
151
|
-
className:
|
|
152
|
-
showLegend:
|
|
153
|
-
onUnselectSeries:
|
|
154
|
-
xMeasureUnit:
|
|
155
|
-
yMeasureUnit:
|
|
156
|
-
optionsOverrides:
|
|
157
|
-
verticalLineOptions:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
200
|
+
className: c,
|
|
201
|
+
showLegend: s = !1,
|
|
202
|
+
onUnselectSeries: b,
|
|
203
|
+
xMeasureUnit: h = "time",
|
|
204
|
+
yMeasureUnit: y = "token",
|
|
205
|
+
optionsOverrides: z,
|
|
206
|
+
verticalLineOptions: p,
|
|
207
|
+
priceLineOptions: R,
|
|
208
|
+
zoneOptions: W,
|
|
209
|
+
currentValueDecimals: ae,
|
|
210
|
+
useSharedPriceScale: D = !1,
|
|
211
|
+
showCurrentValue: Ae = !0,
|
|
212
|
+
graphTitle: le,
|
|
213
|
+
yScaleMin: xe,
|
|
214
|
+
yScaleMinMultiple: Se,
|
|
215
|
+
visibleTimeFrom: j,
|
|
216
|
+
disableZoom: ee = !1
|
|
166
217
|
}) {
|
|
167
|
-
const
|
|
218
|
+
const T = I(null), v = I(/* @__PURE__ */ new Map()), ie = I(!1), ye = I(!0), se = I(
|
|
168
219
|
null
|
|
169
|
-
), Ie =
|
|
220
|
+
), Ie = I(null), H = I(null), ce = I(null), te = I(null), P = Ke(), $ = ge.useMemo(() => t.flatMap((e) => e.data), [t]), ze = ge.useMemo(() => {
|
|
170
221
|
if (t.length > 0) {
|
|
171
222
|
const e = t[t.length - 1];
|
|
172
223
|
if (e.data.length > 0)
|
|
173
224
|
return e.data[e.data.length - 1];
|
|
174
225
|
}
|
|
175
|
-
}, [t]), [
|
|
226
|
+
}, [t]), [we, ue] = be(() => {
|
|
176
227
|
if (!ze) return;
|
|
177
228
|
const e = /* @__PURE__ */ new Map();
|
|
178
|
-
for (const
|
|
179
|
-
|
|
229
|
+
for (const l of t)
|
|
230
|
+
l.data.length > 0 && e.set(l.label, l.data[l.data.length - 1]);
|
|
180
231
|
return e;
|
|
181
|
-
}), [
|
|
182
|
-
|
|
232
|
+
}), [Ne, E] = be(null), [Ve, Re] = be([]);
|
|
233
|
+
L(() => {
|
|
183
234
|
const e = () => {
|
|
184
235
|
try {
|
|
185
|
-
if (
|
|
186
|
-
const
|
|
187
|
-
|
|
236
|
+
if (T.current && H.current) {
|
|
237
|
+
const r = H.current.clientWidth, i = H.current.clientHeight;
|
|
238
|
+
T.current.resize(r, i);
|
|
188
239
|
}
|
|
189
240
|
} catch {
|
|
190
241
|
}
|
|
191
|
-
},
|
|
192
|
-
return
|
|
193
|
-
|
|
242
|
+
}, l = H.current, n = l ? new ResizeObserver(e) : null;
|
|
243
|
+
return te.current = n, l && n?.observe(l), () => {
|
|
244
|
+
l && n?.unobserve(l), n?.disconnect(), te.current = null;
|
|
194
245
|
};
|
|
195
|
-
}, []),
|
|
196
|
-
if (!
|
|
197
|
-
const e =
|
|
246
|
+
}, []), L(() => {
|
|
247
|
+
if (!ce.current || ie.current) return;
|
|
248
|
+
const e = De(), l = O(
|
|
198
249
|
"hsl(var(--foreground))",
|
|
199
250
|
"rgb(0, 0, 0)"
|
|
200
|
-
),
|
|
251
|
+
), n = ee ? {
|
|
201
252
|
handleScale: {
|
|
202
253
|
mouseWheel: !1,
|
|
203
254
|
pinch: !1,
|
|
@@ -210,29 +261,29 @@ function ht({
|
|
|
210
261
|
horzTouchDrag: !1,
|
|
211
262
|
vertTouchDrag: !1
|
|
212
263
|
}
|
|
213
|
-
} : {},
|
|
264
|
+
} : {}, r = He(ce.current, {
|
|
214
265
|
...e,
|
|
215
266
|
rightPriceScale: {
|
|
216
267
|
...e.rightPriceScale || {},
|
|
217
|
-
visible: !
|
|
218
|
-
textColor:
|
|
268
|
+
visible: !P,
|
|
269
|
+
textColor: l
|
|
219
270
|
},
|
|
220
|
-
...
|
|
271
|
+
...P && {
|
|
221
272
|
crosshair: {
|
|
222
273
|
...e.crosshair,
|
|
223
|
-
mode:
|
|
274
|
+
mode: Xe.Magnet
|
|
224
275
|
}
|
|
225
276
|
},
|
|
226
|
-
...
|
|
227
|
-
...
|
|
277
|
+
...n,
|
|
278
|
+
...z
|
|
228
279
|
});
|
|
229
|
-
return
|
|
230
|
-
|
|
280
|
+
return T.current = r, ie.current = !0, () => {
|
|
281
|
+
te.current?.disconnect(), te.current = null, r.remove(), T.current = null, ie.current = !1, v.current.clear();
|
|
231
282
|
};
|
|
232
|
-
}, [
|
|
233
|
-
const e =
|
|
283
|
+
}, [P, z, ee]), L(() => {
|
|
284
|
+
const e = T.current;
|
|
234
285
|
e && e.applyOptions(
|
|
235
|
-
|
|
286
|
+
ee ? {
|
|
236
287
|
handleScale: {
|
|
237
288
|
mouseWheel: !1,
|
|
238
289
|
pinch: !1,
|
|
@@ -260,47 +311,47 @@ function ht({
|
|
|
260
311
|
}
|
|
261
312
|
}
|
|
262
313
|
);
|
|
263
|
-
}, [
|
|
264
|
-
const e =
|
|
314
|
+
}, [ee]), L(() => {
|
|
315
|
+
const e = T.current;
|
|
265
316
|
if (!e || t.length === 0) return;
|
|
266
|
-
const
|
|
267
|
-
formatter:
|
|
268
|
-
tickmarksFormatter:
|
|
269
|
-
updateVisibleRange:
|
|
270
|
-
updateLastValues:
|
|
271
|
-
} =
|
|
272
|
-
yScaleMin:
|
|
317
|
+
const n = t.filter((o) => o.data.length > 0).length <= 1 ? xe : Se, r = h === "time" ? Be(h, $) : Be(h), i = $.map((o) => o.value), {
|
|
318
|
+
formatter: u,
|
|
319
|
+
tickmarksFormatter: d,
|
|
320
|
+
updateVisibleRange: B,
|
|
321
|
+
updateLastValues: g
|
|
322
|
+
} = Ue(i, y, {
|
|
323
|
+
yScaleMin: n
|
|
273
324
|
});
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
const
|
|
325
|
+
se.current = B, Ie.current = g;
|
|
326
|
+
const F = t.filter((o) => o.data.length > 0).map((o) => o.data[o.data.length - 1].value);
|
|
327
|
+
g(F);
|
|
328
|
+
const M = De();
|
|
278
329
|
e.applyOptions({
|
|
279
330
|
localization: {
|
|
280
|
-
...
|
|
331
|
+
...M.localization || {},
|
|
281
332
|
// biome-ignore lint/suspicious/noExplicitAny: External library type compatibility
|
|
282
333
|
timeFormatter: (o) => (
|
|
283
334
|
// biome-ignore lint/suspicious/noExplicitAny: External library type compatibility
|
|
284
|
-
|
|
335
|
+
r.timeFormatter(parseFloat(o), void 0)
|
|
285
336
|
)
|
|
286
337
|
},
|
|
287
338
|
timeScale: {
|
|
288
|
-
...
|
|
339
|
+
...M.timeScale || {},
|
|
289
340
|
// biome-ignore lint/suspicious/noExplicitAny: External library type compatibility
|
|
290
|
-
tickMarkFormatter:
|
|
341
|
+
tickMarkFormatter: r.tickMarkFormatter,
|
|
291
342
|
minBarSpacing: 0
|
|
292
343
|
}
|
|
293
344
|
});
|
|
294
|
-
const
|
|
345
|
+
const m = ($.length > 0 ? Math.min(...$.map((o) => o.value)) : 0) < 0, N = $.some((o) => o.value === 0), C = !m && N, w = t.length > 1 && !D, x = t.length > 1 && !D || P, Y = O(
|
|
295
346
|
"hsl(var(--foreground))",
|
|
296
347
|
"rgb(0, 0, 0)"
|
|
297
348
|
);
|
|
298
349
|
e.applyOptions({
|
|
299
350
|
rightPriceScale: {
|
|
300
|
-
...
|
|
301
|
-
visible: !
|
|
302
|
-
textColor:
|
|
303
|
-
...
|
|
351
|
+
...M.rightPriceScale || {},
|
|
352
|
+
visible: !x,
|
|
353
|
+
textColor: Y,
|
|
354
|
+
...C && {
|
|
304
355
|
scaleMargins: {
|
|
305
356
|
top: 0.3,
|
|
306
357
|
bottom: 0
|
|
@@ -308,86 +359,102 @@ function ht({
|
|
|
308
359
|
}
|
|
309
360
|
}
|
|
310
361
|
});
|
|
311
|
-
const
|
|
312
|
-
for (const o of
|
|
313
|
-
if (!
|
|
314
|
-
const
|
|
315
|
-
|
|
362
|
+
const J = new Set(v.current.keys()), fe = new Set(t.map((o) => o.label));
|
|
363
|
+
for (const o of J)
|
|
364
|
+
if (!fe.has(o)) {
|
|
365
|
+
const a = v.current.get(o);
|
|
366
|
+
a && (e.removeSeries(a), v.current.delete(o));
|
|
367
|
+
}
|
|
368
|
+
const We = Qe(), he = [];
|
|
369
|
+
let re = 0;
|
|
370
|
+
const Pe = t.find((o) => o.data.length > 0), Q = /* @__PURE__ */ new Map();
|
|
371
|
+
if (R && R.length > 0)
|
|
372
|
+
for (const o of R) {
|
|
373
|
+
if (!Number.isFinite(o.price)) continue;
|
|
374
|
+
const a = o.seriesLabel ?? Pe?.label;
|
|
375
|
+
if (!a) continue;
|
|
376
|
+
const V = Q.get(a) ?? [];
|
|
377
|
+
V.push(o.price), Q.set(a, V);
|
|
378
|
+
}
|
|
379
|
+
if (W && W.length > 0)
|
|
380
|
+
for (const o of W) {
|
|
381
|
+
const a = o.seriesLabel ?? Pe?.label;
|
|
382
|
+
if (!a) continue;
|
|
383
|
+
const V = Q.get(a) ?? [];
|
|
384
|
+
Number.isFinite(o.priceTop) && V.push(o.priceTop), Number.isFinite(o.priceBottom) && V.push(o.priceBottom), Q.set(a, V);
|
|
316
385
|
}
|
|
317
|
-
const Ae = He(), ie = [];
|
|
318
|
-
let U = 0;
|
|
319
386
|
for (let o = 0; o < t.length; o++) {
|
|
320
|
-
const
|
|
321
|
-
let
|
|
322
|
-
if (
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
else if (
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
} else if (
|
|
329
|
-
|
|
387
|
+
const a = t[o], V = Fe(o), X = a.lineColor ?? a.color ?? V.line;
|
|
388
|
+
let G, q;
|
|
389
|
+
if (a.lineColor ?? a.color)
|
|
390
|
+
if (a.topColor && a.bottomColor)
|
|
391
|
+
G = a.topColor, q = a.bottomColor;
|
|
392
|
+
else if (a.topColor) {
|
|
393
|
+
const f = ne(X);
|
|
394
|
+
G = a.topColor, q = f.bottomColor;
|
|
395
|
+
} else if (a.bottomColor)
|
|
396
|
+
G = ne(X).topColor, q = a.bottomColor;
|
|
330
397
|
else {
|
|
331
|
-
const
|
|
332
|
-
|
|
398
|
+
const f = ne(X);
|
|
399
|
+
G = f.topColor, q = f.bottomColor;
|
|
333
400
|
}
|
|
334
401
|
else
|
|
335
|
-
|
|
336
|
-
if (
|
|
337
|
-
const
|
|
338
|
-
|
|
402
|
+
G = a.topColor || V.top, q = a.bottomColor || V.bottom;
|
|
403
|
+
if (a.data.length === 0) {
|
|
404
|
+
const f = v.current.get(a.label);
|
|
405
|
+
f && (e.removeSeries(f), v.current.delete(a.label));
|
|
339
406
|
continue;
|
|
340
407
|
}
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
priceScaleId:
|
|
344
|
-
shouldPreventNegativeAxis:
|
|
345
|
-
seriesIndex:
|
|
408
|
+
const $e = (a.data.length > 0 ? Math.min(...a.data.map((f) => f.value)) : 0) < 0, Ee = a.data.some((f) => f.value === 0), Ye = !$e && Ee, Me = D || !w || re === 0 ? "right" : `scale-${re}`;
|
|
409
|
+
w && he.push({
|
|
410
|
+
priceScaleId: Me || "right",
|
|
411
|
+
shouldPreventNegativeAxis: Ye,
|
|
412
|
+
seriesIndex: re
|
|
346
413
|
});
|
|
347
|
-
const
|
|
348
|
-
lineColor:
|
|
349
|
-
topColor:
|
|
350
|
-
bottomColor:
|
|
351
|
-
priceScaleId:
|
|
414
|
+
const _e = (D || !w) && n !== void 0 && typeof n == "number", Ge = Q.get(a.label) ?? [], ke = {
|
|
415
|
+
lineColor: X,
|
|
416
|
+
topColor: G,
|
|
417
|
+
bottomColor: q,
|
|
418
|
+
priceScaleId: Me,
|
|
352
419
|
priceFormat: {
|
|
353
420
|
type: "custom",
|
|
354
421
|
minMove: 0.01,
|
|
355
|
-
formatter:
|
|
356
|
-
|
|
357
|
-
) :
|
|
358
|
-
tickmarksFormatter:
|
|
422
|
+
formatter: _e && typeof n == "number" ? (f) => u(
|
|
423
|
+
f < n ? n : f
|
|
424
|
+
) : u,
|
|
425
|
+
tickmarksFormatter: d
|
|
359
426
|
},
|
|
360
|
-
autoscaleInfoProvider: (
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
427
|
+
autoscaleInfoProvider: (f) => {
|
|
428
|
+
const k = f();
|
|
429
|
+
if (k?.priceRange) {
|
|
430
|
+
_e && (k.priceRange.minValue = n);
|
|
431
|
+
for (const A of Ge)
|
|
432
|
+
A < k.priceRange.minValue && (k.priceRange.minValue = A), A > k.priceRange.maxValue && (k.priceRange.maxValue = A);
|
|
366
433
|
}
|
|
367
|
-
return
|
|
434
|
+
return k;
|
|
368
435
|
}
|
|
369
436
|
};
|
|
370
|
-
let
|
|
371
|
-
const
|
|
372
|
-
...
|
|
373
|
-
time:
|
|
437
|
+
let Z = v.current.get(a.label);
|
|
438
|
+
const K = a.data.map((f) => ({
|
|
439
|
+
...f,
|
|
440
|
+
time: f.time
|
|
374
441
|
}));
|
|
375
|
-
if (
|
|
376
|
-
const
|
|
377
|
-
for (let
|
|
378
|
-
|
|
379
|
-
|
|
442
|
+
if (j !== void 0 && K.length > 0 && Number(K[0].time) > j) {
|
|
443
|
+
const f = Number(K[0].time), k = f - j, A = 86400, je = k > 180 * A ? 7 * A : k > 30 * A ? A : 6 * 3600, Le = [];
|
|
444
|
+
for (let me = j; me < f; me += je)
|
|
445
|
+
Le.push({ time: me });
|
|
446
|
+
K.unshift(...Le);
|
|
380
447
|
}
|
|
381
|
-
|
|
382
|
-
...
|
|
448
|
+
Z ? (Z.applyOptions(ke), Z.setData(K)) : (Z = e.addSeries(qe, {
|
|
449
|
+
...We,
|
|
383
450
|
...ke
|
|
384
|
-
}),
|
|
451
|
+
}), Z.setData(K), v.current.set(a.label, Z)), re++;
|
|
385
452
|
}
|
|
386
|
-
if (
|
|
387
|
-
for (const o of
|
|
453
|
+
if (w && he.length > 0)
|
|
454
|
+
for (const o of he)
|
|
388
455
|
try {
|
|
389
|
-
const
|
|
390
|
-
|
|
456
|
+
const a = e.priceScale(o.priceScaleId);
|
|
457
|
+
a && a.applyOptions({
|
|
391
458
|
visible: !1,
|
|
392
459
|
autoScale: !0,
|
|
393
460
|
scaleMargins: {
|
|
@@ -402,25 +469,25 @@ function ht({
|
|
|
402
469
|
borderVisible: !0,
|
|
403
470
|
borderColor: "rgba(224, 227, 235, 0.1)",
|
|
404
471
|
entireTextOnly: !1,
|
|
405
|
-
textColor:
|
|
472
|
+
textColor: Y
|
|
406
473
|
});
|
|
407
|
-
} catch (
|
|
474
|
+
} catch (a) {
|
|
408
475
|
console.warn(
|
|
409
476
|
`Failed to configure price scale ${o.priceScaleId} for series ${o.seriesIndex}:`,
|
|
410
|
-
|
|
477
|
+
a
|
|
411
478
|
);
|
|
412
479
|
}
|
|
413
|
-
else if (!
|
|
480
|
+
else if (!w)
|
|
414
481
|
try {
|
|
415
482
|
const o = e.priceScale("right");
|
|
416
483
|
o && o.applyOptions({
|
|
417
|
-
visible: !
|
|
484
|
+
visible: !P,
|
|
418
485
|
autoScale: !0,
|
|
419
486
|
scaleMargins: {
|
|
420
487
|
top: 0.1,
|
|
421
488
|
// No bottom margin when yScaleMin is set so the scale doesn't extend below the minimum (avoids negative labels like -10M)
|
|
422
|
-
bottom:
|
|
423
|
-
...
|
|
489
|
+
bottom: n !== void 0 || C ? 0 : 0.1,
|
|
490
|
+
...C && {
|
|
424
491
|
top: 0.3
|
|
425
492
|
}
|
|
426
493
|
},
|
|
@@ -428,240 +495,294 @@ function ht({
|
|
|
428
495
|
borderVisible: !0,
|
|
429
496
|
borderColor: "rgba(224, 227, 235, 0.1)",
|
|
430
497
|
entireTextOnly: !1,
|
|
431
|
-
textColor:
|
|
498
|
+
textColor: Y
|
|
432
499
|
});
|
|
433
500
|
} catch {
|
|
434
501
|
}
|
|
435
|
-
if (
|
|
502
|
+
if (n !== void 0 && !P && (D || !w) && e.applyOptions({
|
|
436
503
|
handleScroll: {
|
|
437
504
|
vertTouchDrag: !1
|
|
438
505
|
}
|
|
439
|
-
}),
|
|
440
|
-
const o =
|
|
441
|
-
e.timeScale().setVisibleRange({ from:
|
|
506
|
+
}), $.length > 0) {
|
|
507
|
+
const o = $.map((G) => Number(G.time)), a = Math.min(...o), V = j !== void 0 ? Math.min(j, a) : a, X = Math.max(...o);
|
|
508
|
+
e.timeScale().setVisibleRange({ from: V, to: X });
|
|
442
509
|
}
|
|
443
|
-
|
|
444
|
-
const
|
|
510
|
+
ye.current && (ye.current = !1);
|
|
511
|
+
const de = /* @__PURE__ */ new Map();
|
|
445
512
|
for (const o of t)
|
|
446
|
-
o.data.length > 0 &&
|
|
447
|
-
|
|
513
|
+
o.data.length > 0 && de.set(o.label, o.data[o.data.length - 1]);
|
|
514
|
+
ue(de.size > 0 ? de : void 0);
|
|
448
515
|
}, [
|
|
449
516
|
t,
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
517
|
+
$,
|
|
518
|
+
h,
|
|
519
|
+
y,
|
|
520
|
+
P,
|
|
521
|
+
D,
|
|
522
|
+
xe,
|
|
523
|
+
Se,
|
|
524
|
+
j,
|
|
525
|
+
R,
|
|
526
|
+
W
|
|
527
|
+
]), L(() => {
|
|
528
|
+
const e = T.current;
|
|
460
529
|
if (!e || t.length === 0) return;
|
|
461
|
-
const
|
|
462
|
-
let
|
|
530
|
+
const l = t.length === 1;
|
|
531
|
+
let n;
|
|
463
532
|
for (const i of t)
|
|
464
533
|
if (i.data.length > 0) {
|
|
465
|
-
|
|
534
|
+
n = i.data[i.data.length - 1].time;
|
|
466
535
|
break;
|
|
467
536
|
}
|
|
468
|
-
if (!
|
|
469
|
-
const
|
|
470
|
-
const { time:
|
|
471
|
-
if (!
|
|
472
|
-
const
|
|
473
|
-
for (const
|
|
474
|
-
|
|
475
|
-
if (
|
|
476
|
-
|
|
477
|
-
else if (
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
const
|
|
481
|
-
|
|
537
|
+
if (!n) return;
|
|
538
|
+
const r = (i) => {
|
|
539
|
+
const { time: u = n, seriesData: d, point: B } = i || {}, g = Array.from(v.current.values());
|
|
540
|
+
if (!B || !u) {
|
|
541
|
+
const _ = /* @__PURE__ */ new Map();
|
|
542
|
+
for (const m of t)
|
|
543
|
+
m.data.length > 0 && _.set(m.label, m.data[m.data.length - 1]);
|
|
544
|
+
if (ue(_.size > 0 ? _ : void 0), l || D)
|
|
545
|
+
E(null);
|
|
546
|
+
else if (g[0] && n) {
|
|
547
|
+
const N = e.timeScale().timeToCoordinate(n), C = t[0];
|
|
548
|
+
if (C.data.length > 0) {
|
|
549
|
+
const w = C.data[C.data.length - 1].value, x = g[0].priceToCoordinate(w);
|
|
550
|
+
N !== null && x !== null && E({ x: N, y: x });
|
|
482
551
|
}
|
|
483
552
|
}
|
|
484
553
|
return;
|
|
485
554
|
}
|
|
486
|
-
const
|
|
487
|
-
let
|
|
488
|
-
for (let
|
|
489
|
-
const
|
|
490
|
-
if (!
|
|
491
|
-
const
|
|
492
|
-
let
|
|
493
|
-
if (
|
|
494
|
-
|
|
495
|
-
else if (
|
|
496
|
-
const
|
|
497
|
-
|
|
555
|
+
const F = /* @__PURE__ */ new Map();
|
|
556
|
+
let M;
|
|
557
|
+
for (let _ = 0; _ < t.length; _++) {
|
|
558
|
+
const m = t[_], N = g[_];
|
|
559
|
+
if (!N) continue;
|
|
560
|
+
const C = d?.get(N), w = C && "value" in C ? C.value : void 0;
|
|
561
|
+
let x;
|
|
562
|
+
if (w !== void 0)
|
|
563
|
+
x = w;
|
|
564
|
+
else if (l) {
|
|
565
|
+
const Y = Number(u), J = m.data.length > 0 ? Number(m.data[0].time) : Number.POSITIVE_INFINITY;
|
|
566
|
+
Y < J ? x = Number.NaN : x = m.data[m.data.length - 1]?.value ?? 0;
|
|
498
567
|
} else
|
|
499
|
-
|
|
500
|
-
Number.isNaN(
|
|
568
|
+
x = it(m.data, Number(u));
|
|
569
|
+
Number.isNaN(x) || (M === void 0 && (M = x), F.set(m.label, { value: x, time: u }));
|
|
501
570
|
}
|
|
502
|
-
if (
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
const
|
|
571
|
+
if (ue(F), M !== void 0 && g[0]) {
|
|
572
|
+
const m = e.timeScale().timeToCoordinate(u), N = g[0].priceToCoordinate(M);
|
|
573
|
+
if (m !== null && N !== null) {
|
|
574
|
+
const C = H.current;
|
|
575
|
+
if (C) {
|
|
576
|
+
const w = C.querySelector(
|
|
508
577
|
".LightweightChart"
|
|
509
578
|
);
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
|
|
579
|
+
if (w) {
|
|
580
|
+
const x = w.getBoundingClientRect(), Y = C.getBoundingClientRect(), J = m + (x.left - Y.left), fe = N + (x.top - Y.top);
|
|
581
|
+
E({ x: J, y: fe });
|
|
513
582
|
} else
|
|
514
|
-
|
|
583
|
+
E({ x: m, y: N });
|
|
515
584
|
} else
|
|
516
|
-
|
|
585
|
+
E({ x: m, y: N });
|
|
517
586
|
} else
|
|
518
|
-
|
|
587
|
+
E(null);
|
|
519
588
|
} else
|
|
520
|
-
|
|
589
|
+
E(null);
|
|
521
590
|
};
|
|
522
|
-
return e.subscribeCrosshairMove(
|
|
523
|
-
const i = Array.from(
|
|
524
|
-
if (i[0] &&
|
|
525
|
-
const
|
|
526
|
-
|
|
591
|
+
return e.subscribeCrosshairMove(r), P && e.subscribeClick(r), !l && !D && requestAnimationFrame(() => {
|
|
592
|
+
const i = Array.from(v.current.values());
|
|
593
|
+
if (i[0] && n && t[0]?.data.length > 0) {
|
|
594
|
+
const d = e.timeScale().timeToCoordinate(n), B = t[0].data[t[0].data.length - 1].value, g = i[0].priceToCoordinate(B);
|
|
595
|
+
d !== null && g !== null && E({ x: d, y: g });
|
|
527
596
|
}
|
|
528
597
|
}), () => {
|
|
529
|
-
e.unsubscribeCrosshairMove(
|
|
598
|
+
e.unsubscribeCrosshairMove(r), P && e.unsubscribeClick(r);
|
|
530
599
|
};
|
|
531
|
-
}, [t,
|
|
532
|
-
const e =
|
|
600
|
+
}, [t, D, P]), L(() => {
|
|
601
|
+
const e = T.current;
|
|
533
602
|
if (!e || t.length === 0) return;
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
const
|
|
537
|
-
if (!
|
|
538
|
-
const i = Number(
|
|
539
|
-
for (const
|
|
540
|
-
for (const
|
|
541
|
-
const
|
|
542
|
-
|
|
603
|
+
const l = e.timeScale(), n = () => {
|
|
604
|
+
if (!se.current) return;
|
|
605
|
+
const r = l.getVisibleRange();
|
|
606
|
+
if (!r) return;
|
|
607
|
+
const i = Number(r.from), u = Number(r.to), d = [];
|
|
608
|
+
for (const B of t)
|
|
609
|
+
for (const g of B.data) {
|
|
610
|
+
const F = Number(g.time);
|
|
611
|
+
F >= i && F <= u && d.push(g.value);
|
|
543
612
|
}
|
|
544
|
-
|
|
613
|
+
d.length > 0 && se.current(d);
|
|
545
614
|
};
|
|
546
|
-
return
|
|
547
|
-
|
|
548
|
-
|
|
615
|
+
return l.subscribeVisibleLogicalRangeChange(n), () => {
|
|
616
|
+
l.unsubscribeVisibleLogicalRangeChange(
|
|
617
|
+
n
|
|
549
618
|
);
|
|
550
619
|
};
|
|
551
|
-
}, [t]),
|
|
552
|
-
const e =
|
|
553
|
-
if (e &&
|
|
554
|
-
const
|
|
555
|
-
for (const
|
|
556
|
-
const
|
|
557
|
-
...
|
|
558
|
-
...
|
|
620
|
+
}, [t]), L(() => {
|
|
621
|
+
const e = T.current, l = Array.from(v.current.values()), n = [];
|
|
622
|
+
if (e && l.length > 0 && p) {
|
|
623
|
+
const r = Oe(), i = l[0];
|
|
624
|
+
for (const u of p) {
|
|
625
|
+
const d = new ot(e, i, u.xCoordinate, {
|
|
626
|
+
...r,
|
|
627
|
+
...u.options || {}
|
|
559
628
|
});
|
|
560
|
-
i.attachPrimitive(
|
|
629
|
+
i.attachPrimitive(d), n.push(d);
|
|
561
630
|
}
|
|
562
631
|
}
|
|
563
632
|
return () => {
|
|
564
|
-
if (
|
|
565
|
-
const
|
|
566
|
-
for (const i of
|
|
567
|
-
|
|
633
|
+
if (l.length > 0) {
|
|
634
|
+
const r = l[0];
|
|
635
|
+
for (const i of n)
|
|
636
|
+
r.detachPrimitive(i);
|
|
568
637
|
}
|
|
569
638
|
};
|
|
570
|
-
}, [
|
|
571
|
-
const e =
|
|
572
|
-
if (
|
|
573
|
-
|
|
639
|
+
}, [p, t]), L(() => {
|
|
640
|
+
const e = [];
|
|
641
|
+
if (R && R.length > 0) {
|
|
642
|
+
const l = Array.from(v.current.values())[0], n = O(
|
|
643
|
+
"hsl(var(--destructive))",
|
|
644
|
+
"rgb(239, 68, 68)"
|
|
645
|
+
);
|
|
646
|
+
for (const r of R) {
|
|
647
|
+
if (!Number.isFinite(r.price)) continue;
|
|
648
|
+
const i = r.seriesLabel ? v.current.get(r.seriesLabel) : l;
|
|
649
|
+
if (!i) continue;
|
|
650
|
+
const u = i.createPriceLine({
|
|
651
|
+
price: r.price,
|
|
652
|
+
color: r.color ? O(r.color, r.color) : n,
|
|
653
|
+
lineWidth: r.lineWidth ?? 1,
|
|
654
|
+
lineStyle: r.lineStyle ?? Ze.Dashed,
|
|
655
|
+
axisLabelVisible: r.axisLabelVisible ?? !0,
|
|
656
|
+
title: r.title ?? ""
|
|
657
|
+
});
|
|
658
|
+
e.push({ series: i, line: u });
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return () => {
|
|
662
|
+
for (const { series: l, line: n } of e)
|
|
663
|
+
try {
|
|
664
|
+
l.removePriceLine(n);
|
|
665
|
+
} catch {
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
}, [R, t]), L(() => {
|
|
669
|
+
const e = [];
|
|
670
|
+
if (W && W.length > 0) {
|
|
671
|
+
const l = Array.from(v.current.values())[0], n = "rgba(239, 68, 68, 0.12)";
|
|
672
|
+
for (const r of W) {
|
|
673
|
+
const i = r.seriesLabel ? v.current.get(r.seriesLabel) : l;
|
|
674
|
+
if (!i) continue;
|
|
675
|
+
const u = r.color ? O(r.color, n) : n, d = new at(
|
|
676
|
+
i,
|
|
677
|
+
r.priceTop,
|
|
678
|
+
r.priceBottom,
|
|
679
|
+
u
|
|
680
|
+
);
|
|
681
|
+
i.attachPrimitive(d), e.push({ series: i, zone: d });
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
return () => {
|
|
685
|
+
for (const { series: l, zone: n } of e)
|
|
686
|
+
try {
|
|
687
|
+
l.detachPrimitive(n);
|
|
688
|
+
} catch {
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
}, [W, t]), L(() => {
|
|
692
|
+
const e = T.current;
|
|
693
|
+
if (!e || !p?.length) {
|
|
694
|
+
Re([]);
|
|
574
695
|
return;
|
|
575
696
|
}
|
|
576
|
-
const
|
|
577
|
-
const i = e.timeScale(),
|
|
578
|
-
|
|
697
|
+
const l = () => {
|
|
698
|
+
const i = e.timeScale(), u = p.map((d) => i.timeToCoordinate(d.xCoordinate) ?? null);
|
|
699
|
+
Re(u);
|
|
579
700
|
};
|
|
580
|
-
|
|
581
|
-
const
|
|
582
|
-
|
|
701
|
+
l();
|
|
702
|
+
const n = e.timeScale(), r = () => {
|
|
703
|
+
l();
|
|
583
704
|
};
|
|
584
|
-
return
|
|
585
|
-
|
|
705
|
+
return n.subscribeVisibleLogicalRangeChange(r), () => {
|
|
706
|
+
n.unsubscribeVisibleLogicalRangeChange(r);
|
|
586
707
|
};
|
|
587
|
-
}, [
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
708
|
+
}, [p, t]);
|
|
709
|
+
const oe = t.length === 1, Te = ge.useMemo(() => {
|
|
710
|
+
if (oe && t.length > 0) {
|
|
590
711
|
const e = t[0];
|
|
591
712
|
if (e.data.length > 0)
|
|
592
713
|
return e.data[e.data.length - 1];
|
|
593
714
|
}
|
|
594
|
-
}, [
|
|
595
|
-
return /* @__PURE__ */
|
|
715
|
+
}, [oe, t]);
|
|
716
|
+
return /* @__PURE__ */ U(
|
|
596
717
|
"div",
|
|
597
718
|
{
|
|
598
|
-
ref:
|
|
599
|
-
className:
|
|
719
|
+
ref: H,
|
|
720
|
+
className: Ce(
|
|
600
721
|
"relative z-[1] w-full h-full overflow-hidden p-0",
|
|
601
|
-
|
|
722
|
+
c
|
|
602
723
|
),
|
|
603
724
|
children: [
|
|
604
|
-
|
|
605
|
-
|
|
725
|
+
le != null && le !== !1 && oe ? /* @__PURE__ */ S("div", { className: "absolute top-2 left-2 right-2 z-[100] pointer-events-none", children: /* @__PURE__ */ S("div", { className: "text-xl sm:text-2xl font-semibold text-foreground whitespace-nowrap overflow-hidden text-ellipsis", children: le }) }) : Ae && oe && Te && /* @__PURE__ */ S(
|
|
726
|
+
et,
|
|
606
727
|
{
|
|
607
|
-
point:
|
|
608
|
-
xMeasureUnit:
|
|
609
|
-
yMeasureUnit:
|
|
610
|
-
decimals:
|
|
728
|
+
point: Te,
|
|
729
|
+
xMeasureUnit: h,
|
|
730
|
+
yMeasureUnit: y,
|
|
731
|
+
decimals: ae
|
|
611
732
|
}
|
|
612
733
|
),
|
|
613
|
-
|
|
614
|
-
|
|
734
|
+
we && Ne && /* @__PURE__ */ S(
|
|
735
|
+
tt,
|
|
615
736
|
{
|
|
616
|
-
points:
|
|
617
|
-
xMeasureUnit:
|
|
618
|
-
yMeasureUnit:
|
|
737
|
+
points: we,
|
|
738
|
+
xMeasureUnit: h,
|
|
739
|
+
yMeasureUnit: y,
|
|
619
740
|
series: t,
|
|
620
|
-
position:
|
|
621
|
-
containerRef:
|
|
622
|
-
decimals:
|
|
741
|
+
position: Ne,
|
|
742
|
+
containerRef: H,
|
|
743
|
+
decimals: ae
|
|
623
744
|
}
|
|
624
745
|
),
|
|
625
|
-
|
|
626
|
-
|
|
746
|
+
s && /* @__PURE__ */ S(ct, { series: t, onUnselect: b }),
|
|
747
|
+
p && p.length > 0 && Ve.length === p.length && /* @__PURE__ */ S(
|
|
627
748
|
"div",
|
|
628
749
|
{
|
|
629
750
|
className: "absolute inset-0 z-[5] pointer-events-none",
|
|
630
751
|
"aria-hidden": !0,
|
|
631
|
-
children:
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
634
|
-
const { labelText:
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
752
|
+
children: p.map((e, l) => {
|
|
753
|
+
const n = Ve[l], r = e.options ?? {}, i = r.showLabel !== !1;
|
|
754
|
+
if (n === null || !i) return null;
|
|
755
|
+
const { labelText: u, valueStr: d } = lt(
|
|
756
|
+
r,
|
|
757
|
+
y,
|
|
758
|
+
ae
|
|
638
759
|
);
|
|
639
|
-
if (!(
|
|
640
|
-
const
|
|
641
|
-
return /* @__PURE__ */
|
|
760
|
+
if (!(u || d)) return null;
|
|
761
|
+
const g = r.labelBackgroundColor ?? r.color ?? "hsl(var(--background))", F = r.labelTextColor ?? "hsl(var(--foreground))", M = `${String(e.xCoordinate)}-${u}`;
|
|
762
|
+
return /* @__PURE__ */ U(
|
|
642
763
|
"div",
|
|
643
764
|
{
|
|
644
765
|
className: "absolute top-2 px-2 py-1 rounded text-xs font-medium whitespace-nowrap shadow-sm border border-border",
|
|
645
766
|
style: {
|
|
646
|
-
left:
|
|
767
|
+
left: n,
|
|
647
768
|
transform: "translateX(-50%)",
|
|
648
|
-
backgroundColor:
|
|
649
|
-
color:
|
|
769
|
+
backgroundColor: g,
|
|
770
|
+
color: F
|
|
650
771
|
},
|
|
651
772
|
children: [
|
|
652
|
-
|
|
653
|
-
|
|
773
|
+
u && /* @__PURE__ */ S("span", { className: "block", children: u }),
|
|
774
|
+
d && /* @__PURE__ */ S("span", { className: Ce("block", u && "mt-0.5"), children: d })
|
|
654
775
|
]
|
|
655
776
|
},
|
|
656
|
-
|
|
777
|
+
M
|
|
657
778
|
);
|
|
658
779
|
})
|
|
659
780
|
}
|
|
660
781
|
),
|
|
661
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ S(
|
|
662
783
|
"div",
|
|
663
784
|
{
|
|
664
|
-
ref:
|
|
785
|
+
ref: ce,
|
|
665
786
|
className: "LightweightChart w-full h-full overflow-hidden"
|
|
666
787
|
}
|
|
667
788
|
)
|
|
@@ -669,41 +790,41 @@ function ht({
|
|
|
669
790
|
}
|
|
670
791
|
);
|
|
671
792
|
}
|
|
672
|
-
function
|
|
793
|
+
function ct({
|
|
673
794
|
series: t,
|
|
674
|
-
onUnselect:
|
|
795
|
+
onUnselect: c
|
|
675
796
|
}) {
|
|
676
|
-
return /* @__PURE__ */
|
|
677
|
-
const
|
|
678
|
-
return /* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ S("div", { className: "absolute top-0 left-2 z-[10] flex flex-wrap gap-2", children: t.map((s, b) => {
|
|
798
|
+
const h = Fe(b), y = (s.lineColor ?? s.color) || h.line, z = s.data.length === 0;
|
|
799
|
+
return /* @__PURE__ */ U(
|
|
679
800
|
"div",
|
|
680
801
|
{
|
|
681
|
-
className:
|
|
802
|
+
className: Ce(
|
|
682
803
|
"flex items-center gap-1.5 px-2 py-1 bg-background/80 backdrop-blur-sm rounded border border-border",
|
|
683
|
-
|
|
804
|
+
z && "opacity-50"
|
|
684
805
|
),
|
|
685
806
|
children: [
|
|
686
|
-
/* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ S(
|
|
687
808
|
"div",
|
|
688
809
|
{
|
|
689
810
|
className: "w-3 h-3 rounded-sm",
|
|
690
|
-
style: { backgroundColor:
|
|
811
|
+
style: { backgroundColor: y }
|
|
691
812
|
}
|
|
692
813
|
),
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
|
|
695
|
-
|
|
814
|
+
/* @__PURE__ */ U("span", { className: "text-[10px] sm:text-xs font-medium text-foreground", children: [
|
|
815
|
+
s.label,
|
|
816
|
+
z && " (no data)"
|
|
696
817
|
] }),
|
|
697
|
-
|
|
818
|
+
c && /* @__PURE__ */ S(
|
|
698
819
|
"button",
|
|
699
820
|
{
|
|
700
821
|
type: "button",
|
|
701
|
-
onClick: (
|
|
702
|
-
|
|
822
|
+
onClick: (p) => {
|
|
823
|
+
p.stopPropagation(), c(s.label);
|
|
703
824
|
},
|
|
704
825
|
className: "ml-1 flex items-center justify-center w-4 h-4 rounded-sm hover:bg-muted transition-colors cursor-pointer",
|
|
705
|
-
"aria-label": `Remove ${
|
|
706
|
-
children: /* @__PURE__ */
|
|
826
|
+
"aria-label": `Remove ${s.label}`,
|
|
827
|
+
children: /* @__PURE__ */ U(
|
|
707
828
|
"svg",
|
|
708
829
|
{
|
|
709
830
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -718,9 +839,9 @@ function et({
|
|
|
718
839
|
className: "text-muted-foreground hover:text-foreground",
|
|
719
840
|
"aria-hidden": "true",
|
|
720
841
|
children: [
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ S("title", { children: "Close" }),
|
|
843
|
+
/* @__PURE__ */ S("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
844
|
+
/* @__PURE__ */ S("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
724
845
|
]
|
|
725
846
|
}
|
|
726
847
|
)
|
|
@@ -728,14 +849,14 @@ function et({
|
|
|
728
849
|
)
|
|
729
850
|
]
|
|
730
851
|
},
|
|
731
|
-
|
|
852
|
+
s.label
|
|
732
853
|
);
|
|
733
854
|
}) });
|
|
734
855
|
}
|
|
735
856
|
export {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
857
|
+
ve as DEFAULT_SERIES_COLORS,
|
|
858
|
+
Nt as Graph,
|
|
859
|
+
Fe as getSeriesColorPalette,
|
|
860
|
+
it as getStepForwardValue,
|
|
861
|
+
lt as getVerticalLineTooltipContent
|
|
741
862
|
};
|