@guihz/trading-vue-editor-tes 0.0.264 → 0.0.266
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/assets/{parserTccWorker-B7F1lNQc.js → parserTccWorker-CAL2PjNe.js} +1 -1
- package/lib/assets/{scriptsRunWorker-BLn67M0K.js → scriptsRunWorker-D5uNcRZc.js} +26 -26
- package/lib/components/editor/parseScript/buildInFuncNamespace/box.d.ts +11 -9
- package/lib/components/editor/parseScript/buildInFuncNamespace/label.d.ts +9 -7
- package/lib/components/editor/parseScript/buildInFuncNamespace/line.d.ts +14 -11
- package/lib/components/editor/parseScript/buildInFuncNamespace/linefill.d.ts +4 -2
- package/lib/components/editor/parseScript/buildInFuncNamespace/polyline.d.ts +3 -1
- package/lib/components/editor/parseScript/buildInFuncNamespace/strategy.d.ts +1 -0
- package/lib/components/editor/parseScript/buildInFuncNamespace/table.d.ts +4 -1
- package/lib/components/editor/parseScript/buildInFunction.d.ts +235 -0
- package/lib/components/editor/parseScript/constants.d.ts +1 -0
- package/lib/components/editor/utils/calc.d.ts +1 -0
- package/lib/trading-vue-editor.js +2 -2
- package/lib/trading-vue-editor.umd.cjs +1 -1
- package/package.json +1 -1
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
1
2
|
import { BuiltInVariables } from "../buildInVariables";
|
2
3
|
import { VExtend, VLineStyle, VSize, VText, VType, VXloc } from "../enum";
|
3
4
|
import { Point, TccErrorListener } from "./index";
|
@@ -44,10 +45,10 @@ export default class BuildInBox {
|
|
44
45
|
private _paramVerfiy;
|
45
46
|
copy({ id }: VBoxArgs, posStr: string): Box;
|
46
47
|
delete({ id }: VBoxArgs, posStr: string): void;
|
47
|
-
get_top({ id }: VBoxArgs, posStr: string):
|
48
|
-
get_bottom({ id }: VBoxArgs, posStr: string):
|
49
|
-
get_left({ id }: VBoxArgs, posStr: string):
|
50
|
-
get_right({ id }: VBoxArgs, posStr: string):
|
48
|
+
get_top({ id }: VBoxArgs, posStr: string): any;
|
49
|
+
get_bottom({ id }: VBoxArgs, posStr: string): any;
|
50
|
+
get_left({ id }: VBoxArgs, posStr: string): any;
|
51
|
+
get_right({ id }: VBoxArgs, posStr: string): any;
|
51
52
|
set_top({ id, ...args }: VBoxArgs, posStr: string): void;
|
52
53
|
set_bottom({ id, ...args }: VBoxArgs, posStr: string): void;
|
53
54
|
set_text({ id, ...args }: VBoxArgs, posStr: string): void;
|
@@ -75,7 +76,8 @@ export declare class Box {
|
|
75
76
|
private _errorListener;
|
76
77
|
private _suffix;
|
77
78
|
private _preId;
|
78
|
-
|
79
|
+
private _data;
|
80
|
+
constructor(variables: BuiltInVariables, key: string, errorListener: TccErrorListener, data: IKeyObjectValue);
|
79
81
|
get type(): VType;
|
80
82
|
get id(): string;
|
81
83
|
get preId(): string;
|
@@ -83,14 +85,14 @@ export declare class Box {
|
|
83
85
|
get data(): IBoxArgs | undefined;
|
84
86
|
copy(posStr: string): Box;
|
85
87
|
delete(posStr: string): void;
|
86
|
-
get_top(posStr: string):
|
88
|
+
get_top(posStr: string): any;
|
87
89
|
set_top({ top }: IBoxArgs, posStr: string): void;
|
88
|
-
get_left(posStr: string):
|
90
|
+
get_left(posStr: string): any;
|
89
91
|
set_left({ left }: IBoxArgs, posStr: string): void;
|
90
92
|
set_text({ text }: IBoxArgs, posStr: string): void;
|
91
|
-
get_right(posStr: string):
|
93
|
+
get_right(posStr: string): any;
|
92
94
|
set_right({ right }: IBoxArgs, posStr: string): void;
|
93
|
-
get_bottom(posStr: string):
|
95
|
+
get_bottom(posStr: string): any;
|
94
96
|
set_bottom({ bottom }: IBoxArgs, posStr: string): void;
|
95
97
|
set_extend({ extend }: IBoxArgs, posStr: string): void;
|
96
98
|
set_bgcolor({ color }: IBoxArgs, posStr: string): void;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
1
2
|
import { BuiltInVariables } from "../buildInVariables";
|
2
3
|
import { VLabelStyle, VSize, VText, VType, VXloc, VYloc } from "../enum";
|
3
4
|
import { Point, TccErrorListener } from "./index";
|
@@ -33,12 +34,12 @@ export default class BuildInLabel {
|
|
33
34
|
x?: Label;
|
34
35
|
}): Label | undefined;
|
35
36
|
copy({ id }: TLabelArgs, posStr: string): Label;
|
36
|
-
get_x({ id }: TLabelArgs, posStr: string):
|
37
|
-
get_y({ id }: TLabelArgs, posStr: string):
|
37
|
+
get_x({ id }: TLabelArgs, posStr: string): any;
|
38
|
+
get_y({ id }: TLabelArgs, posStr: string): any;
|
38
39
|
set_x({ id, ...args }: TLabelArgs, posStr: string): void;
|
39
40
|
set_y({ id, ...args }: TLabelArgs, posStr: string): void;
|
40
41
|
delete({ id }: TLabelArgs, posStr: string): void;
|
41
|
-
get_text({ id }: TLabelArgs, posStr: string):
|
42
|
+
get_text({ id }: TLabelArgs, posStr: string): any;
|
42
43
|
set_xy({ id, ...args }: TLabelArgs, posStr: string): void;
|
43
44
|
set_size({ id, ...args }: TLabelArgs, posStr: string): void;
|
44
45
|
set_xloc({ id, ...args }: TLabelArgs, posStr: string): void;
|
@@ -58,20 +59,21 @@ export declare class Label {
|
|
58
59
|
private _errorListener;
|
59
60
|
private _suffix;
|
60
61
|
private _preId;
|
61
|
-
|
62
|
+
private _data;
|
63
|
+
constructor(key: string, variables: BuiltInVariables, errorListener: TccErrorListener, data: IKeyObjectValue);
|
62
64
|
get type(): VType;
|
63
65
|
get id(): string;
|
64
66
|
get preId(): string;
|
65
67
|
updateId(): string;
|
66
68
|
get data(): Partial<ILabelArgs> | undefined;
|
67
69
|
copy(posStr: string): Label;
|
68
|
-
get_x(posStr: string):
|
69
|
-
get_y(posStr: string):
|
70
|
+
get_x(posStr: string): any;
|
71
|
+
get_y(posStr: string): any;
|
70
72
|
set_x({ x }: PartialLabelArgs, posStr: string): void;
|
71
73
|
set_y({ y }: PartialLabelArgs, posStr: string): void;
|
72
74
|
delete(posStr: string): void;
|
73
75
|
set_xy({ x, y }: PartialLabelArgs, posStr: string): void;
|
74
|
-
get_text(posStr: string):
|
76
|
+
get_text(posStr: string): any;
|
75
77
|
set_size({ size }: PartialLabelArgs, posStr: string): void;
|
76
78
|
set_text({ text }: PartialLabelArgs, posStr: string): void;
|
77
79
|
set_xloc({ x, xloc }: PartialLabelArgs, posStr: string): void;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
1
2
|
import { BuiltInVariables } from "../buildInVariables";
|
2
3
|
import { VExtend, VLineStyle, VType, VXloc } from "../enum";
|
3
4
|
import { Point, TccErrorListener } from "./index";
|
@@ -37,10 +38,10 @@ export default class BuildInLine {
|
|
37
38
|
}): Line | undefined;
|
38
39
|
copy({ id }: LineArgs, posStr: string): Line;
|
39
40
|
delete({ id }: LineArgs, posStr: string): void;
|
40
|
-
get_x1({ id }: LineArgs, posStr: string):
|
41
|
-
get_x2({ id }: LineArgs, posStr: string):
|
42
|
-
get_y1({ id }: LineArgs, posStr: string):
|
43
|
-
get_y2({ id }: LineArgs, posStr: string):
|
41
|
+
get_x1({ id }: LineArgs, posStr: string): any;
|
42
|
+
get_x2({ id }: LineArgs, posStr: string): any;
|
43
|
+
get_y1({ id }: LineArgs, posStr: string): any;
|
44
|
+
get_y2({ id }: LineArgs, posStr: string): any;
|
44
45
|
set_x1({ id, ...args }: LineArgs, posStr: string): void;
|
45
46
|
set_x2({ id, ...args }: LineArgs, posStr: string): void;
|
46
47
|
set_y1({ id, ...args }: LineArgs, posStr: string): void;
|
@@ -48,7 +49,7 @@ export default class BuildInLine {
|
|
48
49
|
set_xy1({ id, ...args }: LineArgs, posStr: string): void;
|
49
50
|
set_xy2({ id, ...args }: LineArgs, posStr: string): void;
|
50
51
|
set_xloc({ id, ...args }: LineArgs, posStr: string): void;
|
51
|
-
get_price({ id, ...args }: LineArgs, posStr: string):
|
52
|
+
get_price({ id, ...args }: LineArgs, posStr: string): any;
|
52
53
|
set_color({ id, ...args }: LineArgs, posStr: string): void;
|
53
54
|
set_style({ id, ...args }: LineArgs, posStr: string): void;
|
54
55
|
set_width({ id, ...args }: LineArgs, posStr: string): void;
|
@@ -63,7 +64,8 @@ export declare class Line {
|
|
63
64
|
private _errorListener;
|
64
65
|
private _fillKeys;
|
65
66
|
private _preId;
|
66
|
-
|
67
|
+
private _data;
|
68
|
+
constructor(key: string, variables: BuiltInVariables, errorListener: TccErrorListener, data: IKeyObjectValue);
|
67
69
|
get id(): string;
|
68
70
|
get __fillKeys(): string[];
|
69
71
|
__setFillKeys(key: string): void;
|
@@ -72,13 +74,14 @@ export declare class Line {
|
|
72
74
|
updateId(): string;
|
73
75
|
get type(): VType;
|
74
76
|
get data(): ILineArgs | undefined;
|
77
|
+
get originData(): IKeyObjectValue;
|
75
78
|
copy(posStr: string): Line;
|
76
79
|
delete(posStr: string): void;
|
77
|
-
get_price({ x }: ILineArgs, posStr: string):
|
78
|
-
get_x1(posStr: string):
|
79
|
-
get_x2(posStr: string):
|
80
|
-
get_y1(posStr: string):
|
81
|
-
get_y2(posStr: string):
|
80
|
+
get_price({ x }: ILineArgs, posStr: string): any;
|
81
|
+
get_x1(posStr: string): any;
|
82
|
+
get_x2(posStr: string): any;
|
83
|
+
get_y1(posStr: string): any;
|
84
|
+
get_y2(posStr: string): any;
|
82
85
|
set_x1({ x }: ILineArgs, posStr: string): void;
|
83
86
|
set_x2({ x }: ILineArgs, posStr: string): void;
|
84
87
|
set_y1({ y }: ILineArgs, posStr: string): void;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
1
2
|
import { BuiltInVariables } from "../buildInVariables";
|
2
3
|
import { VType } from "../enum";
|
3
4
|
import { Line, ILineArgs } from "./line";
|
@@ -29,7 +30,8 @@ export declare class Linefill {
|
|
29
30
|
private _variables;
|
30
31
|
private _suffix?;
|
31
32
|
private _preId;
|
32
|
-
|
33
|
+
private _data;
|
34
|
+
constructor(variables: BuiltInVariables, key: string, data: IKeyObjectValue, line1?: Line, line2?: Line);
|
33
35
|
get type(): VType;
|
34
36
|
get id(): string;
|
35
37
|
get preId(): string;
|
@@ -37,7 +39,7 @@ export declare class Linefill {
|
|
37
39
|
get data(): TLinefill | undefined;
|
38
40
|
linefill(args: {
|
39
41
|
x?: Linefill;
|
40
|
-
}
|
42
|
+
}): Linefill | undefined;
|
41
43
|
delete(): void;
|
42
44
|
get_line1(): Line | undefined;
|
43
45
|
get_line2(): Line | undefined;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { PseudoArray, TccErrorListener } from "./index";
|
2
2
|
import { BuiltInVariables } from "../buildInVariables";
|
3
3
|
import { VLineStyle, VType, VXloc } from "../enum";
|
4
|
+
import { IKeyObjectValue } from "../../type";
|
4
5
|
export interface IPolyline {
|
5
6
|
id?: string;
|
6
7
|
points?: PseudoArray;
|
@@ -30,7 +31,8 @@ export declare class Polyline {
|
|
30
31
|
private _variables;
|
31
32
|
private _suffix?;
|
32
33
|
private _preId;
|
33
|
-
|
34
|
+
private _data;
|
35
|
+
constructor(key: string, variables: BuiltInVariables, data: IKeyObjectValue);
|
34
36
|
get type(): VType;
|
35
37
|
get id(): string;
|
36
38
|
get preId(): string;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IKeyObjectValue } from "../../type";
|
1
2
|
import { BuiltInVariables } from "../buildInVariables";
|
2
3
|
import { VPosition, VSize, VText, VType } from "../enum";
|
3
4
|
import { TccErrorListener } from "./errorListener";
|
@@ -81,7 +82,8 @@ export declare class Table {
|
|
81
82
|
private _suffix;
|
82
83
|
private _preId;
|
83
84
|
private _defaultCell;
|
84
|
-
|
85
|
+
private _data;
|
86
|
+
constructor(variables: BuiltInVariables, key: string, errorListener: TccErrorListener, data: IKeyObjectValue);
|
85
87
|
get type(): VType;
|
86
88
|
get id(): string;
|
87
89
|
get preId(): string;
|
@@ -109,6 +111,7 @@ export declare class Table {
|
|
109
111
|
set_position({ position }: ITableArgs, posStr: string): void;
|
110
112
|
private _paramVerfiy;
|
111
113
|
private _getTableItem;
|
114
|
+
private _getTable;
|
112
115
|
private _verfiyRequestFunc;
|
113
116
|
}
|
114
117
|
export {};
|
@@ -0,0 +1,235 @@
|
|
1
|
+
import { IKeyObjectValue } from "../type";
|
2
|
+
import { VFormatType, VScale, VPlotStyle, VPlotDisplay, VLocation, VSize, VShape, VAlert, VHlineStyle } from "./enum";
|
3
|
+
import { BuiltInVariables } from "./buildInVariables";
|
4
|
+
import { BuildInMath, BuildInArray, BuildInInput, IColorArgs, BuildInMap, BuildInMatrix, BuildInStr, BuildInTa, BuildInTimeframe, ChartPoint, BuildInLine, BuildInLabel, BuildInPolyline, BuildInBox, BuildInLinefill, BuildInTable, Log, Runtime, Strategy, Request, Syminfo } from './buildInFuncNamespace/index';
|
5
|
+
import { IError } from "./type";
|
6
|
+
interface ITimeArgs {
|
7
|
+
timeframe?: string;
|
8
|
+
session?: string;
|
9
|
+
timezone?: string;
|
10
|
+
bars_back?: number;
|
11
|
+
time?: number;
|
12
|
+
seconds?: number;
|
13
|
+
}
|
14
|
+
interface ILibraryArgs {
|
15
|
+
title: string;
|
16
|
+
overlay?: boolean;
|
17
|
+
}
|
18
|
+
interface IIndicatorArgs {
|
19
|
+
title: string;
|
20
|
+
shorttitle?: string;
|
21
|
+
overlay?: boolean;
|
22
|
+
format?: VFormatType;
|
23
|
+
precision?: number;
|
24
|
+
scale?: VScale;
|
25
|
+
max_bars_back?: number;
|
26
|
+
timeframe?: string;
|
27
|
+
timeframe_gaps?: boolean;
|
28
|
+
explicit_plot_zorder?: boolean;
|
29
|
+
max_lines_count?: number;
|
30
|
+
max_labels_count?: number;
|
31
|
+
max_boxes_count?: number;
|
32
|
+
calc_bars_count?: number;
|
33
|
+
max_polylines_count?: number;
|
34
|
+
}
|
35
|
+
interface IPlotArgs {
|
36
|
+
id: string;
|
37
|
+
open?: number;
|
38
|
+
high?: number;
|
39
|
+
low?: number;
|
40
|
+
close?: number;
|
41
|
+
series?: number;
|
42
|
+
title?: string;
|
43
|
+
color?: string;
|
44
|
+
linewidth?: number;
|
45
|
+
style?: VPlotStyle | VShape;
|
46
|
+
trackprice?: boolean;
|
47
|
+
histbase?: number;
|
48
|
+
offset?: number;
|
49
|
+
join?: boolean;
|
50
|
+
editable?: boolean;
|
51
|
+
show_last?: number;
|
52
|
+
display?: VPlotDisplay;
|
53
|
+
format?: string;
|
54
|
+
precision?: number;
|
55
|
+
force_overlay?: boolean;
|
56
|
+
char?: string;
|
57
|
+
location?: VLocation;
|
58
|
+
text?: string;
|
59
|
+
textcolor?: string;
|
60
|
+
size?: VSize;
|
61
|
+
colorup?: string;
|
62
|
+
colordown?: string;
|
63
|
+
minheight?: number;
|
64
|
+
maxheight?: number;
|
65
|
+
wickcolor?: string;
|
66
|
+
bordercolor?: string;
|
67
|
+
seriesColors?: string[];
|
68
|
+
colors?: (string | undefined)[];
|
69
|
+
data?: IKeyObjectValue[];
|
70
|
+
gradientColorKeys?: string[];
|
71
|
+
[key: string]: any;
|
72
|
+
}
|
73
|
+
interface IAlertArgs {
|
74
|
+
id?: string;
|
75
|
+
message: string;
|
76
|
+
freq?: VAlert;
|
77
|
+
condition?: boolean;
|
78
|
+
title?: string;
|
79
|
+
type?: string;
|
80
|
+
}
|
81
|
+
interface IBgColorArgs {
|
82
|
+
color?: string;
|
83
|
+
offset?: number;
|
84
|
+
editable?: boolean;
|
85
|
+
show_last?: number;
|
86
|
+
title?: string;
|
87
|
+
display?: VPlotDisplay | VPlotDisplay[];
|
88
|
+
force_overlay?: boolean;
|
89
|
+
seriesColors?: string[];
|
90
|
+
}
|
91
|
+
interface IHlineArgs {
|
92
|
+
id?: string;
|
93
|
+
price?: number;
|
94
|
+
title?: string;
|
95
|
+
color?: string;
|
96
|
+
linestyle?: VHlineStyle;
|
97
|
+
linewidth?: number;
|
98
|
+
editable?: boolean;
|
99
|
+
display?: VPlotDisplay | VPlotDisplay[];
|
100
|
+
zIndex?: number;
|
101
|
+
}
|
102
|
+
interface IMaxBarsBackArgs {
|
103
|
+
var: any;
|
104
|
+
num: number;
|
105
|
+
var_name: string;
|
106
|
+
}
|
107
|
+
interface IFillArgs {
|
108
|
+
id?: string;
|
109
|
+
hline1?: IKeyObjectValue;
|
110
|
+
hline2?: IKeyObjectValue;
|
111
|
+
plot1?: IKeyObjectValue;
|
112
|
+
plot2?: IKeyObjectValue;
|
113
|
+
top_value?: number;
|
114
|
+
bottom_value?: number;
|
115
|
+
top_color?: string;
|
116
|
+
bottom_color?: string;
|
117
|
+
color?: string;
|
118
|
+
title?: string;
|
119
|
+
editable?: boolean;
|
120
|
+
fillgaps?: boolean;
|
121
|
+
display?: VPlotDisplay | VPlotDisplay[];
|
122
|
+
seriesColors?: string[];
|
123
|
+
data?: IKeyObjectValue[];
|
124
|
+
colors?: string[];
|
125
|
+
top_colors?: string[];
|
126
|
+
bottom_colors?: string[];
|
127
|
+
type?: string;
|
128
|
+
zIndex?: number;
|
129
|
+
force_overlay?: boolean;
|
130
|
+
}
|
131
|
+
export declare class BuildInFunctions {
|
132
|
+
array: BuildInArray;
|
133
|
+
color: any;
|
134
|
+
math: BuildInMath;
|
135
|
+
str: BuildInStr;
|
136
|
+
map: BuildInMap;
|
137
|
+
matrix: BuildInMatrix;
|
138
|
+
timeframe: BuildInTimeframe;
|
139
|
+
ta: BuildInTa;
|
140
|
+
input: BuildInInput;
|
141
|
+
private _variables;
|
142
|
+
private _cacheData;
|
143
|
+
private _options;
|
144
|
+
private _errorListener;
|
145
|
+
private _plots;
|
146
|
+
private _plotshapes;
|
147
|
+
private _plotbars;
|
148
|
+
private _plotchars;
|
149
|
+
private _plotarrows;
|
150
|
+
private _plotcandles;
|
151
|
+
private _alerts;
|
152
|
+
private _bgColors;
|
153
|
+
private _hlines;
|
154
|
+
private _fills;
|
155
|
+
chart: {
|
156
|
+
point: ChartPoint;
|
157
|
+
};
|
158
|
+
line: BuildInLine;
|
159
|
+
label: BuildInLabel;
|
160
|
+
polyline: BuildInPolyline;
|
161
|
+
box: BuildInBox;
|
162
|
+
table: BuildInTable;
|
163
|
+
linefill: BuildInLinefill;
|
164
|
+
log: Log;
|
165
|
+
runtime: Runtime;
|
166
|
+
strategy: Strategy;
|
167
|
+
request: Request;
|
168
|
+
syminfo: Syminfo;
|
169
|
+
private _count;
|
170
|
+
constructor(mintick: number, variables: BuiltInVariables, id: string);
|
171
|
+
get errors(): IError[];
|
172
|
+
get scriptType(): any;
|
173
|
+
clearErrors(): void;
|
174
|
+
addErrors(errors: IError[], key: string): void;
|
175
|
+
options(barindexs: number[], isNew: boolean): IKeyObjectValue;
|
176
|
+
private _getDataOfBarindex;
|
177
|
+
private _getDataFromBarindex;
|
178
|
+
private _getDraws;
|
179
|
+
private _getDrawsFromBarindex;
|
180
|
+
private _getDrawDeletes;
|
181
|
+
updateOptions(options: IKeyObjectValue): void;
|
182
|
+
update(data: IKeyObjectValue): void;
|
183
|
+
endExecution(): void;
|
184
|
+
library(args: ILibraryArgs, posStr: string): void;
|
185
|
+
indicator(args: IIndicatorArgs, posStr: string): void;
|
186
|
+
private _paramVerfiy;
|
187
|
+
private _lineWidthVerify;
|
188
|
+
plot(args: IPlotArgs, posStr: string): {
|
189
|
+
type: string;
|
190
|
+
offset: number;
|
191
|
+
key: string;
|
192
|
+
};
|
193
|
+
plotbar(args: IPlotArgs, posStr: string): void;
|
194
|
+
private _verfiyArgs;
|
195
|
+
plotchar(args: IPlotArgs, posStr: string): void;
|
196
|
+
plotarrow(args: IPlotArgs, posStr: string): void;
|
197
|
+
plotshape(args: IPlotArgs, posStr: string): void;
|
198
|
+
plotcandle(args: IPlotArgs, posStr: string): void;
|
199
|
+
hline(args: IHlineArgs, posStr: string): {
|
200
|
+
type: string;
|
201
|
+
key: string;
|
202
|
+
};
|
203
|
+
fill(args: IFillArgs, posStr: string): void;
|
204
|
+
alert({ message, freq }: IAlertArgs, posStr: string): void;
|
205
|
+
alertcondition({ condition, message, title }: IAlertArgs, posStr: string): void;
|
206
|
+
barcolor(args: IBgColorArgs, posStr: string): void;
|
207
|
+
bgcolor(args: IBgColorArgs, posStr: string): void;
|
208
|
+
private _verifyDisplay;
|
209
|
+
private _setColors;
|
210
|
+
max_bars_back({ var: var_, num, var_name }: IMaxBarsBackArgs): void;
|
211
|
+
float({ x }: IColorArgs): any;
|
212
|
+
bool({ x }: IColorArgs): any;
|
213
|
+
string({ x }: IColorArgs): any;
|
214
|
+
int({ x }: IColorArgs): any;
|
215
|
+
na({ x }: IColorArgs): boolean;
|
216
|
+
fixnan({ source }: IKeyObjectValue, posStr: string): any;
|
217
|
+
nz({ source, replacement }: IKeyObjectValue): any;
|
218
|
+
time({ timeframe, session, timezone, bars_back }: ITimeArgs, posStr: string): any;
|
219
|
+
time_close({ timeframe, session, timezone, bars_back }: ITimeArgs, posStr: string): any;
|
220
|
+
timestamp(args: IKeyObjectValue): number;
|
221
|
+
weekofyear({ time, timezone }: ITimeArgs): number;
|
222
|
+
year({ time, timezone }: ITimeArgs): number;
|
223
|
+
second({ time, timezone }: ITimeArgs): number;
|
224
|
+
month({ time, timezone }: ITimeArgs): number;
|
225
|
+
minute({ time, timezone }: ITimeArgs): number;
|
226
|
+
hour({ time, timezone }: ITimeArgs): number;
|
227
|
+
dayofweek({ time, timezone }: ITimeArgs): number;
|
228
|
+
dayofmonth({ time, timezone }: ITimeArgs): number;
|
229
|
+
private _calcTimeOffset;
|
230
|
+
private _timeHandle;
|
231
|
+
private _seriesColorHandle;
|
232
|
+
private _parserSession;
|
233
|
+
private _processTime;
|
234
|
+
}
|
235
|
+
export {};
|
@@ -2,3 +2,4 @@ export declare function add(a: number, b: number): number;
|
|
2
2
|
export declare function sub(a: number, b: number): number;
|
3
3
|
export declare function mul(a: number, b: number): number;
|
4
4
|
export declare function div(a: number, b: number): number;
|
5
|
+
export declare function fixed(a: number | string, precision?: number): number;
|
@@ -69151,14 +69151,14 @@ function br(a, s, r) {
|
|
69151
69151
|
function Nw() {
|
69152
69152
|
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
69153
69153
|
}
|
69154
|
-
const Cd = new Worker(new URL("" + new URL("assets/scriptsRunWorker-
|
69154
|
+
const Cd = new Worker(new URL("" + new URL("assets/scriptsRunWorker-D5uNcRZc.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
|
69155
69155
|
Cd.onerror = (a) => {
|
69156
69156
|
console.error(a);
|
69157
69157
|
};
|
69158
69158
|
async function Sd(a) {
|
69159
69159
|
return await wn.setInlayHints(a);
|
69160
69160
|
}
|
69161
|
-
const Nd = xo(Cd), zd = xo(new Worker(new URL("" + new URL("assets/parserTccWorker-
|
69161
|
+
const Nd = xo(Cd), zd = xo(new Worker(new URL("" + new URL("assets/parserTccWorker-CAL2PjNe.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
|
69162
69162
|
async function zw(a, s = !1) {
|
69163
69163
|
const { functions: r, types: n, constants: o, variables: l, methods: c } = dt;
|
69164
69164
|
return await zd.parseTcc(a, s, ho(Sd), { functions: Object.fromEntries(r), methods: Object.fromEntries(c), types: Object.fromEntries(n), constants: Object.fromEntries(o), variables: Object.fromEntries(l) });
|
@@ -141,7 +141,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
141
141
|
* @license
|
142
142
|
* Copyright 2019 Google LLC
|
143
143
|
* SPDX-License-Identifier: Apache-2.0
|
144
|
-
*/const tl=Symbol("Comlink.proxy"),Dm=Symbol("Comlink.endpoint"),Im=Symbol("Comlink.releaseProxy"),Bn=Symbol("Comlink.finalizer"),ba=Symbol("Comlink.thrown"),sl=a=>typeof a=="object"&&a!==null||typeof a=="function",Am={canHandle:a=>sl(a)&&a[tl],serialize(a){const{port1:s,port2:r}=new MessageChannel;return al(a,s),[r,[r]]},deserialize(a){return a.start(),Un(a)}},qm={canHandle:a=>sl(a)&&ba in a,serialize({value:a}){let s;return a instanceof Error?s={isError:!0,value:{message:a.message,name:a.name,stack:a.stack}}:s={isError:!1,value:a},[s,[]]},deserialize(a){throw a.isError?Object.assign(new Error(a.value.message),a.value):a.value}},rl=new Map([["proxy",Am],["throw",qm]]);function Cm(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function al(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Cm(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:c,path:u}=Object.assign({path:[]},o.data),m=(o.data.argumentList||[]).map(Is);let _;try{const g=u.slice(0,-1).reduce((h,D)=>h[D],a),x=u.reduce((h,D)=>h[D],a);switch(c){case"GET":_=x;break;case"SET":g[u.slice(-1)[0]]=Is(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,m);break;case"CONSTRUCT":{const h=new x(...m);_=Kn(h)}break;case"ENDPOINT":{const{port1:h,port2:D}=new MessageChannel;al(a,D),_=Lm(h,[h])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[ba]:0}}Promise.resolve(_).catch(g=>({value:g,[ba]:0})).then(g=>{const[x,h]=va(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),h),c==="RELEASE"&&(s.removeEventListener("message",n),nl(s),Bn in a&&typeof a[Bn]=="function"&&a[Bn]())}).catch(g=>{const[x,h]=va({value:new TypeError("Unserializable return value"),[ba]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),h)})}),s.start&&s.start()}function Sm(a){return a.constructor.name==="MessagePort"}function nl(a){Sm(a)&&a.close()}function Un(a,s){return $n(a,[],s)}function xa(a){if(a)throw new Error("Proxy has been released and is not useable")}function il(a){return Hs(a,{type:"RELEASE"}).then(()=>{nl(a)})}const ha=new WeakMap,wa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(ha.get(a)||0)-1;ha.set(a,s),s===0&&il(a)});function zm(a,s){const r=(ha.get(s)||0)+1;ha.set(s,r),wa&&wa.register(a,s,a)}function Nm(a){wa&&wa.unregister(a)}function $n(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,c){if(xa(n),c===Im)return()=>{Nm(o),il(a),n=!0};if(c==="then"){if(s.length===0)return{then:()=>o};const u=Hs(a,{type:"GET",path:s.map(m=>m.toString())}).then(Is);return u.then.bind(u)}return $n(a,[...s,c])},set(l,c,u){xa(n);const[m,_]=va(u);return Hs(a,{type:"SET",path:[...s,c].map(g=>g.toString()),value:m},_).then(Is)},apply(l,c,u){xa(n);const m=s[s.length-1];if(m===Dm)return Hs(a,{type:"ENDPOINT"}).then(Is);if(m==="bind")return $n(a,s.slice(0,-1));const[_,g]=ol(u);return Hs(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Is)},construct(l,c){xa(n);const[u,m]=ol(c);return Hs(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:u},m).then(Is)}});return zm(o,a),o}function Em(a){return Array.prototype.concat.apply([],a)}function ol(a){const s=a.map(va);return[s.map(r=>r[0]),Em(s.map(r=>r[1]))]}const ll=new WeakMap;function Lm(a,s){return ll.set(a,s),a}function Kn(a){return Object.assign(a,{[tl]:!0})}function va(a){for(const[s,r]of rl)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},ll.get(a)||[]]}function Is(a){switch(a.type){case"HANDLER":return rl.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Hs(a,s,r){return new Promise(n=>{const o=Mm();a.addEventListener("message",function l(c){!c.data||!c.data.id||c.data.id!==o||(a.removeEventListener("message",l),n(c.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function Mm(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const cl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-BLn67M0K.js").href:new URL("assets/scriptsRunWorker-BLn67M0K.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ra&&ra.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});cl.onerror=a=>{console.error(a)};async function pl(a){return await _a.setInlayHints(a)}const dl=Un(cl),ul=Un(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-B7F1lNQc.js").href:new URL("assets/parserTccWorker-B7F1lNQc.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ra&&ra.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function ml(a,s=!1){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ul.parseTcc(a,s,Kn(pl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Om(a,s){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ul.parseLibraryCode(a,s,Kn(pl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Pm(a,s,r=!0){return await dl.runScript(a,s,r)}async function Rm(a){return await dl.removeScript(a)}function Fm(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:a==null?void 0:a.name})}const{slice:Bm,forEach:Um}=[];function $m(a){return Um.call(Bm.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const yl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Km=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const c=n.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(c)}`}if(n.domain){if(!yl.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!yl.test(n.path))throw new TypeError("option path is invalid");l+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l},_l={create(a,s,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),n&&(o.domain=n),document.cookie=Km(a,encodeURIComponent(s),o)},read(a){const s=`${a}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let o=r[n];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(s)===0)return o.substring(s.length,o.length)}return null},remove(a){this.create(a,"",-1)}};var jm={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return _l.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&_l.create(r,a,n,o,l)}},Hm={name:"querystring",lookup(a){var n;let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((n=window.location.hash)==null?void 0:n.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const c=o.substring(1).split("&");for(let u=0;u<c.length;u++){const m=c[u].indexOf("=");m>0&&c[u].substring(0,m)===s&&(r=c[u].substring(m+1))}}return r}};let Cr=null;const fl=()=>{if(Cr!==null)return Cr;try{Cr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Cr=!1}return Cr};var Wm={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&fl())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&fl()&&window.localStorage.setItem(r,a)}};let Sr=null;const gl=()=>{if(Sr!==null)return Sr;try{Sr=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Sr=!1}return Sr};var Vm={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&gl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&gl()&&window.sessionStorage.setItem(r,a)}},Gm={name:"navigator",lookup(a){const s=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)s.push(r[l]);n&&s.push(n),o&&s.push(o)}return s.length>0?s:void 0}},Xm={name:"htmlTag",lookup(a){let{htmlTag:s}=a,r;const n=s||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},Ym={name:"path",lookup(a){var o;let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(o=r[typeof s=="number"?s:0])==null?void 0:o.replace("/",""):void 0}},Qm={name:"subdomain",lookup(a){var o,l;let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&((l=(o=window.location)==null?void 0:o.hostname)==null?void 0:l.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[r]}};function Zm(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class bl{constructor(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,r)}init(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s||{languageUtils:{}},this.options=$m(r,this.options||{},Zm()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(jm),this.addDetector(Hm),this.addDetector(Wm),this.addDetector(Vm),this.addDetector(Gm),this.addDetector(Xm),this.addDetector(Ym),this.addDetector(Qm)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let r=[];return s.forEach(n=>{if(this.detectors[n]){let o=this.detectors[n].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.map(n=>this.options.convertDetectedLanguage(n)),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(s,r){r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(s,this.options)}))}}bl.type="languageDetector";const Jm=(...a)=>{console!=null&&console.warn&&(As(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},xl={},jn=(...a)=>{As(a[0])&&xl[a[0]]||(As(a[0])&&(xl[a[0]]=new Date),Jm(...a))},hl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},Hn=(a,s,r)=>{a.loadNamespaces(s,hl(a,r))},wl=(a,s,r,n)=>{if(As(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return Hn(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,hl(a,n))},ey=(a,s,r={})=>!s.languages||!s.languages.length?(jn("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(a,{lng:r.lng,precheck:(n,o)=>{var l;if(((l=r.bindI18n)==null?void 0:l.indexOf("languageChanging"))>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),As=a=>typeof a=="string",ty=a=>typeof a=="object"&&a!==null,sy=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ry={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ay=a=>ry[a];let Wn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(sy,ay)};const ny=(a={})=>{Wn={...Wn,...a}},iy=()=>Wn;let vl;const oy=a=>{vl=a},ly=()=>vl,cy={type:"3rdParty",init(a){ny(a.options.react),oy(a)}},py=N.createContext();class dy{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const uy=(a,s)=>{const r=N.useRef();return N.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Tl=(a,s,r,n)=>a.getFixedT(s,r,n),my=(a,s,r,n)=>N.useCallback(Tl(a,s,r,n),[a,s,r,n]),Ws=(a,s={})=>{var W,Q,C,z;const{i18n:r}=s,{i18n:n,defaultNS:o}=N.useContext(py)||{},l=r||n||ly();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new dy),!l){jn("You will need to pass in an i18next instance by using initReactI18next");const V=(A,L)=>As(L)?L:ty(L)&&As(L.defaultValue)?L.defaultValue:Array.isArray(A)?A[A.length-1]:A,q=[V,{},!1];return q.t=V,q.i18n={},q.ready=!1,q}(W=l.options.react)!=null&&W.wait&&jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...iy(),...l.options.react,...s},{useSuspense:u,keyPrefix:m}=c;let _=a||o||((Q=l.options)==null?void 0:Q.defaultNS);_=As(_)?[_]:_||["translation"],(z=(C=l.reportNamespaces).addUsedNamespaces)==null||z.call(C,_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(V=>ey(V,l,c)),x=my(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),h=()=>x,D=()=>Tl(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),[S,R]=N.useState(h);let U=_.join();s.lng&&(U=`${s.lng}${U}`);const K=uy(U),H=N.useRef(!0);N.useEffect(()=>{const{bindI18n:V,bindI18nStore:q}=c;H.current=!0,!g&&!u&&(s.lng?wl(l,s.lng,_,()=>{H.current&&R(D)}):Hn(l,_,()=>{H.current&&R(D)})),g&&K&&K!==U&&H.current&&R(D);const A=()=>{H.current&&R(D)};return V&&(l==null||l.on(V,A)),q&&(l==null||l.store.on(q,A)),()=>{H.current=!1,l&&(V==null||V.split(" ").forEach(L=>l.off(L,A))),q&&l&&q.split(" ").forEach(L=>l.store.off(L,A))}},[l,U]),N.useEffect(()=>{H.current&&g&&R(h)},[l,m,g]);const re=[S,l,g];if(re.t=S,re.i18n=l,re.ready=g,g||!g&&!u)return re;throw new Promise(V=>{s.lng?wl(l,s.lng,_,()=>V()):Hn(l,_,()=>V())})},yy={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v1 Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help"},_y={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v1参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助"};Me.use(bl).use(cy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:yy},zh:{translation:_y}}}),self.MonacoEnvironment={getWorker(){return new Fm({name:"Editor Worker"})}},In.config({paths:{vs:"https://my.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const fy=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:c,readOnly:u,defaultValue:m,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:h,onActionTrigger:D,onEditorDidMount:S}=a,{t:R,i18n:U}=Ws(),K=N.useRef(null),H=N.useRef(null),re=N.useRef(!1),W=N.useRef(!1);N.useImperativeHandle(s,()=>({setOriginalScript(A){var L;(L=K.current)==null||L.setOriginalScript(A)},setScript(A){var L;(L=K.current)==null||L.setValue(A)},gotoLine(){var A;(A=K.current)==null||A.gotoLine()},getEditorLayout(){var A;return(A=K.current)==null?void 0:A.getEditorLayout()},setPosition(A,L){var Z;(Z=K.current)==null||Z.setPosition({column:A,lineNumber:L})},setModelMarkers(A){var L;W.current=!0,(L=K.current)==null||L.setModelMarkers(A),setTimeout(()=>{W.current=!1},2e3)},focus(){var A;(A=K.current)==null||A.focus()}})),N.useEffect(()=>{var A,L;c?(L=K.current)==null||L.addDiffDecorations():(A=K.current)==null||A.removeDiffDecorations()},[c]),N.useEffect(()=>{o&&Ne.editor.setTheme(o)},[o]),N.useEffect(()=>{_&&U.changeLanguage(_)},[_]),N.useEffect(()=>{var A;(A=K.current)==null||A.updateActionTrigger(D)},[D]),N.useEffect(()=>{var A;x&&((A=K.current)==null||A.addLinkOpenFunc(x))},[x]);function Q(A,L){var ee,ne;Pt.initBuiltinsTrees(),_a.setEditor(A),K.current=new km(A,L,D),x&&((ee=K.current)==null||ee.addLinkOpenFunc(x)),c&&((ne=K.current)==null||ne.addDiffDecorations()),Gu(A),requestAnimationFrame(q);const Z=A.getValue();K.current.onChangeCursorPosition(h),g&&g(Z),!u&&C(Z),S&&S()}const C=N.useCallback(async A=>{var Rt;re.current=!1;const{errors:L,functions:Z,methods:ee,types:ne,variables:Y,overloadsFuncs:le,imports:xe,enums:pe}=await ml(A),_e=new Map(Object.entries(Z)),Ee=new Map(Object.entries(ee)),te=new Map(Object.entries(ne)),de=new Map(Object.entries(Y)),Oe=new Map(Object.entries(xe)),Ge=new Map(Object.entries(pe));Ds.setUserDefined({functions:_e,methods:Ee,types:te,variables:de,imports:Oe,enums:Ge},le),Pt.setUserDefind(_e,te,de,Ee,Ge);const Qe=L.map(us=>({...us,severity:us.type||Ne.MarkerSeverity.Error}));u||!re.current&&!W.current&&Qe.length&&((Rt=K.current)==null||Rt.setModelMarkers(Qe))},[u]),z=N.useMemo(()=>Qu.debounce(C,1500),[C]);function V(A){var L;if(u){C(A||"");return}re.current=!0,_a.clearInlayHints(),(L=K.current)==null||L.setModelMarkers([]),A!==void 0&&(g&&g(A),z(A))}const q=N.useCallback(()=>{var L,Z;const A=(L=H.current)==null?void 0:L.getBoundingClientRect();(Z=K.current)==null||Z.setEditorLayout((A==null?void 0:A.height)||0,A==null?void 0:A.width)},[]);return N.useEffect(()=>{const A=()=>{window.requestAnimationFrame(q)},L=new ResizeObserver(A);return H.current&&L.observe(H.current),()=>{var Z;H.current&&L.unobserve(H.current),L.disconnect(),(Z=K.current)==null||Z.dispose()}},[]),T.jsx("div",{ref:H,children:T.jsx(mu,{height:r,width:n||"100%",defaultLanguage:Ke,defaultValue:m||`indicator("我的脚本")
|
144
|
+
*/const tl=Symbol("Comlink.proxy"),Dm=Symbol("Comlink.endpoint"),Im=Symbol("Comlink.releaseProxy"),Bn=Symbol("Comlink.finalizer"),ba=Symbol("Comlink.thrown"),sl=a=>typeof a=="object"&&a!==null||typeof a=="function",Am={canHandle:a=>sl(a)&&a[tl],serialize(a){const{port1:s,port2:r}=new MessageChannel;return al(a,s),[r,[r]]},deserialize(a){return a.start(),Un(a)}},qm={canHandle:a=>sl(a)&&ba in a,serialize({value:a}){let s;return a instanceof Error?s={isError:!0,value:{message:a.message,name:a.name,stack:a.stack}}:s={isError:!1,value:a},[s,[]]},deserialize(a){throw a.isError?Object.assign(new Error(a.value.message),a.value):a.value}},rl=new Map([["proxy",Am],["throw",qm]]);function Cm(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function al(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Cm(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:c,path:u}=Object.assign({path:[]},o.data),m=(o.data.argumentList||[]).map(Is);let _;try{const g=u.slice(0,-1).reduce((h,D)=>h[D],a),x=u.reduce((h,D)=>h[D],a);switch(c){case"GET":_=x;break;case"SET":g[u.slice(-1)[0]]=Is(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,m);break;case"CONSTRUCT":{const h=new x(...m);_=Kn(h)}break;case"ENDPOINT":{const{port1:h,port2:D}=new MessageChannel;al(a,D),_=Lm(h,[h])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[ba]:0}}Promise.resolve(_).catch(g=>({value:g,[ba]:0})).then(g=>{const[x,h]=va(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),h),c==="RELEASE"&&(s.removeEventListener("message",n),nl(s),Bn in a&&typeof a[Bn]=="function"&&a[Bn]())}).catch(g=>{const[x,h]=va({value:new TypeError("Unserializable return value"),[ba]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),h)})}),s.start&&s.start()}function Sm(a){return a.constructor.name==="MessagePort"}function nl(a){Sm(a)&&a.close()}function Un(a,s){return $n(a,[],s)}function xa(a){if(a)throw new Error("Proxy has been released and is not useable")}function il(a){return Hs(a,{type:"RELEASE"}).then(()=>{nl(a)})}const ha=new WeakMap,wa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(ha.get(a)||0)-1;ha.set(a,s),s===0&&il(a)});function zm(a,s){const r=(ha.get(s)||0)+1;ha.set(s,r),wa&&wa.register(a,s,a)}function Nm(a){wa&&wa.unregister(a)}function $n(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,c){if(xa(n),c===Im)return()=>{Nm(o),il(a),n=!0};if(c==="then"){if(s.length===0)return{then:()=>o};const u=Hs(a,{type:"GET",path:s.map(m=>m.toString())}).then(Is);return u.then.bind(u)}return $n(a,[...s,c])},set(l,c,u){xa(n);const[m,_]=va(u);return Hs(a,{type:"SET",path:[...s,c].map(g=>g.toString()),value:m},_).then(Is)},apply(l,c,u){xa(n);const m=s[s.length-1];if(m===Dm)return Hs(a,{type:"ENDPOINT"}).then(Is);if(m==="bind")return $n(a,s.slice(0,-1));const[_,g]=ol(u);return Hs(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Is)},construct(l,c){xa(n);const[u,m]=ol(c);return Hs(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:u},m).then(Is)}});return zm(o,a),o}function Em(a){return Array.prototype.concat.apply([],a)}function ol(a){const s=a.map(va);return[s.map(r=>r[0]),Em(s.map(r=>r[1]))]}const ll=new WeakMap;function Lm(a,s){return ll.set(a,s),a}function Kn(a){return Object.assign(a,{[tl]:!0})}function va(a){for(const[s,r]of rl)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},ll.get(a)||[]]}function Is(a){switch(a.type){case"HANDLER":return rl.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Hs(a,s,r){return new Promise(n=>{const o=Mm();a.addEventListener("message",function l(c){!c.data||!c.data.id||c.data.id!==o||(a.removeEventListener("message",l),n(c.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function Mm(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const cl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-D5uNcRZc.js").href:new URL("assets/scriptsRunWorker-D5uNcRZc.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ra&&ra.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});cl.onerror=a=>{console.error(a)};async function pl(a){return await _a.setInlayHints(a)}const dl=Un(cl),ul=Un(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CAL2PjNe.js").href:new URL("assets/parserTccWorker-CAL2PjNe.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ra&&ra.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function ml(a,s=!1){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ul.parseTcc(a,s,Kn(pl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Om(a,s){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ul.parseLibraryCode(a,s,Kn(pl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Pm(a,s,r=!0){return await dl.runScript(a,s,r)}async function Rm(a){return await dl.removeScript(a)}function Fm(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:a==null?void 0:a.name})}const{slice:Bm,forEach:Um}=[];function $m(a){return Um.call(Bm.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const yl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Km=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const c=n.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(c)}`}if(n.domain){if(!yl.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!yl.test(n.path))throw new TypeError("option path is invalid");l+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l},_l={create(a,s,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),n&&(o.domain=n),document.cookie=Km(a,encodeURIComponent(s),o)},read(a){const s=`${a}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let o=r[n];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(s)===0)return o.substring(s.length,o.length)}return null},remove(a){this.create(a,"",-1)}};var jm={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return _l.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&_l.create(r,a,n,o,l)}},Hm={name:"querystring",lookup(a){var n;let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((n=window.location.hash)==null?void 0:n.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const c=o.substring(1).split("&");for(let u=0;u<c.length;u++){const m=c[u].indexOf("=");m>0&&c[u].substring(0,m)===s&&(r=c[u].substring(m+1))}}return r}};let Cr=null;const fl=()=>{if(Cr!==null)return Cr;try{Cr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Cr=!1}return Cr};var Wm={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&fl())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&fl()&&window.localStorage.setItem(r,a)}};let Sr=null;const gl=()=>{if(Sr!==null)return Sr;try{Sr=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Sr=!1}return Sr};var Vm={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&gl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&gl()&&window.sessionStorage.setItem(r,a)}},Gm={name:"navigator",lookup(a){const s=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)s.push(r[l]);n&&s.push(n),o&&s.push(o)}return s.length>0?s:void 0}},Xm={name:"htmlTag",lookup(a){let{htmlTag:s}=a,r;const n=s||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},Ym={name:"path",lookup(a){var o;let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(o=r[typeof s=="number"?s:0])==null?void 0:o.replace("/",""):void 0}},Qm={name:"subdomain",lookup(a){var o,l;let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&((l=(o=window.location)==null?void 0:o.hostname)==null?void 0:l.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[r]}};function Zm(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class bl{constructor(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,r)}init(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s||{languageUtils:{}},this.options=$m(r,this.options||{},Zm()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(jm),this.addDetector(Hm),this.addDetector(Wm),this.addDetector(Vm),this.addDetector(Gm),this.addDetector(Xm),this.addDetector(Ym),this.addDetector(Qm)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let r=[];return s.forEach(n=>{if(this.detectors[n]){let o=this.detectors[n].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.map(n=>this.options.convertDetectedLanguage(n)),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(s,r){r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(s,this.options)}))}}bl.type="languageDetector";const Jm=(...a)=>{console!=null&&console.warn&&(As(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},xl={},jn=(...a)=>{As(a[0])&&xl[a[0]]||(As(a[0])&&(xl[a[0]]=new Date),Jm(...a))},hl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},Hn=(a,s,r)=>{a.loadNamespaces(s,hl(a,r))},wl=(a,s,r,n)=>{if(As(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return Hn(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,hl(a,n))},ey=(a,s,r={})=>!s.languages||!s.languages.length?(jn("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(a,{lng:r.lng,precheck:(n,o)=>{var l;if(((l=r.bindI18n)==null?void 0:l.indexOf("languageChanging"))>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),As=a=>typeof a=="string",ty=a=>typeof a=="object"&&a!==null,sy=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ry={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ay=a=>ry[a];let Wn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(sy,ay)};const ny=(a={})=>{Wn={...Wn,...a}},iy=()=>Wn;let vl;const oy=a=>{vl=a},ly=()=>vl,cy={type:"3rdParty",init(a){ny(a.options.react),oy(a)}},py=N.createContext();class dy{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const uy=(a,s)=>{const r=N.useRef();return N.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Tl=(a,s,r,n)=>a.getFixedT(s,r,n),my=(a,s,r,n)=>N.useCallback(Tl(a,s,r,n),[a,s,r,n]),Ws=(a,s={})=>{var W,Q,C,z;const{i18n:r}=s,{i18n:n,defaultNS:o}=N.useContext(py)||{},l=r||n||ly();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new dy),!l){jn("You will need to pass in an i18next instance by using initReactI18next");const V=(A,L)=>As(L)?L:ty(L)&&As(L.defaultValue)?L.defaultValue:Array.isArray(A)?A[A.length-1]:A,q=[V,{},!1];return q.t=V,q.i18n={},q.ready=!1,q}(W=l.options.react)!=null&&W.wait&&jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...iy(),...l.options.react,...s},{useSuspense:u,keyPrefix:m}=c;let _=a||o||((Q=l.options)==null?void 0:Q.defaultNS);_=As(_)?[_]:_||["translation"],(z=(C=l.reportNamespaces).addUsedNamespaces)==null||z.call(C,_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(V=>ey(V,l,c)),x=my(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),h=()=>x,D=()=>Tl(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),[S,R]=N.useState(h);let U=_.join();s.lng&&(U=`${s.lng}${U}`);const K=uy(U),H=N.useRef(!0);N.useEffect(()=>{const{bindI18n:V,bindI18nStore:q}=c;H.current=!0,!g&&!u&&(s.lng?wl(l,s.lng,_,()=>{H.current&&R(D)}):Hn(l,_,()=>{H.current&&R(D)})),g&&K&&K!==U&&H.current&&R(D);const A=()=>{H.current&&R(D)};return V&&(l==null||l.on(V,A)),q&&(l==null||l.store.on(q,A)),()=>{H.current=!1,l&&(V==null||V.split(" ").forEach(L=>l.off(L,A))),q&&l&&q.split(" ").forEach(L=>l.store.off(L,A))}},[l,U]),N.useEffect(()=>{H.current&&g&&R(h)},[l,m,g]);const re=[S,l,g];if(re.t=S,re.i18n=l,re.ready=g,g||!g&&!u)return re;throw new Promise(V=>{s.lng?wl(l,s.lng,_,()=>V()):Hn(l,_,()=>V())})},yy={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v1 Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help"},_y={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v1参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助"};Me.use(bl).use(cy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:yy},zh:{translation:_y}}}),self.MonacoEnvironment={getWorker(){return new Fm({name:"Editor Worker"})}},In.config({paths:{vs:"https://my.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const fy=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:c,readOnly:u,defaultValue:m,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:h,onActionTrigger:D,onEditorDidMount:S}=a,{t:R,i18n:U}=Ws(),K=N.useRef(null),H=N.useRef(null),re=N.useRef(!1),W=N.useRef(!1);N.useImperativeHandle(s,()=>({setOriginalScript(A){var L;(L=K.current)==null||L.setOriginalScript(A)},setScript(A){var L;(L=K.current)==null||L.setValue(A)},gotoLine(){var A;(A=K.current)==null||A.gotoLine()},getEditorLayout(){var A;return(A=K.current)==null?void 0:A.getEditorLayout()},setPosition(A,L){var Z;(Z=K.current)==null||Z.setPosition({column:A,lineNumber:L})},setModelMarkers(A){var L;W.current=!0,(L=K.current)==null||L.setModelMarkers(A),setTimeout(()=>{W.current=!1},2e3)},focus(){var A;(A=K.current)==null||A.focus()}})),N.useEffect(()=>{var A,L;c?(L=K.current)==null||L.addDiffDecorations():(A=K.current)==null||A.removeDiffDecorations()},[c]),N.useEffect(()=>{o&&Ne.editor.setTheme(o)},[o]),N.useEffect(()=>{_&&U.changeLanguage(_)},[_]),N.useEffect(()=>{var A;(A=K.current)==null||A.updateActionTrigger(D)},[D]),N.useEffect(()=>{var A;x&&((A=K.current)==null||A.addLinkOpenFunc(x))},[x]);function Q(A,L){var ee,ne;Pt.initBuiltinsTrees(),_a.setEditor(A),K.current=new km(A,L,D),x&&((ee=K.current)==null||ee.addLinkOpenFunc(x)),c&&((ne=K.current)==null||ne.addDiffDecorations()),Gu(A),requestAnimationFrame(q);const Z=A.getValue();K.current.onChangeCursorPosition(h),g&&g(Z),!u&&C(Z),S&&S()}const C=N.useCallback(async A=>{var Rt;re.current=!1;const{errors:L,functions:Z,methods:ee,types:ne,variables:Y,overloadsFuncs:le,imports:xe,enums:pe}=await ml(A),_e=new Map(Object.entries(Z)),Ee=new Map(Object.entries(ee)),te=new Map(Object.entries(ne)),de=new Map(Object.entries(Y)),Oe=new Map(Object.entries(xe)),Ge=new Map(Object.entries(pe));Ds.setUserDefined({functions:_e,methods:Ee,types:te,variables:de,imports:Oe,enums:Ge},le),Pt.setUserDefind(_e,te,de,Ee,Ge);const Qe=L.map(us=>({...us,severity:us.type||Ne.MarkerSeverity.Error}));u||!re.current&&!W.current&&Qe.length&&((Rt=K.current)==null||Rt.setModelMarkers(Qe))},[u]),z=N.useMemo(()=>Qu.debounce(C,1500),[C]);function V(A){var L;if(u){C(A||"");return}re.current=!0,_a.clearInlayHints(),(L=K.current)==null||L.setModelMarkers([]),A!==void 0&&(g&&g(A),z(A))}const q=N.useCallback(()=>{var L,Z;const A=(L=H.current)==null?void 0:L.getBoundingClientRect();(Z=K.current)==null||Z.setEditorLayout((A==null?void 0:A.height)||0,A==null?void 0:A.width)},[]);return N.useEffect(()=>{const A=()=>{window.requestAnimationFrame(q)},L=new ResizeObserver(A);return H.current&&L.observe(H.current),()=>{var Z;H.current&&L.unobserve(H.current),L.disconnect(),(Z=K.current)==null||Z.dispose()}},[]),T.jsx("div",{ref:H,children:T.jsx(mu,{height:r,width:n||"100%",defaultLanguage:Ke,defaultValue:m||`indicator("我的脚本")
|
145
145
|
plot(close)
|
146
146
|
`,theme:o||"vs-dark",className:`tvue-script ${o||"vs-dark"}`,options:{colorDecorators:!0,useShadowDOM:!1,matchOnWordStartOnly:!0,automaticLayout:!1,unicodeHighlight:{allowedCharacters:{" ":!0}},suggest:{filterGraceful:!0},fontSize:13,...u?am:{},readOnlyMessage:{value:R("This script is read-only. It cannot be edited.")},...l},onMount:Q,onChange:V})})},gy=N.forwardRef(fy),by=a=>{const{theme:s,modified:r,original:n,height:o,width:l,renderSideBySide:c=!0}=a,u=N.useCallback((m,_)=>{_.languages.register({id:Ke}),_.editor.defineTheme("vs-dark",Mn),_.editor.defineTheme("vs",Ln),_.languages.setMonarchTokensProvider(Ke,js),_.languages.setLanguageConfiguration(Ke,En)},[]);return T.jsx(lu,{height:o||"90vh",width:l||"100%",theme:s||"vs-dark",options:{readOnly:!0,renderSideBySide:c,scrollBeyondLastLine:!1},language:Ke,modified:r,original:n,onMount:u})};M.VMarkerSeverity=void 0,function(a){a[a.Hint=1]="Hint",a[a.Info=2]="Info",a[a.Warning=4]="Warning",a[a.Error=8]="Error"}(M.VMarkerSeverity||(M.VMarkerSeverity={}));var Ta={},xy=function(){var a=document.getSelection();if(!a.rangeCount)return function(){};for(var s=document.activeElement,r=[],n=0;n<a.rangeCount;n++)r.push(a.getRangeAt(n));switch(s.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":s.blur();break;default:s=null;break}return a.removeAllRanges(),function(){a.type==="Caret"&&a.removeAllRanges(),a.rangeCount||r.forEach(function(o){a.addRange(o)}),s&&s.focus()}},hy=xy,kl={"text/plain":"Text","text/html":"Url",default:"Text"},wy="Copy to clipboard: #{key}, Enter";function vy(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function Ty(a,s){var r,n,o,l,c,u,m=!1;s||(s={}),r=s.debug||!1;try{o=hy(),l=document.createRange(),c=document.getSelection(),u=document.createElement("span"),u.textContent=a,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(g){if(g.stopPropagation(),s.format)if(g.preventDefault(),typeof g.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=kl[s.format]||kl.default;window.clipboardData.setData(x,a)}else g.clipboardData.clearData(),g.clipboardData.setData(s.format,a);s.onCopy&&(g.preventDefault(),s.onCopy(g.clipboardData))}),document.body.appendChild(u),l.selectNodeContents(u),c.addRange(l);var _=document.execCommand("copy");if(!_)throw new Error("copy command was unsuccessful");m=!0}catch(g){r&&console.error("unable to copy using execCommand: ",g),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",a),s.onCopy&&s.onCopy(window.clipboardData),m=!0}catch(x){r&&console.error("unable to copy using clipboardData: ",x),r&&console.error("falling back to prompt"),n=vy("message"in s?s.message:wy),window.prompt(n,a)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(l):c.removeAllRanges()),u&&document.body.removeChild(u),o()}return m}var ky=Ty;function Vn(a){"@babel/helpers - typeof";return Vn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Vn(a)}Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.CopyToClipboard=void 0;var ka=Dl(N),Dy=Dl(ky),Iy=["text","onCopy","options","children"];function Dl(a){return a&&a.__esModule?a:{default:a}}function Il(a,s){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);s&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),r.push.apply(r,n)}return r}function Al(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Il(Object(r),!0).forEach(function(n){Xn(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Il(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function Ay(a,s){if(a==null)return{};var r=qy(a,s),n,o;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(o=0;o<l.length;o++)n=l[o],!(s.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(a,n)&&(r[n]=a[n])}return r}function qy(a,s){if(a==null)return{};var r={},n=Object.keys(a),o,l;for(l=0;l<n.length;l++)o=n[l],!(s.indexOf(o)>=0)&&(r[o]=a[o]);return r}function Cy(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function ql(a,s){for(var r=0;r<s.length;r++){var n=s[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}function Sy(a,s,r){return s&&ql(a.prototype,s),r&&ql(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function zy(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&Gn(a,s)}function Gn(a,s){return Gn=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},Gn(a,s)}function Ny(a){var s=Ly();return function(){var n=Da(a),o;if(s){var l=Da(this).constructor;o=Reflect.construct(n,arguments,l)}else o=n.apply(this,arguments);return Ey(this,o)}}function Ey(a,s){if(s&&(Vn(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cl(a)}function Cl(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Ly(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Da(a){return Da=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Da(a)}function Xn(a,s,r){return s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}var Sl=function(a){zy(r,a);var s=Ny(r);function r(){var n;Cy(this,r);for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];return n=s.call.apply(s,[this].concat(l)),Xn(Cl(n),"onClick",function(u){var m=n.props,_=m.text,g=m.onCopy,x=m.children,h=m.options,D=ka.default.Children.only(x),S=(0,Dy.default)(_,h);g&&g(_,S),D&&D.props&&typeof D.props.onClick=="function"&&D.props.onClick(u)}),n}return Sy(r,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var l=o.children,c=Ay(o,Iy),u=ka.default.Children.only(l);return ka.default.cloneElement(u,Al(Al({},c),{},{onClick:this.onClick}))}}]),r}(ka.default.PureComponent);Ta.CopyToClipboard=Sl,Xn(Sl,"defaultProps",{onCopy:void 0,options:void 0});var My=Ta,Yn=My.CopyToClipboard;Yn.CopyToClipboard=Yn;var Oy=Yn;const Vs=nd(Oy);Ne.languages.register({id:Ke}),Ne.editor.defineTheme("vs-dark",Mn),Ne.editor.defineTheme("vs",Ln),Ne.languages.setMonarchTokensProvider(Ke,js),Ne.languages.setLanguageConfiguration(Ke,En);async function zl(a,s){return s&&Ne.editor.setTheme(s.includes("dark")?"vs-dark":"light"),await Ne.editor.colorize(a,Ke,{tabSize:4})}async function Qn(a,s=0){const r=a[s];if(!r)return;const{name:n,args:o,type:l,desc:c,examples:u,remarks:m,seeAlso:_,syntax:g,detailedDesc:x,fields:h,returns:D}=r,S={name:n,orirginalName:n};if(a.length>1&&(S.overloads=`${a.length} ${Me.t("overloads")}`),l&&(S.type=l),o&&(S.name=`${n}()`,S.args=o.map(R=>{const{name:U,desc:K,displayType:H}=R;return{label:`${U} (${H})`,desc:K&&qs(K)}})),c&&(S.desc=c.map(R=>qs(R))),u&&(S.originalExample=u.join(`
|
147
147
|
`),S.examples=await Ne.editor.colorize(S.originalExample,Ke,{tabSize:4})),x){S.detailedDesc=[];for(const R of x){const{desc:U,examples:K}=R;let H=U.map(Q=>qs(Q)),re,W;K&&(W=K.join(`
|