@tradecanvas/chart 2.0.0-beta.3 → 2.0.0-beta.5
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 -0
- package/dist/{LayoutSession-CV28T-KY.js → LayoutSession-DlRfUBgK.js} +2 -2
- package/dist/{LayoutSession-CV28T-KY.js.map → LayoutSession-DlRfUBgK.js.map} +1 -1
- package/dist/{LayoutSession-FeinXwhr.cjs → LayoutSession-Dv9lhmSU.cjs} +2 -2
- package/dist/{LayoutSession-FeinXwhr.cjs.map → LayoutSession-Dv9lhmSU.cjs.map} +1 -1
- package/dist/finance/DepthChart.d.ts +2 -0
- package/dist/finance/DepthChart.d.ts.map +1 -1
- package/dist/finance/EquityCurveChart.d.ts +2 -0
- package/dist/finance/EquityCurveChart.d.ts.map +1 -1
- package/dist/finance/GaugeChart.d.ts +2 -0
- package/dist/finance/GaugeChart.d.ts.map +1 -1
- package/dist/finance/PerformanceDashboard.d.ts +8 -2
- package/dist/finance/PerformanceDashboard.d.ts.map +1 -1
- package/dist/finance/SparklineChart.d.ts +2 -0
- package/dist/finance/SparklineChart.d.ts.map +1 -1
- package/dist/finance/WaterfallChart.d.ts +2 -0
- package/dist/finance/WaterfallChart.d.ts.map +1 -1
- package/dist/finance/index.d.ts +2 -2
- package/dist/finance/index.d.ts.map +1 -1
- package/dist/finance/performanceData.d.ts +19 -2
- package/dist/finance/performanceData.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +246 -182
- package/dist/index.js.map +1 -1
- package/dist/widget/index.cjs +1 -1
- package/dist/widget/index.js +1 -1
- package/package.json +3 -3
|
@@ -5,6 +5,8 @@ export declare class DepthChart extends BaseFinanceChart {
|
|
|
5
5
|
/** Always listening: `crosshair` in the options says whether its place is drawn, so it can be switched later. */
|
|
6
6
|
private readonly crosshair;
|
|
7
7
|
constructor(container: HTMLElement, options: DepthChartOptions);
|
|
8
|
+
/** What screen readers hear: `ariaLabel`, else what the chart holds. */
|
|
9
|
+
private applyLabel;
|
|
8
10
|
protected renderChart(ctx: CanvasRenderingContext2D, width: number, height: number, theme: Theme): void;
|
|
9
11
|
update(data: DepthData): void;
|
|
10
12
|
setOptions(opts: Partial<DepthChartOptions>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepthChart.d.ts","sourceRoot":"","sources":["../../src/finance/DepthChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAsC,MAAM,mBAAmB,CAAC;AAEzF,qBAAa,UAAW,SAAQ,gBAAgB;IAC9C,OAAO,CAAC,OAAO,CAAoB;IACnC,iHAAiH;IACjH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;gBAEjC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB;IAa9D,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAKP,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"DepthChart.d.ts","sourceRoot":"","sources":["../../src/finance/DepthChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAsC,MAAM,mBAAmB,CAAC;AAEzF,qBAAa,UAAW,SAAQ,gBAAgB;IAC9C,OAAO,CAAC,OAAO,CAAoB;IACnC,iHAAiH;IACjH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;gBAEjC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB;IAa9D,wEAAwE;IACxE,OAAO,CAAC,UAAU;IAIlB,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAKP,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAM7B,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAOlD,OAAO,IAAI,IAAI;CAIhB"}
|
|
@@ -5,6 +5,8 @@ export declare class EquityCurveChart extends BaseFinanceChart {
|
|
|
5
5
|
/** Always listening: `crosshair` in the options says whether its place is drawn, so it can be switched later. */
|
|
6
6
|
private readonly crosshair;
|
|
7
7
|
constructor(container: HTMLElement, options: EquityCurveOptions);
|
|
8
|
+
/** What screen readers hear: `ariaLabel`, else what the chart holds. */
|
|
9
|
+
private applyLabel;
|
|
8
10
|
protected renderChart(ctx: CanvasRenderingContext2D, width: number, height: number, theme: Theme): void;
|
|
9
11
|
update(data: EquityPoint[], benchmark?: EquityPoint[]): void;
|
|
10
12
|
setOptions(opts: Partial<EquityCurveOptions>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EquityCurveChart.d.ts","sourceRoot":"","sources":["../../src/finance/EquityCurveChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAuC,MAAM,mBAAmB,CAAC;AAE1F,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,OAAO,CAAC,OAAO,CAAqB;IACpC,iHAAiH;IACjH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;gBAEjC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB;IAa/D,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAKP,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"EquityCurveChart.d.ts","sourceRoot":"","sources":["../../src/finance/EquityCurveChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAuC,MAAM,mBAAmB,CAAC;AAE1F,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,OAAO,CAAC,OAAO,CAAqB;IACpC,iHAAiH;IACjH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;gBAEjC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB;IAa/D,wEAAwE;IACxE,OAAO,CAAC,UAAU;IAIlB,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAKP,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI;IAS5D,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAI;IAOnD,OAAO,IAAI,IAAI;CAIhB"}
|
|
@@ -8,6 +8,8 @@ export declare class GaugeChart extends BaseFinanceChart {
|
|
|
8
8
|
private animationFrom;
|
|
9
9
|
private animationFrameId;
|
|
10
10
|
constructor(container: HTMLElement, options: GaugeOptions);
|
|
11
|
+
/** What screen readers hear: `ariaLabel`, else what the chart holds. */
|
|
12
|
+
private applyLabel;
|
|
11
13
|
protected renderChart(ctx: CanvasRenderingContext2D, width: number, height: number, theme: Theme): void;
|
|
12
14
|
setValue(value: number): void;
|
|
13
15
|
setOptions(opts: Partial<GaugeOptions>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GaugeChart.d.ts","sourceRoot":"","sources":["../../src/finance/GaugeChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AASlE,qBAAa,UAAW,SAAQ,gBAAgB;IAC9C,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,gBAAgB,CAAuB;gBAEnC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY;IASzD,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAIP,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"GaugeChart.d.ts","sourceRoot":"","sources":["../../src/finance/GaugeChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AASlE,qBAAa,UAAW,SAAQ,gBAAgB;IAC9C,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,gBAAgB,CAAuB;gBAEnC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY;IASzD,wEAAwE;IACxE,OAAO,CAAC,UAAU;IAIlB,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAIP,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAoB7B,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAc7C,OAAO,CAAC,kBAAkB;IAwB1B,OAAO,CAAC,eAAe;IAQvB,OAAO,IAAI,IAAI;CAIhB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Theme, ThemeName } from '@tradecanvas/commons';
|
|
2
|
-
import { EquitySample, RiskMetricsLike } from './performanceData.js';
|
|
1
|
+
import { FontConfig, Theme, ThemeName } from '@tradecanvas/commons';
|
|
2
|
+
import { EquitySample, RiskMetricsLike, DashboardLabels } from './performanceData.js';
|
|
3
3
|
/** Structurally satisfied by analytics' `BacktestResult`. */
|
|
4
4
|
export interface PerformanceResult {
|
|
5
5
|
equityCurve: ReadonlyArray<EquitySample>;
|
|
@@ -10,6 +10,12 @@ export interface PerformanceDashboardOptions {
|
|
|
10
10
|
theme?: ThemeName | Theme;
|
|
11
11
|
title?: string;
|
|
12
12
|
subtitle?: string;
|
|
13
|
+
/** The face and sizes of the dashboard's text, as on the finance charts: the system's sans face when left out. */
|
|
14
|
+
font?: Partial<FontConfig>;
|
|
15
|
+
/** The language of the months' names and of the charts' numbers and dates (a BCP 47 tag); the browser's when left out. */
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** The panels' titles and the stats' names in your words; those left out stay in English. */
|
|
18
|
+
labels?: Partial<DashboardLabels>;
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
21
|
* A composed strategy-performance dashboard: a headline stats strip, an equity
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerformanceDashboard.d.ts","sourceRoot":"","sources":["../../src/finance/PerformanceDashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"PerformanceDashboard.d.ts","sourceRoot":"","sources":["../../src/finance/PerformanceDashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIzE,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,eAAe,EAErB,MAAM,sBAAsB,CAAC;AAE9B,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kHAAkH;IAClH,IAAI,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3B,0HAA0H;IAC1H,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,OAAO,CAA6B;gBAEhC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,2BAA2B;IAQxE,OAAO,CAAC,KAAK;IA8Fb,OAAO,CAAC,eAAe;IAqCvB,OAAO,CAAC,UAAU;IAgClB,0EAA0E;IAC1E,OAAO,CAAC,eAAe;IAIvB,6DAA6D;IAC7D,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAOvC,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,GAAG,IAAI;IAQxC,OAAO,CAAC,aAAa;IASrB,OAAO,IAAI,IAAI;CAIhB"}
|
|
@@ -3,6 +3,8 @@ import { BaseFinanceChart } from '@tradecanvas/core';
|
|
|
3
3
|
export declare class SparklineChart extends BaseFinanceChart {
|
|
4
4
|
private options;
|
|
5
5
|
constructor(container: HTMLElement, options: SparklineOptions);
|
|
6
|
+
/** What screen readers hear: `ariaLabel`, else what the chart holds. */
|
|
7
|
+
private applyLabel;
|
|
6
8
|
protected renderChart(ctx: CanvasRenderingContext2D, width: number, height: number, theme: Theme): void;
|
|
7
9
|
update(data: number[]): void;
|
|
8
10
|
setOptions(opts: Partial<SparklineOptions>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineChart.d.ts","sourceRoot":"","sources":["../../src/finance/SparklineChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAEtE,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,OAAO,CAAC,OAAO,CAAmB;gBAEtB,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB;IAO7D,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAIP,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"SparklineChart.d.ts","sourceRoot":"","sources":["../../src/finance/SparklineChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAEtE,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,OAAO,CAAC,OAAO,CAAmB;gBAEtB,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB;IAO7D,wEAAwE;IACxE,OAAO,CAAC,UAAU;IAIlB,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAIP,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAM5B,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;CAMlD"}
|
|
@@ -5,6 +5,8 @@ export declare class WaterfallChart extends BaseFinanceChart {
|
|
|
5
5
|
/** Always listening: `crosshair` in the options says whether its place is drawn, so it can be switched later. */
|
|
6
6
|
private readonly crosshair;
|
|
7
7
|
constructor(container: HTMLElement, options: WaterfallOptions);
|
|
8
|
+
/** What screen readers hear: `ariaLabel`, else what the chart holds. */
|
|
9
|
+
private applyLabel;
|
|
8
10
|
protected renderChart(ctx: CanvasRenderingContext2D, width: number, height: number, theme: Theme): void;
|
|
9
11
|
update(data: WaterfallBar[]): void;
|
|
10
12
|
setOptions(opts: Partial<WaterfallOptions>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WaterfallChart.d.ts","sourceRoot":"","sources":["../../src/finance/WaterfallChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAqC,MAAM,mBAAmB,CAAC;AAExF,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,OAAO,CAAC,OAAO,CAAmB;IAClC,iHAAiH;IACjH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;gBAEjC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB;IAa7D,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAKP,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"WaterfallChart.d.ts","sourceRoot":"","sources":["../../src/finance/WaterfallChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAqC,MAAM,mBAAmB,CAAC;AAExF,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,OAAO,CAAC,OAAO,CAAmB;IAClC,iHAAiH;IACjH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;gBAEjC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB;IAa7D,wEAAwE;IACxE,OAAO,CAAC,UAAU;IAIlB,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,IAAI;IAKP,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI;IAMlC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAOjD,OAAO,IAAI,IAAI;CAIhB"}
|
package/dist/finance/index.d.ts
CHANGED
|
@@ -13,6 +13,6 @@ export { MatrixChart } from './MatrixChart.js';
|
|
|
13
13
|
export { CounterClockChart } from './CounterClockChart.js';
|
|
14
14
|
export { PerformanceDashboard } from './PerformanceDashboard.js';
|
|
15
15
|
export type { PerformanceDashboardOptions, PerformanceResult } from './PerformanceDashboard.js';
|
|
16
|
-
export { toEquityPoints, computeDrawdownCurve, computeMonthlyReturns, selectKeyStats, } from './performanceData.js';
|
|
17
|
-
export type { EquitySample, RiskMetricsLike, DashboardStat } from './performanceData.js';
|
|
16
|
+
export { toEquityPoints, computeDrawdownCurve, computeMonthlyReturns, selectKeyStats, DEFAULT_DASHBOARD_LABELS, } from './performanceData.js';
|
|
17
|
+
export type { EquitySample, RiskMetricsLike, DashboardStat, DashboardLabels } from './performanceData.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/finance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/finance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -31,6 +31,21 @@ export interface DashboardStat {
|
|
|
31
31
|
value: string;
|
|
32
32
|
tone: 'positive' | 'negative' | 'neutral';
|
|
33
33
|
}
|
|
34
|
+
/** The words on the dashboard: the panels' titles and the stats' names. */
|
|
35
|
+
export interface DashboardLabels {
|
|
36
|
+
equityCurve: string;
|
|
37
|
+
drawdown: string;
|
|
38
|
+
monthlyReturns: string;
|
|
39
|
+
totalReturn: string;
|
|
40
|
+
cagr: string;
|
|
41
|
+
sharpe: string;
|
|
42
|
+
sortino: string;
|
|
43
|
+
maxDrawdown: string;
|
|
44
|
+
winRate: string;
|
|
45
|
+
profitFactor: string;
|
|
46
|
+
trades: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const DEFAULT_DASHBOARD_LABELS: Readonly<DashboardLabels>;
|
|
34
49
|
/** Map an analytics equity curve to the finance EquityCurveChart point shape. */
|
|
35
50
|
export declare function toEquityPoints(curve: ReadonlyArray<EquitySample>): EquityPoint[];
|
|
36
51
|
/**
|
|
@@ -44,11 +59,13 @@ export declare function computeDrawdownCurve(curve: ReadonlyArray<EquitySample>)
|
|
|
44
59
|
* equity), so the series reads as sequential monthly performance. `group` is
|
|
45
60
|
* the year and `value` is the return in percent.
|
|
46
61
|
*/
|
|
47
|
-
export declare function computeMonthlyReturns(curve: ReadonlyArray<EquitySample
|
|
62
|
+
export declare function computeMonthlyReturns(curve: ReadonlyArray<EquitySample>, locale?: string): HeatmapCell[];
|
|
48
63
|
/**
|
|
49
64
|
* The headline stats rendered as cards above the charts. The drawdown is a
|
|
50
65
|
* fall, so it reads with a minus sign whichever sign it arrives with, as the
|
|
51
66
|
* Drawdown panel below plots it.
|
|
52
67
|
*/
|
|
53
|
-
|
|
68
|
+
/** The dashboard's words: the defaults, with those of `labels` that are given over them. */
|
|
69
|
+
export declare function dashboardLabels(labels?: Partial<DashboardLabels>): DashboardLabels;
|
|
70
|
+
export declare function selectKeyStats(metrics: RiskMetricsLike, labels?: Partial<DashboardLabels>): DashboardStat[];
|
|
54
71
|
//# sourceMappingURL=performanceData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performanceData.d.ts","sourceRoot":"","sources":["../../src/finance/performanceData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGrE,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;CAC3C;
|
|
1
|
+
{"version":3,"file":"performanceData.d.ts","sourceRoot":"","sources":["../../src/finance/performanceData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGrE,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;CAC3C;AAED,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,eAAe,CAY7D,CAAC;AAaH,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,WAAW,EAAE,CAEhF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,WAAW,EAAE,CAOtF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAiCxG;AAgBD;;;;GAIG;AACH,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CAGtF;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,aAAa,EAAE,CAY/G"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-FeinXwhr.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);function r(e){let{id:t,params:n={},position:r=null}=typeof e==`string`?{id:e}:e;return JSON.stringify([t,Object.keys(n).sort().map(e=>[e,n[e]]),r])}function i(e,t,n){let i=new Map,a=t.map(e=>{let t=r(e),n=i.get(t)??0;return i.set(t,n+1),{spec:e,key:`${t}#${n}`}}),o=new Set(a.map(e=>e.key));for(let[t,r]of[...n])o.has(t)||(e.removeIndicator(r),n.delete(t));for(let{spec:t,key:r}of a){if(n.has(r))continue;let i=typeof t==`string`?e.addIndicator(t):t.position===void 0?e.addIndicator(t.id,t.params??{}):e.addIndicator(t.id,t.params??{},t.position);i&&n.set(r,i)}}var a=3,o=e=>({time:e.time,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}),s=e=>e.length>0?e[e.length-1]:null;function c(t,n,r){for(let i=0;i<r;i++)if(!e.N(t[i],n[i]))return!1;return!0}function l(e,t){if(e.isReplayActive())return!0;let n=s(e.getData());return t.inReplay?n?.time===t.last?.time:n===t.shownBar?n?.time===t.last?.time||!e.isExtendedHoursVisible():!1}function u(t,n,r){let i=[];for(let a=0;a<n.length;a++){let s=t[r+a];if(!e.N(s,n[a])){if(s.time!==n[a].time||!e.M(s))return null;i.push(o(s))}}return i}function d(e,t){if(t.length===0)return!0;if(!e.updateBar)return!1;for(let n of t)if(!e.updateBar(n))return!1;return!0}function f(e){return e.slice(Math.max(1,e.length-1-3),-1).map(o)}function p(t,n){let r=[];for(let i=n;i<t.length;i++){if(!e.M(t[i])||!(t[i].time>t[i-1].time))return null;r.push(o(t[i]))}return r}function m(t,n,r){let i=r.length;if(i===0||!r.last||!e.M(r.last)||n.length<i||!l(t,r))return!1;let a=r.recent??[],s=i-1-a.length;if(n!==r.source&&(r.source.length!==i||!c(r.source,n,s)))return!1;let f=n[i-1];if(f.time!==r.last.time||!e.M(f))return!1;let m=u(n,a,s),h=p(n,i);return!m||!h||!d(t,m)?!1:(e.N(f,r.last)||t.updateLastBar(o(f)),h.length===1?t.appendBar(h[0]):h.length>1&&t.appendBars(h),!0)}function h(e,t,n){(!n||!m(e,t,n))&&e.setData(t.map(o));let r=t.length>0?o(t[t.length-1]):null,i=e.isReplayActive();return{source:t,length:t.length,last:r,recent:f(t),shownBar:i?null:s(e.getData()),inReplay:i}}var g=`https://tradecanvas.dev`,_=`Powered by TradeCanvas`,v=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" aria-hidden="true" focusable="false"><path d="M186 70A82 82 0 1 0 186 186" fill="none" stroke="currentColor" stroke-width="22" stroke-linecap="round"/><rect x="92" y="74" width="72" height="20" rx="10" fill="currentColor"/><path fill="#E8961E" d="M119 94H137V108H144a10 10 0 0 1 10 10V164a10 10 0 0 1-10 10H137V190H119V174H112a10 10 0 0 1-10-10V118a10 10 0 0 1 10-10H119Z"/></svg>`,y=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 16 686 88" aria-hidden="true" focusable="false"><path fill="currentColor" transform="translate(0 101.64)" d="M27.24 0.00L27.24 -69.72L1.32 -69.72L1.32 -83.64L68.76 -83.64L68.76 -69.72L42.96 -69.72L42.96 0.00ZM70.90 0.00L70.90 -59.16L85.90 -59.16L85.90 -50.64Q86.26 -51.36 86.74 -51.96Q89.50 -55.92 93.52 -58.14Q97.54 -60.36 101.74 -60.36Q104.74 -60.36 107.44 -59.58Q110.14 -58.80 113.02 -57.00L105.82 -43.56Q104.50 -44.28 102.46 -44.88Q100.42 -45.48 98.38 -45.48Q95.98 -45.48 93.76 -44.64Q91.54 -43.80 89.80 -42.00Q88.06 -40.20 86.98 -37.20Q86.50 -35.52 86.20 -32.94Q85.90 -30.36 85.90 -25.44L85.90 0.00ZM156.44 0.00L155.36 -7.56Q155.00 -6.96 154.52 -6.36Q151.28 -2.40 147.20 -0.60Q143.12 1.20 138.56 1.20Q132.08 1.20 126.98 -1.20Q121.88 -3.60 118.94 -8.04Q116.00 -12.48 116.00 -18.24Q116.00 -23.40 118.10 -27.06Q120.20 -30.72 123.68 -32.64Q126.68 -34.44 130.34 -35.16Q134.00 -35.88 138.20 -35.88L155.24 -35.88L155.24 -37.32Q155.24 -42.60 151.94 -45.18Q148.64 -47.76 143.00 -47.76Q138.32 -47.76 133.46 -45.90Q128.60 -44.04 124.88 -40.68L117.32 -50.88Q123.56 -55.92 130.10 -58.14Q136.64 -60.36 144.20 -60.36Q156.44 -60.36 163.28 -54.24Q170.12 -48.12 170.12 -37.32L170.12 0.00ZM155.24 -24.84L140.36 -24.84Q138.44 -24.84 136.58 -24.54Q134.72 -24.24 133.40 -23.16Q132.20 -22.32 131.60 -21.06Q131.00 -19.80 131.00 -18.24Q131.00 -14.88 133.64 -12.84Q136.28 -10.80 140.72 -10.80Q144.68 -10.80 147.98 -12.54Q151.28 -14.28 153.26 -17.34Q155.24 -20.40 155.24 -24.36ZM202.98 1.20Q195.18 1.20 189.54 -2.82Q183.90 -6.84 180.84 -13.86Q177.78 -20.88 177.78 -29.64Q177.78 -39.36 181.20 -46.20Q184.62 -53.04 190.38 -56.70Q196.14 -60.36 202.98 -60.36Q207.78 -60.36 211.92 -58.38Q216.06 -56.40 219.06 -52.44Q219.54 -51.72 220.02 -51.00L220.02 -83.64L234.78 -83.64L234.78 0.00L220.02 0.00L220.02 -8.04Q219.54 -7.20 218.94 -6.48Q215.70 -2.28 211.56 -0.54Q207.42 1.20 202.98 1.20ZM207.06 -12.48Q211.50 -12.48 214.68 -14.64Q217.86 -16.80 219.60 -20.64Q221.34 -24.48 221.34 -29.64Q221.34 -34.80 219.60 -38.64Q217.86 -42.48 214.68 -44.58Q211.50 -46.68 207.06 -46.68Q202.74 -46.68 199.50 -44.58Q196.26 -42.48 194.52 -38.70Q192.78 -34.92 192.78 -29.64Q192.78 -24.36 194.52 -20.52Q196.26 -16.68 199.50 -14.58Q202.74 -12.48 207.06 -12.48ZM272.32 1.20Q264.64 1.20 259.12 -1.32Q253.60 -3.84 250.06 -8.10Q246.52 -12.36 244.84 -17.82Q243.16 -23.28 243.16 -29.28Q243.16 -35.04 244.84 -40.56Q246.52 -46.08 249.88 -50.52Q253.24 -54.96 258.58 -57.66Q263.92 -60.36 271.36 -60.36Q278.32 -60.36 283.48 -58.02Q288.64 -55.68 292.00 -51.54Q295.36 -47.40 297.10 -41.88Q298.84 -36.36 298.84 -30.12Q298.84 -29.28 298.78 -27.78Q298.72 -26.28 298.48 -24.60L258.04 -24.60Q258.64 -18.24 262.78 -15.00Q266.92 -11.76 273.16 -11.76Q277.72 -11.76 282.04 -13.38Q286.36 -15.00 289.72 -18.00L297.16 -7.92Q292.96 -4.68 289.24 -2.64Q285.52 -0.60 281.50 0.30Q277.48 1.20 272.32 1.20ZM284.68 -35.64Q284.68 -35.76 284.68 -35.76Q284.68 -38.28 283.72 -40.50Q282.76 -42.72 281.08 -44.40Q279.40 -46.08 277.06 -46.98Q274.72 -47.88 271.72 -47.88Q267.28 -47.88 264.28 -46.08Q261.28 -44.28 259.78 -41.46Q258.28 -38.64 257.92 -35.64ZM346.66 1.56Q335.02 1.56 326.20 -3.84Q317.38 -9.24 312.46 -19.08Q307.54 -28.92 307.54 -41.88Q307.54 -54.84 312.46 -64.62Q317.38 -74.40 326.20 -79.80Q335.02 -85.20 346.66 -85.20Q359.50 -85.20 368.92 -78.84Q378.34 -72.48 382.42 -61.20L371.02 -57.00Q368.02 -64.80 361.78 -69.18Q355.54 -73.56 346.66 -73.56Q338.50 -73.56 332.44 -69.66Q326.38 -65.76 323.08 -58.74Q319.78 -51.72 319.78 -41.88Q319.78 -32.04 323.08 -24.96Q326.38 -17.88 332.44 -13.98Q338.50 -10.08 346.66 -10.08Q355.54 -10.08 361.78 -14.46Q368.02 -18.84 371.02 -26.64L382.42 -22.56Q378.34 -11.40 368.92 -4.92Q359.50 1.56 346.66 1.56ZM429.04 0.00L428.32 -8.64Q428.20 -8.52 428.08 -8.40Q424.96 -3.72 420.34 -1.32Q415.72 1.08 409.96 1.08Q403.36 1.08 398.32 -1.32Q393.28 -3.72 390.52 -7.98Q387.76 -12.24 387.76 -17.88Q387.76 -22.80 389.80 -26.34Q391.84 -29.88 395.08 -31.80Q398.08 -33.72 401.98 -34.50Q405.88 -35.28 410.32 -35.28L428.08 -35.28L428.08 -37.20Q428.08 -43.44 424.48 -46.80Q420.88 -50.16 414.04 -50.16Q409.24 -50.16 404.86 -48.24Q400.48 -46.32 396.52 -42.00L389.20 -49.56Q394.48 -55.08 400.90 -57.66Q407.32 -60.24 414.88 -60.24Q426.76 -60.24 433.30 -54.18Q439.84 -48.12 439.84 -37.20L439.84 0.00ZM428.08 -26.40L412.00 -26.40Q409.60 -26.40 407.02 -25.98Q404.44 -25.56 402.64 -24.24Q401.20 -23.16 400.36 -21.54Q399.52 -19.92 399.52 -17.76Q399.52 -13.56 402.76 -11.04Q406.00 -8.52 411.40 -8.52Q415.96 -8.52 419.74 -10.62Q423.52 -12.72 425.80 -16.38Q428.08 -20.04 428.08 -24.72ZM451.94 0.00L451.94 -59.16L463.82 -59.16L463.82 -50.88Q464.78 -52.44 465.98 -53.76Q468.86 -56.88 472.88 -58.56Q476.90 -60.24 481.58 -60.24Q491.42 -60.24 497.00 -54.54Q502.58 -48.84 502.58 -37.92L502.58 0.00L490.82 0.00L490.82 -33.60Q490.82 -42.12 487.76 -46.08Q484.70 -50.04 478.34 -50.04Q473.54 -50.04 470.36 -47.88Q467.18 -45.72 465.50 -41.04Q463.82 -36.36 463.82 -29.16L463.82 0.00ZM533.28 0.00L509.04 -59.16L522.00 -59.16L538.08 -15.24L554.40 -59.16L567.12 -59.16L543.12 0.00ZM610.56 0.00L609.84 -8.64Q609.72 -8.52 609.60 -8.40Q606.48 -3.72 601.86 -1.32Q597.24 1.08 591.48 1.08Q584.88 1.08 579.84 -1.32Q574.80 -3.72 572.04 -7.98Q569.28 -12.24 569.28 -17.88Q569.28 -22.80 571.32 -26.34Q573.36 -29.88 576.60 -31.80Q579.60 -33.72 583.50 -34.50Q587.40 -35.28 591.84 -35.28L609.60 -35.28L609.60 -37.20Q609.60 -43.44 606.00 -46.80Q602.40 -50.16 595.56 -50.16Q590.76 -50.16 586.38 -48.24Q582.00 -46.32 578.04 -42.00L570.72 -49.56Q576.00 -55.08 582.42 -57.66Q588.84 -60.24 596.40 -60.24Q608.28 -60.24 614.82 -54.18Q621.36 -48.12 621.36 -37.20L621.36 0.00ZM609.60 -26.40L593.52 -26.40Q591.12 -26.40 588.54 -25.98Q585.96 -25.56 584.16 -24.24Q582.72 -23.16 581.88 -21.54Q581.04 -19.92 581.04 -17.76Q581.04 -13.56 584.28 -11.04Q587.52 -8.52 592.92 -8.52Q597.48 -8.52 601.26 -10.62Q605.04 -12.72 607.32 -16.38Q609.60 -20.04 609.60 -24.72ZM653.38 1.08Q647.14 1.08 642.34 -0.78Q637.54 -2.64 634.12 -5.58Q630.70 -8.52 628.66 -11.64L636.70 -18.60Q638.98 -14.52 643.24 -11.58Q647.50 -8.64 653.50 -8.64Q658.78 -8.64 661.84 -10.86Q664.90 -13.08 664.90 -16.68Q664.90 -19.56 662.98 -21.30Q661.06 -23.04 657.94 -24.18Q654.82 -25.32 651.10 -26.16Q647.74 -27.12 644.26 -28.32Q640.78 -29.52 637.96 -31.38Q635.14 -33.24 633.40 -36.18Q631.66 -39.12 631.66 -43.44Q631.66 -51.00 637.48 -55.62Q643.30 -60.24 652.90 -60.24Q659.74 -60.24 665.38 -57.42Q671.02 -54.60 674.14 -49.08L666.82 -43.44Q664.42 -47.40 660.64 -49.20Q656.86 -51.00 652.42 -51.00Q648.22 -51.00 645.40 -49.26Q642.58 -47.52 642.58 -44.52Q642.58 -42.36 643.84 -40.98Q645.10 -39.60 647.80 -38.58Q650.50 -37.56 654.46 -36.60Q658.18 -35.76 662.02 -34.56Q665.86 -33.36 669.10 -31.44Q672.34 -29.52 674.38 -26.28Q676.42 -23.04 676.42 -17.88Q676.42 -12.24 673.54 -7.98Q670.66 -3.72 665.50 -1.32Q660.34 1.08 653.38 1.08Z"/></svg>`,b=12,x=16,S=.58,C=10,ee=.56,te=686/88,ne=83.64/88,re=.25;function w(e=x){let t=Number.isFinite(e)?Math.max(b,e):x,n=T(t*ee/ne);return{height:t,fontSize:T(Math.max(C,t*S)),gap:T(t*re),wordmarkWidth:T(n*te),wordmarkHeight:n}}function T(e){return Math.round(e*10)/10}function E(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function D(e){return e&&(/^(https?:)?\/\//i.test(e)||e.startsWith(`/`))?e:g}function O(e){return!!e&&!/^_(self|parent|top)$/i.test(e)}function k(e,t,n){return e.replace(`<svg `,`<svg width="${t}" height="${n}" style="display:block;flex:none" `)}function A(e={}){let t=w(e.height),n=E(D(e.href)),r=e.target??`_blank`;return`<a class="tc-powered-by" href="${n}"${r?` target="${E(r)}"${O(r)?` rel="noopener noreferrer"`:``}`:``} aria-label="${_}" style="${`display:inline-flex;align-items:center;gap:${t.gap}px;height:${t.height}px;color:inherit;text-decoration:none;font-size:${t.fontSize}px;line-height:1;white-space:nowrap`}"><span aria-hidden="true">Powered by</span>`+k(v,t.height,t.height)+k(y,t.wordmarkWidth,t.wordmarkHeight)+`</a>`}function ie(e={},t=document){let n=t.createElement(`div`);return n.innerHTML=A(e),n.firstElementChild}function ae(e){let{viewport:t,data:r}=e,i=(0,n.priceToYMapper)(t),a=r.length-1,o=Math.max(0,Math.floor(t.visibleRange.from)),s=Math.min(a,Math.ceil(t.visibleRange.to)),c=e=>r.length>0?(0,n.timestampToBarIndex)(e,r):e;return{timeToX:e=>(0,n.barIndexToX)(c(e),t),xToTime:e=>{let i=(0,n.xToBarIndex)(e,t);return r.length>0?(0,n.barIndexToTime)(i,r):i},indexToX:e=>(0,n.barIndexToX)(e,t),xToIndex:e=>(0,n.xToBarIndex)(e,t),priceToY:i,yToPrice:e=>(0,n.yToPrice)(e,t),barWidth:t.barWidth,visible:s<o?{from:0,to:-1}:{from:o,to:s}}}var oe=class{root;cells=[];layout;options;destroyed=!1;syncing=!1;constructor(t,n={}){this.options=n,this.layout=e.d(n.layout)?n.layout:`2x2`,this.root=document.createElement(`div`),this.root.style.cssText=`display:grid;width:100%;height:100%;overflow:hidden;`,t.appendChild(this.root),this.applyLayout(),this.createCells()}applyLayout(){let{cols:t,rows:n}=e.s[this.layout],r=this.options.gap??1;this.root.style.gridTemplateColumns=`repeat(${t}, minmax(0, 1fr))`,this.root.style.gridTemplateRows=`repeat(${n}, minmax(0, 1fr))`,this.root.style.gap=`${r}px`,this.placeCells()}placeCells(){let t=e.c(e.s[this.layout]);this.cells.forEach((n,r)=>e.f(n.container,t[r]))}createCells(){let t=e.l(e.s[this.layout]);for(let e=0;e<t;e++)this.cells.push(this.createCell(e));this.placeCells()}createCell(t){let n=this.options.cells?.[t]??{},r=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden;min-width:0;min-height:0;`,this.root.appendChild(r);let i=new e.h(r,{chartType:`candlestick`,autoScale:!0,features:{crosshair:!0,keyboard:!0,volume:!0,legend:!0,priceAxis:!0,timeAxis:!0,grid:!0},...this.options.chartOptions,...n.chartOptions,theme:this.options.theme}),a={container:r,chart:i,symbol:n.symbol??`Chart ${t+1}`,timeframe:n.timeframe??`5m`};return this.options.syncCrosshair!==!1&&(i.on(`crosshairMove`,e=>{let t=e.payload.bar?.time;if(t!==void 0)for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(t)}),i.on(`crosshairLeave`,()=>{for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(null)})),this.options.syncTimeAxis!==!1&&i.on(`visibleRangeChange`,e=>{if(this.syncing)return;this.syncing=!0;let{from:t,to:n}=e.payload,r=i.getData();if(r.length>0&&t>=0&&n<r.length){let e=r[t]?.time,a=r[n]?.time;if(e&&a)for(let t of this.cells)t.chart!==i&&t.chart.setVisibleRange(e,a)}this.syncing=!1}),a}setLayout(t){if(t===this.layout||!e.d(t))return;let n=this.cells.length,r=e.l(e.s[t]);if(r<n)for(let e=n-1;e>=r;e--){let t=this.cells[e];t.chart.destroy(),t.container.remove(),this.cells.pop()}this.layout=t,this.applyLayout();for(let e=n;e<r;e++)this.cells.push(this.createCell(e));this.placeCells()}getLayout(){return this.layout}getChart(e){return this.cells[e]?.chart??null}getCharts(){return this.cells.map(e=>e.chart)}getCellCount(){return this.cells.length}setData(e,t){this.cells[e]?.chart.setData(t)}setAllData(e){for(let t of this.cells)t.chart.setData(e)}async connectCell(e,t){let n=this.cells[e];n&&(n.symbol=t.symbol,n.timeframe=t.timeframe,await n.chart.connect(t))}async connectAll(e,t,r,i=500){let a=[];for(let o=0;o<this.cells.length&&o<t.length;o++)a.push(this.connectCell(o,{...typeof e==`function`?{adapter:e(t[o],o)}:(0,n.isDataFeed)(e)?{feed:e}:{adapter:e},symbol:t[o],timeframe:r,historyLimit:i}));await Promise.all(a)}setTheme(e){for(let t of this.cells)t.chart.setTheme(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(let e of this.cells)e.chart.destroy(),e.container.remove();this.cells=[],this.root.remove()}}},se=class extends n.BaseFinanceChart{options;constructor(e,t){super(e,t.theme),this.options=t,this.applyBaseOptions({ariaLabel:t.ariaLabel}),this.requestRender()}renderChart(e,t,r,i){(0,n.renderSparkline)(e,t,r,this.options,i)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions(e),this.requestRender()}},j=class extends n.BaseFinanceChart{options;crosshair;constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.applyBaseOptions({ariaLabel:t.ariaLabel}),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderDepthChart)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions(e),this.requestRender()}destroy(){this.crosshair.destroy(),super.destroy()}},M=class extends n.BaseFinanceChart{options;crosshair;constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.applyBaseOptions({ariaLabel:t.ariaLabel}),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderEquityCurve)(e,t,r,this.options,i,a)}update(e,t){this.options={...this.options,data:e},t!==void 0&&(this.options={...this.options,benchmark:t}),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions(e),this.requestRender()}destroy(){this.crosshair.destroy(),super.destroy()}},N=class extends n.BaseFinanceChart{options;crosshair;cachedRects=[];cachedGroups=[];currentData=[];lastLayoutWidth=0;lastLayoutHeight=0;handleClick=e=>{let t=this.canvas.getBoundingClientRect();this.onCanvasClick(e.clientX-t.left,e.clientY-t.top)};constructor(e,t){super(e,t.theme),this.options=t,this.currentData=t.data??[],this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.canvas.addEventListener(`click`,this.handleClick),this.applyLabel(),this.recomputeLayout(),this.requestRender()}applyLabel(){let e=new Set(this.currentData.map(e=>e.group).filter(Boolean)).size,t=this.options.grouped&&e>0?`Market map of ${this.currentData.length} cells in ${e} groups`:`Heatmap of ${this.currentData.length} cells`;this.setLabel(this.options.ariaLabel??t)}recomputeLayout(){let e={x:0,y:0,width:this.width,height:this.height},t=this.options.cellPadding??2;if(this.lastLayoutWidth=this.width,this.lastLayoutHeight=this.height,this.cachedGroups=[],this.options.grouped){let{groups:r,cells:i}=(0,n.layoutGroupedTreemap)(this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1),group:e.group,value:e.value})),e,t,n.GROUP_HEADER);this.cachedRects=i,this.cachedGroups=r}else if(this.options.weighted){let r=this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1)}));this.cachedRects=(0,n.layoutSquarifiedTreemap)(r,e,t)}else this.cachedRects=(0,n.layoutUniformGrid)(this.currentData.map(e=>({id:e.id})),e,t)}onCanvasClick(e,t){if(this.options.onCellClick)for(let n of this.cachedRects){let r=n.rect;if(e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height){let e=this.currentData.find(e=>e.id===n.id);e&&this.options.onCellClick(e);return}}}renderChart(e,t,r,i){(t!==this.lastLayoutWidth||r!==this.lastLayoutHeight)&&this.recomputeLayout();let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderHeatmap)(e,t,r,this.currentData,this.cachedRects,this.options,i,a,this.cachedGroups)}update(e){this.currentData=e,this.options={...this.options,data:e},this.applyLabel(),this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},`theme`in e&&this.applyBaseOptions({theme:e.theme}),e.data&&(this.currentData=e.data),this.applyLabel(),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},P=class extends n.BaseFinanceChart{options;crosshair;constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.applyBaseOptions({ariaLabel:t.ariaLabel}),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderWaterfall)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions(e),this.requestRender()}destroy(){this.crosshair.destroy(),super.destroy()}},F=500;function I(e){let t=1-e;return 1-t*t*t}var L=class extends n.BaseFinanceChart{options;currentValue;targetValue;animationStart=null;animationFrom=0;animationFrameId=null;constructor(e,t){super(e,t.theme),this.options=t,this.currentValue=t.value,this.targetValue=t.value,this.applyBaseOptions({ariaLabel:t.ariaLabel}),this.requestRender()}renderChart(e,t,r,i){(0,n.renderGauge)(e,t,r,this.options,i,this.currentValue)}setValue(e){if(this.options.animate===!1){this.cancelAnimation(),this.currentValue=e,this.targetValue=e,this.options={...this.options,value:e},this.requestRender();return}this.targetValue=e,this.animationFrom=this.currentValue,this.animationStart=performance.now(),this.options={...this.options,value:e},this.startAnimationLoop()}setOptions(e){let t={...this.options,...e};if(this.applyBaseOptions(e),e.value!==void 0&&e.value!==this.targetValue){this.options=t,this.setValue(e.value);return}this.options=t,this.requestRender()}startAnimationLoop(){if(this.animationFrameId!==null)return;let e=()=>{if(this.animationFrameId=null,this.animationStart===null)return;let t=this.options.animationDuration??F,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=I(r);this.currentValue=this.animationFrom+(this.targetValue-this.animationFrom)*i,this.requestRender(),r<1?this.animationFrameId=requestAnimationFrame(e):(this.currentValue=this.targetValue,this.animationStart=null)};this.animationFrameId=requestAnimationFrame(e)}cancelAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.animationStart=null}destroy(){this.cancelAnimation(),super.destroy()}},R=class extends n.BaseFinanceChart{options;layout=null;layoutFor=null;crosshair;onClick=e=>{let t=this.canvas.getBoundingClientRect();this.layout&&this.clickAt(this.layout,e.clientX-t.left,e.clientY-t.top)};onMove=e=>{if(!this.layout||!this.clickable())return;let t=this.canvas.getBoundingClientRect();this.canvas.style.cursor=this.hits(this.layout,e.clientX-t.left,e.clientY-t.top)?`pointer`:``};constructor(e,t){super(e,t.theme),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender()),this.canvas.addEventListener(`click`,this.onClick),this.canvas.addEventListener(`pointermove`,this.onMove),this.applyLabel(),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition(),o=this.layoutFor;(!this.layout||!o||o.options!==this.options||o.width!==t||o.height!==r||o.theme!==i)&&(this.layout=this.compute(t,r,i,(0,n.canvasMeasure)(e,i)),this.layoutFor={options:this.options,width:t,height:r,theme:i}),this.draw(e,t,r,i,a,this.layout)}setOptions(e){this.options={...this.options,...e},`theme`in e&&this.setTheme(e.theme??`dark`),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??this.describe())}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.onClick),this.canvas.removeEventListener(`pointermove`,this.onMove),super.destroy()}},z=class extends R{compute(e,t,r,i){return(0,n.computeBarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderBarChart)(e,t,r,this.options,i,a,o)}describe(){return`Bar chart of ${this.options.series.map(e=>e.name).join(`, `)}, ${this.options.categories.length} categories`}clickable(){return this.options.onBarClick!==void 0}hits(e,t,r){return(0,n.hitBar)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitBar)(e,t,r);i&&this.options.onBarClick?.({category:i.category,series:i.series,value:i.value,index:i.index})}update(e,t){this.setOptions({categories:e,series:t})}},B=class extends R{compute(e,t,r,i){return(0,n.computeDonutLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderDonut)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.filter(e=>Number.isFinite(e.value)&&e.value>0).map(e=>e.label).join(`, `);return`${(this.options.innerRadius??.6)>0?`Donut`:`Pie`} chart of ${e}`}clickable(){return this.options.onSliceClick!==void 0}hits(e,t,r){return(0,n.hitSlice)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitSlice)(e,t,r);i&&this.options.onSliceClick?.(i.slice)}update(e){this.setOptions({data:e})}},V=class extends R{compute(e,t,r,i){return(0,n.computeScatterLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderScatter)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.series.reduce((e,t)=>e+t.points.length,0);return`Scatter chart${this.options.xLabel&&this.options.yLabel?` of ${this.options.yLabel} against ${this.options.xLabel}`:``}, ${e} points`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestPoint)(e,t,r);i&&this.options.onPointClick?.(i.point,i.series)}update(e){this.setOptions({series:e})}},H=class extends R{compute(e,t,r,i){return(0,n.computeHistogramLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderHistogram)(e,t,r,this.options,i,a,o)}describe(){return`Histogram of ${this.options.values.length} values`}clickable(){return!1}hits(){return!1}clickAt(){}update(e){this.setOptions({values:e})}},U=class extends R{compute(e,t,r,i){return(0,n.computeCalendarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCalendar)(e,t,r,this.options,i,a,o)}describe(){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];return t&&n?`Calendar of daily values from ${t} to ${n}`:`Calendar of daily values`}clickable(){return this.options.onDayClick!==void 0}hits(e,t,r){return(0,n.hitDay)(e,t,r)?.day!==void 0}clickAt(e,t,r){let i=(0,n.hitDay)(e,t,r)?.day;i&&this.options.onDayClick?.(i)}update(e){this.setOptions({data:e})}},W=12,G=class extends R{compute(e,t,r,i){return(0,n.computeMatrixLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderMatrix)(e,t,r,this.options,i,a,o)}describe(){let{rows:e,columns:t}=this.options;return t?e.length+t.length<=W?`Matrix of ${e.join(`, `)} by ${t.join(`, `)}`:`Matrix of ${e.length} rows by ${t.length} columns`:e.length<=W?`Matrix of ${e.join(`, `)}`:`Matrix of ${e.length} rows`}clickable(){return this.options.onCellClick!==void 0}hits(e,t,r){return(0,n.hitMatrixCell)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitMatrixCell)(e,t,r);i&&this.options.onCellClick?.(i.cell)}update(e){this.setOptions({values:e})}},ce=class extends R{compute(e,t,r,i){return(0,n.computeCounterClockLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCounterClock)(e,t,r,this.options,i,a,o)}describe(){return`Counter-clock chart of price against volume, ${this.options.period??25}-bar averages`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestCounterClockPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestCounterClockPoint)(e,t,r);i&&this.options.onPointClick?.(i.point)}getPhase(){return(0,n.counterClockPhase)((0,n.counterClockPoints)(this.options.data,this.options.period??25,(0,n.shownCount)(this.options)))}update(e){this.setOptions({data:e})}},le=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function K(e){return e.map(e=>({time:e.time,value:e.equity}))}function q(e){let t=-1/0;return e.map(e=>{e.equity>t&&(t=e.equity);let n=t>0?(e.equity/t-1)*100:0;return{time:e.time,value:n}})}function J(e){if(e.length===0)return[];let n=[];for(let r of e){let e=(0,t.timeframeBucketStart)(r.time,`1M`),i=n[n.length-1];i&&i.key===e?i.close=r.equity:n.push({key:e,close:r.equity})}let r=e[0].equity,i=[];for(let e of n){let t=r===0?1:r,n=(e.close/t-1)*100;r=e.close;let a=new Date(e.key),o=a.getUTCFullYear(),s=a.getUTCMonth();i.push({id:`${o}-${String(s+1).padStart(2,`0`)}`,label:le[s],group:String(o),value:n})}return i}var Y=100;function X(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function Z(e){return e>0?`positive`:e<0?`negative`:`neutral`}function Q(e){return[{label:`Total Return`,value:X(e.totalReturnPct*Y),tone:Z(e.totalReturnPct)},{label:`CAGR`,value:X(e.cagr*Y),tone:Z(e.cagr)},{label:`Sharpe`,value:e.sharpe.toFixed(2),tone:Z(e.sharpe)},{label:`Sortino`,value:e.sortino.toFixed(2),tone:Z(e.sortino)},{label:`Max Drawdown`,value:X(-Math.abs(e.maxDrawdownPct)*Y),tone:`negative`},{label:`Win Rate`,value:`${(e.winRate*Y).toFixed(1)}%`,tone:`neutral`},{label:`Profit Factor`,value:Number.isFinite(e.profitFactor)?e.profitFactor.toFixed(2):`∞`,tone:Z(e.profitFactor-1)},{label:`Trades`,value:String(e.trades),tone:`neutral`}]}function $(e){return!e||e===`dark`?t.DARK_THEME:e===`light`?t.LIGHT_THEME:e}var ue=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=$(t.theme),this.root=document.createElement(`div`),this.build(),e.appendChild(this.root)}build(){let e=this.theme,{result:t,title:n,subtitle:r}=this.options,i=this.panelBackground(),a=e.grid;if(this.root.style.cssText=[`display:flex`,`flex-direction:column`,`gap:14px`,`width:100%`,`box-sizing:border-box`,`padding:16px`,`background:${e.background}`,`color:${e.text}`,`font-family:${e.font.family}`].join(`;`),n||r){let t=document.createElement(`div`);if(n){let r=document.createElement(`div`);r.textContent=n,r.style.cssText=`font-size:${e.font.sizeLarge}px;font-weight:600;letter-spacing:-0.01em;`,t.appendChild(r)}if(r){let n=document.createElement(`div`);n.textContent=r,n.style.cssText=`font-size:${e.font.sizeSmall}px;color:${e.textSecondary};margin-top:2px;`,t.appendChild(n)}this.root.appendChild(t)}this.root.appendChild(this.buildStatsStrip(Q(t.metrics),i,a));let o=document.createElement(`div`);o.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))`,`grid-auto-rows:220px`,`gap:14px`].join(`;`),this.root.appendChild(o);let s=this.buildPanel(`Equity Curve`,i,a);s.wrap.style.gridColumn=`1 / -1`,o.appendChild(s.wrap),this.equityChart=new M(s.body,{data:K(t.equityCurve),theme:e,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let c=this.buildPanel(`Drawdown`,i,a);o.appendChild(c.wrap),this.drawdownChart=new M(c.body,{data:q(t.equityCurve),theme:e,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let l=J(t.equityCurve),u=this.buildPanel(`Monthly Returns`,i,a);o.appendChild(u.wrap),this.heatmap=new N(u.body,{data:l,theme:e,showValues:!0,valueFormat:e=>`${e>=0?`+`:``}${e.toFixed(1)}`,colorScale:{negative:e.candleDown,zero:i,positive:e.candleUp}})}buildStatsStrip(e,t,n){let r=document.createElement(`div`);r.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(120px, 1fr))`,`gap:10px`].join(`;`);let i=this.theme;for(let a of e){let e=document.createElement(`div`);e.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`padding:10px 12px`,`display:flex`,`flex-direction:column`,`gap:4px`].join(`;`);let o=document.createElement(`div`);o.textContent=a.label,o.style.cssText=`font-size:${i.font.sizeSmall}px;color:${i.textSecondary};text-transform:uppercase;letter-spacing:0.04em;`;let s=document.createElement(`div`);s.textContent=a.value;let c=a.tone===`positive`?i.candleUp:a.tone===`negative`?i.candleDown:i.text;s.style.cssText=`font-size:${i.font.sizeLarge}px;font-weight:600;color:${c};font-variant-numeric:tabular-nums;`,e.appendChild(o),e.appendChild(s),r.appendChild(e)}return r}buildPanel(e,t,n){let r=this.theme,i=document.createElement(`div`);i.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`overflow:hidden`,`display:flex`,`flex-direction:column`].join(`;`);let a=document.createElement(`div`);a.textContent=e,a.style.cssText=[`font-size:${r.font.sizeSmall}px`,`font-weight:600`,`color:${r.textSecondary}`,`padding:8px 12px`,`border-bottom:1px solid ${n}`,`text-transform:uppercase`,`letter-spacing:0.04em`].join(`;`);let o=document.createElement(`div`);return o.style.cssText=`flex:1;min-height:0;position:relative;`,i.appendChild(a),i.appendChild(o),{wrap:i,body:o}}panelBackground(){return this.theme.name===`light`?`rgba(0,0,0,0.02)`:`rgba(255,255,255,0.03)`}update(e){this.options={...this.options,result:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}setTheme(e){this.theme=$(e),this.options={...this.options,theme:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}destroyCharts(){this.equityChart?.destroy(),this.drawdownChart?.destroy(),this.heatmap?.destroy(),this.equityChart=null,this.drawdownChart=null,this.heatmap=null}destroy(){this.destroyCharts(),this.root.remove()}};Object.defineProperty(exports,`AlertManager`,{enumerable:!0,get:function(){return n.AlertManager}}),Object.defineProperty(exports,`Animator`,{enumerable:!0,get:function(){return n.Animator}}),exports.BarChart=z,Object.defineProperty(exports,`BarCountdown`,{enumerable:!0,get:function(){return n.BarCountdown}}),Object.defineProperty(exports,`BinanceAdapter`,{enumerable:!0,get:function(){return n.BinanceAdapter}}),Object.defineProperty(exports,`BybitAdapter`,{enumerable:!0,get:function(){return n.BybitAdapter}}),Object.defineProperty(exports,`CANDLE_PATTERNS`,{enumerable:!0,get:function(){return n.CANDLE_PATTERNS}}),Object.defineProperty(exports,`CHART_SPACING`,{enumerable:!0,get:function(){return t.CHART_SPACING}}),Object.defineProperty(exports,`CHART_STYLE_KEYS`,{enumerable:!0,get:function(){return t.CHART_STYLE_KEYS}}),exports.CORRECTABLE_BARS=a,exports.CalendarChart=U,exports.Chart=e.h,exports.ChartGrid=oe,Object.defineProperty(exports,`ChartLegend`,{enumerable:!0,get:function(){return n.ChartLegend}}),Object.defineProperty(exports,`ChartStateManager`,{enumerable:!0,get:function(){return n.ChartStateManager}}),Object.defineProperty(exports,`CoinbaseAdapter`,{enumerable:!0,get:function(){return n.CoinbaseAdapter}}),Object.defineProperty(exports,`CompareRenderer`,{enumerable:!0,get:function(){return n.CompareRenderer}}),exports.CounterClockChart=ce,Object.defineProperty(exports,`CrosshairTooltip`,{enumerable:!0,get:function(){return n.CrosshairTooltip}}),Object.defineProperty(exports,`CurrentPriceLine`,{enumerable:!0,get:function(){return n.CurrentPriceLine}}),Object.defineProperty(exports,`DARK_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.DARK_PRICE_LIMITS}}),Object.defineProperty(exports,`DARK_TERMINAL`,{enumerable:!0,get:function(){return t.DARK_TERMINAL}}),Object.defineProperty(exports,`DARK_THEME`,{enumerable:!0,get:function(){return t.DARK_THEME}}),Object.defineProperty(exports,`DEFAULT_DRAWING_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_DRAWING_STYLE}}),Object.defineProperty(exports,`DEFAULT_FONT_FAMILY`,{enumerable:!0,get:function(){return t.DEFAULT_FONT_FAMILY}}),exports.DEFAULT_HISTORY_PAGE_SIZE=e.k,Object.defineProperty(exports,`DEFAULT_LEGEND_CONFIG`,{enumerable:!0,get:function(){return n.DEFAULT_LEGEND_CONFIG}}),Object.defineProperty(exports,`DEFAULT_MAX_WEBGL_CHARTS`,{enumerable:!0,get:function(){return n.DEFAULT_MAX_WEBGL_CHARTS}}),Object.defineProperty(exports,`DEFAULT_RECONNECT`,{enumerable:!0,get:function(){return t.DEFAULT_RECONNECT}}),Object.defineProperty(exports,`DEFAULT_SESSION_HOURS`,{enumerable:!0,get:function(){return n.DEFAULT_SESSION_HOURS}}),Object.defineProperty(exports,`DEFAULT_SIGNAL_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_SIGNAL_STYLE}}),Object.defineProperty(exports,`DEFAULT_STREAM_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_STREAM_CONFIG}}),Object.defineProperty(exports,`DEFAULT_TIMEFRAME_FAVORITES`,{enumerable:!0,get:function(){return t.DEFAULT_TIMEFRAME_FAVORITES}}),Object.defineProperty(exports,`DEFAULT_TRADE_ZONE_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_TRADE_ZONE_STYLE}}),Object.defineProperty(exports,`DEFAULT_TRADING_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_TRADING_CONFIG}}),Object.defineProperty(exports,`DataExporter`,{enumerable:!0,get:function(){return n.DataExporter}}),exports.DataManager=e.j,exports.DepthChart=j,exports.DonutChart=B,exports.DragDropImporter=e.p,Object.defineProperty(exports,`DrawingBase`,{enumerable:!0,get:function(){return n.DrawingBase}}),exports.EXCHANGE_TIME_ZONE=e.g,Object.defineProperty(exports,`Easing`,{enumerable:!0,get:function(){return n.Easing}}),exports.EquityCurveChart=M,exports.GaugeChart=L,exports.HISTORY_RETRY_MS=e.A,Object.defineProperty(exports,`HNX_SESSIONS`,{enumerable:!0,get:function(){return t.HNX_SESSIONS}}),Object.defineProperty(exports,`HOSE_SESSIONS`,{enumerable:!0,get:function(){return t.HOSE_SESSIONS}}),exports.HeatmapChart=N,exports.HistogramChart=H,Object.defineProperty(exports,`INDICATOR_CATEGORIES`,{enumerable:!0,get:function(){return n.INDICATOR_CATEGORIES}}),Object.defineProperty(exports,`IndicatorBase`,{enumerable:!0,get:function(){return n.IndicatorBase}}),Object.defineProperty(exports,`IndicatorValueMap`,{enumerable:!0,get:function(){return n.IndicatorValueMap}}),Object.defineProperty(exports,`KEPT_BUCKETS`,{enumerable:!0,get:function(){return n.KEPT_BUCKETS}}),Object.defineProperty(exports,`KRX_SESSIONS`,{enumerable:!0,get:function(){return t.KRX_SESSIONS}}),Object.defineProperty(exports,`KR_COLORS`,{enumerable:!0,get:function(){return t.KR_COLORS}}),Object.defineProperty(exports,`KeyboardHandler`,{enumerable:!0,get:function(){return n.KeyboardHandler}}),Object.defineProperty(exports,`KrakenAdapter`,{enumerable:!0,get:function(){return n.KrakenAdapter}}),Object.defineProperty(exports,`LIGHT_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.LIGHT_PRICE_LIMITS}}),Object.defineProperty(exports,`LIGHT_THEME`,{enumerable:!0,get:function(){return t.LIGHT_THEME}}),exports.LayoutManager=e.D,exports.LayoutSession=e.t,Object.defineProperty(exports,`MARKET_CRYPTO`,{enumerable:!0,get:function(){return t.MARKET_CRYPTO}}),Object.defineProperty(exports,`MARKET_HNX`,{enumerable:!0,get:function(){return t.MARKET_HNX}}),Object.defineProperty(exports,`MARKET_HOSE`,{enumerable:!0,get:function(){return t.MARKET_HOSE}}),Object.defineProperty(exports,`MARKET_HOSE_ETF`,{enumerable:!0,get:function(){return t.MARKET_HOSE_ETF}}),Object.defineProperty(exports,`MARKET_KRX`,{enumerable:!0,get:function(){return t.MARKET_KRX}}),Object.defineProperty(exports,`MARKET_NXT`,{enumerable:!0,get:function(){return t.MARKET_NXT}}),Object.defineProperty(exports,`MARKET_NYSE`,{enumerable:!0,get:function(){return t.MARKET_NYSE}}),Object.defineProperty(exports,`MARKET_UPBIT_KRW`,{enumerable:!0,get:function(){return t.MARKET_UPBIT_KRW}}),Object.defineProperty(exports,`MARKET_UPCOM`,{enumerable:!0,get:function(){return t.MARKET_UPCOM}}),Object.defineProperty(exports,`MARKET_VN30F`,{enumerable:!0,get:function(){return t.MARKET_VN30F}}),Object.defineProperty(exports,`MAX_ALERT_BARS`,{enumerable:!0,get:function(){return n.MAX_ALERT_BARS}}),exports.MAX_LAYOUT_NAME=e.n,Object.defineProperty(exports,`MIN_ALERT_BARS`,{enumerable:!0,get:function(){return n.MIN_ALERT_BARS}}),Object.defineProperty(exports,`MS_TIME_THRESHOLD`,{enumerable:!0,get:function(){return t.MS_TIME_THRESHOLD}}),Object.defineProperty(exports,`ManualFeed`,{enumerable:!0,get:function(){return n.ManualFeed}}),exports.MatrixChart=G,Object.defineProperty(exports,`MockAdapter`,{enumerable:!0,get:function(){return n.MockAdapter}}),Object.defineProperty(exports,`NXT_SESSIONS`,{enumerable:!0,get:function(){return t.NXT_SESSIONS}}),exports.PLUGIN_API_VERSION=e.w,exports.POWERED_BY_LABEL=_,Object.defineProperty(exports,`PRICE_SOURCES`,{enumerable:!0,get:function(){return t.PRICE_SOURCES}}),Object.defineProperty(exports,`PaperExecutionAdapter`,{enumerable:!0,get:function(){return n.PaperExecutionAdapter}}),exports.PerformanceDashboard=ue,exports.PluginManager=e.y,Object.defineProperty(exports,`PollingAdapter`,{enumerable:!0,get:function(){return n.PollingAdapter}}),Object.defineProperty(exports,`RANGE_PRESETS`,{enumerable:!0,get:function(){return n.RANGE_PRESETS}}),Object.defineProperty(exports,`ReconnectManager`,{enumerable:!0,get:function(){return n.ReconnectManager}}),Object.defineProperty(exports,`ReplayController`,{enumerable:!0,get:function(){return n.ReplayController}}),Object.defineProperty(exports,`ReplayManager`,{enumerable:!0,get:function(){return n.ReplayManager}}),Object.defineProperty(exports,`ResamplingAdapter`,{enumerable:!0,get:function(){return n.ResamplingAdapter}}),Object.defineProperty(exports,`ReshapeMemo`,{enumerable:!0,get:function(){return n.ReshapeMemo}}),Object.defineProperty(exports,`SANS_FONT_FAMILY`,{enumerable:!0,get:function(){return t.SANS_FONT_FAMILY}}),exports.ScatterChart=V,Object.defineProperty(exports,`Screenshot`,{enumerable:!0,get:function(){return n.Screenshot}}),Object.defineProperty(exports,`SessionBreaks`,{enumerable:!0,get:function(){return n.SessionBreaks}}),Object.defineProperty(exports,`SessionShading`,{enumerable:!0,get:function(){return n.SessionShading}}),Object.defineProperty(exports,`SignalMarkerManager`,{enumerable:!0,get:function(){return n.SignalMarkerManager}}),exports.SparklineChart=se,Object.defineProperty(exports,`StreamManager`,{enumerable:!0,get:function(){return n.StreamManager}}),Object.defineProperty(exports,`TC_PALETTE`,{enumerable:!0,get:function(){return t.TC_PALETTE}}),Object.defineProperty(exports,`TC_SERIES_COLORS`,{enumerable:!0,get:function(){return t.TC_SERIES_COLORS}}),Object.defineProperty(exports,`TIMEFRAMES_CRYPTO`,{enumerable:!0,get:function(){return t.TIMEFRAMES_CRYPTO}}),Object.defineProperty(exports,`TIMEFRAMES_FOREX`,{enumerable:!0,get:function(){return t.TIMEFRAMES_FOREX}}),Object.defineProperty(exports,`TIMEFRAMES_STOCK`,{enumerable:!0,get:function(){return t.TIMEFRAMES_STOCK}}),exports.TRADECANVAS_MARK_SVG=v,exports.TRADECANVAS_URL=g,exports.TRADECANVAS_WORDMARK_SVG=y,exports.ThemeManager=e.O,Object.defineProperty(exports,`TickAggregator`,{enumerable:!0,get:function(){return n.TickAggregator}}),Object.defineProperty(exports,`TickBarAdapter`,{enumerable:!0,get:function(){return n.TickBarAdapter}}),Object.defineProperty(exports,`TickBarBuilder`,{enumerable:!0,get:function(){return n.TickBarBuilder}}),Object.defineProperty(exports,`TradeZoneManager`,{enumerable:!0,get:function(){return n.TradeZoneManager}}),Object.defineProperty(exports,`UPCOM_SESSIONS`,{enumerable:!0,get:function(){return t.UPCOM_SESSIONS}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`UpbitAdapter`,{enumerable:!0,get:function(){return n.UpbitAdapter}}),Object.defineProperty(exports,`VN30F_SESSIONS`,{enumerable:!0,get:function(){return t.VN30F_SESSIONS}}),Object.defineProperty(exports,`VN_COLORS`,{enumerable:!0,get:function(){return t.VN_COLORS}}),Object.defineProperty(exports,`VOLUME_ALPHA`,{enumerable:!0,get:function(){return t.VOLUME_ALPHA}}),Object.defineProperty(exports,`VolumeRenderer`,{enumerable:!0,get:function(){return n.VolumeRenderer}}),exports.WaterfallChart=P,Object.defineProperty(exports,`Watermark`,{enumerable:!0,get:function(){return n.Watermark}}),Object.defineProperty(exports,`WebSocketAdapter`,{enumerable:!0,get:function(){return n.WebSocketAdapter}}),Object.defineProperty(exports,`adapterFromFeed`,{enumerable:!0,get:function(){return n.adapterFromFeed}}),Object.defineProperty(exports,`axisTimes`,{enumerable:!0,get:function(){return n.axisTimes}}),Object.defineProperty(exports,`barIndexToX`,{enumerable:!0,get:function(){return n.barIndexToX}}),Object.defineProperty(exports,`barTimeUnit`,{enumerable:!0,get:function(){return t.barTimeUnit}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.b,exports.computeDrawdownCurve=q,exports.computeMonthlyReturns=J,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`contrastRatio`,{enumerable:!0,get:function(){return t.contrastRatio}}),Object.defineProperty(exports,`correlationMatrix`,{enumerable:!0,get:function(){return n.correlationMatrix}}),Object.defineProperty(exports,`counterClockPhase`,{enumerable:!0,get:function(){return n.counterClockPhase}}),Object.defineProperty(exports,`counterClockPoints`,{enumerable:!0,get:function(){return n.counterClockPoints}}),Object.defineProperty(exports,`createMarketTheme`,{enumerable:!0,get:function(){return t.createMarketTheme}}),exports.createPoweredBy=ie,Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`describeInputs`,{enumerable:!0,get:function(){return n.describeInputs}}),Object.defineProperty(exports,`detectCandlePatterns`,{enumerable:!0,get:function(){return n.detectCandlePatterns}}),exports.feedBars=h,Object.defineProperty(exports,`feedFromAdapter`,{enumerable:!0,get:function(){return n.feedFromAdapter}}),Object.defineProperty(exports,`formatFraction`,{enumerable:!0,get:function(){return t.formatFraction}}),Object.defineProperty(exports,`formatNumber`,{enumerable:!0,get:function(){return t.formatNumber}}),Object.defineProperty(exports,`formatTooltipTime`,{enumerable:!0,get:function(){return n.formatTooltipTime}}),Object.defineProperty(exports,`formatVND`,{enumerable:!0,get:function(){return t.formatVND}}),Object.defineProperty(exports,`formatVolumeLoc`,{enumerable:!0,get:function(){return t.formatVolumeLoc}}),Object.defineProperty(exports,`fractionTick`,{enumerable:!0,get:function(){return t.fractionTick}}),Object.defineProperty(exports,`getCurrentSession`,{enumerable:!0,get:function(){return t.getCurrentSession}}),exports.getGlobalPlugins=e.x,Object.defineProperty(exports,`getLocale`,{enumerable:!0,get:function(){return t.getLocale}}),Object.defineProperty(exports,`histogramBins`,{enumerable:!0,get:function(){return n.histogramBins}}),Object.defineProperty(exports,`indicatorCategory`,{enumerable:!0,get:function(){return n.indicatorCategory}}),Object.defineProperty(exports,`indicatorSource`,{enumerable:!0,get:function(){return t.indicatorSource}}),Object.defineProperty(exports,`inkOn`,{enumerable:!0,get:function(){return t.inkOn}}),Object.defineProperty(exports,`isDataFeed`,{enumerable:!0,get:function(){return n.isDataFeed}}),Object.defineProperty(exports,`isPriceLevelAlert`,{enumerable:!0,get:function(){return n.isPriceLevelAlert}}),Object.defineProperty(exports,`isPriceSource`,{enumerable:!0,get:function(){return t.isPriceSource}}),Object.defineProperty(exports,`isTimeFrame`,{enumerable:!0,get:function(){return t.isTimeFrame}}),Object.defineProperty(exports,`isValidTimeZone`,{enumerable:!0,get:function(){return t.isValidTimeZone}}),exports.localStorageLayouts=e.i,Object.defineProperty(exports,`lttbDownsample`,{enumerable:!0,get:function(){return n.lttbDownsample}}),Object.defineProperty(exports,`lttbVisibleIndices`,{enumerable:!0,get:function(){return n.lttbVisibleIndices}}),Object.defineProperty(exports,`marketStatus`,{enumerable:!0,get:function(){return t.marketStatus}}),exports.memoryLayouts=e.a,Object.defineProperty(exports,`niceScale`,{enumerable:!0,get:function(){return n.niceScale}}),Object.defineProperty(exports,`normalizeBar`,{enumerable:!0,get:function(){return t.normalizeBar}}),Object.defineProperty(exports,`normalizeBarTime`,{enumerable:!0,get:function(){return t.normalizeBarTime}}),Object.defineProperty(exports,`offsetAt`,{enumerable:!0,get:function(){return t.offsetAt}}),exports.opensElsewhere=O,exports.overlayScale=ae,exports.overlaysForLayer=e.T,Object.defineProperty(exports,`parseIndicatorSource`,{enumerable:!0,get:function(){return t.parseIndicatorSource}}),exports.parseOHLCV=e.m,Object.defineProperty(exports,`parseTimeframe`,{enumerable:!0,get:function(){return t.parseTimeframe}}),Object.defineProperty(exports,`pickBaseTimeframe`,{enumerable:!0,get:function(){return t.pickBaseTimeframe}}),exports.pluginKey=e.E,exports.poweredByHtml=A,exports.poweredByLayout=w,Object.defineProperty(exports,`priceFormatterFor`,{enumerable:!0,get:function(){return t.priceFormatterFor}}),Object.defineProperty(exports,`priceStepAt`,{enumerable:!0,get:function(){return t.priceStepAt}}),Object.defineProperty(exports,`priceToY`,{enumerable:!0,get:function(){return n.priceToY}}),Object.defineProperty(exports,`priceToYMapper`,{enumerable:!0,get:function(){return n.priceToYMapper}}),Object.defineProperty(exports,`rangePresetStart`,{enumerable:!0,get:function(){return n.rangePresetStart}}),Object.defineProperty(exports,`rankSymbols`,{enumerable:!0,get:function(){return t.rankSymbols}}),Object.defineProperty(exports,`readNews`,{enumerable:!0,get:function(){return t.readNews}}),Object.defineProperty(exports,`readQuote`,{enumerable:!0,get:function(){return t.readQuote}}),Object.defineProperty(exports,`readableOn`,{enumerable:!0,get:function(){return t.readableOn}}),Object.defineProperty(exports,`registerLocale`,{enumerable:!0,get:function(){return t.registerLocale}}),exports.registerPlugin=e.S,Object.defineProperty(exports,`resampleBars`,{enumerable:!0,get:function(){return t.resampleBars}}),Object.defineProperty(exports,`roundToPriceStep`,{enumerable:!0,get:function(){return t.roundToPriceStep}}),exports.safeBadgeHref=D,Object.defineProperty(exports,`scaleMarketPrices`,{enumerable:!0,get:function(){return t.scaleMarketPrices}}),exports.selectKeyStats=Q,Object.defineProperty(exports,`servesTimeframe`,{enumerable:!0,get:function(){return n.servesTimeframe}}),Object.defineProperty(exports,`setLocale`,{enumerable:!0,get:function(){return t.setLocale}}),Object.defineProperty(exports,`setMaxWebGLCharts`,{enumerable:!0,get:function(){return n.setMaxWebGLCharts}}),Object.defineProperty(exports,`sourcePrice`,{enumerable:!0,get:function(){return t.sourcePrice}}),Object.defineProperty(exports,`stepDecimals`,{enumerable:!0,get:function(){return t.stepDecimals}}),Object.defineProperty(exports,`symbolTimeZone`,{enumerable:!0,get:function(){return t.symbolTimeZone}}),exports.syncIndicators=i,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`tickBarCount`,{enumerable:!0,get:function(){return t.tickBarCount}}),Object.defineProperty(exports,`tickerOf`,{enumerable:!0,get:function(){return t.tickerOf}}),Object.defineProperty(exports,`timeToX`,{enumerable:!0,get:function(){return n.timeToX}}),Object.defineProperty(exports,`timeframeBucketStart`,{enumerable:!0,get:function(){return t.timeframeBucketStart}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),Object.defineProperty(exports,`timestampToBarIndex`,{enumerable:!0,get:function(){return n.timestampToBarIndex}}),exports.toEquityPoints=K,Object.defineProperty(exports,`toHeikinAshi`,{enumerable:!0,get:function(){return n.toHeikinAshi}}),Object.defineProperty(exports,`toKagi`,{enumerable:!0,get:function(){return n.toKagi}}),Object.defineProperty(exports,`toLineBreak`,{enumerable:!0,get:function(){return n.toLineBreak}}),Object.defineProperty(exports,`toPointAndFigure`,{enumerable:!0,get:function(){return n.toPointAndFigure}}),Object.defineProperty(exports,`toRangeBars`,{enumerable:!0,get:function(){return n.toRangeBars}}),Object.defineProperty(exports,`toRenko`,{enumerable:!0,get:function(){return n.toRenko}}),exports.unregisterPlugin=e.C,Object.defineProperty(exports,`usesKoreanUnits`,{enumerable:!0,get:function(){return t.usesKoreanUnits}}),Object.defineProperty(exports,`vn30fContracts`,{enumerable:!0,get:function(){return t.vn30fContracts}}),Object.defineProperty(exports,`vn30fLastTradingDay`,{enumerable:!0,get:function(){return t.vn30fLastTradingDay}}),Object.defineProperty(exports,`volumeColor`,{enumerable:!0,get:function(){return t.volumeColor}}),Object.defineProperty(exports,`wallToUtc`,{enumerable:!0,get:function(){return t.wallToUtc}}),Object.defineProperty(exports,`withResampling`,{enumerable:!0,get:function(){return n.withResampling}}),Object.defineProperty(exports,`withTickBars`,{enumerable:!0,get:function(){return n.withTickBars}}),Object.defineProperty(exports,`xToBarIndex`,{enumerable:!0,get:function(){return n.xToBarIndex}}),Object.defineProperty(exports,`xToTime`,{enumerable:!0,get:function(){return n.xToTime}}),Object.defineProperty(exports,`yToPrice`,{enumerable:!0,get:function(){return n.yToPrice}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./LayoutSession-Dv9lhmSU.cjs`);let t=require(`@tradecanvas/commons`),n=require(`@tradecanvas/core`);function r(e){let{id:t,params:n={},position:r=null}=typeof e==`string`?{id:e}:e;return JSON.stringify([t,Object.keys(n).sort().map(e=>[e,n[e]]),r])}function i(e,t,n){let i=new Map,a=t.map(e=>{let t=r(e),n=i.get(t)??0;return i.set(t,n+1),{spec:e,key:`${t}#${n}`}}),o=new Set(a.map(e=>e.key));for(let[t,r]of[...n])o.has(t)||(e.removeIndicator(r),n.delete(t));for(let{spec:t,key:r}of a){if(n.has(r))continue;let i=typeof t==`string`?e.addIndicator(t):t.position===void 0?e.addIndicator(t.id,t.params??{}):e.addIndicator(t.id,t.params??{},t.position);i&&n.set(r,i)}}var a=3,o=e=>({time:e.time,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}),s=e=>e.length>0?e[e.length-1]:null;function c(t,n,r){for(let i=0;i<r;i++)if(!e.N(t[i],n[i]))return!1;return!0}function l(e,t){if(e.isReplayActive())return!0;let n=s(e.getData());return t.inReplay?n?.time===t.last?.time:n===t.shownBar?n?.time===t.last?.time||!e.isExtendedHoursVisible():!1}function u(t,n,r){let i=[];for(let a=0;a<n.length;a++){let s=t[r+a];if(!e.N(s,n[a])){if(s.time!==n[a].time||!e.M(s))return null;i.push(o(s))}}return i}function d(e,t){if(t.length===0)return!0;if(!e.updateBar)return!1;for(let n of t)if(!e.updateBar(n))return!1;return!0}function f(e){return e.slice(Math.max(1,e.length-1-3),-1).map(o)}function p(t,n){let r=[];for(let i=n;i<t.length;i++){if(!e.M(t[i])||!(t[i].time>t[i-1].time))return null;r.push(o(t[i]))}return r}function m(t,n,r){let i=r.length;if(i===0||!r.last||!e.M(r.last)||n.length<i||!l(t,r))return!1;let a=r.recent??[],s=i-1-a.length;if(n!==r.source&&(r.source.length!==i||!c(r.source,n,s)))return!1;let f=n[i-1];if(f.time!==r.last.time||!e.M(f))return!1;let m=u(n,a,s),h=p(n,i);return!m||!h||!d(t,m)?!1:(e.N(f,r.last)||t.updateLastBar(o(f)),h.length===1?t.appendBar(h[0]):h.length>1&&t.appendBars(h),!0)}function h(e,t,n){(!n||!m(e,t,n))&&e.setData(t.map(o));let r=t.length>0?o(t[t.length-1]):null,i=e.isReplayActive();return{source:t,length:t.length,last:r,recent:f(t),shownBar:i?null:s(e.getData()),inReplay:i}}var g=`https://tradecanvas.dev`,_=`Powered by TradeCanvas`,v=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" aria-hidden="true" focusable="false"><path d="M186 70A82 82 0 1 0 186 186" fill="none" stroke="currentColor" stroke-width="22" stroke-linecap="round"/><rect x="92" y="74" width="72" height="20" rx="10" fill="currentColor"/><path fill="#E8961E" d="M119 94H137V108H144a10 10 0 0 1 10 10V164a10 10 0 0 1-10 10H137V190H119V174H112a10 10 0 0 1-10-10V118a10 10 0 0 1 10-10H119Z"/></svg>`,y=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 16 686 88" aria-hidden="true" focusable="false"><path fill="currentColor" transform="translate(0 101.64)" d="M27.24 0.00L27.24 -69.72L1.32 -69.72L1.32 -83.64L68.76 -83.64L68.76 -69.72L42.96 -69.72L42.96 0.00ZM70.90 0.00L70.90 -59.16L85.90 -59.16L85.90 -50.64Q86.26 -51.36 86.74 -51.96Q89.50 -55.92 93.52 -58.14Q97.54 -60.36 101.74 -60.36Q104.74 -60.36 107.44 -59.58Q110.14 -58.80 113.02 -57.00L105.82 -43.56Q104.50 -44.28 102.46 -44.88Q100.42 -45.48 98.38 -45.48Q95.98 -45.48 93.76 -44.64Q91.54 -43.80 89.80 -42.00Q88.06 -40.20 86.98 -37.20Q86.50 -35.52 86.20 -32.94Q85.90 -30.36 85.90 -25.44L85.90 0.00ZM156.44 0.00L155.36 -7.56Q155.00 -6.96 154.52 -6.36Q151.28 -2.40 147.20 -0.60Q143.12 1.20 138.56 1.20Q132.08 1.20 126.98 -1.20Q121.88 -3.60 118.94 -8.04Q116.00 -12.48 116.00 -18.24Q116.00 -23.40 118.10 -27.06Q120.20 -30.72 123.68 -32.64Q126.68 -34.44 130.34 -35.16Q134.00 -35.88 138.20 -35.88L155.24 -35.88L155.24 -37.32Q155.24 -42.60 151.94 -45.18Q148.64 -47.76 143.00 -47.76Q138.32 -47.76 133.46 -45.90Q128.60 -44.04 124.88 -40.68L117.32 -50.88Q123.56 -55.92 130.10 -58.14Q136.64 -60.36 144.20 -60.36Q156.44 -60.36 163.28 -54.24Q170.12 -48.12 170.12 -37.32L170.12 0.00ZM155.24 -24.84L140.36 -24.84Q138.44 -24.84 136.58 -24.54Q134.72 -24.24 133.40 -23.16Q132.20 -22.32 131.60 -21.06Q131.00 -19.80 131.00 -18.24Q131.00 -14.88 133.64 -12.84Q136.28 -10.80 140.72 -10.80Q144.68 -10.80 147.98 -12.54Q151.28 -14.28 153.26 -17.34Q155.24 -20.40 155.24 -24.36ZM202.98 1.20Q195.18 1.20 189.54 -2.82Q183.90 -6.84 180.84 -13.86Q177.78 -20.88 177.78 -29.64Q177.78 -39.36 181.20 -46.20Q184.62 -53.04 190.38 -56.70Q196.14 -60.36 202.98 -60.36Q207.78 -60.36 211.92 -58.38Q216.06 -56.40 219.06 -52.44Q219.54 -51.72 220.02 -51.00L220.02 -83.64L234.78 -83.64L234.78 0.00L220.02 0.00L220.02 -8.04Q219.54 -7.20 218.94 -6.48Q215.70 -2.28 211.56 -0.54Q207.42 1.20 202.98 1.20ZM207.06 -12.48Q211.50 -12.48 214.68 -14.64Q217.86 -16.80 219.60 -20.64Q221.34 -24.48 221.34 -29.64Q221.34 -34.80 219.60 -38.64Q217.86 -42.48 214.68 -44.58Q211.50 -46.68 207.06 -46.68Q202.74 -46.68 199.50 -44.58Q196.26 -42.48 194.52 -38.70Q192.78 -34.92 192.78 -29.64Q192.78 -24.36 194.52 -20.52Q196.26 -16.68 199.50 -14.58Q202.74 -12.48 207.06 -12.48ZM272.32 1.20Q264.64 1.20 259.12 -1.32Q253.60 -3.84 250.06 -8.10Q246.52 -12.36 244.84 -17.82Q243.16 -23.28 243.16 -29.28Q243.16 -35.04 244.84 -40.56Q246.52 -46.08 249.88 -50.52Q253.24 -54.96 258.58 -57.66Q263.92 -60.36 271.36 -60.36Q278.32 -60.36 283.48 -58.02Q288.64 -55.68 292.00 -51.54Q295.36 -47.40 297.10 -41.88Q298.84 -36.36 298.84 -30.12Q298.84 -29.28 298.78 -27.78Q298.72 -26.28 298.48 -24.60L258.04 -24.60Q258.64 -18.24 262.78 -15.00Q266.92 -11.76 273.16 -11.76Q277.72 -11.76 282.04 -13.38Q286.36 -15.00 289.72 -18.00L297.16 -7.92Q292.96 -4.68 289.24 -2.64Q285.52 -0.60 281.50 0.30Q277.48 1.20 272.32 1.20ZM284.68 -35.64Q284.68 -35.76 284.68 -35.76Q284.68 -38.28 283.72 -40.50Q282.76 -42.72 281.08 -44.40Q279.40 -46.08 277.06 -46.98Q274.72 -47.88 271.72 -47.88Q267.28 -47.88 264.28 -46.08Q261.28 -44.28 259.78 -41.46Q258.28 -38.64 257.92 -35.64ZM346.66 1.56Q335.02 1.56 326.20 -3.84Q317.38 -9.24 312.46 -19.08Q307.54 -28.92 307.54 -41.88Q307.54 -54.84 312.46 -64.62Q317.38 -74.40 326.20 -79.80Q335.02 -85.20 346.66 -85.20Q359.50 -85.20 368.92 -78.84Q378.34 -72.48 382.42 -61.20L371.02 -57.00Q368.02 -64.80 361.78 -69.18Q355.54 -73.56 346.66 -73.56Q338.50 -73.56 332.44 -69.66Q326.38 -65.76 323.08 -58.74Q319.78 -51.72 319.78 -41.88Q319.78 -32.04 323.08 -24.96Q326.38 -17.88 332.44 -13.98Q338.50 -10.08 346.66 -10.08Q355.54 -10.08 361.78 -14.46Q368.02 -18.84 371.02 -26.64L382.42 -22.56Q378.34 -11.40 368.92 -4.92Q359.50 1.56 346.66 1.56ZM429.04 0.00L428.32 -8.64Q428.20 -8.52 428.08 -8.40Q424.96 -3.72 420.34 -1.32Q415.72 1.08 409.96 1.08Q403.36 1.08 398.32 -1.32Q393.28 -3.72 390.52 -7.98Q387.76 -12.24 387.76 -17.88Q387.76 -22.80 389.80 -26.34Q391.84 -29.88 395.08 -31.80Q398.08 -33.72 401.98 -34.50Q405.88 -35.28 410.32 -35.28L428.08 -35.28L428.08 -37.20Q428.08 -43.44 424.48 -46.80Q420.88 -50.16 414.04 -50.16Q409.24 -50.16 404.86 -48.24Q400.48 -46.32 396.52 -42.00L389.20 -49.56Q394.48 -55.08 400.90 -57.66Q407.32 -60.24 414.88 -60.24Q426.76 -60.24 433.30 -54.18Q439.84 -48.12 439.84 -37.20L439.84 0.00ZM428.08 -26.40L412.00 -26.40Q409.60 -26.40 407.02 -25.98Q404.44 -25.56 402.64 -24.24Q401.20 -23.16 400.36 -21.54Q399.52 -19.92 399.52 -17.76Q399.52 -13.56 402.76 -11.04Q406.00 -8.52 411.40 -8.52Q415.96 -8.52 419.74 -10.62Q423.52 -12.72 425.80 -16.38Q428.08 -20.04 428.08 -24.72ZM451.94 0.00L451.94 -59.16L463.82 -59.16L463.82 -50.88Q464.78 -52.44 465.98 -53.76Q468.86 -56.88 472.88 -58.56Q476.90 -60.24 481.58 -60.24Q491.42 -60.24 497.00 -54.54Q502.58 -48.84 502.58 -37.92L502.58 0.00L490.82 0.00L490.82 -33.60Q490.82 -42.12 487.76 -46.08Q484.70 -50.04 478.34 -50.04Q473.54 -50.04 470.36 -47.88Q467.18 -45.72 465.50 -41.04Q463.82 -36.36 463.82 -29.16L463.82 0.00ZM533.28 0.00L509.04 -59.16L522.00 -59.16L538.08 -15.24L554.40 -59.16L567.12 -59.16L543.12 0.00ZM610.56 0.00L609.84 -8.64Q609.72 -8.52 609.60 -8.40Q606.48 -3.72 601.86 -1.32Q597.24 1.08 591.48 1.08Q584.88 1.08 579.84 -1.32Q574.80 -3.72 572.04 -7.98Q569.28 -12.24 569.28 -17.88Q569.28 -22.80 571.32 -26.34Q573.36 -29.88 576.60 -31.80Q579.60 -33.72 583.50 -34.50Q587.40 -35.28 591.84 -35.28L609.60 -35.28L609.60 -37.20Q609.60 -43.44 606.00 -46.80Q602.40 -50.16 595.56 -50.16Q590.76 -50.16 586.38 -48.24Q582.00 -46.32 578.04 -42.00L570.72 -49.56Q576.00 -55.08 582.42 -57.66Q588.84 -60.24 596.40 -60.24Q608.28 -60.24 614.82 -54.18Q621.36 -48.12 621.36 -37.20L621.36 0.00ZM609.60 -26.40L593.52 -26.40Q591.12 -26.40 588.54 -25.98Q585.96 -25.56 584.16 -24.24Q582.72 -23.16 581.88 -21.54Q581.04 -19.92 581.04 -17.76Q581.04 -13.56 584.28 -11.04Q587.52 -8.52 592.92 -8.52Q597.48 -8.52 601.26 -10.62Q605.04 -12.72 607.32 -16.38Q609.60 -20.04 609.60 -24.72ZM653.38 1.08Q647.14 1.08 642.34 -0.78Q637.54 -2.64 634.12 -5.58Q630.70 -8.52 628.66 -11.64L636.70 -18.60Q638.98 -14.52 643.24 -11.58Q647.50 -8.64 653.50 -8.64Q658.78 -8.64 661.84 -10.86Q664.90 -13.08 664.90 -16.68Q664.90 -19.56 662.98 -21.30Q661.06 -23.04 657.94 -24.18Q654.82 -25.32 651.10 -26.16Q647.74 -27.12 644.26 -28.32Q640.78 -29.52 637.96 -31.38Q635.14 -33.24 633.40 -36.18Q631.66 -39.12 631.66 -43.44Q631.66 -51.00 637.48 -55.62Q643.30 -60.24 652.90 -60.24Q659.74 -60.24 665.38 -57.42Q671.02 -54.60 674.14 -49.08L666.82 -43.44Q664.42 -47.40 660.64 -49.20Q656.86 -51.00 652.42 -51.00Q648.22 -51.00 645.40 -49.26Q642.58 -47.52 642.58 -44.52Q642.58 -42.36 643.84 -40.98Q645.10 -39.60 647.80 -38.58Q650.50 -37.56 654.46 -36.60Q658.18 -35.76 662.02 -34.56Q665.86 -33.36 669.10 -31.44Q672.34 -29.52 674.38 -26.28Q676.42 -23.04 676.42 -17.88Q676.42 -12.24 673.54 -7.98Q670.66 -3.72 665.50 -1.32Q660.34 1.08 653.38 1.08Z"/></svg>`,ee=12,b=16,te=.58,x=10,S=.56,C=686/88,ne=83.64/88,re=.25;function w(e=b){let t=Number.isFinite(e)?Math.max(ee,e):b,n=T(t*S/ne);return{height:t,fontSize:T(Math.max(x,t*te)),gap:T(t*re),wordmarkWidth:T(n*C),wordmarkHeight:n}}function T(e){return Math.round(e*10)/10}function E(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function D(e){return e&&(/^(https?:)?\/\//i.test(e)||e.startsWith(`/`))?e:g}function O(e){return!!e&&!/^_(self|parent|top)$/i.test(e)}function k(e,t,n){return e.replace(`<svg `,`<svg width="${t}" height="${n}" style="display:block;flex:none" `)}function A(e={}){let t=w(e.height),n=E(D(e.href)),r=e.target??`_blank`;return`<a class="tc-powered-by" href="${n}"${r?` target="${E(r)}"${O(r)?` rel="noopener noreferrer"`:``}`:``} aria-label="${_}" style="${`display:inline-flex;align-items:center;gap:${t.gap}px;height:${t.height}px;color:inherit;text-decoration:none;font-size:${t.fontSize}px;line-height:1;white-space:nowrap`}"><span aria-hidden="true">Powered by</span>`+k(v,t.height,t.height)+k(y,t.wordmarkWidth,t.wordmarkHeight)+`</a>`}function j(e={},t=document){let n=t.createElement(`div`);return n.innerHTML=A(e),n.firstElementChild}function ie(e){let{viewport:t,data:r}=e,i=(0,n.priceToYMapper)(t),a=r.length-1,o=Math.max(0,Math.floor(t.visibleRange.from)),s=Math.min(a,Math.ceil(t.visibleRange.to)),c=e=>r.length>0?(0,n.timestampToBarIndex)(e,r):e;return{timeToX:e=>(0,n.barIndexToX)(c(e),t),xToTime:e=>{let i=(0,n.xToBarIndex)(e,t);return r.length>0?(0,n.barIndexToTime)(i,r):i},indexToX:e=>(0,n.barIndexToX)(e,t),xToIndex:e=>(0,n.xToBarIndex)(e,t),priceToY:i,yToPrice:e=>(0,n.yToPrice)(e,t),barWidth:t.barWidth,visible:s<o?{from:0,to:-1}:{from:o,to:s}}}var ae=class{root;cells=[];layout;options;destroyed=!1;syncing=!1;constructor(t,n={}){this.options=n,this.layout=e.d(n.layout)?n.layout:`2x2`,this.root=document.createElement(`div`),this.root.style.cssText=`display:grid;width:100%;height:100%;overflow:hidden;`,t.appendChild(this.root),this.applyLayout(),this.createCells()}applyLayout(){let{cols:t,rows:n}=e.s[this.layout],r=this.options.gap??1;this.root.style.gridTemplateColumns=`repeat(${t}, minmax(0, 1fr))`,this.root.style.gridTemplateRows=`repeat(${n}, minmax(0, 1fr))`,this.root.style.gap=`${r}px`,this.placeCells()}placeCells(){let t=e.c(e.s[this.layout]);this.cells.forEach((n,r)=>e.f(n.container,t[r]))}createCells(){let t=e.l(e.s[this.layout]);for(let e=0;e<t;e++)this.cells.push(this.createCell(e));this.placeCells()}createCell(t){let n=this.options.cells?.[t]??{},r=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden;min-width:0;min-height:0;`,this.root.appendChild(r);let i=new e.h(r,{chartType:`candlestick`,autoScale:!0,features:{crosshair:!0,keyboard:!0,volume:!0,legend:!0,priceAxis:!0,timeAxis:!0,grid:!0},...this.options.chartOptions,...n.chartOptions,theme:this.options.theme}),a={container:r,chart:i,symbol:n.symbol??`Chart ${t+1}`,timeframe:n.timeframe??`5m`};return this.options.syncCrosshair!==!1&&(i.on(`crosshairMove`,e=>{let t=e.payload.bar?.time;if(t!==void 0)for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(t)}),i.on(`crosshairLeave`,()=>{for(let e of this.cells)e.chart!==i&&e.chart.setCrosshairTime(null)})),this.options.syncTimeAxis!==!1&&i.on(`visibleRangeChange`,e=>{if(this.syncing)return;this.syncing=!0;let{from:t,to:n}=e.payload,r=i.getData();if(r.length>0&&t>=0&&n<r.length){let e=r[t]?.time,a=r[n]?.time;if(e&&a)for(let t of this.cells)t.chart!==i&&t.chart.setVisibleRange(e,a)}this.syncing=!1}),a}setLayout(t){if(t===this.layout||!e.d(t))return;let n=this.cells.length,r=e.l(e.s[t]);if(r<n)for(let e=n-1;e>=r;e--){let t=this.cells[e];t.chart.destroy(),t.container.remove(),this.cells.pop()}this.layout=t,this.applyLayout();for(let e=n;e<r;e++)this.cells.push(this.createCell(e));this.placeCells()}getLayout(){return this.layout}getChart(e){return this.cells[e]?.chart??null}getCharts(){return this.cells.map(e=>e.chart)}getCellCount(){return this.cells.length}setData(e,t){this.cells[e]?.chart.setData(t)}setAllData(e){for(let t of this.cells)t.chart.setData(e)}async connectCell(e,t){let n=this.cells[e];n&&(n.symbol=t.symbol,n.timeframe=t.timeframe,await n.chart.connect(t))}async connectAll(e,t,r,i=500){let a=[];for(let o=0;o<this.cells.length&&o<t.length;o++)a.push(this.connectCell(o,{...typeof e==`function`?{adapter:e(t[o],o)}:(0,n.isDataFeed)(e)?{feed:e}:{adapter:e},symbol:t[o],timeframe:r,historyLimit:i}));await Promise.all(a)}setTheme(e){for(let t of this.cells)t.chart.setTheme(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(let e of this.cells)e.chart.destroy(),e.container.remove();this.cells=[],this.root.remove()}}},oe=class extends n.BaseFinanceChart{options;constructor(e,t){super(e,t.theme,t.font),this.options=t,this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??`Sparkline of ${this.options.data.length} points`)}renderChart(e,t,r,i){(0,n.renderSparkline)(e,t,r,this.options,i)}update(e){this.options={...this.options,data:e},this.applyLabel(),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions({...e,ariaLabel:void 0}),this.applyLabel(),this.requestRender()}},se=class extends n.BaseFinanceChart{options;crosshair;constructor(e,t){super(e,t.theme,t.font),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??`Depth chart of ${this.options.data.bids.length} bids and ${this.options.data.asks.length} asks`)}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderDepthChart)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.applyLabel(),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions({...e,ariaLabel:void 0}),this.applyLabel(),this.requestRender()}destroy(){this.crosshair.destroy(),super.destroy()}},M=class extends n.BaseFinanceChart{options;crosshair;constructor(e,t){super(e,t.theme,t.font),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??`Equity curve of ${this.options.data.length} points`)}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderEquityCurve)(e,t,r,this.options,i,a)}update(e,t){this.options={...this.options,data:e},t!==void 0&&(this.options={...this.options,benchmark:t}),this.applyLabel(),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions({...e,ariaLabel:void 0}),this.applyLabel(),this.requestRender()}destroy(){this.crosshair.destroy(),super.destroy()}},N=class extends n.BaseFinanceChart{options;crosshair;cachedRects=[];cachedGroups=[];currentData=[];lastLayoutWidth=0;lastLayoutHeight=0;handleClick=e=>{let t=this.canvas.getBoundingClientRect();this.onCanvasClick(e.clientX-t.left,e.clientY-t.top)};constructor(e,t){super(e,t.theme,t.font),this.options=t,this.currentData=t.data??[],this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.canvas.addEventListener(`click`,this.handleClick),this.applyLabel(),this.recomputeLayout(),this.requestRender()}applyLabel(){let e=new Set(this.currentData.map(e=>e.group).filter(Boolean)).size,t=this.options.grouped&&e>0?`Market map of ${this.currentData.length} cells in ${e} groups`:`Heatmap of ${this.currentData.length} cells`;this.setLabel(this.options.ariaLabel??t)}recomputeLayout(){let e={x:0,y:0,width:this.width,height:this.height},t=this.options.cellPadding??2;if(this.lastLayoutWidth=this.width,this.lastLayoutHeight=this.height,this.cachedGroups=[],this.options.grouped){let{groups:r,cells:i}=(0,n.layoutGroupedTreemap)(this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1),group:e.group,value:e.value})),e,t,n.GROUP_HEADER);this.cachedRects=i,this.cachedGroups=r}else if(this.options.weighted){let r=this.currentData.map(e=>({id:e.id,weight:e.weight??(Math.abs(e.value)||1)}));this.cachedRects=(0,n.layoutSquarifiedTreemap)(r,e,t)}else this.cachedRects=(0,n.layoutUniformGrid)(this.currentData.map(e=>({id:e.id})),e,t)}onCanvasClick(e,t){if(this.options.onCellClick)for(let n of this.cachedRects){let r=n.rect;if(e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height){let e=this.currentData.find(e=>e.id===n.id);e&&this.options.onCellClick(e);return}}}renderChart(e,t,r,i){(t!==this.lastLayoutWidth||r!==this.lastLayoutHeight)&&this.recomputeLayout();let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderHeatmap)(e,t,r,this.currentData,this.cachedRects,this.options,i,a,this.cachedGroups)}update(e){this.currentData=e,this.options={...this.options,data:e},this.applyLabel(),this.recomputeLayout(),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions({...`theme`in e?{theme:e.theme}:{},...`font`in e?{font:e.font}:{}}),e.data&&(this.currentData=e.data),this.applyLabel(),this.recomputeLayout(),this.requestRender()}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.handleClick),super.destroy()}},ce=class extends n.BaseFinanceChart{options;crosshair;constructor(e,t){super(e,t.theme,t.font),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>{this.options.crosshair!==!1&&this.requestRender()}),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??`Waterfall chart of ${(this.options.data??[]).length} steps`)}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition();(0,n.renderWaterfall)(e,t,r,this.options,i,a)}update(e){this.options={...this.options,data:e},this.applyLabel(),this.requestRender()}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions({...e,ariaLabel:void 0}),this.applyLabel(),this.requestRender()}destroy(){this.crosshair.destroy(),super.destroy()}},P=500;function F(e){let t=1-e;return 1-t*t*t}var I=class extends n.BaseFinanceChart{options;currentValue;targetValue;animationStart=null;animationFrom=0;animationFrameId=null;constructor(e,t){super(e,t.theme,t.font),this.options=t,this.currentValue=t.value,this.targetValue=t.value,this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??`Gauge at ${this.options.value}`)}renderChart(e,t,r,i){(0,n.renderGauge)(e,t,r,this.options,i,this.currentValue)}setValue(e){if(this.options.animate===!1){this.cancelAnimation(),this.currentValue=e,this.targetValue=e,this.options={...this.options,value:e},this.applyLabel(),this.requestRender();return}this.targetValue=e,this.animationFrom=this.currentValue,this.animationStart=performance.now(),this.options={...this.options,value:e},this.applyLabel(),this.startAnimationLoop()}setOptions(e){let t={...this.options,...e};if(this.applyBaseOptions({...e,ariaLabel:void 0}),e.value!==void 0&&e.value!==this.targetValue){this.options=t,this.setValue(e.value);return}this.options=t,this.applyLabel(),this.requestRender()}startAnimationLoop(){if(this.animationFrameId!==null)return;let e=()=>{if(this.animationFrameId=null,this.animationStart===null)return;let t=this.options.animationDuration??P,n=performance.now()-this.animationStart,r=Math.min(1,n/Math.max(1,t)),i=F(r);this.currentValue=this.animationFrom+(this.targetValue-this.animationFrom)*i,this.requestRender(),r<1?this.animationFrameId=requestAnimationFrame(e):(this.currentValue=this.targetValue,this.animationStart=null)};this.animationFrameId=requestAnimationFrame(e)}cancelAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.animationStart=null}destroy(){this.cancelAnimation(),super.destroy()}},L=class extends n.BaseFinanceChart{options;layout=null;layoutFor=null;crosshair;onClick=e=>{let t=this.canvas.getBoundingClientRect();this.layout&&this.clickAt(this.layout,e.clientX-t.left,e.clientY-t.top)};onMove=e=>{if(!this.layout||!this.clickable())return;let t=this.canvas.getBoundingClientRect();this.canvas.style.cursor=this.hits(this.layout,e.clientX-t.left,e.clientY-t.top)?`pointer`:``};constructor(e,t){super(e,t.theme,t.font),this.options=t,this.crosshair=new n.FinanceCrosshair(this.canvas,()=>this.requestRender()),this.canvas.addEventListener(`click`,this.onClick),this.canvas.addEventListener(`pointermove`,this.onMove),this.applyLabel(),this.requestRender()}renderChart(e,t,r,i){let a=this.options.crosshair===!1?null:this.crosshair.getPosition(),o=this.layoutFor;(!this.layout||!o||o.options!==this.options||o.width!==t||o.height!==r||o.theme!==i)&&(this.layout=this.compute(t,r,i,(0,n.canvasMeasure)(e,i)),this.layoutFor={options:this.options,width:t,height:r,theme:i}),this.draw(e,t,r,i,a,this.layout)}setOptions(e){this.options={...this.options,...e},this.applyBaseOptions({...`theme`in e?{theme:e.theme}:{},...`font`in e?{font:e.font}:{}}),this.applyLabel(),this.requestRender()}applyLabel(){this.setLabel(this.options.ariaLabel??this.describe())}destroy(){this.crosshair.destroy(),this.canvas.removeEventListener(`click`,this.onClick),this.canvas.removeEventListener(`pointermove`,this.onMove),super.destroy()}},R=class extends L{compute(e,t,r,i){return(0,n.computeBarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderBarChart)(e,t,r,this.options,i,a,o)}describe(){return`Bar chart of ${this.options.series.map(e=>e.name).join(`, `)}, ${this.options.categories.length} categories`}clickable(){return this.options.onBarClick!==void 0}hits(e,t,r){return(0,n.hitBar)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitBar)(e,t,r);i&&this.options.onBarClick?.({category:i.category,series:i.series,value:i.value,index:i.index})}update(e,t){this.setOptions({categories:e,series:t})}},z=class extends L{compute(e,t,r,i){return(0,n.computeDonutLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderDonut)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.data.filter(e=>Number.isFinite(e.value)&&e.value>0).map(e=>e.label).join(`, `);return`${(this.options.innerRadius??.6)>0?`Donut`:`Pie`} chart of ${e}`}clickable(){return this.options.onSliceClick!==void 0}hits(e,t,r){return(0,n.hitSlice)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitSlice)(e,t,r);i&&this.options.onSliceClick?.(i.slice)}update(e){this.setOptions({data:e})}},B=class extends L{compute(e,t,r,i){return(0,n.computeScatterLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderScatter)(e,t,r,this.options,i,a,o)}describe(){let e=this.options.series.reduce((e,t)=>e+t.points.length,0);return`Scatter chart${this.options.xLabel&&this.options.yLabel?` of ${this.options.yLabel} against ${this.options.xLabel}`:``}, ${e} points`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestPoint)(e,t,r);i&&this.options.onPointClick?.(i.point,i.series)}update(e){this.setOptions({series:e})}},V=class extends L{compute(e,t,r,i){return(0,n.computeHistogramLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderHistogram)(e,t,r,this.options,i,a,o)}describe(){return`Histogram of ${this.options.values.length} values`}clickable(){return!1}hits(){return!1}clickAt(){}update(e){this.setOptions({values:e})}},H=class extends L{compute(e,t,r,i){return(0,n.computeCalendarLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCalendar)(e,t,r,this.options,i,a,o)}describe(){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];return t&&n?`Calendar of daily values from ${t} to ${n}`:`Calendar of daily values`}clickable(){return this.options.onDayClick!==void 0}hits(e,t,r){return(0,n.hitDay)(e,t,r)?.day!==void 0}clickAt(e,t,r){let i=(0,n.hitDay)(e,t,r)?.day;i&&this.options.onDayClick?.(i)}update(e){this.setOptions({data:e})}},U=12,W=class extends L{compute(e,t,r,i){return(0,n.computeMatrixLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderMatrix)(e,t,r,this.options,i,a,o)}describe(){let{rows:e,columns:t}=this.options;return t?e.length+t.length<=U?`Matrix of ${e.join(`, `)} by ${t.join(`, `)}`:`Matrix of ${e.length} rows by ${t.length} columns`:e.length<=U?`Matrix of ${e.join(`, `)}`:`Matrix of ${e.length} rows`}clickable(){return this.options.onCellClick!==void 0}hits(e,t,r){return(0,n.hitMatrixCell)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.hitMatrixCell)(e,t,r);i&&this.options.onCellClick?.(i.cell)}update(e){this.setOptions({values:e})}},le=class extends L{compute(e,t,r,i){return(0,n.computeCounterClockLayout)(this.options,e,t,r,i)}draw(e,t,r,i,a,o){(0,n.renderCounterClock)(e,t,r,this.options,i,a,o)}describe(){return`Counter-clock chart of price against volume, ${this.options.period??25}-bar averages`}clickable(){return this.options.onPointClick!==void 0}hits(e,t,r){return(0,n.nearestCounterClockPoint)(e,t,r)!==null}clickAt(e,t,r){let i=(0,n.nearestCounterClockPoint)(e,t,r);i&&this.options.onPointClick?.(i.point)}getPhase(){return(0,n.counterClockPhase)((0,n.counterClockPoints)(this.options.data,this.options.period??25,(0,n.shownCount)(this.options)))}update(e){this.setOptions({data:e})}},G=Object.freeze({equityCurve:`Equity Curve`,drawdown:`Drawdown`,monthlyReturns:`Monthly Returns`,totalReturn:`Total Return`,cagr:`CAGR`,sharpe:`Sharpe`,sortino:`Sortino`,maxDrawdown:`Max Drawdown`,winRate:`Win Rate`,profitFactor:`Profit Factor`,trades:`Trades`});function ue(e){let t;try{t=new Intl.DateTimeFormat(e,{month:`short`,timeZone:`UTC`})}catch{t=new Intl.DateTimeFormat(void 0,{month:`short`,timeZone:`UTC`})}return Array.from({length:12},(e,n)=>t.format(new Date(Date.UTC(2024,n,15))))}function K(e){return e.map(e=>({time:e.time,value:e.equity}))}function q(e){let t=-1/0;return e.map(e=>{e.equity>t&&(t=e.equity);let n=t>0?(e.equity/t-1)*100:0;return{time:e.time,value:n}})}function J(e,n){if(e.length===0)return[];let r=ue(n),i=[];for(let n of e){let e=(0,t.timeframeBucketStart)(n.time,`1M`),r=i[i.length-1];r&&r.key===e?r.close=n.equity:i.push({key:e,close:n.equity})}let a=e[0].equity,o=[];for(let e of i){let t=a===0?1:a,n=(e.close/t-1)*100;a=e.close;let i=new Date(e.key),s=i.getUTCFullYear(),c=i.getUTCMonth();o.push({id:`${s}-${String(c+1).padStart(2,`0`)}`,label:r[c],group:String(s),value:n})}return o}var Y=100;function X(e){return`${e>0?`+`:``}${e.toFixed(2)}%`}function Z(e){return e>0?`positive`:e<0?`negative`:`neutral`}function Q(e={}){let t=Object.fromEntries(Object.entries(e).filter(([,e])=>typeof e==`string`));return{...G,...t}}function $(e,t={}){let n=Q(t);return[{label:n.totalReturn,value:X(e.totalReturnPct*Y),tone:Z(e.totalReturnPct)},{label:n.cagr,value:X(e.cagr*Y),tone:Z(e.cagr)},{label:n.sharpe,value:e.sharpe.toFixed(2),tone:Z(e.sharpe)},{label:n.sortino,value:e.sortino.toFixed(2),tone:Z(e.sortino)},{label:n.maxDrawdown,value:X(-Math.abs(e.maxDrawdownPct)*Y),tone:`negative`},{label:n.winRate,value:`${(e.winRate*Y).toFixed(1)}%`,tone:`neutral`},{label:n.profitFactor,value:Number.isFinite(e.profitFactor)?e.profitFactor.toFixed(2):`∞`,tone:Z(e.profitFactor-1)},{label:n.trades,value:String(e.trades),tone:`neutral`}]}var de=class{options;theme;root;equityChart=null;drawdownChart=null;heatmap=null;constructor(e,t){this.options=t,this.theme=(0,n.financeTheme)(t.theme,t.font),this.root=document.createElement(`div`),this.build(),e.appendChild(this.root)}build(){let e=this.theme,{result:t,title:n,subtitle:r,locale:i}=this.options,a=Q(this.options.labels),o=e.font,s=this.panelBackground(),c=e.grid;if(this.root.style.cssText=[`display:flex`,`flex-direction:column`,`gap:14px`,`width:100%`,`box-sizing:border-box`,`padding:16px`,`background:${e.background}`,`color:${e.text}`,`font-family:${e.font.family}`].join(`;`),n||r){let t=document.createElement(`div`);if(n){let r=document.createElement(`div`);r.textContent=n,r.style.cssText=`font-size:${e.font.sizeLarge}px;font-weight:600;letter-spacing:-0.01em;`,t.appendChild(r)}if(r){let n=document.createElement(`div`);n.textContent=r,n.style.cssText=`font-size:${e.font.sizeSmall}px;color:${e.textSecondary};margin-top:2px;`,t.appendChild(n)}this.root.appendChild(t)}this.root.appendChild(this.buildStatsStrip($(t.metrics,a),s,c));let l=document.createElement(`div`);l.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))`,`grid-auto-rows:220px`,`gap:14px`].join(`;`),this.root.appendChild(l);let u=this.buildPanel(a.equityCurve,s,c);u.wrap.style.gridColumn=`1 / -1`,l.appendChild(u.wrap),this.equityChart=new M(u.body,{data:K(t.equityCurve),theme:e,font:o,locale:i,ariaLabel:a.equityCurve,lineColor:e.candleUp,fillArea:!0,crosshair:!0});let d=this.buildPanel(a.drawdown,s,c);l.appendChild(d.wrap),this.drawdownChart=new M(d.body,{data:q(t.equityCurve),theme:e,font:o,locale:i,ariaLabel:a.drawdown,lineColor:e.candleDown,fillArea:!0,crosshair:!0,valueFormat:e=>`${e.toFixed(1)}%`});let f=J(t.equityCurve,i),p=this.buildPanel(a.monthlyReturns,s,c);l.appendChild(p.wrap),this.heatmap=new N(p.body,{data:f,theme:e,font:o,locale:i,ariaLabel:a.monthlyReturns,showValues:!0,valueFormat:e=>`${e>=0?`+`:``}${e.toFixed(1)}`,colorScale:{negative:e.candleDown,zero:s,positive:e.candleUp}})}buildStatsStrip(e,t,n){let r=document.createElement(`div`);r.style.cssText=[`display:grid`,`grid-template-columns:repeat(auto-fit, minmax(120px, 1fr))`,`gap:10px`].join(`;`);let i=this.theme;for(let a of e){let e=document.createElement(`div`);e.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`padding:10px 12px`,`display:flex`,`flex-direction:column`,`gap:4px`].join(`;`);let o=document.createElement(`div`);o.textContent=a.label,o.style.cssText=`font-size:${i.font.sizeSmall}px;color:${i.textSecondary};text-transform:uppercase;letter-spacing:0.04em;`;let s=document.createElement(`div`);s.textContent=a.value;let c=a.tone===`positive`?i.candleUp:a.tone===`negative`?i.candleDown:i.text;s.style.cssText=`font-size:${i.font.sizeLarge}px;font-weight:600;color:${c};font-variant-numeric:tabular-nums;`,e.appendChild(o),e.appendChild(s),r.appendChild(e)}return r}buildPanel(e,t,n){let r=this.theme,i=document.createElement(`div`);i.style.cssText=[`background:${t}`,`border:1px solid ${n}`,`border-radius:10px`,`overflow:hidden`,`display:flex`,`flex-direction:column`].join(`;`);let a=document.createElement(`div`);a.textContent=e,a.style.cssText=[`font-size:${r.font.sizeSmall}px`,`font-weight:600`,`color:${r.textSecondary}`,`padding:8px 12px`,`border-bottom:1px solid ${n}`,`text-transform:uppercase`,`letter-spacing:0.04em`].join(`;`);let o=document.createElement(`div`);return o.style.cssText=`flex:1;min-height:0;position:relative;`,i.appendChild(a),i.appendChild(o),{wrap:i,body:o}}panelBackground(){return this.theme.name===`light`?`rgba(0,0,0,0.02)`:`rgba(255,255,255,0.03)`}update(e){this.options={...this.options,result:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}setTheme(e){this.theme=(0,n.financeTheme)(e,this.options.font),this.options={...this.options,theme:e},this.destroyCharts(),this.root.replaceChildren(),this.build()}destroyCharts(){this.equityChart?.destroy(),this.drawdownChart?.destroy(),this.heatmap?.destroy(),this.equityChart=null,this.drawdownChart=null,this.heatmap=null}destroy(){this.destroyCharts(),this.root.remove()}};Object.defineProperty(exports,`AlertManager`,{enumerable:!0,get:function(){return n.AlertManager}}),Object.defineProperty(exports,`Animator`,{enumerable:!0,get:function(){return n.Animator}}),exports.BarChart=R,Object.defineProperty(exports,`BarCountdown`,{enumerable:!0,get:function(){return n.BarCountdown}}),Object.defineProperty(exports,`BinanceAdapter`,{enumerable:!0,get:function(){return n.BinanceAdapter}}),Object.defineProperty(exports,`BybitAdapter`,{enumerable:!0,get:function(){return n.BybitAdapter}}),Object.defineProperty(exports,`CANDLE_PATTERNS`,{enumerable:!0,get:function(){return n.CANDLE_PATTERNS}}),Object.defineProperty(exports,`CHART_SPACING`,{enumerable:!0,get:function(){return t.CHART_SPACING}}),Object.defineProperty(exports,`CHART_STYLE_KEYS`,{enumerable:!0,get:function(){return t.CHART_STYLE_KEYS}}),exports.CORRECTABLE_BARS=a,exports.CalendarChart=H,exports.Chart=e.h,exports.ChartGrid=ae,Object.defineProperty(exports,`ChartLegend`,{enumerable:!0,get:function(){return n.ChartLegend}}),Object.defineProperty(exports,`ChartStateManager`,{enumerable:!0,get:function(){return n.ChartStateManager}}),Object.defineProperty(exports,`CoinbaseAdapter`,{enumerable:!0,get:function(){return n.CoinbaseAdapter}}),Object.defineProperty(exports,`CompareRenderer`,{enumerable:!0,get:function(){return n.CompareRenderer}}),exports.CounterClockChart=le,Object.defineProperty(exports,`CrosshairTooltip`,{enumerable:!0,get:function(){return n.CrosshairTooltip}}),Object.defineProperty(exports,`CurrentPriceLine`,{enumerable:!0,get:function(){return n.CurrentPriceLine}}),Object.defineProperty(exports,`DARK_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.DARK_PRICE_LIMITS}}),Object.defineProperty(exports,`DARK_TERMINAL`,{enumerable:!0,get:function(){return t.DARK_TERMINAL}}),Object.defineProperty(exports,`DARK_THEME`,{enumerable:!0,get:function(){return t.DARK_THEME}}),exports.DEFAULT_DASHBOARD_LABELS=G,Object.defineProperty(exports,`DEFAULT_DRAWING_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_DRAWING_STYLE}}),Object.defineProperty(exports,`DEFAULT_FONT_FAMILY`,{enumerable:!0,get:function(){return t.DEFAULT_FONT_FAMILY}}),exports.DEFAULT_HISTORY_PAGE_SIZE=e.k,Object.defineProperty(exports,`DEFAULT_LEGEND_CONFIG`,{enumerable:!0,get:function(){return n.DEFAULT_LEGEND_CONFIG}}),Object.defineProperty(exports,`DEFAULT_MAX_WEBGL_CHARTS`,{enumerable:!0,get:function(){return n.DEFAULT_MAX_WEBGL_CHARTS}}),Object.defineProperty(exports,`DEFAULT_RECONNECT`,{enumerable:!0,get:function(){return t.DEFAULT_RECONNECT}}),Object.defineProperty(exports,`DEFAULT_SESSION_HOURS`,{enumerable:!0,get:function(){return n.DEFAULT_SESSION_HOURS}}),Object.defineProperty(exports,`DEFAULT_SIGNAL_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_SIGNAL_STYLE}}),Object.defineProperty(exports,`DEFAULT_STREAM_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_STREAM_CONFIG}}),Object.defineProperty(exports,`DEFAULT_TIMEFRAME_FAVORITES`,{enumerable:!0,get:function(){return t.DEFAULT_TIMEFRAME_FAVORITES}}),Object.defineProperty(exports,`DEFAULT_TRADE_ZONE_STYLE`,{enumerable:!0,get:function(){return t.DEFAULT_TRADE_ZONE_STYLE}}),Object.defineProperty(exports,`DEFAULT_TRADING_CONFIG`,{enumerable:!0,get:function(){return t.DEFAULT_TRADING_CONFIG}}),Object.defineProperty(exports,`DataExporter`,{enumerable:!0,get:function(){return n.DataExporter}}),exports.DataManager=e.j,exports.DepthChart=se,exports.DonutChart=z,exports.DragDropImporter=e.p,Object.defineProperty(exports,`DrawingBase`,{enumerable:!0,get:function(){return n.DrawingBase}}),exports.EXCHANGE_TIME_ZONE=e.g,Object.defineProperty(exports,`Easing`,{enumerable:!0,get:function(){return n.Easing}}),exports.EquityCurveChart=M,exports.GaugeChart=I,exports.HISTORY_RETRY_MS=e.A,Object.defineProperty(exports,`HNX_SESSIONS`,{enumerable:!0,get:function(){return t.HNX_SESSIONS}}),Object.defineProperty(exports,`HOSE_SESSIONS`,{enumerable:!0,get:function(){return t.HOSE_SESSIONS}}),exports.HeatmapChart=N,exports.HistogramChart=V,Object.defineProperty(exports,`INDICATOR_CATEGORIES`,{enumerable:!0,get:function(){return n.INDICATOR_CATEGORIES}}),Object.defineProperty(exports,`IndicatorBase`,{enumerable:!0,get:function(){return n.IndicatorBase}}),Object.defineProperty(exports,`IndicatorValueMap`,{enumerable:!0,get:function(){return n.IndicatorValueMap}}),Object.defineProperty(exports,`KEPT_BUCKETS`,{enumerable:!0,get:function(){return n.KEPT_BUCKETS}}),Object.defineProperty(exports,`KRX_SESSIONS`,{enumerable:!0,get:function(){return t.KRX_SESSIONS}}),Object.defineProperty(exports,`KR_COLORS`,{enumerable:!0,get:function(){return t.KR_COLORS}}),Object.defineProperty(exports,`KeyboardHandler`,{enumerable:!0,get:function(){return n.KeyboardHandler}}),Object.defineProperty(exports,`KrakenAdapter`,{enumerable:!0,get:function(){return n.KrakenAdapter}}),Object.defineProperty(exports,`LIGHT_PRICE_LIMITS`,{enumerable:!0,get:function(){return t.LIGHT_PRICE_LIMITS}}),Object.defineProperty(exports,`LIGHT_THEME`,{enumerable:!0,get:function(){return t.LIGHT_THEME}}),exports.LayoutManager=e.D,exports.LayoutSession=e.t,Object.defineProperty(exports,`MARKET_CRYPTO`,{enumerable:!0,get:function(){return t.MARKET_CRYPTO}}),Object.defineProperty(exports,`MARKET_HNX`,{enumerable:!0,get:function(){return t.MARKET_HNX}}),Object.defineProperty(exports,`MARKET_HOSE`,{enumerable:!0,get:function(){return t.MARKET_HOSE}}),Object.defineProperty(exports,`MARKET_HOSE_ETF`,{enumerable:!0,get:function(){return t.MARKET_HOSE_ETF}}),Object.defineProperty(exports,`MARKET_KRX`,{enumerable:!0,get:function(){return t.MARKET_KRX}}),Object.defineProperty(exports,`MARKET_NXT`,{enumerable:!0,get:function(){return t.MARKET_NXT}}),Object.defineProperty(exports,`MARKET_NYSE`,{enumerable:!0,get:function(){return t.MARKET_NYSE}}),Object.defineProperty(exports,`MARKET_UPBIT_KRW`,{enumerable:!0,get:function(){return t.MARKET_UPBIT_KRW}}),Object.defineProperty(exports,`MARKET_UPCOM`,{enumerable:!0,get:function(){return t.MARKET_UPCOM}}),Object.defineProperty(exports,`MARKET_VN30F`,{enumerable:!0,get:function(){return t.MARKET_VN30F}}),Object.defineProperty(exports,`MAX_ALERT_BARS`,{enumerable:!0,get:function(){return n.MAX_ALERT_BARS}}),exports.MAX_LAYOUT_NAME=e.n,Object.defineProperty(exports,`MIN_ALERT_BARS`,{enumerable:!0,get:function(){return n.MIN_ALERT_BARS}}),Object.defineProperty(exports,`MS_TIME_THRESHOLD`,{enumerable:!0,get:function(){return t.MS_TIME_THRESHOLD}}),Object.defineProperty(exports,`ManualFeed`,{enumerable:!0,get:function(){return n.ManualFeed}}),exports.MatrixChart=W,Object.defineProperty(exports,`MockAdapter`,{enumerable:!0,get:function(){return n.MockAdapter}}),Object.defineProperty(exports,`NXT_SESSIONS`,{enumerable:!0,get:function(){return t.NXT_SESSIONS}}),exports.PLUGIN_API_VERSION=e.w,exports.POWERED_BY_LABEL=_,Object.defineProperty(exports,`PRICE_SOURCES`,{enumerable:!0,get:function(){return t.PRICE_SOURCES}}),Object.defineProperty(exports,`PaperExecutionAdapter`,{enumerable:!0,get:function(){return n.PaperExecutionAdapter}}),exports.PerformanceDashboard=de,exports.PluginManager=e.y,Object.defineProperty(exports,`PollingAdapter`,{enumerable:!0,get:function(){return n.PollingAdapter}}),Object.defineProperty(exports,`RANGE_PRESETS`,{enumerable:!0,get:function(){return n.RANGE_PRESETS}}),Object.defineProperty(exports,`ReconnectManager`,{enumerable:!0,get:function(){return n.ReconnectManager}}),Object.defineProperty(exports,`ReplayController`,{enumerable:!0,get:function(){return n.ReplayController}}),Object.defineProperty(exports,`ReplayManager`,{enumerable:!0,get:function(){return n.ReplayManager}}),Object.defineProperty(exports,`ResamplingAdapter`,{enumerable:!0,get:function(){return n.ResamplingAdapter}}),Object.defineProperty(exports,`ReshapeMemo`,{enumerable:!0,get:function(){return n.ReshapeMemo}}),Object.defineProperty(exports,`SANS_FONT_FAMILY`,{enumerable:!0,get:function(){return t.SANS_FONT_FAMILY}}),exports.ScatterChart=B,Object.defineProperty(exports,`Screenshot`,{enumerable:!0,get:function(){return n.Screenshot}}),Object.defineProperty(exports,`SessionBreaks`,{enumerable:!0,get:function(){return n.SessionBreaks}}),Object.defineProperty(exports,`SessionShading`,{enumerable:!0,get:function(){return n.SessionShading}}),Object.defineProperty(exports,`SignalMarkerManager`,{enumerable:!0,get:function(){return n.SignalMarkerManager}}),exports.SparklineChart=oe,Object.defineProperty(exports,`StreamManager`,{enumerable:!0,get:function(){return n.StreamManager}}),Object.defineProperty(exports,`TC_PALETTE`,{enumerable:!0,get:function(){return t.TC_PALETTE}}),Object.defineProperty(exports,`TC_SERIES_COLORS`,{enumerable:!0,get:function(){return t.TC_SERIES_COLORS}}),Object.defineProperty(exports,`TIMEFRAMES_CRYPTO`,{enumerable:!0,get:function(){return t.TIMEFRAMES_CRYPTO}}),Object.defineProperty(exports,`TIMEFRAMES_FOREX`,{enumerable:!0,get:function(){return t.TIMEFRAMES_FOREX}}),Object.defineProperty(exports,`TIMEFRAMES_STOCK`,{enumerable:!0,get:function(){return t.TIMEFRAMES_STOCK}}),exports.TRADECANVAS_MARK_SVG=v,exports.TRADECANVAS_URL=g,exports.TRADECANVAS_WORDMARK_SVG=y,exports.ThemeManager=e.O,Object.defineProperty(exports,`TickAggregator`,{enumerable:!0,get:function(){return n.TickAggregator}}),Object.defineProperty(exports,`TickBarAdapter`,{enumerable:!0,get:function(){return n.TickBarAdapter}}),Object.defineProperty(exports,`TickBarBuilder`,{enumerable:!0,get:function(){return n.TickBarBuilder}}),Object.defineProperty(exports,`TradeZoneManager`,{enumerable:!0,get:function(){return n.TradeZoneManager}}),Object.defineProperty(exports,`UPCOM_SESSIONS`,{enumerable:!0,get:function(){return t.UPCOM_SESSIONS}}),Object.defineProperty(exports,`UndoRedoManager`,{enumerable:!0,get:function(){return n.UndoRedoManager}}),Object.defineProperty(exports,`UpbitAdapter`,{enumerable:!0,get:function(){return n.UpbitAdapter}}),Object.defineProperty(exports,`VN30F_SESSIONS`,{enumerable:!0,get:function(){return t.VN30F_SESSIONS}}),Object.defineProperty(exports,`VN_COLORS`,{enumerable:!0,get:function(){return t.VN_COLORS}}),Object.defineProperty(exports,`VOLUME_ALPHA`,{enumerable:!0,get:function(){return t.VOLUME_ALPHA}}),Object.defineProperty(exports,`VolumeRenderer`,{enumerable:!0,get:function(){return n.VolumeRenderer}}),exports.WaterfallChart=ce,Object.defineProperty(exports,`Watermark`,{enumerable:!0,get:function(){return n.Watermark}}),Object.defineProperty(exports,`WebSocketAdapter`,{enumerable:!0,get:function(){return n.WebSocketAdapter}}),Object.defineProperty(exports,`adapterFromFeed`,{enumerable:!0,get:function(){return n.adapterFromFeed}}),Object.defineProperty(exports,`axisTimes`,{enumerable:!0,get:function(){return n.axisTimes}}),Object.defineProperty(exports,`barIndexToX`,{enumerable:!0,get:function(){return n.barIndexToX}}),Object.defineProperty(exports,`barTimeUnit`,{enumerable:!0,get:function(){return t.barTimeUnit}}),Object.defineProperty(exports,`barsAreDaily`,{enumerable:!0,get:function(){return t.barsAreDaily}}),exports.cleanLayoutName=e.r,exports.clearGlobalPlugins=e.b,exports.computeDrawdownCurve=q,exports.computeMonthlyReturns=J,Object.defineProperty(exports,`computePriceLimits`,{enumerable:!0,get:function(){return t.computePriceLimits}}),Object.defineProperty(exports,`contrastRatio`,{enumerable:!0,get:function(){return t.contrastRatio}}),Object.defineProperty(exports,`correlationMatrix`,{enumerable:!0,get:function(){return n.correlationMatrix}}),Object.defineProperty(exports,`counterClockPhase`,{enumerable:!0,get:function(){return n.counterClockPhase}}),Object.defineProperty(exports,`counterClockPoints`,{enumerable:!0,get:function(){return n.counterClockPoints}}),Object.defineProperty(exports,`createMarketTheme`,{enumerable:!0,get:function(){return t.createMarketTheme}}),exports.createPoweredBy=j,Object.defineProperty(exports,`createVNTheme`,{enumerable:!0,get:function(){return t.createVNTheme}}),Object.defineProperty(exports,`describeInputs`,{enumerable:!0,get:function(){return n.describeInputs}}),Object.defineProperty(exports,`detectCandlePatterns`,{enumerable:!0,get:function(){return n.detectCandlePatterns}}),exports.feedBars=h,Object.defineProperty(exports,`feedFromAdapter`,{enumerable:!0,get:function(){return n.feedFromAdapter}}),Object.defineProperty(exports,`formatFraction`,{enumerable:!0,get:function(){return t.formatFraction}}),Object.defineProperty(exports,`formatNumber`,{enumerable:!0,get:function(){return t.formatNumber}}),Object.defineProperty(exports,`formatTooltipTime`,{enumerable:!0,get:function(){return n.formatTooltipTime}}),Object.defineProperty(exports,`formatVND`,{enumerable:!0,get:function(){return t.formatVND}}),Object.defineProperty(exports,`formatVolumeLoc`,{enumerable:!0,get:function(){return t.formatVolumeLoc}}),Object.defineProperty(exports,`fractionTick`,{enumerable:!0,get:function(){return t.fractionTick}}),Object.defineProperty(exports,`getCurrentSession`,{enumerable:!0,get:function(){return t.getCurrentSession}}),exports.getGlobalPlugins=e.x,Object.defineProperty(exports,`getLocale`,{enumerable:!0,get:function(){return t.getLocale}}),Object.defineProperty(exports,`histogramBins`,{enumerable:!0,get:function(){return n.histogramBins}}),Object.defineProperty(exports,`indicatorCategory`,{enumerable:!0,get:function(){return n.indicatorCategory}}),Object.defineProperty(exports,`indicatorSource`,{enumerable:!0,get:function(){return t.indicatorSource}}),Object.defineProperty(exports,`inkOn`,{enumerable:!0,get:function(){return t.inkOn}}),Object.defineProperty(exports,`isDataFeed`,{enumerable:!0,get:function(){return n.isDataFeed}}),Object.defineProperty(exports,`isPriceLevelAlert`,{enumerable:!0,get:function(){return n.isPriceLevelAlert}}),Object.defineProperty(exports,`isPriceSource`,{enumerable:!0,get:function(){return t.isPriceSource}}),Object.defineProperty(exports,`isTimeFrame`,{enumerable:!0,get:function(){return t.isTimeFrame}}),Object.defineProperty(exports,`isValidTimeZone`,{enumerable:!0,get:function(){return t.isValidTimeZone}}),exports.localStorageLayouts=e.i,Object.defineProperty(exports,`lttbDownsample`,{enumerable:!0,get:function(){return n.lttbDownsample}}),Object.defineProperty(exports,`lttbVisibleIndices`,{enumerable:!0,get:function(){return n.lttbVisibleIndices}}),Object.defineProperty(exports,`marketStatus`,{enumerable:!0,get:function(){return t.marketStatus}}),exports.memoryLayouts=e.a,Object.defineProperty(exports,`niceScale`,{enumerable:!0,get:function(){return n.niceScale}}),Object.defineProperty(exports,`normalizeBar`,{enumerable:!0,get:function(){return t.normalizeBar}}),Object.defineProperty(exports,`normalizeBarTime`,{enumerable:!0,get:function(){return t.normalizeBarTime}}),Object.defineProperty(exports,`offsetAt`,{enumerable:!0,get:function(){return t.offsetAt}}),exports.opensElsewhere=O,exports.overlayScale=ie,exports.overlaysForLayer=e.T,Object.defineProperty(exports,`parseIndicatorSource`,{enumerable:!0,get:function(){return t.parseIndicatorSource}}),exports.parseOHLCV=e.m,Object.defineProperty(exports,`parseTimeframe`,{enumerable:!0,get:function(){return t.parseTimeframe}}),Object.defineProperty(exports,`pickBaseTimeframe`,{enumerable:!0,get:function(){return t.pickBaseTimeframe}}),exports.pluginKey=e.E,exports.poweredByHtml=A,exports.poweredByLayout=w,Object.defineProperty(exports,`priceFormatterFor`,{enumerable:!0,get:function(){return t.priceFormatterFor}}),Object.defineProperty(exports,`priceStepAt`,{enumerable:!0,get:function(){return t.priceStepAt}}),Object.defineProperty(exports,`priceToY`,{enumerable:!0,get:function(){return n.priceToY}}),Object.defineProperty(exports,`priceToYMapper`,{enumerable:!0,get:function(){return n.priceToYMapper}}),Object.defineProperty(exports,`rangePresetStart`,{enumerable:!0,get:function(){return n.rangePresetStart}}),Object.defineProperty(exports,`rankSymbols`,{enumerable:!0,get:function(){return t.rankSymbols}}),Object.defineProperty(exports,`readNews`,{enumerable:!0,get:function(){return t.readNews}}),Object.defineProperty(exports,`readQuote`,{enumerable:!0,get:function(){return t.readQuote}}),Object.defineProperty(exports,`readableOn`,{enumerable:!0,get:function(){return t.readableOn}}),Object.defineProperty(exports,`registerLocale`,{enumerable:!0,get:function(){return t.registerLocale}}),exports.registerPlugin=e.S,Object.defineProperty(exports,`resampleBars`,{enumerable:!0,get:function(){return t.resampleBars}}),Object.defineProperty(exports,`roundToPriceStep`,{enumerable:!0,get:function(){return t.roundToPriceStep}}),exports.safeBadgeHref=D,Object.defineProperty(exports,`scaleMarketPrices`,{enumerable:!0,get:function(){return t.scaleMarketPrices}}),exports.selectKeyStats=$,Object.defineProperty(exports,`servesTimeframe`,{enumerable:!0,get:function(){return n.servesTimeframe}}),Object.defineProperty(exports,`setLocale`,{enumerable:!0,get:function(){return t.setLocale}}),Object.defineProperty(exports,`setMaxWebGLCharts`,{enumerable:!0,get:function(){return n.setMaxWebGLCharts}}),Object.defineProperty(exports,`sourcePrice`,{enumerable:!0,get:function(){return t.sourcePrice}}),Object.defineProperty(exports,`stepDecimals`,{enumerable:!0,get:function(){return t.stepDecimals}}),Object.defineProperty(exports,`symbolTimeZone`,{enumerable:!0,get:function(){return t.symbolTimeZone}}),exports.syncIndicators=i,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t.t}}),Object.defineProperty(exports,`tickBarCount`,{enumerable:!0,get:function(){return t.tickBarCount}}),Object.defineProperty(exports,`tickerOf`,{enumerable:!0,get:function(){return t.tickerOf}}),Object.defineProperty(exports,`timeToX`,{enumerable:!0,get:function(){return n.timeToX}}),Object.defineProperty(exports,`timeframeBucketStart`,{enumerable:!0,get:function(){return t.timeframeBucketStart}}),Object.defineProperty(exports,`timeframeToMs`,{enumerable:!0,get:function(){return t.timeframeToMs}}),Object.defineProperty(exports,`timestampToBarIndex`,{enumerable:!0,get:function(){return n.timestampToBarIndex}}),exports.toEquityPoints=K,Object.defineProperty(exports,`toHeikinAshi`,{enumerable:!0,get:function(){return n.toHeikinAshi}}),Object.defineProperty(exports,`toKagi`,{enumerable:!0,get:function(){return n.toKagi}}),Object.defineProperty(exports,`toLineBreak`,{enumerable:!0,get:function(){return n.toLineBreak}}),Object.defineProperty(exports,`toPointAndFigure`,{enumerable:!0,get:function(){return n.toPointAndFigure}}),Object.defineProperty(exports,`toRangeBars`,{enumerable:!0,get:function(){return n.toRangeBars}}),Object.defineProperty(exports,`toRenko`,{enumerable:!0,get:function(){return n.toRenko}}),exports.unregisterPlugin=e.C,Object.defineProperty(exports,`usesKoreanUnits`,{enumerable:!0,get:function(){return t.usesKoreanUnits}}),Object.defineProperty(exports,`vn30fContracts`,{enumerable:!0,get:function(){return t.vn30fContracts}}),Object.defineProperty(exports,`vn30fLastTradingDay`,{enumerable:!0,get:function(){return t.vn30fLastTradingDay}}),Object.defineProperty(exports,`volumeColor`,{enumerable:!0,get:function(){return t.volumeColor}}),Object.defineProperty(exports,`wallToUtc`,{enumerable:!0,get:function(){return t.wallToUtc}}),Object.defineProperty(exports,`withResampling`,{enumerable:!0,get:function(){return n.withResampling}}),Object.defineProperty(exports,`withTickBars`,{enumerable:!0,get:function(){return n.withTickBars}}),Object.defineProperty(exports,`xToBarIndex`,{enumerable:!0,get:function(){return n.xToBarIndex}}),Object.defineProperty(exports,`xToTime`,{enumerable:!0,get:function(){return n.xToTime}}),Object.defineProperty(exports,`yToPrice`,{enumerable:!0,get:function(){return n.yToPrice}}),Object.defineProperty(exports,`zoneOffsetMinutes`,{enumerable:!0,get:function(){return t.zoneOffsetMinutes}});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|