@tradecanvas/chart 1.56.0 → 1.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Chart.d.ts.map +1 -1
- package/dist/{LayoutSession-CmxR_iG8.js → LayoutSession-BXmESQTc.js} +509 -516
- package/dist/LayoutSession-BXmESQTc.js.map +1 -0
- package/dist/LayoutSession-C8zqGSLI.cjs +2 -0
- package/dist/LayoutSession-C8zqGSLI.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -72
- package/dist/indicatorLabel.d.ts +1 -1
- package/dist/indicatorLabel.d.ts.map +1 -1
- package/dist/widget/index.cjs +1 -1
- package/dist/widget/index.js +1 -1
- package/package.json +8 -3
- package/dist/LayoutSession-CeCJsq_4.cjs +0 -2
- package/dist/LayoutSession-CeCJsq_4.cjs.map +0 -1
- package/dist/LayoutSession-CmxR_iG8.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, g as l, h as u, i as ee, l as te, m as ne, n as re, o as ie, p as ae, r as oe, s as se, t as ce, u as le, v as ue, w as de, x as fe, y as pe } from "./LayoutSession-
|
|
2
|
-
import { CHART_STYLE_KEYS as me, DARK_PRICE_LIMITS as he, DARK_TERMINAL as ge, DARK_THEME as _e, DARK_THEME as ve, DEFAULT_DRAWING_STYLE as ye, DEFAULT_FONT_FAMILY as be, DEFAULT_RECONNECT as xe, DEFAULT_SIGNAL_STYLE as Se, DEFAULT_STREAM_CONFIG as Ce, DEFAULT_TIMEFRAME_FAVORITES as we, DEFAULT_TRADE_ZONE_STYLE as Te, DEFAULT_TRADING_CONFIG as Ee, HNX_SESSIONS as d, HOSE_SESSIONS as f,
|
|
3
|
-
import { AlertManager as
|
|
1
|
+
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, g as l, h as u, i as ee, l as te, m as ne, n as re, o as ie, p as ae, r as oe, s as se, t as ce, u as le, v as ue, w as de, x as fe, y as pe } from "./LayoutSession-BXmESQTc.js";
|
|
2
|
+
import { CHART_STYLE_KEYS as me, DARK_PRICE_LIMITS as he, DARK_TERMINAL as ge, DARK_THEME as _e, DARK_THEME as ve, DEFAULT_DRAWING_STYLE as ye, DEFAULT_FONT_FAMILY as be, DEFAULT_RECONNECT as xe, DEFAULT_SIGNAL_STYLE as Se, DEFAULT_STREAM_CONFIG as Ce, DEFAULT_TIMEFRAME_FAVORITES as we, DEFAULT_TRADE_ZONE_STYLE as Te, DEFAULT_TRADING_CONFIG as Ee, HNX_SESSIONS as d, HOSE_SESSIONS as f, KRX_SESSIONS as p, KR_COLORS as m, LIGHT_PRICE_LIMITS as h, LIGHT_THEME as g, LIGHT_THEME as _, MARKET_CRYPTO as v, MARKET_HNX as y, MARKET_HOSE as b, MARKET_HOSE_ETF as x, MARKET_KRX as S, MARKET_NXT as C, MARKET_NYSE as w, MARKET_UPBIT_KRW as T, MARKET_UPCOM as E, MARKET_VN30F as D, MS_TIME_THRESHOLD as De, NXT_SESSIONS as Oe, PRICE_SOURCES as ke, SANS_FONT_FAMILY as Ae, TC_PALETTE as je, TC_SERIES_COLORS as Me, TIMEFRAMES_CRYPTO as Ne, TIMEFRAMES_FOREX as Pe, TIMEFRAMES_STOCK as Fe, UPCOM_SESSIONS as Ie, VN30F_SESSIONS as Le, VN_COLORS as Re, VOLUME_ALPHA as ze, barTimeUnit as Be, barsAreDaily as Ve, computePriceLimits as He, contrastRatio as Ue, createMarketTheme as We, createVNTheme as Ge, formatFraction as Ke, formatNumber as qe, formatVND as Je, formatVolumeLoc as Ye, fractionTick as Xe, getCurrentSession as Ze, getLocale as Qe, indicatorSource as $e, inkOn as et, isPriceSource as tt, isTimeFrame as nt, isValidTimeZone as rt, marketStatus as it, normalizeBar as at, normalizeBarTime as ot, offsetAt as st, parseIndicatorSource as ct, parseTimeframe as lt, pickBaseTimeframe as ut, priceFormatterFor as dt, priceStepAt as ft, rankSymbols as pt, readNews as mt, readQuote as ht, readableOn as gt, registerLocale as _t, resampleBars as vt, roundToPriceStep as yt, scaleMarketPrices as bt, setLocale as xt, sourcePrice as St, stepDecimals as Ct, symbolTimeZone as wt, t as Tt, tickBarCount as Et, timeframeBucketStart as Dt, timeframeBucketStart as Ot, timeframeToMs as kt, vn30fContracts as At, vn30fLastTradingDay as jt, volumeColor as Mt, wallToUtc as Nt, zoneOffsetMinutes as Pt } from "@tradecanvas/commons";
|
|
3
|
+
import { AlertManager as Ft, Animator as It, BarCountdown as Lt, BaseFinanceChart as O, BinanceAdapter as Rt, BybitAdapter as zt, CANDLE_PATTERNS as Bt, ChartLegend as Vt, ChartStateManager as Ht, CoinbaseAdapter as Ut, CompareRenderer as Wt, CrosshairTooltip as Gt, CurrentPriceLine as Kt, DEFAULT_LEGEND_CONFIG as qt, DEFAULT_MAX_WEBGL_CHARTS as Jt, DEFAULT_SESSION_HOURS as Yt, DataExporter as Xt, DrawingBase as Zt, Easing as Qt, FinanceCrosshair as k, GROUP_HEADER as $t, INDICATOR_CATEGORIES as en, IndicatorBase as tn, IndicatorValueMap as nn, KEPT_BUCKETS as rn, KeyboardHandler as an, KrakenAdapter as on, MAX_ALERT_BARS as sn, MIN_ALERT_BARS as cn, MockAdapter as ln, PaperExecutionAdapter as un, PollingAdapter as dn, RANGE_PRESETS as fn, ReplayManager as pn, ResamplingAdapter as mn, ReshapeMemo as hn, Screenshot as gn, SessionBreaks as _n, SessionShading as vn, SignalMarkerManager as A, StreamManager as yn, TickAggregator as bn, TickBarAdapter as xn, TickBarBuilder as Sn, TradeZoneManager as Cn, UndoRedoManager as wn, UpbitAdapter as Tn, VolumeRenderer as En, Watermark as Dn, WebSocketAdapter as On, axisTimes as kn, barIndexToTime as An, barIndexToX as jn, barIndexToX as j, canvasMeasure as Mn, computeBarLayout as Nn, computeCalendarLayout as Pn, computeCounterClockLayout as Fn, computeDonutLayout as In, computeHistogramLayout as Ln, computeMatrixLayout as Rn, computeScatterLayout as zn, correlationMatrix as Bn, counterClockPhase as Vn, counterClockPhase as Hn, counterClockPoints as Un, counterClockPoints as Wn, detectCandlePatterns as Gn, formatTooltipTime as Kn, histogramBins as qn, hitBar as M, hitDay as N, hitMatrixCell as P, hitSlice as F, indicatorCategory as Jn, isPriceLevelAlert as Yn, layoutGroupedTreemap as Xn, layoutSquarifiedTreemap as Zn, layoutUniformGrid as Qn, lttbDownsample as $n, lttbVisibleIndices as er, nearestCounterClockPoint as I, nearestPoint as L, niceScale as tr, priceToY as nr, priceToYMapper as rr, priceToYMapper as ir, rangePresetStart as ar, renderBarChart as or, renderCalendar as sr, renderCounterClock as cr, renderDepthChart as lr, renderDonut as ur, renderEquityCurve as dr, renderGauge as fr, renderHeatmap as pr, renderHistogram as mr, renderMatrix as hr, renderScatter as gr, renderSparkline as _r, renderWaterfall as vr, servesTimeframe as yr, setMaxWebGLCharts as br, shownCount as xr, timeToX as Sr, timestampToBarIndex as Cr, timestampToBarIndex as wr, toHeikinAshi as Tr, toKagi as Er, toLineBreak as Dr, toPointAndFigure as Or, toRangeBars as kr, toRenko as Ar, withResampling as jr, withTickBars as Mr, xToBarIndex as Nr, xToBarIndex as R, xToTime as Pr, yToPrice as Fr, yToPrice as Ir } from "@tradecanvas/core";
|
|
4
4
|
//#region src/frameworks/syncIndicators.ts
|
|
5
|
-
function
|
|
5
|
+
function Lr(e) {
|
|
6
6
|
let { id: t, params: n = {}, position: r = null } = typeof e == "string" ? { id: e } : e;
|
|
7
7
|
return JSON.stringify([
|
|
8
8
|
t,
|
|
@@ -10,9 +10,9 @@ function kr(e) {
|
|
|
10
10
|
r
|
|
11
11
|
]);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Rr(e, t, n) {
|
|
14
14
|
let r = /* @__PURE__ */ new Map(), i = t.map((e) => {
|
|
15
|
-
let t =
|
|
15
|
+
let t = Lr(e), n = r.get(t) ?? 0;
|
|
16
16
|
return r.set(t, n + 1), {
|
|
17
17
|
spec: e,
|
|
18
18
|
key: `${t}#${n}`
|
|
@@ -27,7 +27,7 @@ function Ar(e, t, n) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/frameworks/feedBars.ts
|
|
30
|
-
var
|
|
30
|
+
var zr = 3, z = (e) => ({
|
|
31
31
|
time: e.time,
|
|
32
32
|
open: e.open,
|
|
33
33
|
high: e.high,
|
|
@@ -35,16 +35,16 @@ var jr = 3, z = (e) => ({
|
|
|
35
35
|
close: e.close,
|
|
36
36
|
volume: e.volume
|
|
37
37
|
}), B = (e) => e.length > 0 ? e[e.length - 1] : null;
|
|
38
|
-
function
|
|
38
|
+
function Br(e, n, r) {
|
|
39
39
|
for (let i = 0; i < r; i++) if (!t(e[i], n[i])) return !1;
|
|
40
40
|
return !0;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Vr(e, t) {
|
|
43
43
|
if (e.isReplayActive()) return !0;
|
|
44
44
|
let n = B(e.getData());
|
|
45
45
|
return t.inReplay ? n?.time === t.last?.time : n === t.shownBar ? n?.time === t.last?.time || !e.isExtendedHoursVisible() : !1;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Hr(e, r, i) {
|
|
48
48
|
let a = [];
|
|
49
49
|
for (let o = 0; o < r.length; o++) {
|
|
50
50
|
let s = e[i + o];
|
|
@@ -55,16 +55,16 @@ function Pr(e, r, i) {
|
|
|
55
55
|
}
|
|
56
56
|
return a;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Ur(e, t) {
|
|
59
59
|
if (t.length === 0) return !0;
|
|
60
60
|
if (!e.updateBar) return !1;
|
|
61
61
|
for (let n of t) if (!e.updateBar(n)) return !1;
|
|
62
62
|
return !0;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Wr(e) {
|
|
65
65
|
return e.slice(Math.max(1, e.length - 1 - 3), -1).map(z);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function Gr(e, t) {
|
|
68
68
|
let r = [];
|
|
69
69
|
for (let i = t; i < e.length; i++) {
|
|
70
70
|
if (!n(e[i]) || !(e[i].time > e[i - 1].time)) return null;
|
|
@@ -72,42 +72,42 @@ function Lr(e, t) {
|
|
|
72
72
|
}
|
|
73
73
|
return r;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Kr(e, r, i) {
|
|
76
76
|
let a = i.length;
|
|
77
|
-
if (a === 0 || !i.last || !n(i.last) || r.length < a || !
|
|
77
|
+
if (a === 0 || !i.last || !n(i.last) || r.length < a || !Vr(e, i)) return !1;
|
|
78
78
|
let o = i.recent ?? [], s = a - 1 - o.length;
|
|
79
|
-
if (r !== i.source && (i.source.length !== a || !
|
|
79
|
+
if (r !== i.source && (i.source.length !== a || !Br(i.source, r, s))) return !1;
|
|
80
80
|
let c = r[a - 1];
|
|
81
81
|
if (c.time !== i.last.time || !n(c)) return !1;
|
|
82
|
-
let l =
|
|
83
|
-
return !l || !u || !
|
|
82
|
+
let l = Hr(r, o, s), u = Gr(r, a);
|
|
83
|
+
return !l || !u || !Ur(e, l) ? !1 : (t(c, i.last) || e.updateLastBar(z(c)), u.length === 1 ? e.appendBar(u[0]) : u.length > 1 && e.appendBars(u), !0);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
(!n || !
|
|
85
|
+
function qr(e, t, n) {
|
|
86
|
+
(!n || !Kr(e, t, n)) && e.setData(t.map(z));
|
|
87
87
|
let r = t.length > 0 ? z(t[t.length - 1]) : null, i = e.isReplayActive();
|
|
88
88
|
return {
|
|
89
89
|
source: t,
|
|
90
90
|
length: t.length,
|
|
91
91
|
last: r,
|
|
92
|
-
recent:
|
|
92
|
+
recent: Wr(t),
|
|
93
93
|
shownBar: i ? null : B(e.getData()),
|
|
94
94
|
inReplay: i
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region src/plugins/overlayScale.ts
|
|
99
|
-
function
|
|
100
|
-
let { viewport: t, data: n } = e, r =
|
|
99
|
+
function Jr(e) {
|
|
100
|
+
let { viewport: t, data: n } = e, r = ir(t), i = n.length - 1, a = Math.max(0, Math.floor(t.visibleRange.from)), o = Math.min(i, Math.ceil(t.visibleRange.to)), s = (e) => n.length > 0 ? wr(e, n) : e;
|
|
101
101
|
return {
|
|
102
102
|
timeToX: (e) => j(s(e), t),
|
|
103
103
|
xToTime: (e) => {
|
|
104
104
|
let r = R(e, t);
|
|
105
|
-
return n.length > 0 ?
|
|
105
|
+
return n.length > 0 ? An(r, n) : r;
|
|
106
106
|
},
|
|
107
107
|
indexToX: (e) => j(e, t),
|
|
108
108
|
xToIndex: (e) => R(e, t),
|
|
109
109
|
priceToY: r,
|
|
110
|
-
yToPrice: (e) =>
|
|
110
|
+
yToPrice: (e) => Ir(e, t),
|
|
111
111
|
barWidth: t.barWidth,
|
|
112
112
|
visible: o < a ? {
|
|
113
113
|
from: 0,
|
|
@@ -153,7 +153,7 @@ var V = {
|
|
|
153
153
|
cols: 2,
|
|
154
154
|
rows: 3
|
|
155
155
|
}
|
|
156
|
-
},
|
|
156
|
+
}, Yr = class {
|
|
157
157
|
root;
|
|
158
158
|
cells = [];
|
|
159
159
|
layout;
|
|
@@ -260,13 +260,13 @@ var V = {
|
|
|
260
260
|
this.cells = [], this.root.remove();
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
},
|
|
263
|
+
}, Xr = class extends O {
|
|
264
264
|
options;
|
|
265
265
|
constructor(e, t) {
|
|
266
266
|
super(e, t.theme), this.options = t, this.requestRender();
|
|
267
267
|
}
|
|
268
268
|
renderChart(e, t, n, r) {
|
|
269
|
-
|
|
269
|
+
_r(e, t, n, this.options, r);
|
|
270
270
|
}
|
|
271
271
|
update(e) {
|
|
272
272
|
this.options = {
|
|
@@ -280,7 +280,7 @@ var V = {
|
|
|
280
280
|
...e
|
|
281
281
|
}, this.requestRender();
|
|
282
282
|
}
|
|
283
|
-
},
|
|
283
|
+
}, Zr = class extends O {
|
|
284
284
|
options;
|
|
285
285
|
crosshair = null;
|
|
286
286
|
constructor(e, t) {
|
|
@@ -288,7 +288,7 @@ var V = {
|
|
|
288
288
|
}
|
|
289
289
|
renderChart(e, t, n, r) {
|
|
290
290
|
let i = this.crosshair?.getPosition() ?? null;
|
|
291
|
-
|
|
291
|
+
lr(e, t, n, this.options, r, i);
|
|
292
292
|
}
|
|
293
293
|
update(e) {
|
|
294
294
|
this.options = {
|
|
@@ -313,7 +313,7 @@ var V = {
|
|
|
313
313
|
}
|
|
314
314
|
renderChart(e, t, n, r) {
|
|
315
315
|
let i = this.crosshair?.getPosition() ?? null;
|
|
316
|
-
|
|
316
|
+
dr(e, t, n, this.options, r, i);
|
|
317
317
|
}
|
|
318
318
|
update(e, t) {
|
|
319
319
|
this.options = {
|
|
@@ -360,20 +360,20 @@ var V = {
|
|
|
360
360
|
height: this.height
|
|
361
361
|
}, t = this.options.cellPadding ?? 2;
|
|
362
362
|
if (this.lastLayoutWidth = this.width, this.lastLayoutHeight = this.height, this.cachedGroups = [], this.options.grouped) {
|
|
363
|
-
let { groups: n, cells: r } =
|
|
363
|
+
let { groups: n, cells: r } = Xn(this.currentData.map((e) => ({
|
|
364
364
|
id: e.id,
|
|
365
365
|
weight: e.weight ?? (Math.abs(e.value) || 1),
|
|
366
366
|
group: e.group,
|
|
367
367
|
value: e.value
|
|
368
|
-
})), e, t,
|
|
368
|
+
})), e, t, $t);
|
|
369
369
|
this.cachedRects = r, this.cachedGroups = n;
|
|
370
370
|
} else if (this.options.weighted) {
|
|
371
371
|
let n = this.currentData.map((e) => ({
|
|
372
372
|
id: e.id,
|
|
373
373
|
weight: e.weight ?? (Math.abs(e.value) || 1)
|
|
374
374
|
}));
|
|
375
|
-
this.cachedRects =
|
|
376
|
-
} else this.cachedRects =
|
|
375
|
+
this.cachedRects = Zn(n, e, t);
|
|
376
|
+
} else this.cachedRects = Qn(this.currentData.map((e) => ({ id: e.id })), e, t);
|
|
377
377
|
}
|
|
378
378
|
onCanvasClick(e, t) {
|
|
379
379
|
if (this.options.onCellClick) for (let n of this.cachedRects) {
|
|
@@ -388,7 +388,7 @@ var V = {
|
|
|
388
388
|
renderChart(e, t, n, r) {
|
|
389
389
|
(t !== this.lastLayoutWidth || n !== this.lastLayoutHeight) && this.recomputeLayout();
|
|
390
390
|
let i = this.crosshair?.getPosition() ?? null;
|
|
391
|
-
|
|
391
|
+
pr(e, t, n, this.currentData, this.cachedRects, this.options, r, i, this.cachedGroups);
|
|
392
392
|
}
|
|
393
393
|
update(e) {
|
|
394
394
|
this.currentData = e, this.options = {
|
|
@@ -405,7 +405,7 @@ var V = {
|
|
|
405
405
|
destroy() {
|
|
406
406
|
this.crosshair?.destroy(), this.handleClick && this.canvas.removeEventListener("click", this.handleClick), super.destroy();
|
|
407
407
|
}
|
|
408
|
-
},
|
|
408
|
+
}, Qr = class extends O {
|
|
409
409
|
options;
|
|
410
410
|
crosshair = null;
|
|
411
411
|
constructor(e, t) {
|
|
@@ -413,7 +413,7 @@ var V = {
|
|
|
413
413
|
}
|
|
414
414
|
renderChart(e, t, n, r) {
|
|
415
415
|
let i = this.crosshair?.getPosition() ?? null;
|
|
416
|
-
|
|
416
|
+
vr(e, t, n, this.options, r, i);
|
|
417
417
|
}
|
|
418
418
|
update(e) {
|
|
419
419
|
this.options = {
|
|
@@ -430,12 +430,12 @@ var V = {
|
|
|
430
430
|
destroy() {
|
|
431
431
|
this.crosshair?.destroy(), super.destroy();
|
|
432
432
|
}
|
|
433
|
-
},
|
|
434
|
-
function
|
|
433
|
+
}, $r = 500;
|
|
434
|
+
function ei(e) {
|
|
435
435
|
let t = 1 - e;
|
|
436
436
|
return 1 - t * t * t;
|
|
437
437
|
}
|
|
438
|
-
var
|
|
438
|
+
var ti = class extends O {
|
|
439
439
|
options;
|
|
440
440
|
currentValue;
|
|
441
441
|
targetValue;
|
|
@@ -446,7 +446,7 @@ var qr = class extends O {
|
|
|
446
446
|
super(e, t.theme), this.options = t, this.currentValue = t.value, this.targetValue = t.value, this.requestRender();
|
|
447
447
|
}
|
|
448
448
|
renderChart(e, t, n, r) {
|
|
449
|
-
|
|
449
|
+
fr(e, t, n, this.options, r, this.currentValue);
|
|
450
450
|
}
|
|
451
451
|
setValue(e) {
|
|
452
452
|
if (this.options.animate === !1) {
|
|
@@ -476,7 +476,7 @@ var qr = class extends O {
|
|
|
476
476
|
if (this.animationFrameId !== null) return;
|
|
477
477
|
let e = () => {
|
|
478
478
|
if (this.animationFrameId = null, this.animationStart === null) return;
|
|
479
|
-
let t = this.options.animationDuration ??
|
|
479
|
+
let t = this.options.animationDuration ?? $r, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = ei(r);
|
|
480
480
|
this.currentValue = this.animationFrom + (this.targetValue - this.animationFrom) * i, this.requestRender(), r < 1 ? this.animationFrameId = requestAnimationFrame(e) : (this.currentValue = this.targetValue, this.animationStart = null);
|
|
481
481
|
};
|
|
482
482
|
this.animationFrameId = requestAnimationFrame(e);
|
|
@@ -506,7 +506,7 @@ var qr = class extends O {
|
|
|
506
506
|
}
|
|
507
507
|
renderChart(e, t, n, r) {
|
|
508
508
|
let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition(), a = this.layoutFor;
|
|
509
|
-
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r,
|
|
509
|
+
(!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r, Mn(e, r)), this.layoutFor = {
|
|
510
510
|
options: this.options,
|
|
511
511
|
width: t,
|
|
512
512
|
height: n,
|
|
@@ -525,12 +525,12 @@ var qr = class extends O {
|
|
|
525
525
|
destroy() {
|
|
526
526
|
this.crosshair.destroy(), this.canvas.removeEventListener("click", this.onClick), this.canvas.removeEventListener("pointermove", this.onMove), super.destroy();
|
|
527
527
|
}
|
|
528
|
-
},
|
|
528
|
+
}, ni = class extends W {
|
|
529
529
|
compute(e, t, n, r) {
|
|
530
|
-
return
|
|
530
|
+
return Nn(this.options, e, t, n, r);
|
|
531
531
|
}
|
|
532
532
|
draw(e, t, n, r, i, a) {
|
|
533
|
-
|
|
533
|
+
or(e, t, n, this.options, r, i, a);
|
|
534
534
|
}
|
|
535
535
|
describe() {
|
|
536
536
|
return `Bar chart of ${this.options.series.map((e) => e.name).join(", ")}, ${this.options.categories.length} categories`;
|
|
@@ -556,12 +556,12 @@ var qr = class extends O {
|
|
|
556
556
|
series: t
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
|
-
},
|
|
559
|
+
}, ri = class extends W {
|
|
560
560
|
compute(e, t, n, r) {
|
|
561
|
-
return
|
|
561
|
+
return In(this.options, e, t, n, r);
|
|
562
562
|
}
|
|
563
563
|
draw(e, t, n, r, i, a) {
|
|
564
|
-
|
|
564
|
+
ur(e, t, n, this.options, r, i, a);
|
|
565
565
|
}
|
|
566
566
|
describe() {
|
|
567
567
|
let e = this.options.data.filter((e) => Number.isFinite(e.value) && e.value > 0).map((e) => e.label).join(", ");
|
|
@@ -580,12 +580,12 @@ var qr = class extends O {
|
|
|
580
580
|
update(e) {
|
|
581
581
|
this.setOptions({ data: e });
|
|
582
582
|
}
|
|
583
|
-
},
|
|
583
|
+
}, ii = class extends W {
|
|
584
584
|
compute(e, t, n, r) {
|
|
585
|
-
return
|
|
585
|
+
return zn(this.options, e, t, n, r);
|
|
586
586
|
}
|
|
587
587
|
draw(e, t, n, r, i, a) {
|
|
588
|
-
|
|
588
|
+
gr(e, t, n, this.options, r, i, a);
|
|
589
589
|
}
|
|
590
590
|
describe() {
|
|
591
591
|
let e = this.options.series.reduce((e, t) => e + t.points.length, 0);
|
|
@@ -604,12 +604,12 @@ var qr = class extends O {
|
|
|
604
604
|
update(e) {
|
|
605
605
|
this.setOptions({ series: e });
|
|
606
606
|
}
|
|
607
|
-
},
|
|
607
|
+
}, ai = class extends W {
|
|
608
608
|
compute(e, t, n, r) {
|
|
609
|
-
return
|
|
609
|
+
return Ln(this.options, e, t, n, r);
|
|
610
610
|
}
|
|
611
611
|
draw(e, t, n, r, i, a) {
|
|
612
|
-
|
|
612
|
+
mr(e, t, n, this.options, r, i, a);
|
|
613
613
|
}
|
|
614
614
|
describe() {
|
|
615
615
|
return `Histogram of ${this.options.values.length} values`;
|
|
@@ -624,12 +624,12 @@ var qr = class extends O {
|
|
|
624
624
|
update(e) {
|
|
625
625
|
this.setOptions({ values: e });
|
|
626
626
|
}
|
|
627
|
-
},
|
|
627
|
+
}, oi = class extends W {
|
|
628
628
|
compute(e, t, n, r) {
|
|
629
|
-
return
|
|
629
|
+
return Pn(this.options, e, t, n, r);
|
|
630
630
|
}
|
|
631
631
|
draw(e, t, n, r, i, a) {
|
|
632
|
-
|
|
632
|
+
sr(e, t, n, this.options, r, i, a);
|
|
633
633
|
}
|
|
634
634
|
describe() {
|
|
635
635
|
let e = this.options.data.map((e) => e.date).filter((e) => /^\d{4}-\d{2}-\d{2}$/.test(e)).sort(), t = this.options.from ?? e[0], n = this.options.to ?? e[e.length - 1];
|
|
@@ -648,12 +648,12 @@ var qr = class extends O {
|
|
|
648
648
|
update(e) {
|
|
649
649
|
this.setOptions({ data: e });
|
|
650
650
|
}
|
|
651
|
-
}, G = 12,
|
|
651
|
+
}, G = 12, si = class extends W {
|
|
652
652
|
compute(e, t, n, r) {
|
|
653
|
-
return
|
|
653
|
+
return Rn(this.options, e, t, n, r);
|
|
654
654
|
}
|
|
655
655
|
draw(e, t, n, r, i, a) {
|
|
656
|
-
|
|
656
|
+
hr(e, t, n, this.options, r, i, a);
|
|
657
657
|
}
|
|
658
658
|
describe() {
|
|
659
659
|
let { rows: e, columns: t } = this.options;
|
|
@@ -672,12 +672,12 @@ var qr = class extends O {
|
|
|
672
672
|
update(e) {
|
|
673
673
|
this.setOptions({ values: e });
|
|
674
674
|
}
|
|
675
|
-
},
|
|
675
|
+
}, ci = class extends W {
|
|
676
676
|
compute(e, t, n, r) {
|
|
677
|
-
return
|
|
677
|
+
return Fn(this.options, e, t, n, r);
|
|
678
678
|
}
|
|
679
679
|
draw(e, t, n, r, i, a) {
|
|
680
|
-
|
|
680
|
+
cr(e, t, n, this.options, r, i, a);
|
|
681
681
|
}
|
|
682
682
|
describe() {
|
|
683
683
|
return `Counter-clock chart of price against volume, ${this.options.period ?? 25}-bar averages`;
|
|
@@ -693,12 +693,12 @@ var qr = class extends O {
|
|
|
693
693
|
r && this.options.onPointClick?.(r.point);
|
|
694
694
|
}
|
|
695
695
|
getPhase() {
|
|
696
|
-
return
|
|
696
|
+
return Hn(Wn(this.options.data, this.options.period ?? 25, xr(this.options)));
|
|
697
697
|
}
|
|
698
698
|
update(e) {
|
|
699
699
|
this.setOptions({ data: e });
|
|
700
700
|
}
|
|
701
|
-
},
|
|
701
|
+
}, li = [
|
|
702
702
|
"Jan",
|
|
703
703
|
"Feb",
|
|
704
704
|
"Mar",
|
|
@@ -733,7 +733,7 @@ function J(e) {
|
|
|
733
733
|
if (e.length === 0) return [];
|
|
734
734
|
let t = [];
|
|
735
735
|
for (let n of e) {
|
|
736
|
-
let e =
|
|
736
|
+
let e = Ot(n.time, "1M"), r = t[t.length - 1];
|
|
737
737
|
r && r.key === e ? r.close = n.equity : t.push({
|
|
738
738
|
key: e,
|
|
739
739
|
close: n.equity
|
|
@@ -746,7 +746,7 @@ function J(e) {
|
|
|
746
746
|
let a = new Date(e.key), o = a.getUTCFullYear(), s = a.getUTCMonth();
|
|
747
747
|
r.push({
|
|
748
748
|
id: `${o}-${String(s + 1).padStart(2, "0")}`,
|
|
749
|
-
label:
|
|
749
|
+
label: li[s],
|
|
750
750
|
group: String(o),
|
|
751
751
|
value: i
|
|
752
752
|
});
|
|
@@ -807,9 +807,9 @@ function Q(e) {
|
|
|
807
807
|
//#endregion
|
|
808
808
|
//#region src/finance/PerformanceDashboard.ts
|
|
809
809
|
function $(e) {
|
|
810
|
-
return !e || e === "dark" ? ve : e === "light" ?
|
|
810
|
+
return !e || e === "dark" ? ve : e === "light" ? _ : e;
|
|
811
811
|
}
|
|
812
|
-
var
|
|
812
|
+
var ui = class {
|
|
813
813
|
options;
|
|
814
814
|
theme;
|
|
815
815
|
root;
|
|
@@ -958,6 +958,6 @@ var ni = class {
|
|
|
958
958
|
}
|
|
959
959
|
};
|
|
960
960
|
//#endregion
|
|
961
|
-
export {
|
|
961
|
+
export { Ft as AlertManager, It as Animator, ni as BarChart, Lt as BarCountdown, Rt as BinanceAdapter, zt as BybitAdapter, Bt as CANDLE_PATTERNS, me as CHART_STYLE_KEYS, zr as CORRECTABLE_BARS, oi as CalendarChart, c as Chart, Yr as ChartGrid, Vt as ChartLegend, Ht as ChartStateManager, Ut as CoinbaseAdapter, Wt as CompareRenderer, ci as CounterClockChart, Gt as CrosshairTooltip, Kt as CurrentPriceLine, he as DARK_PRICE_LIMITS, ge as DARK_TERMINAL, _e as DARK_THEME, ye as DEFAULT_DRAWING_STYLE, be as DEFAULT_FONT_FAMILY, e as DEFAULT_HISTORY_PAGE_SIZE, qt as DEFAULT_LEGEND_CONFIG, Jt as DEFAULT_MAX_WEBGL_CHARTS, xe as DEFAULT_RECONNECT, Yt as DEFAULT_SESSION_HOURS, Se as DEFAULT_SIGNAL_STYLE, Ce as DEFAULT_STREAM_CONFIG, we as DEFAULT_TIMEFRAME_FAVORITES, Te as DEFAULT_TRADE_ZONE_STYLE, Ee as DEFAULT_TRADING_CONFIG, Xt as DataExporter, i as DataManager, Zr as DepthChart, ri as DonutChart, ie as DragDropImporter, Zt as DrawingBase, te as EXCHANGE_TIMEZONE, le as EXCHANGE_TIME_ZONE, Qt as Easing, H as EquityCurveChart, ti as GaugeChart, de as HISTORY_RETRY_MS, d as HNX_SESSIONS, f as HOSE_SESSIONS, U as HeatmapChart, ai as HistogramChart, en as INDICATOR_CATEGORIES, tn as IndicatorBase, nn as IndicatorValueMap, rn as KEPT_BUCKETS, p as KRX_SESSIONS, m as KR_COLORS, an as KeyboardHandler, on as KrakenAdapter, h as LIGHT_PRICE_LIMITS, g as LIGHT_THEME, fe as LayoutManager, ce as LayoutSession, v as MARKET_CRYPTO, y as MARKET_HNX, b as MARKET_HOSE, x as MARKET_HOSE_ETF, S as MARKET_KRX, C as MARKET_NXT, w as MARKET_NYSE, T as MARKET_UPBIT_KRW, E as MARKET_UPCOM, D as MARKET_VN30F, sn as MAX_ALERT_BARS, re as MAX_LAYOUT_NAME, cn as MIN_ALERT_BARS, De as MS_TIME_THRESHOLD, si as MatrixChart, ln as MockAdapter, Oe as NXT_SESSIONS, ue as PLUGIN_API_VERSION, ke as PRICE_SOURCES, un as PaperExecutionAdapter, ui as PerformanceDashboard, ae as PluginManager, dn as PollingAdapter, fn as RANGE_PRESETS, pn as ReplayManager, mn as ResamplingAdapter, hn as ReshapeMemo, Ae as SANS_FONT_FAMILY, ii as ScatterChart, gn as Screenshot, _n as SessionBreaks, vn as SessionShading, A as SignalMarkerManager, Xr as SparklineChart, yn as StreamManager, je as TC_PALETTE, Me as TC_SERIES_COLORS, Ne as TIMEFRAMES_CRYPTO, Pe as TIMEFRAMES_FOREX, Fe as TIMEFRAMES_STOCK, r as ThemeManager, bn as TickAggregator, xn as TickBarAdapter, Sn as TickBarBuilder, Cn as TradeZoneManager, Ie as UPCOM_SESSIONS, wn as UndoRedoManager, Tn as UpbitAdapter, Le as VN30F_SESSIONS, Re as VN_COLORS, ze as VOLUME_ALPHA, En as VolumeRenderer, Qr as WaterfallChart, Dn as Watermark, On as WebSocketAdapter, kn as axisTimes, jn as barIndexToX, Be as barTimeUnit, Ve as barsAreDaily, oe as cleanLayoutName, ne as clearGlobalPlugins, q as computeDrawdownCurve, J as computeMonthlyReturns, He as computePriceLimits, Ue as contrastRatio, Bn as correlationMatrix, Vn as counterClockPhase, Un as counterClockPoints, We as createMarketTheme, Ge as createVNTheme, Gn as detectCandlePatterns, qr as feedBars, Ke as formatFraction, qe as formatNumber, Kn as formatTooltipTime, Je as formatVND, Ye as formatVolumeLoc, Xe as fractionTick, Ze as getCurrentSession, u as getGlobalPlugins, Qe as getLocale, qn as histogramBins, Jn as indicatorCategory, $e as indicatorSource, et as inkOn, Yn as isPriceLevelAlert, tt as isPriceSource, nt as isTimeFrame, rt as isValidTimeZone, ee as localStorageLayouts, $n as lttbDownsample, er as lttbVisibleIndices, it as marketStatus, o as memoryLayouts, tr as niceScale, at as normalizeBar, ot as normalizeBarTime, st as offsetAt, Jr as overlayScale, pe as overlaysForLayer, ct as parseIndicatorSource, se as parseOHLCV, lt as parseTimeframe, ut as pickBaseTimeframe, s as pluginKey, dt as priceFormatterFor, ft as priceStepAt, nr as priceToY, rr as priceToYMapper, ar as rangePresetStart, pt as rankSymbols, mt as readNews, ht as readQuote, gt as readableOn, _t as registerLocale, l as registerPlugin, vt as resampleBars, yt as roundToPriceStep, bt as scaleMarketPrices, Q as selectKeyStats, yr as servesTimeframe, xt as setLocale, br as setMaxWebGLCharts, St as sourcePrice, Ct as stepDecimals, wt as symbolTimeZone, Rr as syncIndicators, Tt as t, Et as tickBarCount, Sr as timeToX, Dt as timeframeBucketStart, kt as timeframeToMs, Cr as timestampToBarIndex, K as toEquityPoints, Tr as toHeikinAshi, Er as toKagi, Dr as toLineBreak, Or as toPointAndFigure, kr as toRangeBars, Ar as toRenko, a as unregisterPlugin, At as vn30fContracts, jt as vn30fLastTradingDay, Mt as volumeColor, Nt as wallToUtc, jr as withResampling, Mr as withTickBars, Nr as xToBarIndex, Pr as xToTime, Fr as yToPrice, Pt as zoneOffsetMinutes };
|
|
962
962
|
|
|
963
963
|
//# sourceMappingURL=index.js.map
|
package/dist/indicatorLabel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* "EMA 20", "BB 20 2", "MACD 12 26 9": the short name (`shortName`, else the
|
|
3
3
|
* id in capitals) plus up to three numeric parameters (four for Stochastic
|
|
4
|
-
* RSI), in the indicator's own order, so two instances of the same indicator
|
|
4
|
+
* RSI and Ichimoku), in the indicator's own order, so two instances of the same indicator
|
|
5
5
|
* can be told apart.
|
|
6
6
|
*/
|
|
7
7
|
export declare function indicatorChipLabel(id: string, params: Record<string, unknown>, defaults?: Record<string, unknown>, shortName?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indicatorLabel.d.ts","sourceRoot":"","sources":["../src/indicatorLabel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"indicatorLabel.d.ts","sourceRoot":"","sources":["../src/indicatorLabel.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAWR"}
|
package/dist/widget/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../LayoutSession-CeCJsq_4.cjs`),t=require(`../i18n-SIiP0kRx.cjs`);let n=require(`@tradecanvas/commons`),r=require(`@tradecanvas/core`);function i(e,t,r={}){return(0,n.resampleBars)(e,t,{weekStartsOn:r.weekStartsOn??1,timeZone:r.timeZone})}function a(e){if(e.length<2)return 0;let t=[];for(let n=1;n<e.length;n++){let r=e[n].time-e[n-1].time;r>0&&t.push(r)}return t.length===0?0:(t.sort((e,t)=>e-t),t[Math.floor(t.length/2)])}var o=[{zone:`Pacific/Honolulu`,city:`Honolulu`},{zone:`America/Los_Angeles`,city:`Los Angeles`},{zone:`America/Denver`,city:`Denver`},{zone:`America/Chicago`,city:`Chicago`},{zone:`America/New_York`,city:`New York`},{zone:`America/Toronto`,city:`Toronto`},{zone:`America/Sao_Paulo`,city:`São Paulo`},{zone:`UTC`,city:`UTC`},{zone:`Europe/London`,city:`London`},{zone:`Europe/Berlin`,city:`Frankfurt`},{zone:`Europe/Paris`,city:`Paris`},{zone:`Europe/Zurich`,city:`Zurich`},{zone:`Africa/Johannesburg`,city:`Johannesburg`},{zone:`Europe/Istanbul`,city:`Istanbul`},{zone:`Europe/Moscow`,city:`Moscow`},{zone:`Asia/Dubai`,city:`Dubai`},{zone:`Asia/Kolkata`,city:`Mumbai`},{zone:`Asia/Bangkok`,city:`Bangkok`},{zone:`Asia/Ho_Chi_Minh`,city:`Ho Chi Minh City`},{zone:`Asia/Jakarta`,city:`Jakarta`},{zone:`Asia/Singapore`,city:`Singapore`},{zone:`Asia/Hong_Kong`,city:`Hong Kong`},{zone:`Asia/Shanghai`,city:`Shanghai`},{zone:`Asia/Taipei`,city:`Taipei`},{zone:`Asia/Seoul`,city:`Seoul`},{zone:`Asia/Tokyo`,city:`Tokyo`},{zone:`Australia/Sydney`,city:`Sydney`},{zone:`Pacific/Auckland`,city:`Auckland`}],s=/^-?\d+$/,c=840;function l(e){if(!s.test(e))return null;let t=Number(e);return Math.abs(t)<=c?t:null}function u(e){return!e||e===`local`?null:e===`exchange`?`exchange`:s.test(e)?l(e):(0,n.isValidTimeZone)(e)?e:null}function d(e){return e===null?`local`:String(e)}function f(e,t,r,i){let a=(0,n.offsetAt)(null,t),s=o.filter(({zone:e})=>(0,n.isValidTimeZone)(e)).map(({zone:e,city:r})=>{let i=(0,n.offsetAt)(e,t);return{value:e,label:e===`UTC`?`UTC`:`(${(0,n.tzLabel)(i)}) ${r}`,offset:i}}),c=u(e);typeof c==`number`&&s.push({value:e,label:(0,n.tzLabel)(c),offset:c}),s.sort((e,t)=>e.offset-t.offset);let l=[{value:`local`,label:`${r} (${(0,n.tzLabel)(a)})`,offset:a}];if(i){let e=(0,n.offsetAt)(i.zone&&(0,n.isValidTimeZone)(i.zone)?i.zone:`UTC`,t);l.push({value:`exchange`,label:`${i.label} (${(0,n.tzLabel)(e)})`,offset:e})}return[...l,...s]}var p=6,m=8,h=120;function ee(e,t,n=`left`){let r=e.style,i=t.getBoundingClientRect();r.position=`fixed`,r.margin=`0`,r.top=r.bottom=r.left=r.right=``;let a=window.innerHeight-i.bottom-p-m,o=i.top-p-m;e.scrollHeight<=a||a>=o?(r.top=`${i.bottom+p}px`,r.bottom=`auto`,r.maxHeight=`${Math.max(h,a)}px`):(r.top=`auto`,r.bottom=`${window.innerHeight-i.top+p}px`,r.maxHeight=`${Math.max(h,o)}px`);let s=getComputedStyle(t).direction===`rtl`,c=n===`right`!==s,l=e.offsetWidth,u=c?i.right-l:i.left;r.left=`${Math.max(m,Math.min(u,window.innerWidth-l-m))}px`}var te=700,g=class{select=null;panel=null;rows=[];active=-1;typed=``;typedAt=0;onOutside=e=>{let t=e.target;this.panel?.contains(t)||this.select?.contains(t)||this.close(!1)};onAway=()=>this.close(!1);onScroll=e=>{e.target instanceof Node&&this.panel?.contains(e.target)||this.close(!1)};watch=new MutationObserver(()=>{this.select&&!this.select.isConnected&&this.close(!1)});constructor(e){this.layer=e}isOpenFor(e){return this.select===e}owns(e){return e!==null&&(e===this.select||this.panel?.contains(e)===!0)}open(e){this.close(!1),this.select=e;let t=document.createElement(`div`);t.className=`tcw-dropdown tcw-select-menu`,t.setAttribute(`role`,`listbox`),t.id=`tcw-select-menu-${Math.random().toString(36).slice(2,9)}`;let n=e.getAttribute(`aria-label`)??e.labels?.[0]?.textContent??``;n&&t.setAttribute(`aria-label`,n.trim()),t.style.minWidth=`${e.getBoundingClientRect().width}px`,this.rows=[];for(let n of e.children)if(n instanceof HTMLOptGroupElement){let e=document.createElement(`div`);e.className=`tcw-select-group`,e.textContent=n.label,t.appendChild(e);for(let e of n.querySelectorAll(`option`))this.addRow(t,e,n.disabled)}else n instanceof HTMLOptionElement&&this.addRow(t,n,!1);t.addEventListener(`mousedown`,e=>e.preventDefault());let r=e=>this.rows.findIndex(t=>t.el.contains(e.target));t.addEventListener(`click`,e=>{let t=r(e);t>=0&&this.pick(t)}),t.addEventListener(`mousemove`,e=>{let t=r(e);t>=0&&t!==this.active&&this.enabled(t)&&this.setActive(t,!1)}),this.layer().appendChild(t),this.panel=t,ee(t,e),e.setAttribute(`aria-expanded`,`true`),e.setAttribute(`aria-controls`,t.id),this.setActive(this.rows.findIndex(e=>e.option.selected)),document.addEventListener(`pointerdown`,this.onOutside,!0),window.addEventListener(`resize`,this.onAway),document.addEventListener(`scroll`,this.onScroll,{capture:!0,passive:!0}),this.watch.observe(document.documentElement,{childList:!0,subtree:!0})}close(e){let t=this.select;t&&(document.removeEventListener(`pointerdown`,this.onOutside,!0),window.removeEventListener(`resize`,this.onAway),document.removeEventListener(`scroll`,this.onScroll,{capture:!0}),this.watch.disconnect(),this.panel?.remove(),this.panel=null,this.rows=[],this.select=null,t.setAttribute(`aria-expanded`,`false`),t.removeAttribute(`aria-controls`),t.removeAttribute(`aria-activedescendant`),e&&t.isConnected&&t.focus())}key(e){if(!this.select)return!1;switch(e.key){case`ArrowDown`:return this.step(1),!0;case`ArrowUp`:return this.step(-1),!0;case`Home`:return this.setActive(this.nextEnabled(-1,1)),!0;case`End`:return this.setActive(this.nextEnabled(this.rows.length,-1)),!0;case`PageDown`:return this.step(8),!0;case`PageUp`:return this.step(-8),!0;case` `:return this.typed&&Date.now()-this.typedAt<=te?(this.typeahead(` `),!0):(this.active>=0?this.pick(this.active):this.close(!0),!0);case`Enter`:return this.active>=0?this.pick(this.active):this.close(!0),!0;case`Escape`:return this.close(!0),!0;case`Tab`:return this.close(!1),!1;default:return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(this.typeahead(e.key),!0):!1}}destroy(){this.close(!1)}addRow(e,t,n){let r=document.createElement(`div`);r.className=`tcw-select-option`,r.id=`${e.id}-${this.rows.length}`,r.setAttribute(`role`,`option`),r.setAttribute(`aria-selected`,String(t.selected)),(t.disabled||n)&&r.setAttribute(`aria-disabled`,`true`);let i=document.createElement(`span`);i.className=`tcw-select-option-text`,i.textContent=t.label||t.textContent||``,t.dir&&(i.dir=t.dir);let a=document.createElement(`span`);a.className=`tcw-select-check`,a.setAttribute(`aria-hidden`,`true`),r.append(a,i),e.appendChild(r),this.rows.push({option:t,el:r})}enabled(e){return this.rows[e]?.el.getAttribute(`aria-disabled`)!==`true`}nextEnabled(e,t){for(let n=e+t;n>=0&&n<this.rows.length;n+=t)if(this.enabled(n))return n;return-1}step(e){let t=e>0?1:-1,n=this.active;for(let r=0;r<Math.abs(e);r++){let e=this.nextEnabled(n,t);if(e<0)break;n=e}n>=0&&this.setActive(n)}setActive(e,t=!0){this.rows[this.active]?.el.classList.remove(`tcw-active`),this.active=e;let n=this.rows[e];n&&(n.el.classList.add(`tcw-active`),this.select?.setAttribute(`aria-activedescendant`,n.el.id),t&&n.el.scrollIntoView?.({block:`nearest`}))}typeahead(e){let t=Date.now();this.typed=t-this.typedAt>te?e.toLowerCase():this.typed+e.toLowerCase(),this.typedAt=t;let n=e=>this.enabled(e)&&(this.rows[e].el.textContent??``).trim().toLowerCase().startsWith(this.typed),r=this.typed.length===1?this.active+1:Math.max(0,this.active);for(let e=0;e<this.rows.length;e++){let t=(r+e)%this.rows.length;if(n(t)){this.setActive(t);return}}}pick(e){let t=this.select,n=this.rows[e];if(!t||!n||!this.enabled(e))return;let r=!n.option.selected;n.option.selected=!0,this.close(!0),r&&(t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0})))}},_=42,v=7,y=new Set([`US`,`CA`,`MX`,`BR`,`JP`,`KR`,`TW`,`HK`,`IL`,`PH`,`IN`,`ZA`,`AU`,`TH`,`SA`,`PE`,`CO`]);function b(e){try{let t=new Intl.Locale(e),n=t.getWeekInfo?.()??t.weekInfo;return n?n.firstDay===7?0:1:+!y.has(t.maximize().region??``)}catch{return 1}}function x(e,t,n){let r=(new Date(Date.UTC(e,t,1)).getUTCDay()-n+v)%v,i=[];for(let n=0;n<_;n++){let a=new Date(Date.UTC(e,t,1-r+n));i.push({year:a.getUTCFullYear(),month:a.getUTCMonth(),day:a.getUTCDate()})}return i}var ne=e=>String(e).padStart(2,`0`),S=e=>`${String(e.year).padStart(4,`0`)}-${ne(e.month+1)}-${ne(e.day)}`;function re(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e??``);return t?{year:Number(t[1]),month:Number(t[2])-1,day:Number(t[3])}:null}function ie(){let e=new Date;return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}}function ae(e,t){let n=new Date(Date.UTC(e.year,e.month,e.day+t));return{year:n.getUTCFullYear(),month:n.getUTCMonth(),day:n.getUTCDate()}}var oe=class{element;grid;titleEl;chosen=``;limits={};today=S(ie());view={year:0,month:0};focusDay=ie();constructor(e,t,n){this.locale=t,this.onPick=n;let r=document.createElement(`div`);r.className=`tcw-calendar`;let i=document.createElement(`div`);i.className=`tcw-calendar-head`;let a=document.createElement(`div`);a.className=`tcw-calendar-title`,a.setAttribute(`aria-live`,`polite`),i.append(this.navButton(e.prevMonth,-1),a,this.navButton(e.nextMonth,1));let o=document.createElement(`div`);o.className=`tcw-calendar-weekdays`,o.setAttribute(`aria-hidden`,`true`);let s=b(t),c=new Intl.DateTimeFormat(t,{weekday:`narrow`,timeZone:`UTC`});for(let e=0;e<v;e++){let t=document.createElement(`span`);t.className=`tcw-calendar-weekday`,t.textContent=c.format(new Date(Date.UTC(2023,0,1+(s+e)%v))),o.appendChild(t)}let l=document.createElement(`div`);l.className=`tcw-calendar-grid`,l.setAttribute(`role`,`grid`),l.addEventListener(`keydown`,e=>this.onKey(e)),l.addEventListener(`click`,e=>{let t=e.target.closest(`.tcw-calendar-day`);t&&!t.disabled&&t.dataset.date&&this.pick(t.dataset.date)});let u=document.createElement(`div`);u.className=`tcw-calendar-foot`;let d=document.createElement(`button`);d.type=`button`,d.className=`tcw-calendar-today`,d.textContent=e.today,d.addEventListener(`click`,()=>this.pick(this.today)),u.appendChild(d),r.append(i,o,l,u),this.element=r,this.grid=l,this.titleEl=a}show(e,t={}){this.chosen=e,this.limits=t,this.today=re(t.today)?t.today:S(ie());let n=this.clamp(re(e)??re(this.today));this.focusDay=n,this.view={year:n.year,month:n.month},this.render()}focusGrid(){this.grid.querySelector(`[tabindex="0"]`)?.focus()}navButton(e,t){let n=document.createElement(`button`);return n.type=`button`,n.className=`tcw-calendar-nav`,n.setAttribute(`aria-label`,e),n.innerHTML=t<0?`<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5L5.5 8l4.5 4.5"/></svg>`:`<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5L10.5 8 6 12.5"/></svg>`,n.addEventListener(`click`,()=>this.turn(t)),n}turn(e){let t=new Date(Date.UTC(this.view.year,this.view.month+e,1));this.view={year:t.getUTCFullYear(),month:t.getUTCMonth()};let n=new Date(Date.UTC(this.view.year,this.view.month+1,0)).getUTCDate();this.focusDay=this.clamp({...this.view,day:Math.min(this.focusDay.day,n)}),this.view={year:this.focusDay.year,month:this.focusDay.month},this.render()}clamp(e){let t=S(e),n=re(this.limits.min),r=re(this.limits.max);return n&&t<S(n)?n:r&&t>S(r)?r:e}allowed(e){let{min:t,max:n}=this.limits;return!(t&&e<t)&&!(n&&e>n)}render(){let e=this.locale;this.titleEl.textContent=new Intl.DateTimeFormat(e,{month:`long`,year:`numeric`,timeZone:`UTC`}).format(new Date(Date.UTC(this.view.year,this.view.month,1)));let t=this.today,n=S(this.focusDay),r=new Intl.DateTimeFormat(e,{dateStyle:`full`,timeZone:`UTC`});this.grid.textContent=``;let i=null;for(let[a,o]of x(this.view.year,this.view.month,b(e)).entries()){a%v===0&&(i=document.createElement(`div`),i.className=`tcw-calendar-week`,i.setAttribute(`role`,`row`),this.grid.appendChild(i));let e=S(o),s=document.createElement(`button`);s.type=`button`,s.className=`tcw-calendar-day`,s.dataset.date=e,s.setAttribute(`role`,`gridcell`),s.textContent=String(o.day),s.setAttribute(`aria-label`,r.format(new Date(Date.UTC(o.year,o.month,o.day)))),s.setAttribute(`aria-selected`,String(e===this.chosen)),s.tabIndex=e===n?0:-1,o.month!==this.view.month&&s.classList.add(`tcw-outside`),e===t&&s.classList.add(`tcw-today`),this.allowed(e)||(s.disabled=!0),i?.appendChild(s)}}onKey(e){let t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-v,ArrowDown:v},n=this.element.isConnected&&getComputedStyle(this.element).direction===`rtl`;if(e.key in t){let r=n&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)?-t[e.key]:t[e.key];this.moveFocus(ae(this.focusDay,r))}else if(e.key===`PageUp`||e.key===`PageDown`)this.turn(e.key===`PageUp`?-1:1),this.focusGrid();else if(e.key===`Home`||e.key===`End`){let t=new Date(Date.UTC(this.view.year,this.view.month+1,0)).getUTCDate();this.moveFocus({...this.view,day:e.key===`Home`?1:t})}else if(e.key===`Enter`||e.key===` `)this.pick(S(this.focusDay));else return;e.preventDefault()}moveFocus(e){let t=this.clamp(e);this.focusDay=t,(t.year!==this.view.year||t.month!==this.view.month)&&(this.view={year:t.year,month:t.month}),this.render(),this.focusGrid()}pick(e){this.allowed(e)&&this.onPick(e)}},se=class{input=null;view=null;onOutside=e=>{let t=e.target;this.view?.element.contains(t)||this.input?.contains(t)||this.close(!1)};onAway=()=>this.close(!1);onScroll=e=>{e.target instanceof Node&&this.view?.element.contains(e.target)||this.close(!1)};watch=new MutationObserver(()=>{this.input&&!this.input.isConnected&&this.close(!1)});constructor(e,t,n){this.layer=e,this.labels=t,this.locale=n}isOpenFor(e){return this.input===e}owns(e){return e!==null&&(e===this.input||this.view?.element.contains(e)===!0)}open(e){this.close(!1),this.input=e;let t=new oe(this.labels(),this.locale(),e=>this.pick(e));t.show(e.value,{min:e.min||void 0,max:e.max||void 0});let n=t.element;n.setAttribute(`role`,`dialog`);let r=e.getAttribute(`aria-label`)??e.labels?.[0]?.textContent??``;r&&n.setAttribute(`aria-label`,r.trim()),n.addEventListener(`mousedown`,e=>{e.target.closest(`button`)||e.preventDefault()}),n.addEventListener(`keydown`,e=>{e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),this.close(!0))}),this.view=t,this.layer().appendChild(n),ee(n,e),document.addEventListener(`pointerdown`,this.onOutside,!0),window.addEventListener(`resize`,this.onAway),document.addEventListener(`scroll`,this.onScroll,{capture:!0,passive:!0}),this.watch.observe(document.documentElement,{childList:!0,subtree:!0})}close(e){let t=this.input;t&&(document.removeEventListener(`pointerdown`,this.onOutside,!0),window.removeEventListener(`resize`,this.onAway),document.removeEventListener(`scroll`,this.onScroll,{capture:!0}),this.watch.disconnect(),this.view?.element.remove(),this.view=null,this.input=null,e&&t.isConnected&&t.focus())}focusGrid(){this.view?.focusGrid()}destroy(){this.close(!1)}pick(e){let t=this.input;if(!t)return;let n=t.value!==e;t.value=e,this.close(!0),n&&(t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0})))}},ce=()=>typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches,le=()=>typeof CSS>`u`||typeof CSS.supports!=`function`||CSS.supports(`selector(::-webkit-calendar-picker-indicator)`);function ue(e){if(!(e instanceof Element))return null;let t=e.closest(`select`);return!t||t.matches(`:disabled`)||t.multiple||t.size>1?null:t}function de(e){return!(e instanceof HTMLInputElement)||e.type!==`date`||e.dataset.tcwCalendar===`inline`||e.matches(`:disabled`)||e.readOnly?null:e}function fe(e,t){let n=new g(t.layer),r=new se(t.layer,t.labels,t.locale),i=t.native??ce,a=t.calendar??le,o=new WeakSet,s=e=>o.has(e)?!1:(o.add(e),!0),c=e=>{if(e.button!==0||i()||!s(e))return;let t=ue(e.target);if(t){if(e.preventDefault(),n.isOpenFor(t)){n.close(!0);return}t.focus(),n.open(t)}},l=e=>{if(i()||!a()||!s(e))return;let t=de(e.target);t&&(e.preventDefault(),r.isOpenFor(t)||r.open(t))},u=e=>{if(i()||!s(e))return;let t=ue(e.target);if(t){if(n.isOpenFor(t)){n.key(e)&&(e.preventDefault(),e.stopPropagation());return}(e.key===`Enter`||e.key===` `||e.altKey&&(e.key===`ArrowDown`||e.key===`ArrowUp`)||e.key===`F4`)&&(e.preventDefault(),e.stopPropagation(),n.open(t));return}let o=de(e.target);!o||!a()||(e.key===`Escape`&&r.isOpenFor(o)?(e.preventDefault(),e.stopPropagation(),r.close(!0)):(e.altKey&&e.key===`ArrowDown`||e.key===`F4`)&&(e.preventDefault(),r.isOpenFor(o)||r.open(o),r.focusGrid()))},d=e=>{if(!s(e))return;let t=e.target instanceof Node?e.target:null,i=e.relatedTarget instanceof Node?e.relatedTarget:null;n.owns(t)&&!n.owns(i)&&n.close(!1),r.owns(t)&&!r.owns(i)&&r.close(!1)};for(let t of e)t.addEventListener(`mousedown`,c,!0),t.addEventListener(`click`,l,!0),t.addEventListener(`keydown`,u,!0),t.addEventListener(`focusout`,d,!0);return()=>{for(let t of e)t.removeEventListener(`mousedown`,c,!0),t.removeEventListener(`click`,l,!0),t.removeEventListener(`keydown`,u,!0),t.removeEventListener(`focusout`,d,!0);n.destroy(),r.destroy()}}var pe=[{label:`Candlestick`,value:`candlestick`},{label:`Line`,value:`line`},{label:`Area`,value:`area`},{label:`Bar`,value:`bar`},{label:`Heikin-Ashi`,value:`heikinAshi`},{label:`Hollow Candle`,value:`hollowCandle`},{label:`Baseline`,value:`baseline`},{label:`Volume Candles`,value:`volumeCandles`},{label:`Equivolume`,value:`equivolume`},{label:`HLC Area`,value:`hlcArea`},{label:`Step Line`,value:`stepLine`},{label:`Line + Markers`,value:`lineWithMarkers`},{label:`High-Low`,value:`hiLo`},{label:`Renko`,value:`renko`},{label:`Line Break`,value:`lineBreak`},{label:`Kagi`,value:`kagi`},{label:`Point & Figure`,value:`pointAndFigure`},{label:`Range Bars`,value:`rangeBars`}],me=[{label:`Lines`,section:`lines`,tools:[{label:`Trend Line`,value:`trendLine`},{label:`Ray`,value:`ray`},{label:`Extended Line`,value:`extendedLine`},{label:`Info Line`,value:`infoLine`},{label:`Trend Angle`,value:`trendAngle`}]},{label:`Horizontal/Vertical`,section:`lines`,tools:[{label:`Horizontal Line`,value:`horizontalLine`},{label:`Horizontal Ray`,value:`horizontalRay`},{label:`Vertical Line`,value:`verticalLine`},{label:`Cross Line`,value:`crossLine`}]},{label:`Channels`,section:`lines`,tools:[{label:`Parallel Channel`,value:`parallelChannel`},{label:`Regression Channel`,value:`regressionChannel`}]},{label:`Fibonacci`,section:`fibonacci`,tools:[{label:`Fib Retracement`,value:`fibRetracement`},{label:`Fib Extension`,value:`fibExtension`},{label:`Fib Channel`,value:`fibChannel`},{label:`Fib Time Zones`,value:`fibTimeZones`},{label:`Fib Speed Resistance Fan`,value:`fibSpeedResistanceFan`},{label:`Fib Speed Resistance Arcs`,value:`fibArcs`},{label:`Fib Circles`,value:`fibCircles`},{label:`Fib Spiral`,value:`fibSpiral`},{label:`Fib Wedge`,value:`fibWedge`}]},{label:`Gann & Pitchforks`,section:`fibonacci`,tools:[{label:`Pitchfork`,value:`pitchfork`},{label:`Schiff Pitchfork`,value:`schiffPitchfork`},{label:`Modified Schiff Pitchfork`,value:`modifiedSchiffPitchfork`},{label:`Gann Fan`,value:`gannFan`},{label:`Gann Box`,value:`gannBox`},{label:`Gann Square`,value:`gannSquare`},{label:`Pitchfan`,value:`pitchfan`}]},{label:`Cycles`,section:`fibonacci`,tools:[{label:`Cyclic Lines`,value:`cyclicLines`},{label:`Time Cycles`,value:`timeCycles`},{label:`Sine Line`,value:`sineLine`}]},{label:`Patterns`,section:`patterns`,tools:[{label:`XABCD Pattern`,value:`xabcdPattern`},{label:`ABCD Pattern`,value:`abcdPattern`},{label:`Head and Shoulders`,value:`headAndShoulders`},{label:`Cypher Pattern`,value:`cypherPattern`},{label:`Three Drives Pattern`,value:`threeDrives`}]},{label:`Elliott Waves`,section:`patterns`,tools:[{label:`Elliott Wave`,value:`elliottWave`},{label:`Elliott Impulse Wave`,value:`elliottImpulse`},{label:`Elliott Correction Wave`,value:`elliottCorrection`},{label:`Elliott Triangle Wave`,value:`elliottTriangle`},{label:`Elliott Double Combo Wave`,value:`elliottDoubleCombo`},{label:`Elliott Triple Combo Wave`,value:`elliottTripleCombo`}]},{label:`Forecasting`,section:`forecasting`,tools:[{label:`Long/Short Position`,value:`riskReward`},{label:`Anchored VWAP`,value:`anchoredVWAP`},{label:`Fixed Range Volume Profile`,value:`volumeProfileRange`},{label:`Forecast`,value:`forecast`},{label:`Projection`,value:`projection`},{label:`Bars Pattern`,value:`barsPattern`}]},{label:`Measure`,section:`forecasting`,tools:[{label:`Price Range`,value:`priceRange`},{label:`Date Range`,value:`dateRange`},{label:`Date and Price Range`,value:`dateAndPriceRange`},{label:`Measure`,value:`measure`}]},{label:`Shapes`,section:`annotation`,tools:[{label:`Rectangle`,value:`rectangle`},{label:`Circle`,value:`circle`},{label:`Ellipse`,value:`ellipse`},{label:`Triangle`,value:`triangle`},{label:`Polyline`,value:`polyline`},{label:`Curve`,value:`curve`},{label:`Arc`,value:`arc`}]},{label:`Brushes`,section:`annotation`,tools:[{label:`Brush`,value:`brush`},{label:`Highlighter`,value:`highlighter`},{label:`Path`,value:`path`}]},{label:`Annotation`,section:`annotation`,tools:[{label:`Text`,value:`text`},{label:`Price Label`,value:`priceLabel`},{label:`Arrow`,value:`arrow`},{label:`Note`,value:`note`},{label:`Callout`,value:`callout`},{label:`Flag Mark`,value:`flag`},{label:`Arrow Mark`,value:`arrowMark`},{label:`Icon`,value:`icon`}]}],he=[`BTCUSDT`,`ETHUSDT`,`SOLUSDT`,`BNBUSDT`],ge={gridVisible:!0,volumeVisible:!0,volumeProfileVisible:!1,marketProfileVisible:!1,marketProfileSplit:!1,marketProfileLetters:!1,marketProfileBuckets:48,marketProfileOpacity:.32,depthHeatmapVisible:!1,depthHeatmapOpacity:.7,sessionShadingVisible:!1,pivotMarkersVisible:!1,pivotStrength:5,pivotStructureLabels:!1,periodLevelsVisible:!1,periodLevelsPeriod:`day`,legendVisible:!0,barCountdown:!0,indicatorValueLabels:!1,alignAxisLabels:!0,logScale:!1,scaleMode:`regular`,autoScale:!0,invertScale:!1,leftPriceScale:!1,crosshairMode:`magnet`,numberLocale:`en-US`,timezone:`local`,highLowLines:!1,mainSeriesVisible:!0,extendedHours:!0,chartTypeOptions:{}},C=(e,...t)=>({label:e,keys:t}),w=(e,t,n={})=>({label:e,keys:[t],auto:n}),T=e=>({hint:e}),_e={from:`panes.titleColor`},ve={title:`settings.section.lastPrice`,rows:[C(`settings.priceLine`,`lastPrice.visible`),C(`settings.up`,`lastPrice.upColor`),C(`settings.down`,`lastPrice.downColor`),C(`drawingSettings.lineStyle`,`lastPrice.style`),C(`drawingSettings.lineWidth`,`lastPrice.width`)]},ye={title:`settings.volume`,rows:[C(`settings.up`,`volume.upColor`),C(`settings.down`,`volume.downColor`)]},be={title:`settings.highLowLines`,rows:[w(`drawingSettings.color`,`highLow.color`,_e)]},xe=[ve,ye,be],Se=[C(`settings.legendText`,`legend.textColor`),C(`settings.legendLabels`,`legend.labelColor`)],Ce=[...Se,C(`settings.paneTitles`,`panes.titleColor`)],we=[C(`drawingSettings.text`,`axis.price.textColor`,`axis.time.textColor`),C(`settings.scaleLines`,`axis.price.lineColor`,`axis.time.lineColor`)],Te=[{title:`settings.section.background`,rows:[C(`settings.background`,`background.color`),C(`settings.paneBackground`,`panes.background`),C(`settings.paneSeparator`,`panes.separatorColor`),w(`settings.watermark`,`watermark.color`,_e)]},{title:`settings.gridLines`,rows:[C(`settings.horizontal`,`grid.horizontal.visible`),C(`settings.vertical`,`grid.vertical.visible`),C(`drawingSettings.color`,`grid.horizontal.color`,`grid.vertical.color`),C(`drawingSettings.lineStyle`,`grid.horizontal.style`,`grid.vertical.style`),C(`drawingSettings.lineWidth`,`grid.horizontal.width`,`grid.vertical.width`)]},{title:`settings.crosshairMode`,rows:[C(`settings.horizontal`,`crosshair.horizontal.visible`),C(`settings.vertical`,`crosshair.vertical.visible`),C(`drawingSettings.color`,`crosshair.horizontal.color`,`crosshair.vertical.color`),C(`drawingSettings.lineStyle`,`crosshair.horizontal.style`,`crosshair.vertical.style`),C(`drawingSettings.lineWidth`,`crosshair.horizontal.width`,`crosshair.vertical.width`),C(`settings.labelBackground`,`crosshair.labelBackground`),C(`settings.labelText`,`crosshair.labelTextColor`)]},{title:`settings.sessionBreaks`,rows:[w(`drawingSettings.color`,`sessionBreaks.color`,{from:`axis.price.lineColor`}),w(`drawingSettings.lineStyle`,`sessionBreaks.style`),w(`drawingSettings.lineWidth`,`sessionBreaks.width`)]},{title:`objects.drawings`,rows:[w(`settings.handles`,`drawings.handleColor`,T(`#ffffff`))]}],Ee=[{title:`settings.section.orders`,trading:!0,rows:[w(`ticket.buy`,`trading.buyColor`,T(n.DEFAULT_TRADING_CONFIG.orderColors?.buy)),w(`ticket.sell`,`trading.sellColor`,T(n.DEFAULT_TRADING_CONFIG.orderColors?.sell)),w(`settings.profit`,`trading.profitColor`,T(n.DEFAULT_TRADING_CONFIG.positionColors?.profit)),w(`settings.loss`,`trading.lossColor`,T(n.DEFAULT_TRADING_CONFIG.positionColors?.loss)),w(`account.entry`,`trading.entryColor`,T(n.DEFAULT_TRADING_CONFIG.positionColors?.entry))]},{title:`settings.section.signals`,rows:[w(`account.long`,`markers.longColor`,T(n.DEFAULT_SIGNAL_STYLE.longColor)),w(`account.short`,`markers.shortColor`,T(n.DEFAULT_SIGNAL_STYLE.shortColor)),w(`markers.neutral`,`markers.neutralColor`,T(n.DEFAULT_SIGNAL_STYLE.neutralColor))]},{title:`settings.section.tradeZones`,rows:[w(`settings.profit`,`tradeZones.profitColor`,T(n.DEFAULT_TRADE_ZONE_STYLE.profitColor)),w(`settings.loss`,`tradeZones.lossColor`,T(n.DEFAULT_TRADE_ZONE_STYLE.lossColor)),w(`settings.openTrade`,`tradeZones.activeColor`,T(n.DEFAULT_TRADE_ZONE_STYLE.activeColor))]}],De={upColor:`settings.up`,downColor:`settings.down`,wickUpColor:`settings.upWick`,wickDownColor:`settings.downWick`,color:`drawingSettings.color`,lineColor:`drawingSettings.color`,lineWidth:`drawingSettings.lineWidth`,topColor:`settings.areaTop`,bottomColor:`settings.areaBottom`},Oe=new Set([`candlestick`,`heikinAshi`,`volumeCandles`,`equivolume`]);function ke(e){let t=`series.${e}.`;return Object.keys(n.CHART_STYLE_KEYS).filter(e=>e.startsWith(t)).map(n=>{let r=n.slice(t.length),i=De[r]??`drawingSettings.color`;return Oe.has(e)&&r===`upColor`&&(i=`settings.upBody`),Oe.has(e)&&r===`downColor`&&(i=`settings.downBody`),e===`baseline`&&r===`upColor`&&(i=`settings.aboveBase`),e===`baseline`&&r===`downColor`&&(i=`settings.belowBase`),C(i,n)})}var E=[...new Set([...Object.keys(n.CHART_STYLE_KEYS).filter(e=>e.startsWith(`series.`)),...[...xe,...Te,...Ee].flatMap(e=>e.rows.flatMap(e=>e.keys)),...[...Ce,...we].flatMap(e=>e.keys)])],Ae=`/* === TradeCanvas Widget — Premium Styles === */
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../LayoutSession-C8zqGSLI.cjs`),t=require(`../i18n-SIiP0kRx.cjs`);let n=require(`@tradecanvas/commons`),r=require(`@tradecanvas/core`);function i(e,t,r={}){return(0,n.resampleBars)(e,t,{weekStartsOn:r.weekStartsOn??1,timeZone:r.timeZone})}function a(e){if(e.length<2)return 0;let t=[];for(let n=1;n<e.length;n++){let r=e[n].time-e[n-1].time;r>0&&t.push(r)}return t.length===0?0:(t.sort((e,t)=>e-t),t[Math.floor(t.length/2)])}var o=[{zone:`Pacific/Honolulu`,city:`Honolulu`},{zone:`America/Los_Angeles`,city:`Los Angeles`},{zone:`America/Denver`,city:`Denver`},{zone:`America/Chicago`,city:`Chicago`},{zone:`America/New_York`,city:`New York`},{zone:`America/Toronto`,city:`Toronto`},{zone:`America/Sao_Paulo`,city:`São Paulo`},{zone:`UTC`,city:`UTC`},{zone:`Europe/London`,city:`London`},{zone:`Europe/Berlin`,city:`Frankfurt`},{zone:`Europe/Paris`,city:`Paris`},{zone:`Europe/Zurich`,city:`Zurich`},{zone:`Africa/Johannesburg`,city:`Johannesburg`},{zone:`Europe/Istanbul`,city:`Istanbul`},{zone:`Europe/Moscow`,city:`Moscow`},{zone:`Asia/Dubai`,city:`Dubai`},{zone:`Asia/Kolkata`,city:`Mumbai`},{zone:`Asia/Bangkok`,city:`Bangkok`},{zone:`Asia/Ho_Chi_Minh`,city:`Ho Chi Minh City`},{zone:`Asia/Jakarta`,city:`Jakarta`},{zone:`Asia/Singapore`,city:`Singapore`},{zone:`Asia/Hong_Kong`,city:`Hong Kong`},{zone:`Asia/Shanghai`,city:`Shanghai`},{zone:`Asia/Taipei`,city:`Taipei`},{zone:`Asia/Seoul`,city:`Seoul`},{zone:`Asia/Tokyo`,city:`Tokyo`},{zone:`Australia/Sydney`,city:`Sydney`},{zone:`Pacific/Auckland`,city:`Auckland`}],s=/^-?\d+$/,c=840;function l(e){if(!s.test(e))return null;let t=Number(e);return Math.abs(t)<=c?t:null}function u(e){return!e||e===`local`?null:e===`exchange`?`exchange`:s.test(e)?l(e):(0,n.isValidTimeZone)(e)?e:null}function d(e){return e===null?`local`:String(e)}function f(e,t,r,i){let a=(0,n.offsetAt)(null,t),s=o.filter(({zone:e})=>(0,n.isValidTimeZone)(e)).map(({zone:e,city:r})=>{let i=(0,n.offsetAt)(e,t);return{value:e,label:e===`UTC`?`UTC`:`(${(0,n.tzLabel)(i)}) ${r}`,offset:i}}),c=u(e);typeof c==`number`&&s.push({value:e,label:(0,n.tzLabel)(c),offset:c}),s.sort((e,t)=>e.offset-t.offset);let l=[{value:`local`,label:`${r} (${(0,n.tzLabel)(a)})`,offset:a}];if(i){let e=(0,n.offsetAt)(i.zone&&(0,n.isValidTimeZone)(i.zone)?i.zone:`UTC`,t);l.push({value:`exchange`,label:`${i.label} (${(0,n.tzLabel)(e)})`,offset:e})}return[...l,...s]}var p=6,m=8,h=120;function ee(e,t,n=`left`){let r=e.style,i=t.getBoundingClientRect();r.position=`fixed`,r.margin=`0`,r.top=r.bottom=r.left=r.right=``;let a=window.innerHeight-i.bottom-p-m,o=i.top-p-m;e.scrollHeight<=a||a>=o?(r.top=`${i.bottom+p}px`,r.bottom=`auto`,r.maxHeight=`${Math.max(h,a)}px`):(r.top=`auto`,r.bottom=`${window.innerHeight-i.top+p}px`,r.maxHeight=`${Math.max(h,o)}px`);let s=getComputedStyle(t).direction===`rtl`,c=n===`right`!==s,l=e.offsetWidth,u=c?i.right-l:i.left;r.left=`${Math.max(m,Math.min(u,window.innerWidth-l-m))}px`}var te=700,g=class{select=null;panel=null;rows=[];active=-1;typed=``;typedAt=0;onOutside=e=>{let t=e.target;this.panel?.contains(t)||this.select?.contains(t)||this.close(!1)};onAway=()=>this.close(!1);onScroll=e=>{e.target instanceof Node&&this.panel?.contains(e.target)||this.close(!1)};watch=new MutationObserver(()=>{this.select&&!this.select.isConnected&&this.close(!1)});constructor(e){this.layer=e}isOpenFor(e){return this.select===e}owns(e){return e!==null&&(e===this.select||this.panel?.contains(e)===!0)}open(e){this.close(!1),this.select=e;let t=document.createElement(`div`);t.className=`tcw-dropdown tcw-select-menu`,t.setAttribute(`role`,`listbox`),t.id=`tcw-select-menu-${Math.random().toString(36).slice(2,9)}`;let n=e.getAttribute(`aria-label`)??e.labels?.[0]?.textContent??``;n&&t.setAttribute(`aria-label`,n.trim()),t.style.minWidth=`${e.getBoundingClientRect().width}px`,this.rows=[];for(let n of e.children)if(n instanceof HTMLOptGroupElement){let e=document.createElement(`div`);e.className=`tcw-select-group`,e.textContent=n.label,t.appendChild(e);for(let e of n.querySelectorAll(`option`))this.addRow(t,e,n.disabled)}else n instanceof HTMLOptionElement&&this.addRow(t,n,!1);t.addEventListener(`mousedown`,e=>e.preventDefault());let r=e=>this.rows.findIndex(t=>t.el.contains(e.target));t.addEventListener(`click`,e=>{let t=r(e);t>=0&&this.pick(t)}),t.addEventListener(`mousemove`,e=>{let t=r(e);t>=0&&t!==this.active&&this.enabled(t)&&this.setActive(t,!1)}),this.layer().appendChild(t),this.panel=t,ee(t,e),e.setAttribute(`aria-expanded`,`true`),e.setAttribute(`aria-controls`,t.id),this.setActive(this.rows.findIndex(e=>e.option.selected)),document.addEventListener(`pointerdown`,this.onOutside,!0),window.addEventListener(`resize`,this.onAway),document.addEventListener(`scroll`,this.onScroll,{capture:!0,passive:!0}),this.watch.observe(document.documentElement,{childList:!0,subtree:!0})}close(e){let t=this.select;t&&(document.removeEventListener(`pointerdown`,this.onOutside,!0),window.removeEventListener(`resize`,this.onAway),document.removeEventListener(`scroll`,this.onScroll,{capture:!0}),this.watch.disconnect(),this.panel?.remove(),this.panel=null,this.rows=[],this.select=null,t.setAttribute(`aria-expanded`,`false`),t.removeAttribute(`aria-controls`),t.removeAttribute(`aria-activedescendant`),e&&t.isConnected&&t.focus())}key(e){if(!this.select)return!1;switch(e.key){case`ArrowDown`:return this.step(1),!0;case`ArrowUp`:return this.step(-1),!0;case`Home`:return this.setActive(this.nextEnabled(-1,1)),!0;case`End`:return this.setActive(this.nextEnabled(this.rows.length,-1)),!0;case`PageDown`:return this.step(8),!0;case`PageUp`:return this.step(-8),!0;case` `:return this.typed&&Date.now()-this.typedAt<=te?(this.typeahead(` `),!0):(this.active>=0?this.pick(this.active):this.close(!0),!0);case`Enter`:return this.active>=0?this.pick(this.active):this.close(!0),!0;case`Escape`:return this.close(!0),!0;case`Tab`:return this.close(!1),!1;default:return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(this.typeahead(e.key),!0):!1}}destroy(){this.close(!1)}addRow(e,t,n){let r=document.createElement(`div`);r.className=`tcw-select-option`,r.id=`${e.id}-${this.rows.length}`,r.setAttribute(`role`,`option`),r.setAttribute(`aria-selected`,String(t.selected)),(t.disabled||n)&&r.setAttribute(`aria-disabled`,`true`);let i=document.createElement(`span`);i.className=`tcw-select-option-text`,i.textContent=t.label||t.textContent||``,t.dir&&(i.dir=t.dir);let a=document.createElement(`span`);a.className=`tcw-select-check`,a.setAttribute(`aria-hidden`,`true`),r.append(a,i),e.appendChild(r),this.rows.push({option:t,el:r})}enabled(e){return this.rows[e]?.el.getAttribute(`aria-disabled`)!==`true`}nextEnabled(e,t){for(let n=e+t;n>=0&&n<this.rows.length;n+=t)if(this.enabled(n))return n;return-1}step(e){let t=e>0?1:-1,n=this.active;for(let r=0;r<Math.abs(e);r++){let e=this.nextEnabled(n,t);if(e<0)break;n=e}n>=0&&this.setActive(n)}setActive(e,t=!0){this.rows[this.active]?.el.classList.remove(`tcw-active`),this.active=e;let n=this.rows[e];n&&(n.el.classList.add(`tcw-active`),this.select?.setAttribute(`aria-activedescendant`,n.el.id),t&&n.el.scrollIntoView?.({block:`nearest`}))}typeahead(e){let t=Date.now();this.typed=t-this.typedAt>te?e.toLowerCase():this.typed+e.toLowerCase(),this.typedAt=t;let n=e=>this.enabled(e)&&(this.rows[e].el.textContent??``).trim().toLowerCase().startsWith(this.typed),r=this.typed.length===1?this.active+1:Math.max(0,this.active);for(let e=0;e<this.rows.length;e++){let t=(r+e)%this.rows.length;if(n(t)){this.setActive(t);return}}}pick(e){let t=this.select,n=this.rows[e];if(!t||!n||!this.enabled(e))return;let r=!n.option.selected;n.option.selected=!0,this.close(!0),r&&(t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0})))}},_=42,v=7,y=new Set([`US`,`CA`,`MX`,`BR`,`JP`,`KR`,`TW`,`HK`,`IL`,`PH`,`IN`,`ZA`,`AU`,`TH`,`SA`,`PE`,`CO`]);function b(e){try{let t=new Intl.Locale(e),n=t.getWeekInfo?.()??t.weekInfo;return n?n.firstDay===7?0:1:+!y.has(t.maximize().region??``)}catch{return 1}}function x(e,t,n){let r=(new Date(Date.UTC(e,t,1)).getUTCDay()-n+v)%v,i=[];for(let n=0;n<_;n++){let a=new Date(Date.UTC(e,t,1-r+n));i.push({year:a.getUTCFullYear(),month:a.getUTCMonth(),day:a.getUTCDate()})}return i}var ne=e=>String(e).padStart(2,`0`),S=e=>`${String(e.year).padStart(4,`0`)}-${ne(e.month+1)}-${ne(e.day)}`;function re(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e??``);return t?{year:Number(t[1]),month:Number(t[2])-1,day:Number(t[3])}:null}function ie(){let e=new Date;return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}}function ae(e,t){let n=new Date(Date.UTC(e.year,e.month,e.day+t));return{year:n.getUTCFullYear(),month:n.getUTCMonth(),day:n.getUTCDate()}}var oe=class{element;grid;titleEl;chosen=``;limits={};today=S(ie());view={year:0,month:0};focusDay=ie();constructor(e,t,n){this.locale=t,this.onPick=n;let r=document.createElement(`div`);r.className=`tcw-calendar`;let i=document.createElement(`div`);i.className=`tcw-calendar-head`;let a=document.createElement(`div`);a.className=`tcw-calendar-title`,a.setAttribute(`aria-live`,`polite`),i.append(this.navButton(e.prevMonth,-1),a,this.navButton(e.nextMonth,1));let o=document.createElement(`div`);o.className=`tcw-calendar-weekdays`,o.setAttribute(`aria-hidden`,`true`);let s=b(t),c=new Intl.DateTimeFormat(t,{weekday:`narrow`,timeZone:`UTC`});for(let e=0;e<v;e++){let t=document.createElement(`span`);t.className=`tcw-calendar-weekday`,t.textContent=c.format(new Date(Date.UTC(2023,0,1+(s+e)%v))),o.appendChild(t)}let l=document.createElement(`div`);l.className=`tcw-calendar-grid`,l.setAttribute(`role`,`grid`),l.addEventListener(`keydown`,e=>this.onKey(e)),l.addEventListener(`click`,e=>{let t=e.target.closest(`.tcw-calendar-day`);t&&!t.disabled&&t.dataset.date&&this.pick(t.dataset.date)});let u=document.createElement(`div`);u.className=`tcw-calendar-foot`;let d=document.createElement(`button`);d.type=`button`,d.className=`tcw-calendar-today`,d.textContent=e.today,d.addEventListener(`click`,()=>this.pick(this.today)),u.appendChild(d),r.append(i,o,l,u),this.element=r,this.grid=l,this.titleEl=a}show(e,t={}){this.chosen=e,this.limits=t,this.today=re(t.today)?t.today:S(ie());let n=this.clamp(re(e)??re(this.today));this.focusDay=n,this.view={year:n.year,month:n.month},this.render()}focusGrid(){this.grid.querySelector(`[tabindex="0"]`)?.focus()}navButton(e,t){let n=document.createElement(`button`);return n.type=`button`,n.className=`tcw-calendar-nav`,n.setAttribute(`aria-label`,e),n.innerHTML=t<0?`<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5L5.5 8l4.5 4.5"/></svg>`:`<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5L10.5 8 6 12.5"/></svg>`,n.addEventListener(`click`,()=>this.turn(t)),n}turn(e){let t=new Date(Date.UTC(this.view.year,this.view.month+e,1));this.view={year:t.getUTCFullYear(),month:t.getUTCMonth()};let n=new Date(Date.UTC(this.view.year,this.view.month+1,0)).getUTCDate();this.focusDay=this.clamp({...this.view,day:Math.min(this.focusDay.day,n)}),this.view={year:this.focusDay.year,month:this.focusDay.month},this.render()}clamp(e){let t=S(e),n=re(this.limits.min),r=re(this.limits.max);return n&&t<S(n)?n:r&&t>S(r)?r:e}allowed(e){let{min:t,max:n}=this.limits;return!(t&&e<t)&&!(n&&e>n)}render(){let e=this.locale;this.titleEl.textContent=new Intl.DateTimeFormat(e,{month:`long`,year:`numeric`,timeZone:`UTC`}).format(new Date(Date.UTC(this.view.year,this.view.month,1)));let t=this.today,n=S(this.focusDay),r=new Intl.DateTimeFormat(e,{dateStyle:`full`,timeZone:`UTC`});this.grid.textContent=``;let i=null;for(let[a,o]of x(this.view.year,this.view.month,b(e)).entries()){a%v===0&&(i=document.createElement(`div`),i.className=`tcw-calendar-week`,i.setAttribute(`role`,`row`),this.grid.appendChild(i));let e=S(o),s=document.createElement(`button`);s.type=`button`,s.className=`tcw-calendar-day`,s.dataset.date=e,s.setAttribute(`role`,`gridcell`),s.textContent=String(o.day),s.setAttribute(`aria-label`,r.format(new Date(Date.UTC(o.year,o.month,o.day)))),s.setAttribute(`aria-selected`,String(e===this.chosen)),s.tabIndex=e===n?0:-1,o.month!==this.view.month&&s.classList.add(`tcw-outside`),e===t&&s.classList.add(`tcw-today`),this.allowed(e)||(s.disabled=!0),i?.appendChild(s)}}onKey(e){let t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-v,ArrowDown:v},n=this.element.isConnected&&getComputedStyle(this.element).direction===`rtl`;if(e.key in t){let r=n&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)?-t[e.key]:t[e.key];this.moveFocus(ae(this.focusDay,r))}else if(e.key===`PageUp`||e.key===`PageDown`)this.turn(e.key===`PageUp`?-1:1),this.focusGrid();else if(e.key===`Home`||e.key===`End`){let t=new Date(Date.UTC(this.view.year,this.view.month+1,0)).getUTCDate();this.moveFocus({...this.view,day:e.key===`Home`?1:t})}else if(e.key===`Enter`||e.key===` `)this.pick(S(this.focusDay));else return;e.preventDefault()}moveFocus(e){let t=this.clamp(e);this.focusDay=t,(t.year!==this.view.year||t.month!==this.view.month)&&(this.view={year:t.year,month:t.month}),this.render(),this.focusGrid()}pick(e){this.allowed(e)&&this.onPick(e)}},se=class{input=null;view=null;onOutside=e=>{let t=e.target;this.view?.element.contains(t)||this.input?.contains(t)||this.close(!1)};onAway=()=>this.close(!1);onScroll=e=>{e.target instanceof Node&&this.view?.element.contains(e.target)||this.close(!1)};watch=new MutationObserver(()=>{this.input&&!this.input.isConnected&&this.close(!1)});constructor(e,t,n){this.layer=e,this.labels=t,this.locale=n}isOpenFor(e){return this.input===e}owns(e){return e!==null&&(e===this.input||this.view?.element.contains(e)===!0)}open(e){this.close(!1),this.input=e;let t=new oe(this.labels(),this.locale(),e=>this.pick(e));t.show(e.value,{min:e.min||void 0,max:e.max||void 0});let n=t.element;n.setAttribute(`role`,`dialog`);let r=e.getAttribute(`aria-label`)??e.labels?.[0]?.textContent??``;r&&n.setAttribute(`aria-label`,r.trim()),n.addEventListener(`mousedown`,e=>{e.target.closest(`button`)||e.preventDefault()}),n.addEventListener(`keydown`,e=>{e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),this.close(!0))}),this.view=t,this.layer().appendChild(n),ee(n,e),document.addEventListener(`pointerdown`,this.onOutside,!0),window.addEventListener(`resize`,this.onAway),document.addEventListener(`scroll`,this.onScroll,{capture:!0,passive:!0}),this.watch.observe(document.documentElement,{childList:!0,subtree:!0})}close(e){let t=this.input;t&&(document.removeEventListener(`pointerdown`,this.onOutside,!0),window.removeEventListener(`resize`,this.onAway),document.removeEventListener(`scroll`,this.onScroll,{capture:!0}),this.watch.disconnect(),this.view?.element.remove(),this.view=null,this.input=null,e&&t.isConnected&&t.focus())}focusGrid(){this.view?.focusGrid()}destroy(){this.close(!1)}pick(e){let t=this.input;if(!t)return;let n=t.value!==e;t.value=e,this.close(!0),n&&(t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0})))}},ce=()=>typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches,le=()=>typeof CSS>`u`||typeof CSS.supports!=`function`||CSS.supports(`selector(::-webkit-calendar-picker-indicator)`);function ue(e){if(!(e instanceof Element))return null;let t=e.closest(`select`);return!t||t.matches(`:disabled`)||t.multiple||t.size>1?null:t}function de(e){return!(e instanceof HTMLInputElement)||e.type!==`date`||e.dataset.tcwCalendar===`inline`||e.matches(`:disabled`)||e.readOnly?null:e}function fe(e,t){let n=new g(t.layer),r=new se(t.layer,t.labels,t.locale),i=t.native??ce,a=t.calendar??le,o=new WeakSet,s=e=>o.has(e)?!1:(o.add(e),!0),c=e=>{if(e.button!==0||i()||!s(e))return;let t=ue(e.target);if(t){if(e.preventDefault(),n.isOpenFor(t)){n.close(!0);return}t.focus(),n.open(t)}},l=e=>{if(i()||!a()||!s(e))return;let t=de(e.target);t&&(e.preventDefault(),r.isOpenFor(t)||r.open(t))},u=e=>{if(i()||!s(e))return;let t=ue(e.target);if(t){if(n.isOpenFor(t)){n.key(e)&&(e.preventDefault(),e.stopPropagation());return}(e.key===`Enter`||e.key===` `||e.altKey&&(e.key===`ArrowDown`||e.key===`ArrowUp`)||e.key===`F4`)&&(e.preventDefault(),e.stopPropagation(),n.open(t));return}let o=de(e.target);!o||!a()||(e.key===`Escape`&&r.isOpenFor(o)?(e.preventDefault(),e.stopPropagation(),r.close(!0)):(e.altKey&&e.key===`ArrowDown`||e.key===`F4`)&&(e.preventDefault(),r.isOpenFor(o)||r.open(o),r.focusGrid()))},d=e=>{if(!s(e))return;let t=e.target instanceof Node?e.target:null,i=e.relatedTarget instanceof Node?e.relatedTarget:null;n.owns(t)&&!n.owns(i)&&n.close(!1),r.owns(t)&&!r.owns(i)&&r.close(!1)};for(let t of e)t.addEventListener(`mousedown`,c,!0),t.addEventListener(`click`,l,!0),t.addEventListener(`keydown`,u,!0),t.addEventListener(`focusout`,d,!0);return()=>{for(let t of e)t.removeEventListener(`mousedown`,c,!0),t.removeEventListener(`click`,l,!0),t.removeEventListener(`keydown`,u,!0),t.removeEventListener(`focusout`,d,!0);n.destroy(),r.destroy()}}var pe=[{label:`Candlestick`,value:`candlestick`},{label:`Line`,value:`line`},{label:`Area`,value:`area`},{label:`Bar`,value:`bar`},{label:`Heikin-Ashi`,value:`heikinAshi`},{label:`Hollow Candle`,value:`hollowCandle`},{label:`Baseline`,value:`baseline`},{label:`Volume Candles`,value:`volumeCandles`},{label:`Equivolume`,value:`equivolume`},{label:`HLC Area`,value:`hlcArea`},{label:`Step Line`,value:`stepLine`},{label:`Line + Markers`,value:`lineWithMarkers`},{label:`High-Low`,value:`hiLo`},{label:`Renko`,value:`renko`},{label:`Line Break`,value:`lineBreak`},{label:`Kagi`,value:`kagi`},{label:`Point & Figure`,value:`pointAndFigure`},{label:`Range Bars`,value:`rangeBars`}],me=[{label:`Lines`,section:`lines`,tools:[{label:`Trend Line`,value:`trendLine`},{label:`Ray`,value:`ray`},{label:`Extended Line`,value:`extendedLine`},{label:`Info Line`,value:`infoLine`},{label:`Trend Angle`,value:`trendAngle`}]},{label:`Horizontal/Vertical`,section:`lines`,tools:[{label:`Horizontal Line`,value:`horizontalLine`},{label:`Horizontal Ray`,value:`horizontalRay`},{label:`Vertical Line`,value:`verticalLine`},{label:`Cross Line`,value:`crossLine`}]},{label:`Channels`,section:`lines`,tools:[{label:`Parallel Channel`,value:`parallelChannel`},{label:`Regression Channel`,value:`regressionChannel`}]},{label:`Fibonacci`,section:`fibonacci`,tools:[{label:`Fib Retracement`,value:`fibRetracement`},{label:`Fib Extension`,value:`fibExtension`},{label:`Fib Channel`,value:`fibChannel`},{label:`Fib Time Zones`,value:`fibTimeZones`},{label:`Fib Speed Resistance Fan`,value:`fibSpeedResistanceFan`},{label:`Fib Speed Resistance Arcs`,value:`fibArcs`},{label:`Fib Circles`,value:`fibCircles`},{label:`Fib Spiral`,value:`fibSpiral`},{label:`Fib Wedge`,value:`fibWedge`}]},{label:`Gann & Pitchforks`,section:`fibonacci`,tools:[{label:`Pitchfork`,value:`pitchfork`},{label:`Schiff Pitchfork`,value:`schiffPitchfork`},{label:`Modified Schiff Pitchfork`,value:`modifiedSchiffPitchfork`},{label:`Gann Fan`,value:`gannFan`},{label:`Gann Box`,value:`gannBox`},{label:`Gann Square`,value:`gannSquare`},{label:`Pitchfan`,value:`pitchfan`}]},{label:`Cycles`,section:`fibonacci`,tools:[{label:`Cyclic Lines`,value:`cyclicLines`},{label:`Time Cycles`,value:`timeCycles`},{label:`Sine Line`,value:`sineLine`}]},{label:`Patterns`,section:`patterns`,tools:[{label:`XABCD Pattern`,value:`xabcdPattern`},{label:`ABCD Pattern`,value:`abcdPattern`},{label:`Head and Shoulders`,value:`headAndShoulders`},{label:`Cypher Pattern`,value:`cypherPattern`},{label:`Three Drives Pattern`,value:`threeDrives`}]},{label:`Elliott Waves`,section:`patterns`,tools:[{label:`Elliott Wave`,value:`elliottWave`},{label:`Elliott Impulse Wave`,value:`elliottImpulse`},{label:`Elliott Correction Wave`,value:`elliottCorrection`},{label:`Elliott Triangle Wave`,value:`elliottTriangle`},{label:`Elliott Double Combo Wave`,value:`elliottDoubleCombo`},{label:`Elliott Triple Combo Wave`,value:`elliottTripleCombo`}]},{label:`Forecasting`,section:`forecasting`,tools:[{label:`Long/Short Position`,value:`riskReward`},{label:`Anchored VWAP`,value:`anchoredVWAP`},{label:`Fixed Range Volume Profile`,value:`volumeProfileRange`},{label:`Forecast`,value:`forecast`},{label:`Projection`,value:`projection`},{label:`Bars Pattern`,value:`barsPattern`}]},{label:`Measure`,section:`forecasting`,tools:[{label:`Price Range`,value:`priceRange`},{label:`Date Range`,value:`dateRange`},{label:`Date and Price Range`,value:`dateAndPriceRange`},{label:`Measure`,value:`measure`}]},{label:`Shapes`,section:`annotation`,tools:[{label:`Rectangle`,value:`rectangle`},{label:`Circle`,value:`circle`},{label:`Ellipse`,value:`ellipse`},{label:`Triangle`,value:`triangle`},{label:`Polyline`,value:`polyline`},{label:`Curve`,value:`curve`},{label:`Arc`,value:`arc`}]},{label:`Brushes`,section:`annotation`,tools:[{label:`Brush`,value:`brush`},{label:`Highlighter`,value:`highlighter`},{label:`Path`,value:`path`}]},{label:`Annotation`,section:`annotation`,tools:[{label:`Text`,value:`text`},{label:`Price Label`,value:`priceLabel`},{label:`Arrow`,value:`arrow`},{label:`Note`,value:`note`},{label:`Callout`,value:`callout`},{label:`Flag Mark`,value:`flag`},{label:`Arrow Mark`,value:`arrowMark`},{label:`Icon`,value:`icon`}]}],he=[`BTCUSDT`,`ETHUSDT`,`SOLUSDT`,`BNBUSDT`],ge={gridVisible:!0,volumeVisible:!0,volumeProfileVisible:!1,marketProfileVisible:!1,marketProfileSplit:!1,marketProfileLetters:!1,marketProfileBuckets:48,marketProfileOpacity:.32,depthHeatmapVisible:!1,depthHeatmapOpacity:.7,sessionShadingVisible:!1,pivotMarkersVisible:!1,pivotStrength:5,pivotStructureLabels:!1,periodLevelsVisible:!1,periodLevelsPeriod:`day`,legendVisible:!0,barCountdown:!0,indicatorValueLabels:!1,alignAxisLabels:!0,logScale:!1,scaleMode:`regular`,autoScale:!0,invertScale:!1,leftPriceScale:!1,crosshairMode:`magnet`,numberLocale:`en-US`,timezone:`local`,highLowLines:!1,mainSeriesVisible:!0,extendedHours:!0,chartTypeOptions:{}},C=(e,...t)=>({label:e,keys:t}),w=(e,t,n={})=>({label:e,keys:[t],auto:n}),T=e=>({hint:e}),_e={from:`panes.titleColor`},ve={title:`settings.section.lastPrice`,rows:[C(`settings.priceLine`,`lastPrice.visible`),C(`settings.up`,`lastPrice.upColor`),C(`settings.down`,`lastPrice.downColor`),C(`drawingSettings.lineStyle`,`lastPrice.style`),C(`drawingSettings.lineWidth`,`lastPrice.width`)]},ye={title:`settings.volume`,rows:[C(`settings.up`,`volume.upColor`),C(`settings.down`,`volume.downColor`)]},be={title:`settings.highLowLines`,rows:[w(`drawingSettings.color`,`highLow.color`,_e)]},xe=[ve,ye,be],Se=[C(`settings.legendText`,`legend.textColor`),C(`settings.legendLabels`,`legend.labelColor`)],Ce=[...Se,C(`settings.paneTitles`,`panes.titleColor`)],we=[C(`drawingSettings.text`,`axis.price.textColor`,`axis.time.textColor`),C(`settings.scaleLines`,`axis.price.lineColor`,`axis.time.lineColor`)],Te=[{title:`settings.section.background`,rows:[C(`settings.background`,`background.color`),C(`settings.paneBackground`,`panes.background`),C(`settings.paneSeparator`,`panes.separatorColor`),w(`settings.watermark`,`watermark.color`,_e)]},{title:`settings.gridLines`,rows:[C(`settings.horizontal`,`grid.horizontal.visible`),C(`settings.vertical`,`grid.vertical.visible`),C(`drawingSettings.color`,`grid.horizontal.color`,`grid.vertical.color`),C(`drawingSettings.lineStyle`,`grid.horizontal.style`,`grid.vertical.style`),C(`drawingSettings.lineWidth`,`grid.horizontal.width`,`grid.vertical.width`)]},{title:`settings.crosshairMode`,rows:[C(`settings.horizontal`,`crosshair.horizontal.visible`),C(`settings.vertical`,`crosshair.vertical.visible`),C(`drawingSettings.color`,`crosshair.horizontal.color`,`crosshair.vertical.color`),C(`drawingSettings.lineStyle`,`crosshair.horizontal.style`,`crosshair.vertical.style`),C(`drawingSettings.lineWidth`,`crosshair.horizontal.width`,`crosshair.vertical.width`),C(`settings.labelBackground`,`crosshair.labelBackground`),C(`settings.labelText`,`crosshair.labelTextColor`)]},{title:`settings.sessionBreaks`,rows:[w(`drawingSettings.color`,`sessionBreaks.color`,{from:`axis.price.lineColor`}),w(`drawingSettings.lineStyle`,`sessionBreaks.style`),w(`drawingSettings.lineWidth`,`sessionBreaks.width`)]},{title:`objects.drawings`,rows:[w(`settings.handles`,`drawings.handleColor`,T(`#ffffff`))]}],Ee=[{title:`settings.section.orders`,trading:!0,rows:[w(`ticket.buy`,`trading.buyColor`,T(n.DEFAULT_TRADING_CONFIG.orderColors?.buy)),w(`ticket.sell`,`trading.sellColor`,T(n.DEFAULT_TRADING_CONFIG.orderColors?.sell)),w(`settings.profit`,`trading.profitColor`,T(n.DEFAULT_TRADING_CONFIG.positionColors?.profit)),w(`settings.loss`,`trading.lossColor`,T(n.DEFAULT_TRADING_CONFIG.positionColors?.loss)),w(`account.entry`,`trading.entryColor`,T(n.DEFAULT_TRADING_CONFIG.positionColors?.entry))]},{title:`settings.section.signals`,rows:[w(`account.long`,`markers.longColor`,T(n.DEFAULT_SIGNAL_STYLE.longColor)),w(`account.short`,`markers.shortColor`,T(n.DEFAULT_SIGNAL_STYLE.shortColor)),w(`markers.neutral`,`markers.neutralColor`,T(n.DEFAULT_SIGNAL_STYLE.neutralColor))]},{title:`settings.section.tradeZones`,rows:[w(`settings.profit`,`tradeZones.profitColor`,T(n.DEFAULT_TRADE_ZONE_STYLE.profitColor)),w(`settings.loss`,`tradeZones.lossColor`,T(n.DEFAULT_TRADE_ZONE_STYLE.lossColor)),w(`settings.openTrade`,`tradeZones.activeColor`,T(n.DEFAULT_TRADE_ZONE_STYLE.activeColor))]}],De={upColor:`settings.up`,downColor:`settings.down`,wickUpColor:`settings.upWick`,wickDownColor:`settings.downWick`,color:`drawingSettings.color`,lineColor:`drawingSettings.color`,lineWidth:`drawingSettings.lineWidth`,topColor:`settings.areaTop`,bottomColor:`settings.areaBottom`},Oe=new Set([`candlestick`,`heikinAshi`,`volumeCandles`,`equivolume`]);function ke(e){let t=`series.${e}.`;return Object.keys(n.CHART_STYLE_KEYS).filter(e=>e.startsWith(t)).map(n=>{let r=n.slice(t.length),i=De[r]??`drawingSettings.color`;return Oe.has(e)&&r===`upColor`&&(i=`settings.upBody`),Oe.has(e)&&r===`downColor`&&(i=`settings.downBody`),e===`baseline`&&r===`upColor`&&(i=`settings.aboveBase`),e===`baseline`&&r===`downColor`&&(i=`settings.belowBase`),C(i,n)})}var E=[...new Set([...Object.keys(n.CHART_STYLE_KEYS).filter(e=>e.startsWith(`series.`)),...[...xe,...Te,...Ee].flatMap(e=>e.rows.flatMap(e=>e.keys)),...[...Ce,...we].flatMap(e=>e.keys)])],Ae=`/* === TradeCanvas Widget — Premium Styles === */
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* The HTML \`hidden\` attribute only sets \`display: none\` via the UA stylesheet,
|
package/dist/widget/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as e, a as t, c as n, d as r, f as i, i as a, n as o, o as s, r as c, t as l } from "../LayoutSession-
|
|
1
|
+
import { O as e, a as t, c as n, d as r, f as i, i as a, n as o, o as s, r as c, t as l } from "../LayoutSession-BXmESQTc.js";
|
|
2
2
|
import { a as u, c as d, i as f, n as p, o as m, r as h, s as ee, t as g } from "../i18n-BaJ3lo-i.js";
|
|
3
3
|
import { CHART_STYLE_KEYS as _, CHART_TYPE_ICONS as v, DARK_THEME as y, DEFAULT_SIGNAL_STYLE as b, DEFAULT_TRADE_ZONE_STYLE as x, DEFAULT_TRADING_CONFIG as S, DRAWING_TOOL_ICONS as te, LIGHT_THEME as ne, PHI as re, PRICE_SOURCES as ie, SANS_FONT_FAMILY as ae, UI_ICONS as oe, barTimeUnit as se, formatPrice as ce, iconSvg as le, indicatorSource as ue, isTimeFrame as de, isValidTimeZone as fe, marketStatus as pe, offsetAt as me, parseIndicatorSource as he, phiStep as ge, readChartStyleOverrides as _e, readChartTypeOptions as ve, readIndicatorPlotStyles as ye, readNews as be, readQuote as xe, resampleBars as Se, sanitizeDrawingOptions as Ce, sanitizeDrawingStyle as we, stepDecimals as Te, symbolTimeZone as Ee, tickBarCount as De, timeParts as Oe, timeframeFollowsDays as ke, timeframeToMs as C, tzLabel as Ae, wallToUtc as je, zoneOffsetMinutes as Me, zonedDateFormatter as Ne } from "@tradecanvas/commons";
|
|
4
4
|
import { ChartStateManager as Pe, INDICATOR_CATEGORIES as Fe, INTERVAL_LIMITS as Ie, INTERVAL_UNITS as Le, MAX_ALERT_BARS as Re, MIN_ALERT_BARS as ze, RANGE_PRESETS as Be, ResamplingAdapter as Ve, SYMBOL_INDICATOR_IDS as He, indicatorCategory as Ue, indicatorValuePrecision as We, isSeriesPalette as Ge, plotColor as Ke, plotShown as qe, rangePresetStart as Je, servesTimeframe as Ye, sourceParam as Xe, withResampling as Ze } from "@tradecanvas/core";
|