@guihz/trading-vue-editor-tes 0.1.31 → 0.1.32
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/lib/assets/{scriptsRunWorker-Dhiatl4n.js → scriptsRunWorker-YaH60Kkw.js} +73 -53
- package/lib/components/editor/v3/parseScript/buildInFuncNamespace/strategy.d.ts +1 -0
- package/lib/components/editor/v4/parseScript/buildInFuncNamespace/strategy.d.ts +1 -0
- package/lib/components/editor/v5/parseScript/buildInFuncNamespace/strategy.d.ts +1 -0
- package/lib/trading-vue-editor.es.packages.js +1 -1
- package/lib/trading-vue-editor.umd.packages.mjs +1 -1
- package/package.json +1 -1
@@ -18597,6 +18597,7 @@ Example:
|
|
18597
18597
|
_useSetArgs = {};
|
18598
18598
|
_id;
|
18599
18599
|
_closeOrderList = [];
|
18600
|
+
_notCloseHistoryOrders = [];
|
18600
18601
|
constructor(e, t, r, i, s) {
|
18601
18602
|
this._variables = e, this._errorListener = i, this._options = {
|
18602
18603
|
overlay: !1,
|
@@ -18635,18 +18636,19 @@ Example:
|
|
18635
18636
|
return {
|
18636
18637
|
totalChangeCapital: this._totalChangeCapital,
|
18637
18638
|
orders: this._orders,
|
18638
|
-
historyOrders: this._historyOrder,
|
18639
|
+
// historyOrders: this._historyOrder,
|
18639
18640
|
pendingOrders: this._pendingOrders,
|
18640
18641
|
pendingCloseOrders: this._pendingCloseOrders,
|
18641
18642
|
exitOrders: this._exitOrders,
|
18642
18643
|
maxDrawdownVerifyIndex: this._maxDrawdownVerifyIndex,
|
18643
18644
|
useSetArgs: this._useSetArgs,
|
18644
|
-
cacheArgs: this._cacheArgs
|
18645
|
+
cacheArgs: this._cacheArgs,
|
18646
|
+
notCloseHistoryOrders: this._notCloseHistoryOrders
|
18645
18647
|
};
|
18646
18648
|
}
|
18647
18649
|
set _strategyCacheData(e) {
|
18648
|
-
const { totalChangeCapital: t, orders: r,
|
18649
|
-
this._totalChangeCapital = t, this._orders = r, this.
|
18650
|
+
const { totalChangeCapital: t, orders: r, notCloseHistoryOrders: i, pendingOrders: s, pendingCloseOrders: o, exitOrders: a, maxDrawdownVerifyIndex: c, cacheArgs: p, useSetArgs: b } = e;
|
18651
|
+
this._totalChangeCapital = t, this._orders = r, this._pendingOrders = s, this._pendingCloseOrders = o, this._exitOrders = a, this._maxDrawdownVerifyIndex = c, this._notCloseHistoryOrders = i, this._variables.strategy.updateOrders(this._orders), Object.keys(p).length && this._updateArgToOptions(p, b), this._variables.strategy.updateHistoryOrderCalcData(), this._variables.strategy.updateHistoryOrder();
|
18650
18652
|
}
|
18651
18653
|
get orders() {
|
18652
18654
|
return [...this._orders];
|
@@ -19132,7 +19134,7 @@ Example:
|
|
19132
19134
|
_closeOrders(e, t, r, i, s, o, a, c) {
|
19133
19135
|
const p = this._getUnCloseOrders();
|
19134
19136
|
if (this._options.close_entries_rule !== "ANY") {
|
19135
|
-
const b = this.
|
19137
|
+
const b = this._notCloseHistoryOrders.filter((M) => !M.isPartClose && !M.isTiggerClose && (!c || c !== M.direction));
|
19136
19138
|
for (const M of b)
|
19137
19139
|
M.realQty = M.original_qty, M.isTiggerClose = !0;
|
19138
19140
|
}
|
@@ -19261,7 +19263,7 @@ Example:
|
|
19261
19263
|
}
|
19262
19264
|
_ordersHandle(e) {
|
19263
19265
|
let t = this._orders.filter((a) => a.isMarketPriceLimit || a.isMarketPriceStop);
|
19264
|
-
if (this._options.close_entries_rule !== "ANY" && (t = this.
|
19266
|
+
if (this._options.close_entries_rule !== "ANY" && (t = this._notCloseHistoryOrders.filter((c) => (c.isMarketPriceLimit || c.isMarketPriceStop) && !c.isPartClose).concat(t)), !t.length)
|
19265
19267
|
return;
|
19266
19268
|
const { open: r, close: i } = this.calcOnOrderFillsData.data || this._variables, s = e || this._variables._isRealTimeBar ? i : r, o = this._getUnCloseOrders();
|
19267
19269
|
for (const a of t) {
|
@@ -19370,7 +19372,8 @@ Example:
|
|
19370
19372
|
for (const r of e) {
|
19371
19373
|
switch (r.place_order_type) {
|
19372
19374
|
case "close":
|
19373
|
-
this._closeOrderHandle(r, !0);
|
19375
|
+
const i = this._closeOrderHandle(r, !0);
|
19376
|
+
i && this._closeOrderList.push(i);
|
19374
19377
|
break;
|
19375
19378
|
case "close_all":
|
19376
19379
|
this._closeAllOrders(r, t);
|
@@ -19382,8 +19385,8 @@ Example:
|
|
19382
19385
|
this._orderOnCloseHandle(r);
|
19383
19386
|
break;
|
19384
19387
|
case "exit":
|
19385
|
-
const { posStr:
|
19386
|
-
this._exit(
|
19388
|
+
const { posStr: s, place_order_type: o, ...a } = r;
|
19389
|
+
this._exit(a, s);
|
19387
19390
|
break;
|
19388
19391
|
}
|
19389
19392
|
if (["entry", "order"].includes(r.place_order_type) && this._closeOrderList.length) {
|
@@ -19447,7 +19450,7 @@ Example:
|
|
19447
19450
|
_getHisOrderSurplusQty(e, t) {
|
19448
19451
|
let r = 0;
|
19449
19452
|
if (this._options.close_entries_rule !== "ANY") {
|
19450
|
-
const i = this.
|
19453
|
+
const i = this._notCloseHistoryOrders.filter((s) => (s.direction !== e || e === "all") && !s.isPartClose && !s.isTiggerClose);
|
19451
19454
|
for (const s of i) {
|
19452
19455
|
const { realQty: o = 0, original_qty: a = 0 } = s, c = a - o;
|
19453
19456
|
if (s.realQty = o + (t >= c ? c : t), s.isTiggerClose = a <= s.realQty, r += c, t -= c, t <= 0)
|
@@ -19460,7 +19463,7 @@ Example:
|
|
19460
19463
|
const { close_entries_rule: t = "FIFO" } = this._options;
|
19461
19464
|
let r = [];
|
19462
19465
|
if (t === "FIFO") {
|
19463
|
-
const i = this.
|
19466
|
+
const i = this._notCloseHistoryOrders.filter((s) => s.id === e && !s.isTiggerClose && !s.isPartClose);
|
19464
19467
|
r = this._orders.filter((s) => s.id === e && (s.realQty || 0) < (s.original_qty || 0)), r = i.concat(r);
|
19465
19468
|
} else
|
19466
19469
|
r = this._orders.filter((i) => i.id === e && !i.close_qty);
|
@@ -19515,7 +19518,8 @@ Example:
|
|
19515
19518
|
return e;
|
19516
19519
|
}
|
19517
19520
|
_getUnCloseOrders() {
|
19518
|
-
|
19521
|
+
const e = this._notCloseHistoryOrders.filter((t) => !t.isTiggerClose);
|
19522
|
+
return this._notCloseHistoryOrders = [...e], e.push(...this._orders.filter((t) => !t.isTiggerClose)), e;
|
19519
19523
|
}
|
19520
19524
|
_exit(e, t) {
|
19521
19525
|
if (!e.hasOwnProperty("profit") && !e.hasOwnProperty("loss") && !e.hasOwnProperty("stop") && !e.hasOwnProperty("limit") && (!e.hasOwnProperty("trail_offset") || !e.hasOwnProperty("trail_price") && !e.hasOwnProperty("trail_points"))) {
|
@@ -19736,7 +19740,7 @@ Example:
|
|
19736
19740
|
profit_percent: O / A * 100,
|
19737
19741
|
max_profit_percent: d / A * 100,
|
19738
19742
|
trading_loss_percent: _ / A * 100
|
19739
|
-
}), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, u);
|
19743
|
+
}), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), !e.isPartClose && (!e.isTiggerClose || e.isMarketPriceLimit || e.isMarketPriceStop) && this._notCloseHistoryOrders.push(e), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, u);
|
19740
19744
|
}
|
19741
19745
|
_getCommission(e, t) {
|
19742
19746
|
const { commission_value: r = 0, commission_type: i } = this._options, s = e * t;
|
@@ -25358,6 +25362,7 @@ ${u}`), u;
|
|
25358
25362
|
_cacheArgs = {};
|
25359
25363
|
_useSetArgs = {};
|
25360
25364
|
_closeOrderList = [];
|
25365
|
+
_notCloseHistoryOrders = [];
|
25361
25366
|
constructor(e, t, r, i, s) {
|
25362
25367
|
this._variables = e, this._errorListener = i, this._options = {
|
25363
25368
|
overlay: !1,
|
@@ -25391,18 +25396,19 @@ ${u}`), u;
|
|
25391
25396
|
return {
|
25392
25397
|
totalChangeCapital: this._totalChangeCapital,
|
25393
25398
|
orders: this._orders,
|
25394
|
-
historyOrders: this._historyOrder,
|
25399
|
+
// historyOrders: this._historyOrder,
|
25395
25400
|
pendingOrders: this._pendingOrders,
|
25396
25401
|
pendingCloseOrders: this._pendingCloseOrders,
|
25397
25402
|
exitOrders: this._exitOrders,
|
25398
25403
|
maxDrawdownVerifyIndex: this._maxDrawdownVerifyIndex,
|
25399
25404
|
useSetArgs: this._useSetArgs,
|
25400
|
-
cacheArgs: this._cacheArgs
|
25405
|
+
cacheArgs: this._cacheArgs,
|
25406
|
+
notCloseHistoryOrders: this._notCloseHistoryOrders
|
25401
25407
|
};
|
25402
25408
|
}
|
25403
25409
|
set _strategyCacheData(e) {
|
25404
|
-
const { totalChangeCapital: t, orders: r,
|
25405
|
-
this._totalChangeCapital = t, this._orders = r, this.
|
25410
|
+
const { totalChangeCapital: t, orders: r, notCloseHistoryOrders: i, pendingOrders: s, pendingCloseOrders: o, exitOrders: a, maxDrawdownVerifyIndex: c, cacheArgs: p, useSetArgs: b } = e;
|
25411
|
+
this._totalChangeCapital = t, this._orders = r, this._pendingOrders = s, this._pendingCloseOrders = o, this._exitOrders = a, this._maxDrawdownVerifyIndex = c, this._notCloseHistoryOrders = i, this._variables.strategy.updateOrders(this._orders), Object.keys(p).length && this._updateArgToOptions(p, b), this._variables.strategy.updateHistoryOrderCalcData(), this._variables.strategy.updateHistoryOrder();
|
25406
25412
|
}
|
25407
25413
|
get orders() {
|
25408
25414
|
return [...this._orders];
|
@@ -25890,7 +25896,7 @@ ${u}`), u;
|
|
25890
25896
|
_closeOrders(e, t, r, i, s, o, a, c) {
|
25891
25897
|
const p = this._getUnCloseOrders();
|
25892
25898
|
if (this._options.close_entries_rule !== "ANY") {
|
25893
|
-
const b = this.
|
25899
|
+
const b = this._notCloseHistoryOrders.filter((M) => !M.isPartClose && !M.isTiggerClose && (!c || c !== M.direction));
|
25894
25900
|
for (const M of b)
|
25895
25901
|
M.realQty = M.original_qty, M.isTiggerClose = !0;
|
25896
25902
|
}
|
@@ -26019,7 +26025,7 @@ ${u}`), u;
|
|
26019
26025
|
}
|
26020
26026
|
_ordersHandle(e) {
|
26021
26027
|
let t = this._orders.filter((a) => a.isMarketPriceLimit || a.isMarketPriceStop);
|
26022
|
-
if (this._options.close_entries_rule !== "ANY" && (t = this.
|
26028
|
+
if (this._options.close_entries_rule !== "ANY" && (t = this._notCloseHistoryOrders.filter((c) => (c.isMarketPriceLimit || c.isMarketPriceStop) && !c.isPartClose).concat(t)), !t.length)
|
26023
26029
|
return;
|
26024
26030
|
const { open: r, close: i } = this.calcOnOrderFillsData.data || this._variables, s = e || this._variables._isRealTimeBar ? i : r, o = this._getUnCloseOrders();
|
26025
26031
|
for (const a of t) {
|
@@ -26125,34 +26131,33 @@ ${u}`), u;
|
|
26125
26131
|
this._closeOrderList = this._closeOrderList.filter((t) => !t.isEnd), this._ordersHandle(!0);
|
26126
26132
|
}
|
26127
26133
|
_onCloseOrderHandle(e) {
|
26128
|
-
const { close: t } = this.calcOnOrderFillsData.data || this._variables
|
26129
|
-
for (const
|
26130
|
-
switch (
|
26134
|
+
const { close: t } = this.calcOnOrderFillsData.data || this._variables;
|
26135
|
+
for (const r of e) {
|
26136
|
+
switch (r.place_order_type) {
|
26131
26137
|
case "close":
|
26132
|
-
const
|
26133
|
-
|
26138
|
+
const i = this._closeOrderHandle(r, !0);
|
26139
|
+
i && this._closeOrderList.push(i);
|
26134
26140
|
break;
|
26135
26141
|
case "close_all":
|
26136
|
-
this._closeAllOrders(
|
26142
|
+
this._closeAllOrders(r, t);
|
26137
26143
|
break;
|
26138
26144
|
case "entry":
|
26139
|
-
this._entryOnCloseHandle(
|
26145
|
+
this._entryOnCloseHandle(r);
|
26140
26146
|
break;
|
26141
26147
|
case "order":
|
26142
|
-
this._orderOnCloseHandle(
|
26148
|
+
this._orderOnCloseHandle(r);
|
26143
26149
|
break;
|
26144
26150
|
case "exit":
|
26145
|
-
const { posStr:
|
26146
|
-
this._exit(
|
26151
|
+
const { posStr: s, place_order_type: o, ...a } = r;
|
26152
|
+
this._exit(a, s);
|
26147
26153
|
break;
|
26148
26154
|
}
|
26149
|
-
if (["entry", "order"].includes(
|
26150
|
-
const
|
26151
|
-
for (const
|
26152
|
-
this._closeOrderHandle(
|
26155
|
+
if (["entry", "order"].includes(r.place_order_type) && this._closeOrderList.length) {
|
26156
|
+
const i = this._closeOrderList.filter((s) => s.id === r.id);
|
26157
|
+
for (const s of i)
|
26158
|
+
this._closeOrderHandle(s);
|
26153
26159
|
}
|
26154
26160
|
}
|
26155
|
-
return r;
|
26156
26161
|
}
|
26157
26162
|
_entryOrderHandle(e) {
|
26158
26163
|
const { open: t, low: r, high: i, close: s } = this.calcOnOrderFillsData.data || this._variables, { isMarketPrice: o, qty: a = 0, in_price: c, direction: p, active_price: b, id: M } = e;
|
@@ -26208,7 +26213,7 @@ ${u}`), u;
|
|
26208
26213
|
_getHisOrderSurplusQty(e, t) {
|
26209
26214
|
let r = 0;
|
26210
26215
|
if (this._options.close_entries_rule !== "ANY") {
|
26211
|
-
const i = this.
|
26216
|
+
const i = this._notCloseHistoryOrders.filter((s) => (s.direction !== e || e === "all") && !s.isPartClose && !s.isTiggerClose);
|
26212
26217
|
for (const s of i) {
|
26213
26218
|
const { realQty: o = 0, original_qty: a = 0 } = s, c = a - o;
|
26214
26219
|
if (s.realQty = o + (t >= c ? c : t), s.isTiggerClose = a <= s.realQty, r += c, t -= c, t <= 0)
|
@@ -26221,7 +26226,7 @@ ${u}`), u;
|
|
26221
26226
|
const { close_entries_rule: t = "FIFO" } = this._options;
|
26222
26227
|
let r = [];
|
26223
26228
|
if (t === "FIFO") {
|
26224
|
-
const i = this.
|
26229
|
+
const i = this._notCloseHistoryOrders.filter((s) => s.id === e && !s.isTiggerClose && !s.isPartClose);
|
26225
26230
|
r = this._orders.filter((s) => s.id === e && (s.realQty || 0) < (s.original_qty || 0)), r = i.concat(r);
|
26226
26231
|
} else
|
26227
26232
|
r = this._orders.filter((i) => i.id === e && !i.close_qty);
|
@@ -26276,7 +26281,8 @@ ${u}`), u;
|
|
26276
26281
|
return e;
|
26277
26282
|
}
|
26278
26283
|
_getUnCloseOrders() {
|
26279
|
-
|
26284
|
+
const e = this._notCloseHistoryOrders.filter((t) => !t.isTiggerClose);
|
26285
|
+
return this._notCloseHistoryOrders = [...e], e.push(...this._orders.filter((t) => !t.isTiggerClose)), e;
|
26280
26286
|
}
|
26281
26287
|
_exit(e, t) {
|
26282
26288
|
if (!e.hasOwnProperty("profit") && !e.hasOwnProperty("loss") && !e.hasOwnProperty("stop") && !e.hasOwnProperty("limit") && (!e.hasOwnProperty("trail_offset") || !e.hasOwnProperty("trail_price") && !e.hasOwnProperty("trail_points"))) {
|
@@ -26497,7 +26503,7 @@ ${u}`), u;
|
|
26497
26503
|
profit_percent: O / A * 100,
|
26498
26504
|
max_profit_percent: d / A * 100,
|
26499
26505
|
trading_loss_percent: _ / A * 100
|
26500
|
-
}), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, u);
|
26506
|
+
}), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), !e.isPartClose && (!e.isTiggerClose || e.isMarketPriceLimit || e.isMarketPriceStop) && this._notCloseHistoryOrders.push(e), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, u);
|
26501
26507
|
}
|
26502
26508
|
_getCommission(e, t) {
|
26503
26509
|
const { commission_value: r = 0, commission_type: i } = this._options, s = e * t;
|
@@ -34875,6 +34881,7 @@ ${Gf}`);
|
|
34875
34881
|
_cacheArgs = {};
|
34876
34882
|
_useSetArgs = {};
|
34877
34883
|
_closeOrderList = [];
|
34884
|
+
_notCloseHistoryOrders = [];
|
34878
34885
|
constructor(e, t, r, i, s) {
|
34879
34886
|
this._variables = e, this._errorListener = i, this._options = {
|
34880
34887
|
overlay: !1,
|
@@ -34913,18 +34920,30 @@ ${Gf}`);
|
|
34913
34920
|
return {
|
34914
34921
|
totalChangeCapital: this._totalChangeCapital,
|
34915
34922
|
orders: this._orders,
|
34916
|
-
historyOrders: this._historyOrder,
|
34923
|
+
// historyOrders: this._historyOrder,
|
34917
34924
|
pendingOrders: this._pendingOrders,
|
34918
34925
|
pendingCloseOrders: this._pendingCloseOrders,
|
34919
34926
|
exitOrders: this._exitOrders,
|
34920
34927
|
maxDrawdownVerifyIndex: this._maxDrawdownVerifyIndex,
|
34921
34928
|
useSetArgs: this._useSetArgs,
|
34922
|
-
cacheArgs: this._cacheArgs
|
34929
|
+
cacheArgs: this._cacheArgs,
|
34930
|
+
notCloseHistoryOrders: this._notCloseHistoryOrders
|
34923
34931
|
};
|
34924
34932
|
}
|
34925
34933
|
set _strategyCacheData(e) {
|
34926
|
-
const {
|
34927
|
-
|
34934
|
+
const {
|
34935
|
+
totalChangeCapital: t,
|
34936
|
+
orders: r,
|
34937
|
+
historyOrders: i,
|
34938
|
+
pendingOrders: s,
|
34939
|
+
pendingCloseOrders: o,
|
34940
|
+
exitOrders: a,
|
34941
|
+
maxDrawdownVerifyIndex: c,
|
34942
|
+
cacheArgs: p,
|
34943
|
+
useSetArgs: b,
|
34944
|
+
notCloseHistoryOrders: M
|
34945
|
+
} = e;
|
34946
|
+
this._totalChangeCapital = t, this._orders = r, this._pendingOrders = s, this._pendingCloseOrders = o, this._exitOrders = a, this._maxDrawdownVerifyIndex = c, this._notCloseHistoryOrders = M, this._variables.strategy.updateOrders(this._orders), Object.keys(p).length && this._updateArgToOptions(p, b), this._variables.strategy.updateHistoryOrderCalcData(), this._variables.strategy.updateHistoryOrder();
|
34928
34947
|
}
|
34929
34948
|
get orders() {
|
34930
34949
|
return [...this._orders];
|
@@ -35441,7 +35460,7 @@ ${Gf}`);
|
|
35441
35460
|
_closeOrders(e, t, r, i, s, o, a, c) {
|
35442
35461
|
const p = this._getUnCloseOrders();
|
35443
35462
|
if (this._options.close_entries_rule !== "ANY") {
|
35444
|
-
const b = this.
|
35463
|
+
const b = this._notCloseHistoryOrders.filter((M) => !M.isPartClose && !M.isTiggerClose && (!c || c !== M.direction));
|
35445
35464
|
for (const M of b)
|
35446
35465
|
M.realQty = M.original_qty, M.isTiggerClose = !0;
|
35447
35466
|
}
|
@@ -35570,7 +35589,7 @@ ${Gf}`);
|
|
35570
35589
|
}
|
35571
35590
|
_ordersHandle(e) {
|
35572
35591
|
let t = this._orders.filter((a) => a.isMarketPriceLimit || a.isMarketPriceStop);
|
35573
|
-
if (this._options.close_entries_rule !== "ANY" && (t = this.
|
35592
|
+
if (this._options.close_entries_rule !== "ANY" && (t = this._notCloseHistoryOrders.filter((c) => (c.isMarketPriceLimit || c.isMarketPriceStop) && !c.isPartClose).concat(t)), !t.length)
|
35574
35593
|
return;
|
35575
35594
|
const { open: r, close: i } = this.calcOnOrderFillsData.data || this._variables, s = e || this._variables._isRealTimeBar ? i : r, o = this._getUnCloseOrders();
|
35576
35595
|
for (const a of t) {
|
@@ -35769,7 +35788,7 @@ ${Gf}`);
|
|
35769
35788
|
_getHisOrderSurplusQty(e, t) {
|
35770
35789
|
let r = 0;
|
35771
35790
|
if (this._options.close_entries_rule !== "ANY") {
|
35772
|
-
const i = this.
|
35791
|
+
const i = this._notCloseHistoryOrders.filter((s) => (s.direction !== e || e === "all") && !s.isPartClose && !s.isTiggerClose);
|
35773
35792
|
for (const s of i) {
|
35774
35793
|
const { realQty: o = 0, original_qty: a = 0 } = s, c = a - o;
|
35775
35794
|
if (s.realQty = o + (t >= c ? c : t), s.isTiggerClose = a <= s.realQty, r += c, t -= c, t <= 0)
|
@@ -35782,7 +35801,7 @@ ${Gf}`);
|
|
35782
35801
|
const { close_entries_rule: t = "FIFO" } = this._options;
|
35783
35802
|
let r = [];
|
35784
35803
|
if (t === "FIFO") {
|
35785
|
-
const i = this.
|
35804
|
+
const i = this._notCloseHistoryOrders.filter((s) => s.id === e && !s.isTiggerClose && !s.isPartClose);
|
35786
35805
|
r = this._orders.filter((s) => s.id === e && (s.realQty || 0) < (s.original_qty || 0)), r = i.concat(r);
|
35787
35806
|
} else
|
35788
35807
|
r = this._orders.filter((i) => i.id === e && !i.close_qty);
|
@@ -35837,7 +35856,8 @@ ${Gf}`);
|
|
35837
35856
|
return e;
|
35838
35857
|
}
|
35839
35858
|
_getUnCloseOrders() {
|
35840
|
-
|
35859
|
+
const e = this._notCloseHistoryOrders.filter((t) => !t.isTiggerClose);
|
35860
|
+
return this._notCloseHistoryOrders = [...e], e.push(...this._orders.filter((t) => !t.isTiggerClose)), e;
|
35841
35861
|
}
|
35842
35862
|
_exit(e, t) {
|
35843
35863
|
if (!e.hasOwnProperty("profit") && !e.hasOwnProperty("loss") && !e.hasOwnProperty("stop") && !e.hasOwnProperty("limit") && (!e.hasOwnProperty("trail_offset") || !e.hasOwnProperty("trail_price") && !e.hasOwnProperty("trail_points"))) {
|
@@ -36058,7 +36078,7 @@ ${Gf}`);
|
|
36058
36078
|
profit_percent: O / A * 100,
|
36059
36079
|
max_profit_percent: d / A * 100,
|
36060
36080
|
trading_loss_percent: _ / A * 100
|
36061
|
-
}), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, u);
|
36081
|
+
}), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), !e.isPartClose && (!e.isTiggerClose || e.isMarketPriceLimit || e.isMarketPriceStop) && this._notCloseHistoryOrders.push(e), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, u);
|
36062
36082
|
}
|
36063
36083
|
_getCommission(e, t) {
|
36064
36084
|
const { commission_value: r = 0, commission_type: i } = this._options, s = e * t;
|
@@ -43359,16 +43379,16 @@ ${u}`), u;
|
|
43359
43379
|
return {
|
43360
43380
|
totalChangeCapital: this._totalChangeCapital,
|
43361
43381
|
orders: this._orders,
|
43362
|
-
historyOrders: this._historyOrder,
|
43382
|
+
// historyOrders: this._historyOrder,
|
43363
43383
|
pendingOrders: this._pendingOrders,
|
43364
43384
|
pendingCloseOrders: this._pendingCloseOrders,
|
43365
43385
|
exitOrders: this._exitOrders,
|
43366
43386
|
maxDrawdownVerifyIndex: this._maxDrawdownVerifyIndex,
|
43367
43387
|
useSetArgs: this._useSetArgs,
|
43368
43388
|
cacheArgs: this._cacheArgs,
|
43369
|
-
historyOrdersShard: this._historyOrdersShard,
|
43370
|
-
notCloseHistoryOrders: this._notCloseHistoryOrders
|
43371
|
-
historyOrderLen: this._historyOrderLen
|
43389
|
+
// historyOrdersShard: this._historyOrdersShard,
|
43390
|
+
notCloseHistoryOrders: this._notCloseHistoryOrders
|
43391
|
+
// historyOrderLen: this._historyOrderLen,
|
43372
43392
|
};
|
43373
43393
|
}
|
43374
43394
|
set _strategyCacheData(e) {
|
@@ -43386,7 +43406,7 @@ ${u}`), u;
|
|
43386
43406
|
notCloseHistoryOrders: l,
|
43387
43407
|
historyOrderLen: u
|
43388
43408
|
} = e;
|
43389
|
-
this._totalChangeCapital = t, this._orders = r, this.
|
43409
|
+
this._totalChangeCapital = t, this._orders = r, this._pendingOrders = s, this._pendingCloseOrders = o, this._exitOrders = a, this._maxDrawdownVerifyIndex = c, this._notCloseHistoryOrders = l, this._variables.strategy.updateOrders(this._orders), Object.keys(p).length && this._updateArgToOptions(p, b), this._variables.strategy.updateHistoryOrderCalcData(), this._variables.strategy.updateHistoryOrder();
|
43390
43410
|
}
|
43391
43411
|
get orders() {
|
43392
43412
|
return [...this._orders];
|
@@ -159,6 +159,7 @@ export default class Strategy {
|
|
159
159
|
private _useSetArgs;
|
160
160
|
private _id;
|
161
161
|
private _closeOrderList;
|
162
|
+
private _notCloseHistoryOrders;
|
162
163
|
constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick: number, errorListener: TccErrorListener, id: string);
|
163
164
|
get _strategyCacheData(): IKeyObjectValue;
|
164
165
|
set _strategyCacheData(val: IKeyObjectValue);
|
@@ -159,6 +159,7 @@ export default class Strategy {
|
|
159
159
|
private _cacheArgs;
|
160
160
|
private _useSetArgs;
|
161
161
|
private _closeOrderList;
|
162
|
+
private _notCloseHistoryOrders;
|
162
163
|
constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick: number, errorListener: TccErrorListener, id: string);
|
163
164
|
get _strategyCacheData(): IKeyObjectValue;
|
164
165
|
set _strategyCacheData(val: IKeyObjectValue);
|
@@ -163,6 +163,7 @@ export default class Strategy {
|
|
163
163
|
private _cacheArgs;
|
164
164
|
private _useSetArgs;
|
165
165
|
private _closeOrderList;
|
166
|
+
private _notCloseHistoryOrders;
|
166
167
|
constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick: number, errorListener: TccErrorListener, id: string);
|
167
168
|
get _strategyCacheData(): IKeyObjectValue;
|
168
169
|
set _strategyCacheData(val: IKeyObjectValue);
|
@@ -9170,7 +9170,7 @@ function mr(i, n, r) {
|
|
9170
9170
|
function I1() {
|
9171
9171
|
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
9172
9172
|
}
|
9173
|
-
const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-
|
9173
|
+
const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-YaH60Kkw.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
|
9174
9174
|
Lf.onerror = (i) => {
|
9175
9175
|
console.error(i);
|
9176
9176
|
};
|
@@ -74,7 +74,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
74
74
|
* @license
|
75
75
|
* Copyright 2019 Google LLC
|
76
76
|
* SPDX-License-Identifier: Apache-2.0
|
77
|
-
*/const ul=Symbol("Comlink.proxy"),Xu=Symbol("Comlink.endpoint"),Vu=Symbol("Comlink.releaseProxy"),Vn=Symbol("Comlink.finalizer"),za=Symbol("Comlink.thrown"),yl=a=>typeof a=="object"&&a!==null||typeof a=="function",Yu={canHandle:a=>yl(a)&&a[ul],serialize(a){const{port1:s,port2:r}=new MessageChannel;return fl(a,s),[r,[r]]},deserialize(a){return a.start(),Yn(a)}},Qu={canHandle:a=>yl(a)&&za 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}},_l=new Map([["proxy",Yu],["throw",Qu]]);function Zu(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function fl(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Zu(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:p,path:d}=Object.assign({path:[]},o.data),u=(o.data.argumentList||[]).map(Ms);let _;try{const g=d.slice(0,-1).reduce((w,C)=>w[C],a),x=d.reduce((w,C)=>w[C],a);switch(p){case"GET":_=x;break;case"SET":g[d.slice(-1)[0]]=Ms(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,u);break;case"CONSTRUCT":{const w=new x(...u);_=Zn(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;fl(a,C),_=ry(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[za]:0}}Promise.resolve(_).catch(g=>({value:g,[za]:0})).then(g=>{const[x,w]=Ea(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",n),gl(s),Vn in a&&typeof a[Vn]=="function"&&a[Vn]())}).catch(g=>{const[x,w]=Ea({value:new TypeError("Unserializable return value"),[za]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function Ju(a){return a.constructor.name==="MessagePort"}function gl(a){Ju(a)&&a.close()}function Yn(a,s){return Qn(a,[],s)}function Ca(a){if(a)throw new Error("Proxy has been released and is not useable")}function bl(a){return er(a,{type:"RELEASE"}).then(()=>{gl(a)})}const Na=new WeakMap,Sa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Na.get(a)||0)-1;Na.set(a,s),s===0&&bl(a)});function ey(a,s){const r=(Na.get(s)||0)+1;Na.set(s,r),Sa&&Sa.register(a,s,a)}function ty(a){Sa&&Sa.unregister(a)}function Qn(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,p){if(Ca(n),p===Vu)return()=>{ty(o),bl(a),n=!0};if(p==="then"){if(s.length===0)return{then:()=>o};const d=er(a,{type:"GET",path:s.map(u=>u.toString())}).then(Ms);return d.then.bind(d)}return Qn(a,[...s,p])},set(l,p,d){Ca(n);const[u,_]=Ea(d);return er(a,{type:"SET",path:[...s,p].map(g=>g.toString()),value:u},_).then(Ms)},apply(l,p,d){Ca(n);const u=s[s.length-1];if(u===Xu)return er(a,{type:"ENDPOINT"}).then(Ms);if(u==="bind")return Qn(a,s.slice(0,-1));const[_,g]=xl(d);return er(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ms)},construct(l,p){Ca(n);const[d,u]=xl(p);return er(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},u).then(Ms)}});return ey(o,a),o}function sy(a){return Array.prototype.concat.apply([],a)}function xl(a){const s=a.map(Ea);return[s.map(r=>r[0]),sy(s.map(r=>r[1]))]}const hl=new WeakMap;function ry(a,s){return hl.set(a,s),a}function Zn(a){return Object.assign(a,{[ul]:!0})}function Ea(a){for(const[s,r]of _l)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},hl.get(a)||[]]}function Ms(a){switch(a.type){case"HANDLER":return _l.get(a.name).deserialize(a.value);case"RAW":return a.value}}function er(a,s,r){return new Promise(n=>{const o=ay();a.addEventListener("message",function l(p){!p.data||!p.data.id||p.data.id!==o||(a.removeEventListener("message",l),n(p.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function ay(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const wl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-Dhiatl4n.js").href:new URL("assets/scriptsRunWorker-Dhiatl4n.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:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});wl.onerror=a=>{console.error(a)};async function vl(a){return await Ia.setInlayHints(a)}const Tl=Yn(wl),kl=Yn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CNzNddjG.js").href:new URL("assets/parserTccWorker-CNzNddjG.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:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function Dl(a,s=!1,r=Qt){const n=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];n&&(r=parseInt(n),r=r<3?3:r>6?6:r);const o=await xs(r);if(!o)return;const{functions:l,types:p,constants:d,variables:u,methods:_}=o.KEY_MAP_LIST;return await kl.parseTcc(a,s,Zn(vl),{functions:Object.fromEntries(l),methods:Object.fromEntries(_),types:Object.fromEntries(p),constants:Object.fromEntries(d),variables:Object.fromEntries(u)},r)}async function ny(a,s){const r=await xs(5);if(!r)return;const{functions:n,types:o,constants:l,variables:p,methods:d}=r.KEY_MAP_LIST;return await kl.parseLibraryCode(a,s,Zn(vl),{functions:Object.fromEntries(n),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function iy(a,s,r=!0,n=Qt){return await Tl.runScript(a,s,r,n)}async function oy(a){return await Tl.removeScript(a)}function ly(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-BxEYBjj-.js").href:new URL("assets/editor.worker-BxEYBjj-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:a?.name})}const{slice:cy,forEach:py}=[];function dy(a){return py.call(cy.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const Il=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,my=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const p=n.maxAge-0;if(Number.isNaN(p))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(p)}`}if(n.domain){if(!Il.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!Il.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},Al={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=my(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 uy={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return Al.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&Al.create(r,a,n,o,l)}},yy={name:"querystring",lookup(a){let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const l=n.substring(1).split("&");for(let p=0;p<l.length;p++){const d=l[p].indexOf("=");d>0&&l[p].substring(0,d)===s&&(r=l[p].substring(d+1))}}return r}};let Pr=null;const ql=()=>{if(Pr!==null)return Pr;try{Pr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Pr=!1}return Pr};var _y={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&ql())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&ql()&&window.localStorage.setItem(r,a)}};let Br=null;const zl=()=>{if(Br!==null)return Br;try{Br=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Br=!1}return Br};var fy={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&zl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&zl()&&window.sessionStorage.setItem(r,a)}},gy={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}},by={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}},xy={name:"path",lookup(a){let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof s=="number"?s:0]?.replace("/",""):void 0}},hy={name:"subdomain",lookup(a){let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};function wy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class Cl{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=dy(r,this.options||{},wy()),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(uy),this.addDetector(yy),this.addDetector(_y),this.addDetector(fy),this.addDetector(gy),this.addDetector(by),this.addDetector(xy),this.addDetector(hy)}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)}))}}Cl.type="languageDetector";const vy=(...a)=>{console?.warn&&(Fs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},Nl={},Jn=(...a)=>{Fs(a[0])&&Nl[a[0]]||(Fs(a[0])&&(Nl[a[0]]=new Date),vy(...a))},Sl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},ei=(a,s,r)=>{a.loadNamespaces(s,Sl(a,r))},El=(a,s,r,n)=>{if(Fs(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return ei(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,Sl(a,n))},Ty=(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)=>{if(r.bindI18n?.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),Fs=a=>typeof a=="string",ky=a=>typeof a=="object"&&a!==null,Dy=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Iy={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Ay=a=>Iy[a];let ti={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(Dy,Ay)};const qy=(a={})=>{ti={...ti,...a}},zy=()=>ti;let Ll;const Cy=a=>{Ll=a},Ny=()=>Ll,Sy={type:"3rdParty",init(a){qy(a.options.react),Cy(a)}},Ey=I.createContext();class Ly{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const My=(a,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Ml=(a,s,r,n)=>a.getFixedT(s,r,n),Fy=(a,s,r,n)=>I.useCallback(Ml(a,s,r,n),[a,s,r,n]),tr=(a,s={})=>{const{i18n:r}=s,{i18n:n,defaultNS:o}=I.useContext(Ey)||{},l=r||n||Ny();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new Ly),!l){Jn("You will need to pass in an i18next instance by using initReactI18next");const j=(R,z)=>Fs(z)?z:ky(z)&&Fs(z.defaultValue)?z.defaultValue:Array.isArray(R)?R[R.length-1]:R,W=[j,{},!1];return W.t=j,W.i18n={},W.ready=!1,W}l.options.react?.wait&&Jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...zy(),...l.options.react,...s},{useSuspense:d,keyPrefix:u}=p;let _=a||o||l.options?.defaultNS;_=Fs(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>Ty(j,l,p)),x=Fy(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ml(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),[M,K]=I.useState(w);let G=_.join();s.lng&&(G=`${s.lng}${G}`);const X=My(G),q=I.useRef(!0);I.useEffect(()=>{const{bindI18n:j,bindI18nStore:W}=p;q.current=!0,!g&&!d&&(s.lng?El(l,s.lng,_,()=>{q.current&&K(C)}):ei(l,_,()=>{q.current&&K(C)})),g&&X&&X!==G&&q.current&&K(C);const R=()=>{q.current&&K(C)};return j&&l?.on(j,R),W&&l?.store.on(W,R),()=>{q.current=!1,l&&j?.split(" ").forEach(z=>l.off(z,R)),W&&l&&W.split(" ").forEach(z=>l.store.off(z,R))}},[l,G]),I.useEffect(()=>{q.current&&g&&K(w)},[l,u,g]);const se=[M,l,g];if(se.t=M,se.i18n=l,se.ready=g,g||!g&&!d)return se;throw new Promise(j=>{s.lng?El(l,s.lng,_,()=>j()):ei(l,_,()=>j())})},Oy={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® v{{version}} 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"},Py={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™ v{{version}} 参考手册","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":"“点击”关键词以获得更多帮助"};Oe.use(Cl).use(Sy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Oy},zh:{translation:Py}}}),self.MonacoEnvironment={getWorker(){return new ly({name:"Editor Worker"})}},On.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const By=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:p,readOnly:d,defaultValue:u,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:w,onActionTrigger:C,onEditorDidMount:M,onVersionChange:K}=a,{t:G,i18n:X}=tr(),q=I.useRef(null),se=I.useRef(null),j=I.useRef(!1),W=I.useRef(!1);I.useImperativeHandle(s,()=>({setOriginalScript(ne){q.current?.setOriginalScript(ne)},setScript(ne){q.current?.setValue(ne)},gotoLine(){q.current?.gotoLine()},getEditorLayout(){return q.current?.getEditorLayout()},setPosition(ne,De){q.current?.setPosition({column:ne,lineNumber:De})},setModelMarkers(ne){W.current=!0,q.current?.setModelMarkers(ne),setTimeout(()=>{W.current=!1},2e3)},focus(){q.current?.focus()}})),I.useEffect(()=>{p?q.current?.addDiffDecorations():q.current?.removeDiffDecorations()},[p]),I.useEffect(()=>{o&&Me.editor.setTheme(o)},[o]),I.useEffect(()=>{_&&X.changeLanguage(_)},[_]),I.useEffect(()=>{q.current?.updateActionTrigger(C)},[C]),I.useEffect(()=>{x&&q.current?.addLinkOpenFunc(x)},[x]);function R(ne,De){Ia.setEditor(ne),q.current=new Wu(ne,De,C),x&&q.current?.addLinkOpenFunc(x),p&&q.current?.addDiffDecorations(),xu(ne),requestAnimationFrame(te);const V=ne.getValue();q.current.onChangeCursorPosition(w),g&&g(V),!d&&z(V),M&&M()}const z=I.useCallback(async ne=>{const De=q.current?.getVersion();K&&K(De||Qt),j.current=!1;const{errors:V,functions:ie,methods:Z,types:ce,variables:ue,overloadsFuncs:$,imports:oe,enums:we}=await Dl(ne,!1,De),_e=new Map(Object.entries(ie)),Ke=new Map(Object.entries(Z)),Xe=new Map(Object.entries(ce)),it=new Map(Object.entries(ue)),tt=new Map(Object.entries(oe)),Qe=new Map(Object.entries(we));hs.setUserDefined({functions:_e,methods:Ke,types:Xe,variables:it,imports:tt,enums:Qe},$),$t.setUserDefind(_e,Xe,it,Ke,Qe);const ht=V.map(wt=>({...wt,severity:wt.type||Me.MarkerSeverity.Error}));d||!j.current&&!W.current&&ht.length&&q.current?.setModelMarkers(ht)},[d]),J=I.useMemo(()=>vu.debounce(z,1500),[z]);function re(ne){if(d){z(ne||"");return}j.current=!0,Ia.clearInlayHints(),q.current?.setModelMarkers([]),ne!==void 0&&(g&&g(ne),J(ne))}const te=I.useCallback(()=>{const ne=se.current?.getBoundingClientRect();q.current?.setEditorLayout(ne?.height||0,ne?.width)},[]);return I.useEffect(()=>{const ne=()=>{window.requestAnimationFrame(te)},De=new ResizeObserver(ne);return se.current&&De.observe(se.current),()=>{se.current&&De.unobserve(se.current),De.disconnect(),q.current?.dispose()}},[]),T.jsx("div",{ref:se,children:T.jsx(Km,{height:r,width:n||"100%",defaultLanguage:je,defaultValue:u||`//@version=6
|
77
|
+
*/const ul=Symbol("Comlink.proxy"),Xu=Symbol("Comlink.endpoint"),Vu=Symbol("Comlink.releaseProxy"),Vn=Symbol("Comlink.finalizer"),za=Symbol("Comlink.thrown"),yl=a=>typeof a=="object"&&a!==null||typeof a=="function",Yu={canHandle:a=>yl(a)&&a[ul],serialize(a){const{port1:s,port2:r}=new MessageChannel;return fl(a,s),[r,[r]]},deserialize(a){return a.start(),Yn(a)}},Qu={canHandle:a=>yl(a)&&za 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}},_l=new Map([["proxy",Yu],["throw",Qu]]);function Zu(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function fl(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Zu(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:p,path:d}=Object.assign({path:[]},o.data),u=(o.data.argumentList||[]).map(Ms);let _;try{const g=d.slice(0,-1).reduce((w,C)=>w[C],a),x=d.reduce((w,C)=>w[C],a);switch(p){case"GET":_=x;break;case"SET":g[d.slice(-1)[0]]=Ms(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,u);break;case"CONSTRUCT":{const w=new x(...u);_=Zn(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;fl(a,C),_=ry(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[za]:0}}Promise.resolve(_).catch(g=>({value:g,[za]:0})).then(g=>{const[x,w]=Ea(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",n),gl(s),Vn in a&&typeof a[Vn]=="function"&&a[Vn]())}).catch(g=>{const[x,w]=Ea({value:new TypeError("Unserializable return value"),[za]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function Ju(a){return a.constructor.name==="MessagePort"}function gl(a){Ju(a)&&a.close()}function Yn(a,s){return Qn(a,[],s)}function Ca(a){if(a)throw new Error("Proxy has been released and is not useable")}function bl(a){return er(a,{type:"RELEASE"}).then(()=>{gl(a)})}const Na=new WeakMap,Sa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Na.get(a)||0)-1;Na.set(a,s),s===0&&bl(a)});function ey(a,s){const r=(Na.get(s)||0)+1;Na.set(s,r),Sa&&Sa.register(a,s,a)}function ty(a){Sa&&Sa.unregister(a)}function Qn(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,p){if(Ca(n),p===Vu)return()=>{ty(o),bl(a),n=!0};if(p==="then"){if(s.length===0)return{then:()=>o};const d=er(a,{type:"GET",path:s.map(u=>u.toString())}).then(Ms);return d.then.bind(d)}return Qn(a,[...s,p])},set(l,p,d){Ca(n);const[u,_]=Ea(d);return er(a,{type:"SET",path:[...s,p].map(g=>g.toString()),value:u},_).then(Ms)},apply(l,p,d){Ca(n);const u=s[s.length-1];if(u===Xu)return er(a,{type:"ENDPOINT"}).then(Ms);if(u==="bind")return Qn(a,s.slice(0,-1));const[_,g]=xl(d);return er(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ms)},construct(l,p){Ca(n);const[d,u]=xl(p);return er(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},u).then(Ms)}});return ey(o,a),o}function sy(a){return Array.prototype.concat.apply([],a)}function xl(a){const s=a.map(Ea);return[s.map(r=>r[0]),sy(s.map(r=>r[1]))]}const hl=new WeakMap;function ry(a,s){return hl.set(a,s),a}function Zn(a){return Object.assign(a,{[ul]:!0})}function Ea(a){for(const[s,r]of _l)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},hl.get(a)||[]]}function Ms(a){switch(a.type){case"HANDLER":return _l.get(a.name).deserialize(a.value);case"RAW":return a.value}}function er(a,s,r){return new Promise(n=>{const o=ay();a.addEventListener("message",function l(p){!p.data||!p.data.id||p.data.id!==o||(a.removeEventListener("message",l),n(p.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function ay(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const wl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-YaH60Kkw.js").href:new URL("assets/scriptsRunWorker-YaH60Kkw.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:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});wl.onerror=a=>{console.error(a)};async function vl(a){return await Ia.setInlayHints(a)}const Tl=Yn(wl),kl=Yn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CNzNddjG.js").href:new URL("assets/parserTccWorker-CNzNddjG.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:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function Dl(a,s=!1,r=Qt){const n=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];n&&(r=parseInt(n),r=r<3?3:r>6?6:r);const o=await xs(r);if(!o)return;const{functions:l,types:p,constants:d,variables:u,methods:_}=o.KEY_MAP_LIST;return await kl.parseTcc(a,s,Zn(vl),{functions:Object.fromEntries(l),methods:Object.fromEntries(_),types:Object.fromEntries(p),constants:Object.fromEntries(d),variables:Object.fromEntries(u)},r)}async function ny(a,s){const r=await xs(5);if(!r)return;const{functions:n,types:o,constants:l,variables:p,methods:d}=r.KEY_MAP_LIST;return await kl.parseLibraryCode(a,s,Zn(vl),{functions:Object.fromEntries(n),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function iy(a,s,r=!0,n=Qt){return await Tl.runScript(a,s,r,n)}async function oy(a){return await Tl.removeScript(a)}function ly(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-BxEYBjj-.js").href:new URL("assets/editor.worker-BxEYBjj-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:a?.name})}const{slice:cy,forEach:py}=[];function dy(a){return py.call(cy.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const Il=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,my=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const p=n.maxAge-0;if(Number.isNaN(p))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(p)}`}if(n.domain){if(!Il.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!Il.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},Al={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=my(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 uy={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return Al.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&Al.create(r,a,n,o,l)}},yy={name:"querystring",lookup(a){let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const l=n.substring(1).split("&");for(let p=0;p<l.length;p++){const d=l[p].indexOf("=");d>0&&l[p].substring(0,d)===s&&(r=l[p].substring(d+1))}}return r}};let Pr=null;const ql=()=>{if(Pr!==null)return Pr;try{Pr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Pr=!1}return Pr};var _y={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&ql())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&ql()&&window.localStorage.setItem(r,a)}};let Br=null;const zl=()=>{if(Br!==null)return Br;try{Br=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Br=!1}return Br};var fy={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&zl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&zl()&&window.sessionStorage.setItem(r,a)}},gy={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}},by={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}},xy={name:"path",lookup(a){let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof s=="number"?s:0]?.replace("/",""):void 0}},hy={name:"subdomain",lookup(a){let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};function wy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class Cl{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=dy(r,this.options||{},wy()),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(uy),this.addDetector(yy),this.addDetector(_y),this.addDetector(fy),this.addDetector(gy),this.addDetector(by),this.addDetector(xy),this.addDetector(hy)}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)}))}}Cl.type="languageDetector";const vy=(...a)=>{console?.warn&&(Fs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},Nl={},Jn=(...a)=>{Fs(a[0])&&Nl[a[0]]||(Fs(a[0])&&(Nl[a[0]]=new Date),vy(...a))},Sl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},ei=(a,s,r)=>{a.loadNamespaces(s,Sl(a,r))},El=(a,s,r,n)=>{if(Fs(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return ei(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,Sl(a,n))},Ty=(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)=>{if(r.bindI18n?.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),Fs=a=>typeof a=="string",ky=a=>typeof a=="object"&&a!==null,Dy=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Iy={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Ay=a=>Iy[a];let ti={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(Dy,Ay)};const qy=(a={})=>{ti={...ti,...a}},zy=()=>ti;let Ll;const Cy=a=>{Ll=a},Ny=()=>Ll,Sy={type:"3rdParty",init(a){qy(a.options.react),Cy(a)}},Ey=I.createContext();class Ly{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const My=(a,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Ml=(a,s,r,n)=>a.getFixedT(s,r,n),Fy=(a,s,r,n)=>I.useCallback(Ml(a,s,r,n),[a,s,r,n]),tr=(a,s={})=>{const{i18n:r}=s,{i18n:n,defaultNS:o}=I.useContext(Ey)||{},l=r||n||Ny();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new Ly),!l){Jn("You will need to pass in an i18next instance by using initReactI18next");const j=(R,z)=>Fs(z)?z:ky(z)&&Fs(z.defaultValue)?z.defaultValue:Array.isArray(R)?R[R.length-1]:R,W=[j,{},!1];return W.t=j,W.i18n={},W.ready=!1,W}l.options.react?.wait&&Jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...zy(),...l.options.react,...s},{useSuspense:d,keyPrefix:u}=p;let _=a||o||l.options?.defaultNS;_=Fs(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>Ty(j,l,p)),x=Fy(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ml(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),[M,K]=I.useState(w);let G=_.join();s.lng&&(G=`${s.lng}${G}`);const X=My(G),q=I.useRef(!0);I.useEffect(()=>{const{bindI18n:j,bindI18nStore:W}=p;q.current=!0,!g&&!d&&(s.lng?El(l,s.lng,_,()=>{q.current&&K(C)}):ei(l,_,()=>{q.current&&K(C)})),g&&X&&X!==G&&q.current&&K(C);const R=()=>{q.current&&K(C)};return j&&l?.on(j,R),W&&l?.store.on(W,R),()=>{q.current=!1,l&&j?.split(" ").forEach(z=>l.off(z,R)),W&&l&&W.split(" ").forEach(z=>l.store.off(z,R))}},[l,G]),I.useEffect(()=>{q.current&&g&&K(w)},[l,u,g]);const se=[M,l,g];if(se.t=M,se.i18n=l,se.ready=g,g||!g&&!d)return se;throw new Promise(j=>{s.lng?El(l,s.lng,_,()=>j()):ei(l,_,()=>j())})},Oy={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® v{{version}} 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"},Py={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™ v{{version}} 参考手册","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":"“点击”关键词以获得更多帮助"};Oe.use(Cl).use(Sy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Oy},zh:{translation:Py}}}),self.MonacoEnvironment={getWorker(){return new ly({name:"Editor Worker"})}},On.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const By=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:p,readOnly:d,defaultValue:u,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:w,onActionTrigger:C,onEditorDidMount:M,onVersionChange:K}=a,{t:G,i18n:X}=tr(),q=I.useRef(null),se=I.useRef(null),j=I.useRef(!1),W=I.useRef(!1);I.useImperativeHandle(s,()=>({setOriginalScript(ne){q.current?.setOriginalScript(ne)},setScript(ne){q.current?.setValue(ne)},gotoLine(){q.current?.gotoLine()},getEditorLayout(){return q.current?.getEditorLayout()},setPosition(ne,De){q.current?.setPosition({column:ne,lineNumber:De})},setModelMarkers(ne){W.current=!0,q.current?.setModelMarkers(ne),setTimeout(()=>{W.current=!1},2e3)},focus(){q.current?.focus()}})),I.useEffect(()=>{p?q.current?.addDiffDecorations():q.current?.removeDiffDecorations()},[p]),I.useEffect(()=>{o&&Me.editor.setTheme(o)},[o]),I.useEffect(()=>{_&&X.changeLanguage(_)},[_]),I.useEffect(()=>{q.current?.updateActionTrigger(C)},[C]),I.useEffect(()=>{x&&q.current?.addLinkOpenFunc(x)},[x]);function R(ne,De){Ia.setEditor(ne),q.current=new Wu(ne,De,C),x&&q.current?.addLinkOpenFunc(x),p&&q.current?.addDiffDecorations(),xu(ne),requestAnimationFrame(te);const V=ne.getValue();q.current.onChangeCursorPosition(w),g&&g(V),!d&&z(V),M&&M()}const z=I.useCallback(async ne=>{const De=q.current?.getVersion();K&&K(De||Qt),j.current=!1;const{errors:V,functions:ie,methods:Z,types:ce,variables:ue,overloadsFuncs:$,imports:oe,enums:we}=await Dl(ne,!1,De),_e=new Map(Object.entries(ie)),Ke=new Map(Object.entries(Z)),Xe=new Map(Object.entries(ce)),it=new Map(Object.entries(ue)),tt=new Map(Object.entries(oe)),Qe=new Map(Object.entries(we));hs.setUserDefined({functions:_e,methods:Ke,types:Xe,variables:it,imports:tt,enums:Qe},$),$t.setUserDefind(_e,Xe,it,Ke,Qe);const ht=V.map(wt=>({...wt,severity:wt.type||Me.MarkerSeverity.Error}));d||!j.current&&!W.current&&ht.length&&q.current?.setModelMarkers(ht)},[d]),J=I.useMemo(()=>vu.debounce(z,1500),[z]);function re(ne){if(d){z(ne||"");return}j.current=!0,Ia.clearInlayHints(),q.current?.setModelMarkers([]),ne!==void 0&&(g&&g(ne),J(ne))}const te=I.useCallback(()=>{const ne=se.current?.getBoundingClientRect();q.current?.setEditorLayout(ne?.height||0,ne?.width)},[]);return I.useEffect(()=>{const ne=()=>{window.requestAnimationFrame(te)},De=new ResizeObserver(ne);return se.current&&De.observe(se.current),()=>{se.current&&De.unobserve(se.current),De.disconnect(),q.current?.dispose()}},[]),T.jsx("div",{ref:se,children:T.jsx(Km,{height:r,width:n||"100%",defaultLanguage:je,defaultValue:u||`//@version=6
|
78
78
|
indicator("我的脚本")
|
79
79
|
plot(close)
|
80
80
|
`,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,...d?$m:{},readOnlyMessage:{value:G("This script is read-only. It cannot be edited.")},...l},onMount:R,onChange:re})})},Ry=I.forwardRef(By),Ky=a=>{const{theme:s,modified:r,original:n,height:o,width:l,renderSideBySide:p=!0,version:d=Qt}=a,u=I.useCallback(async(_,g)=>{g.languages.register({id:je}),g.editor.defineTheme("vs-dark",Hn),g.editor.defineTheme("vs",$n);const x=await Ta(d);x&&(g.languages.setMonarchTokensProvider(je,x.LANGUAGE_MONARCH_TOKENS),g.languages.setLanguageConfiguration(je,x.CONFIGURATION))},[d]);return T.jsx(Fm,{height:o||"90vh",width:l||"100%",theme:s||"vs-dark",options:{readOnly:!0,renderSideBySide:p,scrollBeyondLastLine:!1},language:je,modified:r,original:n,onMount:u})};F.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"}(F.VMarkerSeverity||(F.VMarkerSeverity={}));var La={},Uy=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()}},$y=Uy,Fl={"text/plain":"Text","text/html":"Url",default:"Text"},Hy="Copy to clipboard: #{key}, Enter";function jy(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function Gy(a,s){var r,n,o,l,p,d,u=!1;s||(s={}),r=s.debug||!1;try{o=$y(),l=document.createRange(),p=document.getSelection(),d=document.createElement("span"),d.textContent=a,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.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=Fl[s.format]||Fl.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(d),l.selectNodeContents(d),p.addRange(l);var _=document.execCommand("copy");if(!_)throw new Error("copy command was unsuccessful");u=!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),u=!0}catch(x){r&&console.error("unable to copy using clipboardData: ",x),r&&console.error("falling back to prompt"),n=jy("message"in s?s.message:Hy),window.prompt(n,a)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(l):p.removeAllRanges()),d&&document.body.removeChild(d),o()}return u}var Wy=Gy;function si(a){"@babel/helpers - typeof";return si=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},si(a)}Object.defineProperty(La,"__esModule",{value:!0}),La.CopyToClipboard=void 0;var Ma=Ol(I),Xy=Ol(Wy),Vy=["text","onCopy","options","children"];function Ol(a){return a&&a.__esModule?a:{default:a}}function Pl(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 Bl(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Pl(Object(r),!0).forEach(function(n){ai(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Pl(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function Yy(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 Zy(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function Rl(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 Jy(a,s,r){return s&&Rl(a.prototype,s),r&&Rl(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function e_(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&&ri(a,s)}function ri(a,s){return ri=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},ri(a,s)}function t_(a){var s=r_();return function(){var n=Fa(a),o;if(s){var l=Fa(this).constructor;o=Reflect.construct(n,arguments,l)}else o=n.apply(this,arguments);return s_(this,o)}}function s_(a,s){if(s&&(si(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kl(a)}function Kl(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function r_(){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 Fa(a){return Fa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Fa(a)}function ai(a,s,r){return s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}var Ul=function(a){e_(r,a);var s=t_(r);function r(){var n;Zy(this,r);for(var o=arguments.length,l=new Array(o),p=0;p<o;p++)l[p]=arguments[p];return n=s.call.apply(s,[this].concat(l)),ai(Kl(n),"onClick",function(d){var u=n.props,_=u.text,g=u.onCopy,x=u.children,w=u.options,C=Ma.default.Children.only(x),M=(0,Xy.default)(_,w);g&&g(_,M),C&&C.props&&typeof C.props.onClick=="function"&&C.props.onClick(d)}),n}return Jy(r,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var l=o.children,p=Yy(o,Vy),d=Ma.default.Children.only(l);return Ma.default.cloneElement(d,Bl(Bl({},p),{},{onClick:this.onClick}))}}]),r}(Ma.default.PureComponent);La.CopyToClipboard=Ul,ai(Ul,"defaultProps",{onCopy:void 0,options:void 0});var a_=La,ni=a_.CopyToClipboard;ni.CopyToClipboard=ni;var n_=ni;const sr=Ed(n_);Me.languages.register({id:je}),Me.editor.defineTheme("vs-dark",Hn),Me.editor.defineTheme("vs",$n);const $l=[{label:"版本 v3",version:3},{label:"版本 v4",version:4},{label:"版本 v5",version:5},{label:"版本 v6",version:6}];async function ii(a){const s=await Ta(a);s&&(Me.languages.setMonarchTokensProvider(je,s.LANGUAGE_MONARCH_TOKENS),Me.languages.setLanguageConfiguration(je,s.CONFIGURATION))}async function Hl(a,s,r){return s&&Me.editor.setTheme(s.includes("dark")?"vs-dark":"light"),r&&await ii(r),await Me.editor.colorize(a,je,{tabSize:4})}async function oi(a,s=0){const r=a[s];if(!r)return;const{name:n,args:o,type:l,desc:p,examples:d,remarks:u,seeAlso:_,syntax:g,detailedDesc:x,fields:w,returns:C}=r,M={name:n,orirginalName:n};if(a.length>1&&(M.overloads=`${a.length} ${Oe.t("overloads")}`),l&&(M.type=l),o&&(M.name=`${n}()`,M.args=o.map(K=>{const{name:G,desc:X,displayType:q}=K;return{label:`${G} (${q})`,desc:X&&Os(X)}})),p&&(M.desc=p.map(K=>Os(K))),d&&(M.originalExample=d.join(`
|