@guihz/trading-vue-editor-tes 0.1.26 → 0.1.28

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.
@@ -3182,7 +3182,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
3182
3182
  for (typeof $ == "string" && ($ = [$]), K = 0; K < $.length; K++)
3183
3183
  Z = $[K].split("|"), i0 = S(Z[0]), w0 = S(Z[1]), i[i0] = w0, o[i0] = Z[0], i[w0] = i0, o[w0] = Z[1];
3184
3184
  }
3185
- function c0($) {
3185
+ function o0($) {
3186
3186
  var K, Z, i0, w0;
3187
3187
  if (!(!$ || !$.length))
3188
3188
  for (K = 0; K < $.length; K++)
@@ -3207,7 +3207,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
3207
3207
  }) : Z;
3208
3208
  }
3209
3209
  function r0($) {
3210
- k($.zones), G($.links), c0($.countries), f0.dataVersion = $.version;
3210
+ k($.zones), G($.links), o0($.countries), f0.dataVersion = $.version;
3211
3211
  }
3212
3212
  function k0($) {
3213
3213
  return k0.didShowError || (k0.didShowError = !0, B0("moment.tz.zoneExists('" + $ + "') has been deprecated in favor of !moment.tz.zone('" + $ + "')")), !!X($);
@@ -4255,7 +4255,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
4255
4255
  hc.exports;
4256
4256
  (function(n, e) {
4257
4257
  (function() {
4258
- var t, r = "4.17.21", i = 200, s = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", o = "Expected a function", a = "Invalid `variable` option passed into `_.template`", c = "__lodash_hash_undefined__", p = 500, b = "__lodash_placeholder__", M = 1, l = 2, u = 4, O = 1, d = 2, _ = 1, f = 2, A = 4, q = 8, g = 16, W = 32, v = 64, y = 128, L = 256, D = 512, N = 30, w = "...", x = 800, T = 16, S = 1, k = 2, X = 3, Y = 1 / 0, V = 9007199254740991, G = 17976931348623157e292, c0 = NaN, d0 = 4294967295, p0 = d0 - 1, r0 = d0 >>> 1, k0 = [
4258
+ var t, r = "4.17.21", i = 200, s = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", o = "Expected a function", a = "Invalid `variable` option passed into `_.template`", c = "__lodash_hash_undefined__", p = 500, b = "__lodash_placeholder__", M = 1, l = 2, u = 4, O = 1, d = 2, _ = 1, f = 2, A = 4, q = 8, g = 16, W = 32, v = 64, y = 128, L = 256, D = 512, N = 30, w = "...", x = 800, T = 16, S = 1, k = 2, X = 3, Y = 1 / 0, V = 9007199254740991, G = 17976931348623157e292, o0 = NaN, d0 = 4294967295, p0 = d0 - 1, r0 = d0 >>> 1, k0 = [
4259
4259
  ["ary", y],
4260
4260
  ["bind", _],
4261
4261
  ["bindKey", f],
@@ -4265,7 +4265,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
4265
4265
  ["partial", W],
4266
4266
  ["partialRight", v],
4267
4267
  ["rearg", L]
4268
- ], F0 = "[object Arguments]", B0 = "[object Array]", f0 = "[object AsyncFunction]", s1 = "[object Boolean]", e1 = "[object Date]", n1 = "[object DOMException]", V0 = "[object Error]", x0 = "[object Function]", $ = "[object GeneratorFunction]", K = "[object Map]", Z = "[object Number]", i0 = "[object Null]", w0 = "[object Object]", a1 = "[object Promise]", P1 = "[object Proxy]", O1 = "[object RegExp]", m1 = "[object Set]", ri = "[object String]", I = "[object Symbol]", j = "[object Undefined]", Q = "[object WeakMap]", a0 = "[object WeakSet]", M0 = "[object ArrayBuffer]", o0 = "[object DataView]", A0 = "[object Float32Array]", u0 = "[object Float64Array]", q0 = "[object Int8Array]", z0 = "[object Int16Array]", x1 = "[object Int32Array]", F1 = "[object Uint8Array]", ze = "[object Uint8ClampedArray]", ke = "[object Uint16Array]", xe = "[object Uint32Array]", xt = /\b__p \+= '';/g, Ct = /\b(__p \+=) '' \+/g, Si = /(__e\(.*?\)|\b__t\)) \+\n'';/g, _s = /&(?:amp|lt|gt|quot|#39);/g, Bo = /[&<>"']/g, h2 = RegExp(_s.source), _2 = RegExp(Bo.source), A2 = /<%-([\s\S]+?)%>/g, q2 = /<%([\s\S]+?)%>/g, xo = /<%=([\s\S]+?)%>/g, m2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, g2 = /^\w*$/, W2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, kn = /[\\^$.*+?()[\]{}|]/g, v2 = RegExp(kn.source), Pn = /^\s+/, y2 = /\s/, R2 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, N2 = /\{\n\/\* \[wrapped with (.+)\] \*/, L2 = /,? & /, w2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, D2 = /[()=,{}\[\]\/\s]/, B2 = /\\(\\)?/g, x2 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Co = /\w*$/, C2 = /^[-+]0x[0-9a-f]+$/i, E2 = /^0b[01]+$/i, T2 = /^\[object .+?Constructor\]$/, X2 = /^0o[0-7]+$/i, I2 = /^(?:0|[1-9]\d*)$/, $2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ks = /($^)/, As = /['\n\r\u2028\u2029\\]/g, N1 = "\\ud800-\\udfff", Ze = "\\u0300-\\u036f", F2 = "\\ufe20-\\ufe2f", Gs = "\\u20d0-\\u20ff", ki = Ze + F2 + Gs, Eo = "\\u2700-\\u27bf", XM = "a-z\\xdf-\\xf6\\xf8-\\xff", lh = "\\xac\\xb1\\xd7\\xf7", zh = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", uh = "\\u2000-\\u206f", Oh = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", IM = "A-Z\\xc0-\\xd6\\xd8-\\xde", $M = "\\ufe0e\\ufe0f", FM = lh + zh + uh + Oh, S2 = "['’]", dh = "[" + N1 + "]", SM = "[" + FM + "]", To = "[" + ki + "]", kM = "\\d+", fh = "[" + Eo + "]", PM = "[" + XM + "]", HM = "[^" + N1 + FM + kM + Eo + XM + IM + "]", k2 = "\\ud83c[\\udffb-\\udfff]", hh = "(?:" + To + "|" + k2 + ")", UM = "[^" + N1 + "]", P2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", H2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", Qs = "[" + IM + "]", jM = "\\u200d", VM = "(?:" + PM + "|" + HM + ")", _h = "(?:" + Qs + "|" + HM + ")", YM = "(?:" + S2 + "(?:d|ll|m|re|s|t|ve))?", KM = "(?:" + S2 + "(?:D|LL|M|RE|S|T|VE))?", GM = hh + "?", QM = "[" + $M + "]?", Ah = "(?:" + jM + "(?:" + [UM, P2, H2].join("|") + ")" + QM + GM + ")*", qh = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", mh = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", JM = QM + GM + Ah, gh = "(?:" + [fh, P2, H2].join("|") + ")" + JM, Wh = "(?:" + [UM + To + "?", To, P2, H2, dh].join("|") + ")", vh = RegExp(S2, "g"), yh = RegExp(To, "g"), U2 = RegExp(k2 + "(?=" + k2 + ")|" + Wh + JM, "g"), Rh = RegExp([
4268
+ ], F0 = "[object Arguments]", B0 = "[object Array]", f0 = "[object AsyncFunction]", s1 = "[object Boolean]", e1 = "[object Date]", n1 = "[object DOMException]", V0 = "[object Error]", x0 = "[object Function]", $ = "[object GeneratorFunction]", K = "[object Map]", Z = "[object Number]", i0 = "[object Null]", w0 = "[object Object]", a1 = "[object Promise]", P1 = "[object Proxy]", O1 = "[object RegExp]", m1 = "[object Set]", ri = "[object String]", I = "[object Symbol]", j = "[object Undefined]", Q = "[object WeakMap]", c0 = "[object WeakSet]", M0 = "[object ArrayBuffer]", a0 = "[object DataView]", A0 = "[object Float32Array]", u0 = "[object Float64Array]", q0 = "[object Int8Array]", z0 = "[object Int16Array]", x1 = "[object Int32Array]", F1 = "[object Uint8Array]", ze = "[object Uint8ClampedArray]", ke = "[object Uint16Array]", xe = "[object Uint32Array]", xt = /\b__p \+= '';/g, Ct = /\b(__p \+=) '' \+/g, Si = /(__e\(.*?\)|\b__t\)) \+\n'';/g, _s = /&(?:amp|lt|gt|quot|#39);/g, Bo = /[&<>"']/g, h2 = RegExp(_s.source), _2 = RegExp(Bo.source), A2 = /<%-([\s\S]+?)%>/g, q2 = /<%([\s\S]+?)%>/g, xo = /<%=([\s\S]+?)%>/g, m2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, g2 = /^\w*$/, W2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, kn = /[\\^$.*+?()[\]{}|]/g, v2 = RegExp(kn.source), Pn = /^\s+/, y2 = /\s/, R2 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, N2 = /\{\n\/\* \[wrapped with (.+)\] \*/, L2 = /,? & /, w2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, D2 = /[()=,{}\[\]\/\s]/, B2 = /\\(\\)?/g, x2 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Co = /\w*$/, C2 = /^[-+]0x[0-9a-f]+$/i, E2 = /^0b[01]+$/i, T2 = /^\[object .+?Constructor\]$/, X2 = /^0o[0-7]+$/i, I2 = /^(?:0|[1-9]\d*)$/, $2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ks = /($^)/, As = /['\n\r\u2028\u2029\\]/g, N1 = "\\ud800-\\udfff", Ze = "\\u0300-\\u036f", F2 = "\\ufe20-\\ufe2f", Gs = "\\u20d0-\\u20ff", ki = Ze + F2 + Gs, Eo = "\\u2700-\\u27bf", XM = "a-z\\xdf-\\xf6\\xf8-\\xff", lh = "\\xac\\xb1\\xd7\\xf7", zh = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", uh = "\\u2000-\\u206f", Oh = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", IM = "A-Z\\xc0-\\xd6\\xd8-\\xde", $M = "\\ufe0e\\ufe0f", FM = lh + zh + uh + Oh, S2 = "['’]", dh = "[" + N1 + "]", SM = "[" + FM + "]", To = "[" + ki + "]", kM = "\\d+", fh = "[" + Eo + "]", PM = "[" + XM + "]", HM = "[^" + N1 + FM + kM + Eo + XM + IM + "]", k2 = "\\ud83c[\\udffb-\\udfff]", hh = "(?:" + To + "|" + k2 + ")", UM = "[^" + N1 + "]", P2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", H2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", Qs = "[" + IM + "]", jM = "\\u200d", VM = "(?:" + PM + "|" + HM + ")", _h = "(?:" + Qs + "|" + HM + ")", YM = "(?:" + S2 + "(?:d|ll|m|re|s|t|ve))?", KM = "(?:" + S2 + "(?:D|LL|M|RE|S|T|VE))?", GM = hh + "?", QM = "[" + $M + "]?", Ah = "(?:" + jM + "(?:" + [UM, P2, H2].join("|") + ")" + QM + GM + ")*", qh = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", mh = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", JM = QM + GM + Ah, gh = "(?:" + [fh, P2, H2].join("|") + ")" + JM, Wh = "(?:" + [UM + To + "?", To, P2, H2, dh].join("|") + ")", vh = RegExp(S2, "g"), yh = RegExp(To, "g"), U2 = RegExp(k2 + "(?=" + k2 + ")|" + Wh + JM, "g"), Rh = RegExp([
4269
4269
  Qs + "?" + PM + "+" + YM + "(?=" + [SM, Qs, "$"].join("|") + ")",
4270
4270
  _h + "+" + KM + "(?=" + [SM, Qs + VM, "$"].join("|") + ")",
4271
4271
  Qs + "?" + VM + "+" + YM,
@@ -4306,9 +4306,9 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
4306
4306
  "parseInt",
4307
4307
  "setTimeout"
4308
4308
  ], Dh = -1, se = {};
4309
- se[A0] = se[u0] = se[q0] = se[z0] = se[x1] = se[F1] = se[ze] = se[ke] = se[xe] = !0, se[F0] = se[B0] = se[M0] = se[s1] = se[o0] = se[e1] = se[V0] = se[x0] = se[K] = se[Z] = se[w0] = se[O1] = se[m1] = se[ri] = se[Q] = !1;
4309
+ se[A0] = se[u0] = se[q0] = se[z0] = se[x1] = se[F1] = se[ze] = se[ke] = se[xe] = !0, se[F0] = se[B0] = se[M0] = se[s1] = se[a0] = se[e1] = se[V0] = se[x0] = se[K] = se[Z] = se[w0] = se[O1] = se[m1] = se[ri] = se[Q] = !1;
4310
4310
  var Z1 = {};
4311
- Z1[F0] = Z1[B0] = Z1[M0] = Z1[o0] = Z1[s1] = Z1[e1] = Z1[A0] = Z1[u0] = Z1[q0] = Z1[z0] = Z1[x1] = Z1[K] = Z1[Z] = Z1[w0] = Z1[O1] = Z1[m1] = Z1[ri] = Z1[I] = Z1[F1] = Z1[ze] = Z1[ke] = Z1[xe] = !0, Z1[V0] = Z1[x0] = Z1[Q] = !1;
4311
+ Z1[F0] = Z1[B0] = Z1[M0] = Z1[a0] = Z1[s1] = Z1[e1] = Z1[A0] = Z1[u0] = Z1[q0] = Z1[z0] = Z1[x1] = Z1[K] = Z1[Z] = Z1[w0] = Z1[O1] = Z1[m1] = Z1[ri] = Z1[I] = Z1[F1] = Z1[ze] = Z1[ke] = Z1[xe] = !0, Z1[V0] = Z1[x0] = Z1[Q] = !1;
4312
4312
  var Bh = {
4313
4313
  // Latin-1 Supplement block.
4314
4314
  À: "A",
@@ -4643,7 +4643,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
4643
4643
  }
4644
4644
  function bl(H, t0) {
4645
4645
  var J = H == null ? 0 : H.length;
4646
- return J ? Z2(H, t0) / J : c0;
4646
+ return J ? Z2(H, t0) / J : o0;
4647
4647
  }
4648
4648
  function Q2(H) {
4649
4649
  return function(t0) {
@@ -5593,7 +5593,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
5593
5593
  return E;
5594
5594
  }
5595
5595
  function jl(z) {
5596
- return typeof z == "number" ? z : It(z) ? c0 : +z;
5596
+ return typeof z == "number" ? z : It(z) ? o0 : +z;
5597
5597
  }
5598
5598
  function Xt(z) {
5599
5599
  if (typeof z == "string")
@@ -6101,7 +6101,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
6101
6101
  }
6102
6102
  function FA(z, h, m, R, B, E, F) {
6103
6103
  switch (m) {
6104
- case o0:
6104
+ case a0:
6105
6105
  if (z.byteLength != h.byteLength || z.byteOffset != h.byteOffset)
6106
6106
  return !1;
6107
6107
  z = z.buffer, h = h.buffer;
@@ -6227,12 +6227,12 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
6227
6227
  Hi(h, Dp(z)), z = jo(z);
6228
6228
  return h;
6229
6229
  } : Kp, tt = at;
6230
- (np && tt(new np(new ArrayBuffer(1))) != o0 || jn && tt(new jn()) != K || op && tt(op.resolve()) != a1 || sn && tt(new sn()) != m1 || Vn && tt(new Vn()) != Q) && (tt = function(z) {
6230
+ (np && tt(new np(new ArrayBuffer(1))) != a0 || jn && tt(new jn()) != K || op && tt(op.resolve()) != a1 || sn && tt(new sn()) != m1 || Vn && tt(new Vn()) != Q) && (tt = function(z) {
6231
6231
  var h = at(z), m = h == w0 ? z.constructor : t, R = m ? Ns(m) : "";
6232
6232
  if (R)
6233
6233
  switch (R) {
6234
6234
  case W_:
6235
- return o0;
6235
+ return a0;
6236
6236
  case v_:
6237
6237
  return K;
6238
6238
  case y_:
@@ -6293,7 +6293,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
6293
6293
  case s1:
6294
6294
  case e1:
6295
6295
  return new R(+z);
6296
- case o0:
6296
+ case a0:
6297
6297
  return LA(z, m);
6298
6298
  case A0:
6299
6299
  case u0:
@@ -7249,7 +7249,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
7249
7249
  return me(z) && tt(z) == Q;
7250
7250
  }
7251
7251
  function Am(z) {
7252
- return me(z) && at(z) == a0;
7252
+ return me(z) && at(z) == c0;
7253
7253
  }
7254
7254
  var qm = ba(Op), mm = ba(function(z, h) {
7255
7255
  return z <= h;
@@ -7284,7 +7284,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
7284
7284
  if (typeof z == "number")
7285
7285
  return z;
7286
7286
  if (It(z))
7287
- return c0;
7287
+ return o0;
7288
7288
  if (fe(z)) {
7289
7289
  var h = typeof z.valueOf == "function" ? z.valueOf() : z;
7290
7290
  z = fe(h) ? h + "" : h;
@@ -7293,7 +7293,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
7293
7293
  return z === 0 ? z : +z;
7294
7294
  z = ll(z);
7295
7295
  var m = E2.test(z);
7296
- return m || X2.test(z) ? Xh(z.slice(2), m ? 2 : 8) : C2.test(z) ? c0 : +z;
7296
+ return m || X2.test(z) ? Xh(z.slice(2), m ? 2 : 8) : C2.test(z) ? o0 : +z;
7297
7297
  }
7298
7298
  function Yz(z) {
7299
7299
  return Sr(z, qt(z));
@@ -8191,13 +8191,13 @@ function print() { __p += __j.call(arguments, '') }
8191
8191
  hold_profit_short_k_count: Y = 0,
8192
8192
  hold_loss_long_k_count: V = 0,
8193
8193
  hold_loss_short_k_count: G = 0,
8194
- balanceByInterval: c0,
8194
+ balanceByInterval: o0,
8195
8195
  shapeRatioType: d0 = "NONE"
8196
8196
  } = this._preHistoryOrderCalcResult;
8197
8197
  const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
8198
- if (f0 === Y0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !c0) {
8198
+ if (f0 === Y0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
8199
8199
  const i0 = this._createBalanceByInterval(s1, Date.now());
8200
- c0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
8200
+ o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
8201
8201
  }
8202
8202
  const x0 = i + s;
8203
8203
  this._closedtrades = x0;
@@ -8242,11 +8242,11 @@ function print() { __p += __j.call(arguments, '') }
8242
8242
  hold_profit_short_k_count: Y,
8243
8243
  hold_loss_long_k_count: V,
8244
8244
  hold_loss_short_k_count: G,
8245
- balanceByInterval: c0,
8245
+ balanceByInterval: o0,
8246
8246
  shapeRatioType: d0
8247
8247
  }, d0 !== "NONE") {
8248
8248
  const i0 = d0 === "D" ? p3 : Gc;
8249
- c0[i0(e1)] = $ + n1;
8249
+ o0[i0(e1)] = $ + n1;
8250
8250
  }
8251
8251
  } else if (this._options?.commission_value) {
8252
8252
  const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
@@ -9752,10 +9752,10 @@ Example:
9752
9752
  if (j)
9753
9753
  return j;
9754
9754
  let Q = 'Unknown type "' + I + '"';
9755
- const a0 = I.toLowerCase();
9755
+ const c0 = I.toLowerCase();
9756
9756
  let M0;
9757
9757
  for (M0 of i)
9758
- if (M0.toLowerCase() === a0) {
9758
+ if (M0.toLowerCase() === c0) {
9759
9759
  Q += '. Did you mean "' + M0 + '" ?';
9760
9760
  break;
9761
9761
  }
@@ -9763,26 +9763,26 @@ Example:
9763
9763
  }
9764
9764
  function c(I) {
9765
9765
  let j = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "any";
9766
- const Q = j ? a(j).index : i.length, a0 = [];
9767
- for (let o0 = 0; o0 < I.length; ++o0) {
9768
- if (!I[o0] || typeof I[o0].name != "string" || typeof I[o0].test != "function")
9766
+ const Q = j ? a(j).index : i.length, c0 = [];
9767
+ for (let a0 = 0; a0 < I.length; ++a0) {
9768
+ if (!I[a0] || typeof I[a0].name != "string" || typeof I[a0].test != "function")
9769
9769
  throw new TypeError("Object with properties {name: string, test: function} expected");
9770
- const A0 = I[o0].name;
9770
+ const A0 = I[a0].name;
9771
9771
  if (r.has(A0))
9772
9772
  throw new TypeError('Duplicate type name "' + A0 + '"');
9773
- a0.push(A0), r.set(A0, {
9773
+ c0.push(A0), r.set(A0, {
9774
9774
  name: A0,
9775
- test: I[o0].test,
9776
- isAny: I[o0].isAny,
9777
- index: Q + o0,
9775
+ test: I[a0].test,
9776
+ isAny: I[a0].isAny,
9777
+ index: Q + a0,
9778
9778
  conversionsTo: []
9779
9779
  // Newly added type can't have any conversions to it
9780
9780
  });
9781
9781
  }
9782
9782
  const M0 = i.slice(Q);
9783
- i = i.slice(0, Q).concat(a0).concat(M0);
9784
- for (let o0 = Q + a0.length; o0 < i.length; ++o0)
9785
- r.get(i[o0]).index = o0;
9783
+ i = i.slice(0, Q).concat(c0).concat(M0);
9784
+ for (let a0 = Q + c0.length; a0 < i.length; ++a0)
9785
+ r.get(i[a0]).index = a0;
9786
9786
  }
9787
9787
  function p() {
9788
9788
  r = /* @__PURE__ */ new Map(), i = [], s = 0, c([t], !1);
@@ -9796,8 +9796,8 @@ Example:
9796
9796
  }
9797
9797
  function M(I) {
9798
9798
  const j = i.filter((Q) => {
9799
- const a0 = r.get(Q);
9800
- return !a0.isAny && a0.test(I);
9799
+ const c0 = r.get(Q);
9800
+ return !c0.isAny && c0.test(I);
9801
9801
  });
9802
9802
  return j.length ? j : ["any"];
9803
9803
  }
@@ -9807,15 +9807,15 @@ Example:
9807
9807
  function u(I, j, Q) {
9808
9808
  if (!l(I))
9809
9809
  throw new TypeError(qu);
9810
- const a0 = Q && Q.exact, M0 = Array.isArray(j) ? j.join(",") : j, o0 = g(M0), A0 = _(o0);
9811
- if (!a0 || A0 in I.signatures) {
9810
+ const c0 = Q && Q.exact, M0 = Array.isArray(j) ? j.join(",") : j, a0 = g(M0), A0 = _(a0);
9811
+ if (!c0 || A0 in I.signatures) {
9812
9812
  const x1 = I._typedFunctionData.signatureMap.get(A0);
9813
9813
  if (x1)
9814
9814
  return x1;
9815
9815
  }
9816
- const u0 = o0.length;
9816
+ const u0 = a0.length;
9817
9817
  let q0;
9818
- if (a0) {
9818
+ if (c0) {
9819
9819
  q0 = [];
9820
9820
  let x1;
9821
9821
  for (x1 in I.signatures)
@@ -9823,7 +9823,7 @@ Example:
9823
9823
  } else
9824
9824
  q0 = I._typedFunctionData.signatures;
9825
9825
  for (let x1 = 0; x1 < u0; ++x1) {
9826
- const F1 = o0[x1], ze = [];
9826
+ const F1 = a0[x1], ze = [];
9827
9827
  let ke;
9828
9828
  for (ke of q0) {
9829
9829
  const xe = L(ke.params, x1);
@@ -9843,7 +9843,7 @@ Example:
9843
9843
  for (z0 of q0)
9844
9844
  if (z0.params.length <= u0)
9845
9845
  return z0;
9846
- throw new TypeError("Signature not found (signature: " + (I.name || "unnamed") + "(" + _(o0, ", ") + "))");
9846
+ throw new TypeError("Signature not found (signature: " + (I.name || "unnamed") + "(" + _(a0, ", ") + "))");
9847
9847
  }
9848
9848
  function O(I, j, Q) {
9849
9849
  return u(I, j, Q).implementation;
@@ -9852,12 +9852,12 @@ Example:
9852
9852
  const Q = a(j);
9853
9853
  if (Q.test(I))
9854
9854
  return I;
9855
- const a0 = Q.conversionsTo;
9856
- if (a0.length === 0)
9855
+ const c0 = Q.conversionsTo;
9856
+ if (c0.length === 0)
9857
9857
  throw new Error("There are no conversions to " + j + " defined.");
9858
- for (let M0 = 0; M0 < a0.length; M0++)
9859
- if (a(a0[M0].from).test(I))
9860
- return a0[M0].convert(I);
9858
+ for (let M0 = 0; M0 < c0.length; M0++)
9859
+ if (a(c0[M0].from).test(I))
9860
+ return c0[M0].convert(I);
9861
9861
  throw new Error("Cannot convert " + I + " to " + j);
9862
9862
  }
9863
9863
  function _(I) {
@@ -9865,11 +9865,11 @@ Example:
9865
9865
  return I.map((Q) => Q.name).join(j);
9866
9866
  }
9867
9867
  function f(I) {
9868
- const j = I.indexOf("...") === 0, a0 = (j ? I.length > 3 ? I.slice(3) : "any" : I).split("|").map((u0) => a(u0.trim()));
9869
- let M0 = !1, o0 = j ? "..." : "";
9868
+ const j = I.indexOf("...") === 0, c0 = (j ? I.length > 3 ? I.slice(3) : "any" : I).split("|").map((u0) => a(u0.trim()));
9869
+ let M0 = !1, a0 = j ? "..." : "";
9870
9870
  return {
9871
- types: a0.map(function(u0) {
9872
- return M0 = u0.isAny || M0, o0 += u0.name + "|", {
9871
+ types: c0.map(function(u0) {
9872
+ return M0 = u0.isAny || M0, a0 += u0.name + "|", {
9873
9873
  name: u0.name,
9874
9874
  typeIndex: u0.index,
9875
9875
  test: u0.test,
@@ -9878,7 +9878,7 @@ Example:
9878
9878
  conversionIndex: -1
9879
9879
  };
9880
9880
  }),
9881
- name: o0.slice(0, -1),
9881
+ name: a0.slice(0, -1),
9882
9882
  // remove trailing '|' from above
9883
9883
  hasAny: M0,
9884
9884
  hasConversion: !1,
@@ -9887,10 +9887,10 @@ Example:
9887
9887
  }
9888
9888
  function A(I) {
9889
9889
  const j = I.types.map((A0) => A0.name), Q = Y(j);
9890
- let a0 = I.hasAny, M0 = I.name;
9891
- const o0 = Q.map(function(A0) {
9890
+ let c0 = I.hasAny, M0 = I.name;
9891
+ const a0 = Q.map(function(A0) {
9892
9892
  const u0 = a(A0.from);
9893
- return a0 = u0.isAny || a0, M0 += "|" + A0.from, {
9893
+ return c0 = u0.isAny || c0, M0 += "|" + A0.from, {
9894
9894
  name: A0.from,
9895
9895
  typeIndex: u0.index,
9896
9896
  test: u0.test,
@@ -9900,10 +9900,10 @@ Example:
9900
9900
  };
9901
9901
  });
9902
9902
  return {
9903
- types: I.types.concat(o0),
9903
+ types: I.types.concat(a0),
9904
9904
  name: M0,
9905
- hasAny: a0,
9906
- hasConversion: o0.length > 0,
9905
+ hasAny: c0,
9906
+ hasConversion: a0.length > 0,
9907
9907
  restParam: I.restParam
9908
9908
  };
9909
9909
  }
@@ -9917,14 +9917,14 @@ Example:
9917
9917
  const Q = I.trim();
9918
9918
  if (Q === "")
9919
9919
  return j;
9920
- const a0 = Q.split(",");
9921
- for (let M0 = 0; M0 < a0.length; ++M0) {
9922
- const o0 = f(a0[M0].trim());
9923
- if (o0.restParam && M0 !== a0.length - 1)
9924
- throw new SyntaxError('Unexpected rest parameter "' + a0[M0] + '": only allowed for the last parameter');
9925
- if (o0.types.length === 0)
9920
+ const c0 = Q.split(",");
9921
+ for (let M0 = 0; M0 < c0.length; ++M0) {
9922
+ const a0 = f(c0[M0].trim());
9923
+ if (a0.restParam && M0 !== c0.length - 1)
9924
+ throw new SyntaxError('Unexpected rest parameter "' + c0[M0] + '": only allowed for the last parameter');
9925
+ if (a0.types.length === 0)
9926
9926
  return null;
9927
- j.push(o0);
9927
+ j.push(a0);
9928
9928
  }
9929
9929
  return j;
9930
9930
  }
@@ -9946,21 +9946,21 @@ Example:
9946
9946
  const j = I.types.map(function(Q) {
9947
9947
  return a(Q.name).test;
9948
9948
  });
9949
- return function(a0) {
9949
+ return function(c0) {
9950
9950
  for (let M0 = 0; M0 < j.length; M0++)
9951
- if (j[M0](a0))
9951
+ if (j[M0](c0))
9952
9952
  return !0;
9953
9953
  return !1;
9954
9954
  };
9955
9955
  }
9956
9956
  }
9957
9957
  function y(I) {
9958
- let j, Q, a0;
9958
+ let j, Q, c0;
9959
9959
  if (W(I)) {
9960
9960
  j = s1(I).map(v);
9961
- const M0 = j.length, o0 = v(e1(I)), A0 = function(u0) {
9961
+ const M0 = j.length, a0 = v(e1(I)), A0 = function(u0) {
9962
9962
  for (let q0 = M0; q0 < u0.length; q0++)
9963
- if (!o0(u0[q0]))
9963
+ if (!a0(u0[q0]))
9964
9964
  return !1;
9965
9965
  return !0;
9966
9966
  };
@@ -9971,17 +9971,17 @@ Example:
9971
9971
  return A0(q0) && q0.length >= M0 + 1;
9972
9972
  };
9973
9973
  } else
9974
- return I.length === 0 ? function(o0) {
9975
- return o0.length === 0;
9976
- } : I.length === 1 ? (Q = v(I[0]), function(o0) {
9977
- return Q(o0[0]) && o0.length === 1;
9978
- }) : I.length === 2 ? (Q = v(I[0]), a0 = v(I[1]), function(o0) {
9979
- return Q(o0[0]) && a0(o0[1]) && o0.length === 2;
9980
- }) : (j = I.map(v), function(o0) {
9974
+ return I.length === 0 ? function(a0) {
9975
+ return a0.length === 0;
9976
+ } : I.length === 1 ? (Q = v(I[0]), function(a0) {
9977
+ return Q(a0[0]) && a0.length === 1;
9978
+ }) : I.length === 2 ? (Q = v(I[0]), c0 = v(I[1]), function(a0) {
9979
+ return Q(a0[0]) && c0(a0[1]) && a0.length === 2;
9980
+ }) : (j = I.map(v), function(a0) {
9981
9981
  for (let A0 = 0; A0 < j.length; A0++)
9982
- if (!j[A0](o0[A0]))
9982
+ if (!j[A0](a0[A0]))
9983
9983
  return !1;
9984
- return o0.length === j.length;
9984
+ return a0.length === j.length;
9985
9985
  });
9986
9986
  }
9987
9987
  function L(I, j) {
@@ -9996,16 +9996,16 @@ Example:
9996
9996
  }
9997
9997
  function w(I, j) {
9998
9998
  const Q = /* @__PURE__ */ new Set();
9999
- return I.forEach((a0) => {
10000
- const M0 = D(a0.params, j);
10001
- let o0;
10002
- for (o0 of M0)
10003
- Q.add(o0);
9999
+ return I.forEach((c0) => {
10000
+ const M0 = D(c0.params, j);
10001
+ let a0;
10002
+ for (a0 of M0)
10003
+ Q.add(a0);
10004
10004
  }), Q.has("any") ? ["any"] : Array.from(Q);
10005
10005
  }
10006
10006
  function x(I, j, Q) {
10007
- let a0, M0;
10008
- const o0 = I || "unnamed";
10007
+ let c0, M0;
10008
+ const a0 = I || "unnamed";
10009
10009
  let A0 = Q, u0;
10010
10010
  for (u0 = 0; u0 < j.length; u0++) {
10011
10011
  const F1 = [];
@@ -10015,13 +10015,13 @@ Example:
10015
10015
  }), F1.length === 0) {
10016
10016
  if (M0 = w(A0, u0), M0.length > 0) {
10017
10017
  const ze = M(j[u0]);
10018
- return a0 = new TypeError("Unexpected type of argument in function " + o0 + " (expected: " + M0.join(" or ") + ", actual: " + ze.join(" | ") + ", index: " + u0 + ")"), a0.data = {
10018
+ return c0 = new TypeError("Unexpected type of argument in function " + a0 + " (expected: " + M0.join(" or ") + ", actual: " + ze.join(" | ") + ", index: " + u0 + ")"), c0.data = {
10019
10019
  category: "wrongType",
10020
- fn: o0,
10020
+ fn: a0,
10021
10021
  index: u0,
10022
10022
  actual: ze,
10023
10023
  expected: M0
10024
- }, a0;
10024
+ }, c0;
10025
10025
  }
10026
10026
  } else
10027
10027
  A0 = F1;
@@ -10030,27 +10030,27 @@ Example:
10030
10030
  return W(F1.params) ? 1 / 0 : F1.params.length;
10031
10031
  });
10032
10032
  if (j.length < Math.min.apply(null, q0))
10033
- return M0 = w(A0, u0), a0 = new TypeError("Too few arguments in function " + o0 + " (expected: " + M0.join(" or ") + ", index: " + j.length + ")"), a0.data = {
10033
+ return M0 = w(A0, u0), c0 = new TypeError("Too few arguments in function " + a0 + " (expected: " + M0.join(" or ") + ", index: " + j.length + ")"), c0.data = {
10034
10034
  category: "tooFewArgs",
10035
- fn: o0,
10035
+ fn: a0,
10036
10036
  index: j.length,
10037
10037
  expected: M0
10038
- }, a0;
10038
+ }, c0;
10039
10039
  const z0 = Math.max.apply(null, q0);
10040
10040
  if (j.length > z0)
10041
- return a0 = new TypeError("Too many arguments in function " + o0 + " (expected: " + z0 + ", actual: " + j.length + ")"), a0.data = {
10041
+ return c0 = new TypeError("Too many arguments in function " + a0 + " (expected: " + z0 + ", actual: " + j.length + ")"), c0.data = {
10042
10042
  category: "tooManyArgs",
10043
- fn: o0,
10043
+ fn: a0,
10044
10044
  index: j.length,
10045
10045
  expectedLength: z0
10046
- }, a0;
10046
+ }, c0;
10047
10047
  const x1 = [];
10048
10048
  for (let F1 = 0; F1 < j.length; ++F1)
10049
10049
  x1.push(M(j[F1]).join("|"));
10050
- return a0 = new TypeError('Arguments of type "' + x1.join(", ") + '" do not match any of the defined signatures of function ' + o0 + "."), a0.data = {
10050
+ return c0 = new TypeError('Arguments of type "' + x1.join(", ") + '" do not match any of the defined signatures of function ' + a0 + "."), c0.data = {
10051
10051
  category: "mismatch",
10052
10052
  actual: x1
10053
- }, a0;
10053
+ }, c0;
10054
10054
  }
10055
10055
  function T(I) {
10056
10056
  let j = i.length + 1;
@@ -10085,28 +10085,28 @@ Example:
10085
10085
  return -1;
10086
10086
  if (Q > 0)
10087
10087
  return 1;
10088
- const a0 = S(I) - S(j);
10089
- return a0 < 0 ? -1 : a0 > 0 ? 1 : 0;
10088
+ const c0 = S(I) - S(j);
10089
+ return c0 < 0 ? -1 : c0 > 0 ? 1 : 0;
10090
10090
  }
10091
10091
  function X(I, j) {
10092
- const Q = I.params, a0 = j.params, M0 = e1(Q), o0 = e1(a0), A0 = W(Q), u0 = W(a0);
10092
+ const Q = I.params, c0 = j.params, M0 = e1(Q), a0 = e1(c0), A0 = W(Q), u0 = W(c0);
10093
10093
  if (A0 && M0.hasAny) {
10094
- if (!u0 || !o0.hasAny)
10094
+ if (!u0 || !a0.hasAny)
10095
10095
  return 1;
10096
- } else if (u0 && o0.hasAny)
10096
+ } else if (u0 && a0.hasAny)
10097
10097
  return -1;
10098
10098
  let q0 = 0, z0 = 0, x1;
10099
10099
  for (x1 of Q)
10100
10100
  x1.hasAny && ++q0, x1.hasConversion && ++z0;
10101
10101
  let F1 = 0, ze = 0;
10102
- for (x1 of a0)
10102
+ for (x1 of c0)
10103
10103
  x1.hasAny && ++F1, x1.hasConversion && ++ze;
10104
10104
  if (q0 !== F1)
10105
10105
  return q0 - F1;
10106
10106
  if (A0 && M0.hasConversion) {
10107
- if (!u0 || !o0.hasConversion)
10107
+ if (!u0 || !a0.hasConversion)
10108
10108
  return 1;
10109
- } else if (u0 && o0.hasConversion)
10109
+ } else if (u0 && a0.hasConversion)
10110
10110
  return -1;
10111
10111
  if (z0 !== ze)
10112
10112
  return z0 - ze;
@@ -10115,13 +10115,13 @@ Example:
10115
10115
  return 1;
10116
10116
  } else if (u0)
10117
10117
  return -1;
10118
- const ke = (Q.length - a0.length) * (A0 ? -1 : 1);
10118
+ const ke = (Q.length - c0.length) * (A0 ? -1 : 1);
10119
10119
  if (ke !== 0)
10120
10120
  return ke;
10121
10121
  const xe = [];
10122
10122
  let xt = 0;
10123
10123
  for (let Si = 0; Si < Q.length; ++Si) {
10124
- const _s = k(Q[Si], a0[Si]);
10124
+ const _s = k(Q[Si], c0[Si]);
10125
10125
  xe.push(_s), xt += _s;
10126
10126
  }
10127
10127
  if (xt !== 0)
@@ -10136,82 +10136,82 @@ Example:
10136
10136
  if (I.length === 0)
10137
10137
  return [];
10138
10138
  const j = I.map(a);
10139
- I.length > 1 && j.sort((M0, o0) => M0.index - o0.index);
10139
+ I.length > 1 && j.sort((M0, a0) => M0.index - a0.index);
10140
10140
  let Q = j[0].conversionsTo;
10141
10141
  if (I.length === 1)
10142
10142
  return Q;
10143
10143
  Q = Q.concat([]);
10144
- const a0 = new Set(I);
10144
+ const c0 = new Set(I);
10145
10145
  for (let M0 = 1; M0 < j.length; ++M0) {
10146
- let o0;
10147
- for (o0 of j[M0].conversionsTo)
10148
- a0.has(o0.from) || (Q.push(o0), a0.add(o0.from));
10146
+ let a0;
10147
+ for (a0 of j[M0].conversionsTo)
10148
+ c0.has(a0.from) || (Q.push(a0), c0.add(a0.from));
10149
10149
  }
10150
10150
  return Q;
10151
10151
  }
10152
10152
  function V(I, j) {
10153
10153
  let Q = j;
10154
10154
  if (I.some((M0) => M0.hasConversion)) {
10155
- const M0 = W(I), o0 = I.map(G);
10155
+ const M0 = W(I), a0 = I.map(G);
10156
10156
  Q = function() {
10157
10157
  const u0 = [], q0 = M0 ? arguments.length - 1 : arguments.length;
10158
10158
  for (let z0 = 0; z0 < q0; z0++)
10159
- u0[z0] = o0[z0](arguments[z0]);
10160
- return M0 && (u0[q0] = arguments[q0].map(o0[q0])), j.apply(this, u0);
10159
+ u0[z0] = a0[z0](arguments[z0]);
10160
+ return M0 && (u0[q0] = arguments[q0].map(a0[q0])), j.apply(this, u0);
10161
10161
  };
10162
10162
  }
10163
- let a0 = Q;
10163
+ let c0 = Q;
10164
10164
  if (W(I)) {
10165
10165
  const M0 = I.length - 1;
10166
- a0 = function() {
10166
+ c0 = function() {
10167
10167
  return Q.apply(this, n1(arguments, 0, M0).concat([n1(arguments, M0)]));
10168
10168
  };
10169
10169
  }
10170
- return a0;
10170
+ return c0;
10171
10171
  }
10172
10172
  function G(I) {
10173
- let j, Q, a0, M0;
10174
- const o0 = [], A0 = [];
10173
+ let j, Q, c0, M0;
10174
+ const a0 = [], A0 = [];
10175
10175
  switch (I.types.forEach(function(u0) {
10176
- u0.conversion && (o0.push(a(u0.conversion.from).test), A0.push(u0.conversion.convert));
10176
+ u0.conversion && (a0.push(a(u0.conversion.from).test), A0.push(u0.conversion.convert));
10177
10177
  }), A0.length) {
10178
10178
  case 0:
10179
10179
  return function(q0) {
10180
10180
  return q0;
10181
10181
  };
10182
10182
  case 1:
10183
- return j = o0[0], a0 = A0[0], function(q0) {
10184
- return j(q0) ? a0(q0) : q0;
10183
+ return j = a0[0], c0 = A0[0], function(q0) {
10184
+ return j(q0) ? c0(q0) : q0;
10185
10185
  };
10186
10186
  case 2:
10187
- return j = o0[0], Q = o0[1], a0 = A0[0], M0 = A0[1], function(q0) {
10188
- return j(q0) ? a0(q0) : Q(q0) ? M0(q0) : q0;
10187
+ return j = a0[0], Q = a0[1], c0 = A0[0], M0 = A0[1], function(q0) {
10188
+ return j(q0) ? c0(q0) : Q(q0) ? M0(q0) : q0;
10189
10189
  };
10190
10190
  default:
10191
10191
  return function(q0) {
10192
10192
  for (let z0 = 0; z0 < A0.length; z0++)
10193
- if (o0[z0](q0))
10193
+ if (a0[z0](q0))
10194
10194
  return A0[z0](q0);
10195
10195
  return q0;
10196
10196
  };
10197
10197
  }
10198
10198
  }
10199
- function c0(I) {
10200
- function j(Q, a0, M0) {
10201
- if (a0 < Q.length) {
10202
- const o0 = Q[a0];
10199
+ function o0(I) {
10200
+ function j(Q, c0, M0) {
10201
+ if (c0 < Q.length) {
10202
+ const a0 = Q[c0];
10203
10203
  let A0 = [];
10204
- if (o0.restParam) {
10205
- const u0 = o0.types.filter(N);
10206
- u0.length < o0.types.length && A0.push({
10204
+ if (a0.restParam) {
10205
+ const u0 = a0.types.filter(N);
10206
+ u0.length < a0.types.length && A0.push({
10207
10207
  types: u0,
10208
10208
  name: "..." + u0.map((q0) => q0.name).join("|"),
10209
10209
  hasAny: u0.some((q0) => q0.isAny),
10210
10210
  hasConversion: !1,
10211
10211
  restParam: !0
10212
- }), A0.push(o0);
10212
+ }), A0.push(a0);
10213
10213
  } else
10214
- A0 = o0.types.map(function(u0) {
10214
+ A0 = a0.types.map(function(u0) {
10215
10215
  return {
10216
10216
  types: [u0],
10217
10217
  name: u0.name,
@@ -10221,7 +10221,7 @@ Example:
10221
10221
  };
10222
10222
  });
10223
10223
  return x0(A0, function(u0) {
10224
- return j(Q, a0 + 1, M0.concat([u0]));
10224
+ return j(Q, c0 + 1, M0.concat([u0]));
10225
10225
  });
10226
10226
  } else
10227
10227
  return [M0];
@@ -10241,52 +10241,52 @@ Example:
10241
10241
  if (!x1)
10242
10242
  return !1;
10243
10243
  }
10244
- const a0 = I.length, M0 = j.length, o0 = W(I), A0 = W(j);
10245
- return o0 ? A0 ? a0 === M0 : M0 >= a0 : A0 ? a0 >= M0 : a0 === M0;
10244
+ const c0 = I.length, M0 = j.length, a0 = W(I), A0 = W(j);
10245
+ return a0 ? A0 ? c0 === M0 : M0 >= c0 : A0 ? c0 >= M0 : c0 === M0;
10246
10246
  }
10247
10247
  function p0(I) {
10248
10248
  return I.map((j) => w0(j) ? Z(j.referToSelf.callback) : i0(j) ? K(j.referTo.references, j.referTo.callback) : j);
10249
10249
  }
10250
10250
  function r0(I, j, Q) {
10251
- const a0 = [];
10251
+ const c0 = [];
10252
10252
  let M0;
10253
10253
  for (M0 of I) {
10254
- let o0 = Q[M0];
10255
- if (typeof o0 != "number")
10254
+ let a0 = Q[M0];
10255
+ if (typeof a0 != "number")
10256
10256
  throw new TypeError('No definition for referenced signature "' + M0 + '"');
10257
- if (o0 = j[o0], typeof o0 != "function")
10257
+ if (a0 = j[a0], typeof a0 != "function")
10258
10258
  return !1;
10259
- a0.push(o0);
10259
+ c0.push(a0);
10260
10260
  }
10261
- return a0;
10261
+ return c0;
10262
10262
  }
10263
10263
  function k0(I, j, Q) {
10264
- const a0 = p0(I), M0 = new Array(a0.length).fill(!1);
10265
- let o0 = !0;
10266
- for (; o0; ) {
10267
- o0 = !1;
10264
+ const c0 = p0(I), M0 = new Array(c0.length).fill(!1);
10265
+ let a0 = !0;
10266
+ for (; a0; ) {
10267
+ a0 = !1;
10268
10268
  let A0 = !0;
10269
- for (let u0 = 0; u0 < a0.length; ++u0) {
10269
+ for (let u0 = 0; u0 < c0.length; ++u0) {
10270
10270
  if (M0[u0])
10271
10271
  continue;
10272
- const q0 = a0[u0];
10272
+ const q0 = c0[u0];
10273
10273
  if (w0(q0))
10274
- a0[u0] = q0.referToSelf.callback(Q), a0[u0].referToSelf = q0.referToSelf, M0[u0] = !0, A0 = !1;
10274
+ c0[u0] = q0.referToSelf.callback(Q), c0[u0].referToSelf = q0.referToSelf, M0[u0] = !0, A0 = !1;
10275
10275
  else if (i0(q0)) {
10276
- const z0 = r0(q0.referTo.references, a0, j);
10277
- z0 ? (a0[u0] = q0.referTo.callback.apply(this, z0), a0[u0].referTo = q0.referTo, M0[u0] = !0, A0 = !1) : o0 = !0;
10276
+ const z0 = r0(q0.referTo.references, c0, j);
10277
+ z0 ? (c0[u0] = q0.referTo.callback.apply(this, z0), c0[u0].referTo = q0.referTo, M0[u0] = !0, A0 = !1) : a0 = !0;
10278
10278
  }
10279
10279
  }
10280
- if (A0 && o0)
10280
+ if (A0 && a0)
10281
10281
  throw new SyntaxError("Circular reference detected in resolving typed.referTo");
10282
10282
  }
10283
- return a0;
10283
+ return c0;
10284
10284
  }
10285
10285
  function F0(I) {
10286
10286
  const j = /\bthis(\(|\.signatures\b)/;
10287
10287
  Object.keys(I).forEach((Q) => {
10288
- const a0 = I[Q];
10289
- if (j.test(a0.toString()))
10288
+ const c0 = I[Q];
10289
+ if (j.test(c0.toString()))
10290
10290
  throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.");
10291
10291
  });
10292
10292
  }
@@ -10294,7 +10294,7 @@ Example:
10294
10294
  if (o.createCount++, Object.keys(j).length === 0)
10295
10295
  throw new SyntaxError("No signatures provided");
10296
10296
  o.warnAgainstDeprecatedThis && F0(j);
10297
- const Q = [], a0 = [], M0 = {}, o0 = [];
10297
+ const Q = [], c0 = [], M0 = {}, a0 = [];
10298
10298
  let A0;
10299
10299
  for (A0 in j) {
10300
10300
  if (!Object.prototype.hasOwnProperty.call(j, A0))
@@ -10306,26 +10306,26 @@ Example:
10306
10306
  if (d0(ki, N1))
10307
10307
  throw new TypeError('Conflicting signatures "' + _(ki) + '" and "' + _(N1) + '".');
10308
10308
  }), Q.push(N1);
10309
- const Ze = a0.length;
10310
- a0.push(j[A0]);
10309
+ const Ze = c0.length;
10310
+ c0.push(j[A0]);
10311
10311
  const F2 = N1.map(A);
10312
10312
  let Gs;
10313
- for (Gs of c0(F2)) {
10313
+ for (Gs of o0(F2)) {
10314
10314
  const ki = _(Gs);
10315
- o0.push({
10315
+ a0.push({
10316
10316
  params: Gs,
10317
10317
  name: ki,
10318
10318
  fn: Ze
10319
10319
  }), Gs.every((Eo) => !Eo.hasConversion) && (M0[ki] = Ze);
10320
10320
  }
10321
10321
  }
10322
- o0.sort(X);
10323
- const u0 = k0(a0, M0, As);
10322
+ a0.sort(X);
10323
+ const u0 = k0(c0, M0, As);
10324
10324
  let q0;
10325
10325
  for (q0 in M0)
10326
10326
  Object.prototype.hasOwnProperty.call(M0, q0) && (M0[q0] = u0[M0[q0]]);
10327
10327
  const z0 = [], x1 = /* @__PURE__ */ new Map();
10328
- for (q0 of o0)
10328
+ for (q0 of a0)
10329
10329
  x1.has(q0.name) || (q0.fn = u0[q0.fn], z0.push(q0), x1.set(q0.name, q0));
10330
10330
  const F1 = z0[0] && z0[0].params.length <= 2 && !W(z0[0].params), ze = z0[1] && z0[1].params.length <= 2 && !W(z0[1].params), ke = z0[2] && z0[2].params.length <= 2 && !W(z0[2].params), xe = z0[3] && z0[3].params.length <= 2 && !W(z0[3].params), xt = z0[4] && z0[4].params.length <= 2 && !W(z0[4].params), Ct = z0[5] && z0[5].params.length <= 2 && !W(z0[5].params), Si = F1 && ze && ke && xe && xt && Ct;
10331
10331
  for (let N1 = 0; N1 < z0.length; ++N1)
@@ -10425,12 +10425,12 @@ Example:
10425
10425
  for (Q in j)
10426
10426
  if (Object.prototype.hasOwnProperty.call(j, Q)) {
10427
10427
  if (Q in I && j[Q] !== I[Q]) {
10428
- const a0 = new Error('Signature "' + Q + '" is defined twice');
10429
- throw a0.data = {
10428
+ const c0 = new Error('Signature "' + Q + '" is defined twice');
10429
+ throw c0.data = {
10430
10430
  signature: Q,
10431
10431
  sourceFunction: j[Q],
10432
10432
  destFunction: I[Q]
10433
- }, a0;
10433
+ }, c0;
10434
10434
  }
10435
10435
  I[Q] = j[Q];
10436
10436
  }
@@ -10438,21 +10438,21 @@ Example:
10438
10438
  const m1 = o;
10439
10439
  o = function(I) {
10440
10440
  const j = typeof I == "string", Q = j ? 1 : 0;
10441
- let a0 = j ? I : "";
10441
+ let c0 = j ? I : "";
10442
10442
  const M0 = {};
10443
- for (let o0 = Q; o0 < arguments.length; ++o0) {
10444
- const A0 = arguments[o0];
10443
+ for (let a0 = Q; a0 < arguments.length; ++a0) {
10444
+ const A0 = arguments[a0];
10445
10445
  let u0 = {}, q0;
10446
10446
  if (typeof A0 == "function" ? (q0 = A0.name, typeof A0.signature == "string" ? u0[A0.signature] = A0 : l(A0) && (u0 = A0.signatures)) : n(A0) && (u0 = A0, j || (q0 = P1(A0))), Object.keys(u0).length === 0) {
10447
- const z0 = new TypeError("Argument to 'typed' at index " + o0 + " is not a (typed) function, nor an object with signatures as keys and functions as values.");
10447
+ const z0 = new TypeError("Argument to 'typed' at index " + a0 + " is not a (typed) function, nor an object with signatures as keys and functions as values.");
10448
10448
  throw z0.data = {
10449
- index: o0,
10449
+ index: a0,
10450
10450
  argument: A0
10451
10451
  }, z0;
10452
10452
  }
10453
- j || (a0 = a1(a0, q0)), O1(M0, u0);
10453
+ j || (c0 = a1(c0, q0)), O1(M0, u0);
10454
10454
  }
10455
- return B0(a0 || "", M0);
10455
+ return B0(c0 || "", M0);
10456
10456
  }, o.create = h3, o.createCount = m1.createCount, o.onMismatch = f0, o.throwMismatchError = f0, o.createError = x, o.clear = p, o.clearConversions = b, o.addTypes = c, o._findType = a, o.referTo = $, o.referToSelf = Z, o.convert = d, o.findSignature = u, o.find = O, o.isTypedFunction = l, o.warnAgainstDeprecatedThis = !0, o.addType = function(I, j) {
10457
10457
  let Q = "any";
10458
10458
  j !== !1 && r.has("Object") && (Q = "Object"), o.addTypes([I], Q);
@@ -10485,15 +10485,15 @@ Example:
10485
10485
  throw new Error("Attempt to remove nonexistent conversion from " + I.from + " to " + I.to);
10486
10486
  if (Q.convert !== I.convert)
10487
10487
  throw new Error("Conversion to remove does not match existing conversion");
10488
- const a0 = j.conversionsTo.indexOf(Q);
10489
- j.conversionsTo.splice(a0, 1);
10488
+ const c0 = j.conversionsTo.indexOf(Q);
10489
+ j.conversionsTo.splice(c0, 1);
10490
10490
  }, o.resolve = function(I, j) {
10491
10491
  if (!l(I))
10492
10492
  throw new TypeError(qu);
10493
10493
  const Q = I._typedFunctionData.signatures;
10494
- for (let a0 = 0; a0 < Q.length; ++a0)
10495
- if (Q[a0].test(j))
10496
- return Q[a0];
10494
+ for (let c0 = 0; c0 < Q.length; ++c0)
10495
+ if (Q[c0].test(j))
10496
+ return Q[c0];
10497
10497
  return null;
10498
10498
  }, o;
10499
10499
  }
@@ -14472,8 +14472,8 @@ Example:
14472
14472
  for (q = 0, g = d._size.length; q < g; q++)
14473
14473
  _e(y[q], d._size[q]), _e(L[q], d._size[q]);
14474
14474
  var D = d._values, N = d._index, w = d._ptr, x = _.dimension(0), T = _.dimension(1), S = [], k = [];
14475
- x.forEach(function(G, c0) {
14476
- k[G] = c0[0], S[G] = !0;
14475
+ x.forEach(function(G, o0) {
14476
+ k[G] = o0[0], S[G] = !0;
14477
14477
  });
14478
14478
  var X = D ? [] : void 0, Y = [], V = [];
14479
14479
  return T.forEach(function(G) {
@@ -14681,9 +14681,9 @@ Example:
14681
14681
  var G = d._index[V];
14682
14682
  Y[G] = d._values[V];
14683
14683
  }
14684
- for (var c0 = _; c0 <= f; c0++) {
14685
- var d0 = c0 in Y ? Y[c0] : 0;
14686
- w(d0, c0 - _, x - A);
14684
+ for (var o0 = _; o0 <= f; o0++) {
14685
+ var d0 = o0 in Y ? Y[o0] : 0;
14686
+ w(d0, o0 - _, x - A);
14687
14687
  }
14688
14688
  }
14689
14689
  }
@@ -14805,15 +14805,15 @@ Example:
14805
14805
  if (he(_)) {
14806
14806
  if (_.length !== N)
14807
14807
  throw new Error("Invalid value array length");
14808
- w = function(c0) {
14809
- return _[c0];
14808
+ w = function(o0) {
14809
+ return _[o0];
14810
14810
  };
14811
14811
  } else if (be(_)) {
14812
14812
  var x = _.size();
14813
14813
  if (x.length !== 1 || x[0] !== N)
14814
14814
  throw new Error("Invalid matrix length");
14815
- w = function(c0) {
14816
- return _.get([c0]);
14815
+ w = function(o0) {
14816
+ return _.get([o0]);
14817
14817
  };
14818
14818
  } else
14819
14819
  w = function() {
@@ -15284,9 +15284,9 @@ Example:
15284
15284
  if (y)
15285
15285
  for (X = D[k]; X < L.length; ) {
15286
15286
  S = L[X];
15287
- var G = x[S], c0 = T[S];
15288
- if (G === V || c0 === V) {
15289
- var d0 = G === V ? N[S] : W, p0 = c0 === V ? w[S] : W, r0 = v(d0, p0);
15287
+ var G = x[S], o0 = T[S];
15288
+ if (G === V || o0 === V) {
15289
+ var d0 = G === V ? N[S] : W, p0 = o0 === V ? w[S] : W, r0 = v(d0, p0);
15290
15290
  g(r0, W) ? L.splice(X, 1) : (y.push(r0), X++);
15291
15291
  }
15292
15292
  }
@@ -15434,8 +15434,8 @@ Example:
15434
15434
  for (Y = O[k], V = O[k + 1], X = Y; X < V; X++)
15435
15435
  if (S = u[X], x[S] === G) {
15436
15436
  if (N) {
15437
- var c0 = v(N[S], l[X]);
15438
- g(c0, W) ? x[S] = null : N[S] = c0;
15437
+ var o0 = v(N[S], l[X]);
15438
+ g(o0, W) ? x[S] = null : N[S] = o0;
15439
15439
  }
15440
15440
  } else
15441
15441
  L.push(S), T[S] = G, w && (w[S] = l[X]);
@@ -15556,9 +15556,9 @@ Example:
15556
15556
  var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._data, w = v._size, x = v._datatype || v.getDataType(), T = L[0], S = w[1], k, X = r, Y = i;
15557
15557
  D && x && D === x && typeof D == "string" && D !== "mixed" && (k = D, X = e.find(r, [k, k]), Y = e.find(i, [k, k]));
15558
15558
  for (var V = [], G = 0; G < S; G++) {
15559
- for (var c0 = Y(y[0], N[0][G]), d0 = 1; d0 < T; d0++)
15560
- c0 = X(c0, Y(y[d0], N[d0][G]));
15561
- V[G] = c0;
15559
+ for (var o0 = Y(y[0], N[0][G]), d0 = 1; d0 < T; d0++)
15560
+ o0 = X(o0, Y(y[d0], N[d0][G]));
15561
+ V[G] = o0;
15562
15562
  }
15563
15563
  return W.createDenseMatrix({
15564
15564
  data: V,
@@ -15579,9 +15579,9 @@ Example:
15579
15579
  var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._data, w = v._datatype || v.getDataType(), x = L[0], T = L[1], S, k = r, X = i;
15580
15580
  D && w && D === w && typeof D == "string" && D !== "mixed" && (S = D, k = e.find(r, [S, S]), X = e.find(i, [S, S]));
15581
15581
  for (var Y = [], V = 0; V < x; V++) {
15582
- for (var G = y[V], c0 = X(G[0], N[0]), d0 = 1; d0 < T; d0++)
15583
- c0 = k(c0, X(G[d0], N[d0]));
15584
- Y[V] = c0;
15582
+ for (var G = y[V], o0 = X(G[0], N[0]), d0 = 1; d0 < T; d0++)
15583
+ o0 = k(o0, X(G[d0], N[d0]));
15584
+ Y[V] = o0;
15585
15585
  }
15586
15586
  return W.createDenseMatrix({
15587
15587
  data: Y,
@@ -15592,13 +15592,13 @@ Example:
15592
15592
  function _(W, v) {
15593
15593
  var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._data, w = v._size, x = v._datatype || v.getDataType(), T = L[0], S = L[1], k = w[1], X, Y = r, V = i;
15594
15594
  D && x && D === x && typeof D == "string" && D !== "mixed" && D !== "mixed" && (X = D, Y = e.find(r, [X, X]), V = e.find(i, [X, X]));
15595
- for (var G = [], c0 = 0; c0 < T; c0++) {
15596
- var d0 = y[c0];
15597
- G[c0] = [];
15595
+ for (var G = [], o0 = 0; o0 < T; o0++) {
15596
+ var d0 = y[o0];
15597
+ G[o0] = [];
15598
15598
  for (var p0 = 0; p0 < k; p0++) {
15599
15599
  for (var r0 = V(d0[0], N[0][p0]), k0 = 1; k0 < S; k0++)
15600
15600
  r0 = Y(r0, V(d0[k0], N[k0][p0]));
15601
- G[c0][p0] = r0;
15601
+ G[o0][p0] = r0;
15602
15602
  }
15603
15603
  }
15604
15604
  return W.createDenseMatrix({
@@ -15611,8 +15611,8 @@ Example:
15611
15611
  var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._values, w = v._index, x = v._ptr, T = v._size, S = v._datatype || v._data === void 0 ? v._datatype : v.getDataType();
15612
15612
  if (!N)
15613
15613
  throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");
15614
- var k = L[0], X = T[1], Y, V = r, G = i, c0 = s, d0 = 0;
15615
- D && S && D === S && typeof D == "string" && D !== "mixed" && (Y = D, V = e.find(r, [Y, Y]), G = e.find(i, [Y, Y]), c0 = e.find(s, [Y, Y]), d0 = e.convert(0, Y));
15614
+ var k = L[0], X = T[1], Y, V = r, G = i, o0 = s, d0 = 0;
15615
+ D && S && D === S && typeof D == "string" && D !== "mixed" && (Y = D, V = e.find(r, [Y, Y]), G = e.find(i, [Y, Y]), o0 = e.find(s, [Y, Y]), d0 = e.convert(0, Y));
15616
15616
  for (var p0 = [], r0 = [], k0 = [], F0 = v.createSparseMatrix({
15617
15617
  values: p0,
15618
15618
  index: r0,
@@ -15628,7 +15628,7 @@ Example:
15628
15628
  var K = w[$];
15629
15629
  e1 !== V0 ? (x0 = G(y[n1][K], N[$]), e1 = V0) : x0 = V(x0, G(y[n1][K], N[$]));
15630
15630
  }
15631
- e1 === V0 && !c0(x0, d0) && (r0.push(n1), p0.push(x0));
15631
+ e1 === V0 && !o0(x0, d0) && (r0.push(n1), p0.push(x0));
15632
15632
  }
15633
15633
  }
15634
15634
  return k0[X] = r0.length, F0;
@@ -15637,8 +15637,8 @@ Example:
15637
15637
  var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType();
15638
15638
  if (!y)
15639
15639
  throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");
15640
- var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = [], X = [], Y = [], V, G = r, c0 = i, d0 = s, p0 = 0;
15641
- N && x && N === x && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]), c0 = e.find(i, [V, V]), d0 = e.find(s, [V, V]), p0 = e.convert(0, V));
15640
+ var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = [], X = [], Y = [], V, G = r, o0 = i, d0 = s, p0 = 0;
15641
+ N && x && N === x && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]), o0 = e.find(i, [V, V]), d0 = e.find(s, [V, V]), p0 = e.convert(0, V));
15642
15642
  var r0 = [], k0 = [];
15643
15643
  Y[0] = 0;
15644
15644
  for (var F0 = 0; F0 < S; F0++) {
@@ -15646,7 +15646,7 @@ Example:
15646
15646
  if (!d0(B0, p0))
15647
15647
  for (var f0 = D[F0], s1 = D[F0 + 1], e1 = f0; e1 < s1; e1++) {
15648
15648
  var n1 = L[e1];
15649
- k0[n1] ? r0[n1] = G(r0[n1], c0(B0, y[e1])) : (k0[n1] = !0, X.push(n1), r0[n1] = c0(B0, y[e1]));
15649
+ k0[n1] ? r0[n1] = G(r0[n1], o0(B0, y[e1])) : (k0[n1] = !0, X.push(n1), r0[n1] = o0(B0, y[e1]));
15650
15650
  }
15651
15651
  }
15652
15652
  for (var V0 = X.length, x0 = 0; x0 < V0; x0++) {
@@ -15665,8 +15665,8 @@ Example:
15665
15665
  var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType();
15666
15666
  if (!y)
15667
15667
  throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");
15668
- var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = v._size[1], X, Y = r, V = i, G = s, c0 = 0;
15669
- N && x && N === x && typeof N == "string" && N !== "mixed" && (X = N, Y = e.find(r, [X, X]), V = e.find(i, [X, X]), G = e.find(s, [X, X]), c0 = e.convert(0, X));
15668
+ var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = v._size[1], X, Y = r, V = i, G = s, o0 = 0;
15669
+ N && x && N === x && typeof N == "string" && N !== "mixed" && (X = N, Y = e.find(r, [X, X]), V = e.find(i, [X, X]), G = e.find(s, [X, X]), o0 = e.convert(0, X));
15670
15670
  for (var d0 = [], p0 = [], r0 = [], k0 = W.createSparseMatrix({
15671
15671
  values: d0,
15672
15672
  index: p0,
@@ -15677,7 +15677,7 @@ Example:
15677
15677
  r0[f0] = p0.length;
15678
15678
  for (var s1 = f0 + 1, e1 = 0; e1 < S; e1++) {
15679
15679
  var n1 = w[e1][f0];
15680
- if (!G(n1, c0))
15680
+ if (!G(n1, o0))
15681
15681
  for (var V0 = D[e1], x0 = D[e1 + 1], $ = V0; $ < x0; $++) {
15682
15682
  var K = L[$];
15683
15683
  B0[K] !== s1 ? (B0[K] = s1, p0.push(K), F0[K] = V(n1, y[$])) : F0[K] = Y(F0[K], V(n1, y[$]));
@@ -15691,8 +15691,8 @@ Example:
15691
15691
  return r0[k] = p0.length, k0;
15692
15692
  }
15693
15693
  function g(W, v) {
15694
- var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType(), w = v._values, x = v._index, T = v._ptr, S = v._datatype || v._data === void 0 ? v._datatype : v.getDataType(), k = W._size[0], X = v._size[1], Y = y && w, V, G = r, c0 = i;
15695
- N && S && N === S && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]), c0 = e.find(i, [V, V]));
15694
+ var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType(), w = v._values, x = v._index, T = v._ptr, S = v._datatype || v._data === void 0 ? v._datatype : v.getDataType(), k = W._size[0], X = v._size[1], Y = y && w, V, G = r, o0 = i;
15695
+ N && S && N === S && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]), o0 = e.find(i, [V, V]));
15696
15696
  for (var d0 = Y ? [] : void 0, p0 = [], r0 = [], k0 = W.createSparseMatrix({
15697
15697
  values: d0,
15698
15698
  index: p0,
@@ -15705,7 +15705,7 @@ Example:
15705
15705
  for (V0 = T[Z], x0 = T[Z + 1], n1 = V0; n1 < x0; n1++)
15706
15706
  if (K = x[n1], Y)
15707
15707
  for (s1 = D[K], e1 = D[K + 1], f0 = s1; f0 < e1; f0++)
15708
- $ = L[f0], B0[$] !== i0 ? (B0[$] = i0, p0.push($), F0[$] = c0(w[n1], y[f0])) : F0[$] = G(F0[$], c0(w[n1], y[f0]));
15708
+ $ = L[f0], B0[$] !== i0 ? (B0[$] = i0, p0.push($), F0[$] = o0(w[n1], y[f0])) : F0[$] = G(F0[$], o0(w[n1], y[f0]));
15709
15709
  else
15710
15710
  for (s1 = D[K], e1 = D[K + 1], f0 = s1; f0 < e1; f0++)
15711
15711
  $ = L[f0], B0[$] !== i0 && (B0[$] = i0, p0.push($));
@@ -18135,8 +18135,10 @@ Example:
18135
18135
  if (i === void 0 || i <= 0)
18136
18136
  return;
18137
18137
  const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
18138
- if (a?.length)
18139
- return Math.max(...a.slice(-i));
18138
+ if (!a?.length)
18139
+ return;
18140
+ const c = a.slice(-i).filter((p) => !isNaN(p));
18141
+ return Math.max(...c);
18140
18142
  }
18141
18143
  highestbars(e, t) {
18142
18144
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -18176,8 +18178,10 @@ Example:
18176
18178
  if (i === void 0 || i <= 0)
18177
18179
  return;
18178
18180
  const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
18179
- if (a?.length)
18180
- return Math.min(...a.slice(-i));
18181
+ if (!a?.length)
18182
+ return;
18183
+ const c = a.slice(-i).filter((p) => !isNaN(p));
18184
+ return Math.min(...c);
18181
18185
  }
18182
18186
  lowestbars(e, t) {
18183
18187
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -18368,12 +18372,12 @@ Example:
18368
18372
  const r = `vwap_${t}`, i = this._verifyCacheData(r);
18369
18373
  if (i)
18370
18374
  return i?.value;
18371
- const s = this._timeframe.change({ timeframe: "1D" }, t), { volume: o } = this._variables;
18372
- let { sum: a = 0, sumV: c = 0, count: p = 0, isReset: b, sumS: M = 0 } = this._getCacheData(r);
18373
- if (s && (a = c = p = M = 0, b = !0), !b)
18375
+ const s = /\$[\d]+_\$/.test(t), o = this._timeframe.change({ timeframe: "1D" }, t), { volume: a } = this._variables;
18376
+ let { sum: c = 0, sumV: p = 0, count: b = 0, isReset: M } = this._getCacheData(r);
18377
+ if (o ? (c = p = b = 0, M = !0) : s && (M = !1), !M)
18374
18378
  return;
18375
- const l = e * o + a, u = o + c, O = l / u;
18376
- return p++, this._cacheDataHandle(r, { sum: l, sumV: u, count: p, isReset: b, value: O }), O;
18379
+ const l = e * a + c, u = a + p, O = l / u;
18380
+ return b++, this._cacheDataHandle(r, { sum: l, sumV: u, count: b, isReset: M, value: O }), O;
18377
18381
  }
18378
18382
  vwma({ source: e, length: t, isSeriesLen: r }, i) {
18379
18383
  if (e === void 0 || isNaN(e) || t === void 0 || t <= 0)
@@ -18400,7 +18404,7 @@ Example:
18400
18404
  }, { bar_index: c } = this._variables;
18401
18405
  if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
18402
18406
  const p = a.list.length;
18403
- a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
18407
+ o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
18404
18408
  }
18405
18409
  if (!(a.list.length < t && s))
18406
18410
  return a.list;
@@ -20172,6 +20176,7 @@ ${u}`), u;
20172
20176
  _fills;
20173
20177
  strategy;
20174
20178
  _count = 0;
20179
+ _alertSelects = [];
20175
20180
  constructor(e, t, r) {
20176
20181
  super(t, r), t.buildInTimeframeFunc = this._timeframe, this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.strategy = new eB(this._variables, this._options, e, this._errorListener, r);
20177
20182
  }
@@ -20216,7 +20221,7 @@ ${u}`), u;
20216
20221
  const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0;
20217
20222
  this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
20218
20223
  const p = this._plots.size > 0 ? [...this._plots.values()] : void 0, b = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, M = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, l = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, u = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, O = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0;
20219
- return Object.assign({}, this._options, { inputs: r, plots: p, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b });
20224
+ return Object.assign({}, this._options, { inputs: r, plots: p, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b, alertSelects: this._alertSelects });
20220
20225
  }
20221
20226
  _getDataOfBarindex(e) {
20222
20227
  const t = this._alerts.size ? [...this._alerts.values()] : void 0;
@@ -20391,13 +20396,18 @@ ${u}`), u;
20391
20396
  }
20392
20397
  }
20393
20398
  alertcondition({ condition: e, message: t, title: r }, i) {
20394
- const { _isRealTimeBar: s } = this._variables, o = `alertcondition_${i}`;
20395
- s && e ? this._alerts.set(o, {
20399
+ const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
20400
+ this._variables.bar_index === 0 && !o && this._alertSelects.push({
20401
+ id: a,
20402
+ message: t || "警报已发出!",
20403
+ title: r || "警报",
20404
+ type: "alertcondition"
20405
+ }), !s && e ? this._alerts.set(a, {
20396
20406
  message: t,
20397
20407
  title: r,
20398
- id: o,
20408
+ id: a,
20399
20409
  type: "alertcondition"
20400
- }) : this._alerts.delete(o);
20410
+ }) : this._alerts.delete(a);
20401
20411
  }
20402
20412
  barcolor(e, t) {
20403
20413
  this._setColors(e, "barcolor", t);
@@ -21091,11 +21101,11 @@ ${u}`), u;
21091
21101
  if (G)
21092
21102
  return G;
21093
21103
  S = Object.assign(Y, { barIndex: V || X, lastBarIndex: r[D].barindex || D, lastBarTime: r[D].time, nextBarTime: r[X + 1]?.time }), Lf(f, q, A, g, M, S, N);
21094
- const c0 = q.errors;
21095
- if (c0.length && c0.some((d0) => d0.type === ge.Error))
21104
+ const o0 = q.errors;
21105
+ if (o0.length && o0.some((d0) => d0.type === ge.Error))
21096
21106
  return {
21097
21107
  status: 1,
21098
- errors: C0.uniqBy(c0, "startLineNumber")
21108
+ errors: C0.uniqBy(o0, "startLineNumber")
21099
21109
  };
21100
21110
  }
21101
21111
  if (N?.size) {
@@ -21798,13 +21808,13 @@ ${u}`), u;
21798
21808
  hold_profit_short_k_count: Y = 0,
21799
21809
  hold_loss_long_k_count: V = 0,
21800
21810
  hold_loss_short_k_count: G = 0,
21801
- balanceByInterval: c0,
21811
+ balanceByInterval: o0,
21802
21812
  shapeRatioType: d0 = "NONE"
21803
21813
  } = this._preHistoryOrderCalcResult;
21804
21814
  const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
21805
- if (f0 === f1.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !c0) {
21815
+ if (f0 === f1.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
21806
21816
  const i0 = this._createBalanceByInterval(s1, Date.now());
21807
- c0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
21817
+ o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
21808
21818
  }
21809
21819
  const x0 = i + s;
21810
21820
  this._closedtrades = x0;
@@ -21849,11 +21859,11 @@ ${u}`), u;
21849
21859
  hold_profit_short_k_count: Y,
21850
21860
  hold_loss_long_k_count: V,
21851
21861
  hold_loss_short_k_count: G,
21852
- balanceByInterval: c0,
21862
+ balanceByInterval: o0,
21853
21863
  shapeRatioType: d0
21854
21864
  }, d0 !== "NONE") {
21855
21865
  const i0 = d0 === "D" ? p3 : Gc;
21856
- c0[i0(e1)] = $ + n1;
21866
+ o0[i0(e1)] = $ + n1;
21857
21867
  }
21858
21868
  } else if (this._options?.commission_value) {
21859
21869
  const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
@@ -23134,7 +23144,7 @@ ${u}`), u;
23134
23144
  }
23135
23145
  avg({ id: e }, t) {
23136
23146
  if (e)
23137
- return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value);
23147
+ return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value.filter((r) => !isNaN(r)));
23138
23148
  }
23139
23149
  clear({ id: e }) {
23140
23150
  e && (e._value = []);
@@ -23852,8 +23862,10 @@ ${u}`), u;
23852
23862
  if (i === void 0 || i <= 0)
23853
23863
  return;
23854
23864
  const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
23855
- if (a?.length)
23856
- return Math.max(...a.slice(-i));
23865
+ if (!a?.length)
23866
+ return;
23867
+ const c = a.slice(-i).filter((p) => !isNaN(p));
23868
+ return Math.max(...c);
23857
23869
  }
23858
23870
  highestbars(e, t) {
23859
23871
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -23911,8 +23923,10 @@ ${u}`), u;
23911
23923
  if (i === void 0 || i <= 0)
23912
23924
  return;
23913
23925
  const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
23914
- if (a?.length)
23915
- return Math.min(...a.slice(-i));
23926
+ if (!a?.length)
23927
+ return;
23928
+ const c = a.slice(-i).filter((p) => !isNaN(p));
23929
+ return Math.min(...c);
23916
23930
  }
23917
23931
  lowestbars(e, t) {
23918
23932
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -24149,13 +24163,14 @@ ${u}`), u;
24149
24163
  const i = `vwap_${r}`, s = this._verifyCacheData(i);
24150
24164
  if (s)
24151
24165
  return s?.value;
24166
+ const o = /\$[\d]+_\$/.test(r);
24152
24167
  t = t === void 0 ? this._timeframe.change({ timeframe: "1D" }, r) : t;
24153
- const { volume: o } = this._variables;
24154
- let { sum: a = 0, sumV: c = 0, count: p = 0, isReset: b } = this._getCacheData(i);
24155
- if (t && (a = c = p = 0, b = !0), !b)
24168
+ const { volume: a } = this._variables;
24169
+ let { sum: c = 0, sumV: p = 0, count: b = 0, isReset: M } = this._getCacheData(i);
24170
+ if (t ? (c = p = b = 0, M = !0) : o && (M = !1), !M)
24156
24171
  return;
24157
- const M = e * o + a, l = o + c, u = M / l;
24158
- return p++, this._cacheDataHandle(i, { sum: M, sumV: l, count: p, isReset: b, value: u }), u;
24172
+ const l = e * a + c, u = a + p, O = l / u;
24173
+ return b++, this._cacheDataHandle(i, { sum: l, sumV: u, count: b, isReset: M, value: O }), O;
24159
24174
  }
24160
24175
  vwma({ source: e, length: t, isSeriesLen: r }, i) {
24161
24176
  if (e === void 0 || isNaN(e) || t === void 0 || t <= 0)
@@ -24189,7 +24204,7 @@ ${u}`), u;
24189
24204
  }, { bar_index: c } = this._variables;
24190
24205
  if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
24191
24206
  const p = a.list.length;
24192
- a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
24207
+ o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
24193
24208
  }
24194
24209
  if (!(a.list.length < t && s))
24195
24210
  return a.list;
@@ -26699,11 +26714,11 @@ ${u}`), u;
26699
26714
  return;
26700
26715
  }
26701
26716
  if (X <= N && V > N) {
26702
- const c0 = v + S;
26717
+ const o0 = v + S;
26703
26718
  return this._reqCacheDataLoc[t] = {
26704
- index: c0,
26719
+ index: o0,
26705
26720
  periodStamp: y
26706
- }, { ...k, barIndex: Y || c0, nextBarTime: D[S + 1]?.time, ...T };
26721
+ }, { ...k, barIndex: Y || o0, nextBarTime: D[S + 1]?.time, ...T };
26707
26722
  }
26708
26723
  }
26709
26724
  else
@@ -26924,6 +26939,7 @@ ${u}`), u;
26924
26939
  table;
26925
26940
  strategy;
26926
26941
  _count = 0;
26942
+ _alertSelects = [];
26927
26943
  constructor(e, t, r) {
26928
26944
  super(t, r);
26929
26945
  const i = e.toString().split(".")[1]?.length || 5;
@@ -26979,7 +26995,7 @@ ${u}`), u;
26979
26995
  const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0;
26980
26996
  this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
26981
26997
  const p = this._plots.size > 0 ? [...this._plots.values()] : void 0, b = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, M = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, l = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, u = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, O = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0, d = this._getDraws();
26982
- return Object.assign({}, this._options, { inputs: r, plots: p, draws: d, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b });
26998
+ return Object.assign({}, this._options, { inputs: r, plots: p, draws: d, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b, alertSelects: this._alertSelects });
26983
26999
  }
26984
27000
  _getDataOfBarindex(e) {
26985
27001
  const t = this._alerts.size ? [...this._alerts.values()] : void 0;
@@ -27166,7 +27182,7 @@ ${u}`), u;
27166
27182
  }
27167
27183
  }
27168
27184
  alert({ message: e, freq: t = Rr.freqOncePerBar }, r) {
27169
- const { bar_index: i, _isRealTimeBar: s, last_bar_index: o } = this._variables, a = `alert_${r}`, c = this._cacheData[a] || {}, p = c.barIndex;
27185
+ const { bar_index: i, __isFirstRun: s, _isRealTimeBar: o } = this._variables, a = `alert_${r}`, c = this._cacheData[a] || {}, p = c.barIndex;
27170
27186
  if (this._paramVerfiy(t, r, "alert", [Rr.freqAll, Rr.freqOncePerBar, Rr.freqOncePerBarClose]), t === Rr.freqOncePerBar && i === p) {
27171
27187
  this._alerts.delete(a);
27172
27188
  return;
@@ -27178,24 +27194,29 @@ ${u}`), u;
27178
27194
  id: a,
27179
27195
  type: "alert"
27180
27196
  };
27181
- if (s) {
27197
+ if (!s) {
27182
27198
  t !== Rr.freqOncePerBarClose && this._alerts.set(a, b), c.barIndex = i;
27183
27199
  return;
27184
27200
  }
27185
- if (!s && t === Rr.freqOncePerBarClose && i === p && o === i - 1) {
27201
+ if (!o && t === Rr.freqOncePerBarClose && !s) {
27186
27202
  this._alerts.set(a, b), c.barIndex = i;
27187
27203
  return;
27188
27204
  }
27189
27205
  this._alerts.delete(a);
27190
27206
  }
27191
27207
  alertcondition({ condition: e, message: t, title: r }, i) {
27192
- const { _isRealTimeBar: s } = this._variables, o = `alertcondition_${i}`;
27193
- s && e ? this._alerts.set(o, {
27208
+ const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
27209
+ this._variables.bar_index === 0 && !o && this._alertSelects.push({
27210
+ id: a,
27211
+ message: t || "警报已发出!",
27212
+ title: r || "警报",
27213
+ type: "alertcondition"
27214
+ }), !s && e ? this._alerts.set(a, {
27194
27215
  message: t,
27195
27216
  title: r,
27196
- id: o,
27217
+ id: a,
27197
27218
  type: "alertcondition"
27198
- }) : this._alerts.delete(o);
27219
+ }) : this._alerts.delete(a);
27199
27220
  }
27200
27221
  barcolor(e, t) {
27201
27222
  this._setColors(e, "barcolor", t);
@@ -27456,11 +27477,11 @@ ${u}`), u;
27456
27477
  if (G)
27457
27478
  return G;
27458
27479
  S = Object.assign(Y, { barIndex: V || X, lastBarIndex: r[D].barindex || D, lastBarTime: r[D].time, nextBarTime: r[X + 1]?.time }), Xf(f, q, A, g, M, S, N);
27459
- const c0 = q.errors;
27460
- if (c0.length && c0.some((d0) => d0.type === k1.Error))
27480
+ const o0 = q.errors;
27481
+ if (o0.length && o0.some((d0) => d0.type === k1.Error))
27461
27482
  return {
27462
27483
  status: 1,
27463
- errors: C0.uniqBy(c0, "startLineNumber")
27484
+ errors: C0.uniqBy(o0, "startLineNumber")
27464
27485
  };
27465
27486
  }
27466
27487
  if (N?.size) {
@@ -28063,7 +28084,7 @@ ${u}`), u;
28063
28084
  }
28064
28085
  avg({ id: e }, t) {
28065
28086
  if (e)
28066
- return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value);
28087
+ return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value.filter((r) => !isNaN(r)));
28067
28088
  }
28068
28089
  binary_search({ id: e, val: t }, r) {
28069
28090
  if (e)
@@ -28789,8 +28810,10 @@ ${u}`), u;
28789
28810
  if (i === void 0 || i <= 0)
28790
28811
  return;
28791
28812
  const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
28792
- if (a?.length)
28793
- return Math.max(...a.slice(-i));
28813
+ if (!a?.length)
28814
+ return;
28815
+ const c = a.slice(-i).filter((p) => !isNaN(p));
28816
+ return Math.max(...c);
28794
28817
  }
28795
28818
  highestbars(e, t) {
28796
28819
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -28848,8 +28871,10 @@ ${u}`), u;
28848
28871
  if (i === void 0 || i <= 0)
28849
28872
  return;
28850
28873
  const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
28851
- if (a?.length)
28852
- return Math.min(...a.slice(-i));
28874
+ if (!a?.length)
28875
+ return;
28876
+ const c = a.slice(-i).filter((p) => !isNaN(p));
28877
+ return Math.min(...c);
28853
28878
  }
28854
28879
  lowestbars(e, t) {
28855
28880
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -29158,18 +29183,19 @@ ${u}`), u;
29158
29183
  const s = `vwap_${i}`, o = this._verifyCacheData(s);
29159
29184
  if (o)
29160
29185
  return o?.value;
29186
+ const a = /\$[\d]+_\$/.test(i);
29161
29187
  t = t === void 0 ? this._timeframe.change({ timeframe: "1D" }, i) : t;
29162
- const { volume: a } = this._variables;
29163
- let { sum: c = 0, sumV: p = 0, count: b = 0, isReset: M, sumS: l = 0 } = this._getCacheData(s);
29164
- if (t && (c = p = b = l = 0, M = !0), !M)
29188
+ const { volume: c } = this._variables;
29189
+ let { sum: p = 0, sumV: b = 0, count: M = 0, isReset: l, sumS: u = 0 } = this._getCacheData(s);
29190
+ if (t ? (p = b = M = u = 0, l = !0) : a && (l = !1), !l)
29165
29191
  return r !== void 0 ? [] : void 0;
29166
- const u = e * a + c, O = a + p, d = u / O;
29167
- if (b++, r !== void 0) {
29168
- l = a * Math.pow(e, 2) + l;
29169
- const _ = this._computeBands(l, O, r, d);
29170
- return this._cacheDataHandle(s, { sum: u, sumV: O, count: b, isReset: M, sumS: l, value: _ }), _;
29192
+ const O = e * c + p, d = c + b, _ = O / d;
29193
+ if (M++, r !== void 0) {
29194
+ u = c * Math.pow(e, 2) + u;
29195
+ const f = this._computeBands(u, d, r, _);
29196
+ return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, sumS: u, value: f }), f;
29171
29197
  }
29172
- return this._cacheDataHandle(s, { sum: u, sumV: O, count: b, isReset: M, value: d }), d;
29198
+ return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, value: _ }), _;
29173
29199
  }
29174
29200
  _computeBands(e, t, r, i) {
29175
29201
  let s = e / t - Math.pow(i, 2);
@@ -29209,7 +29235,7 @@ ${u}`), u;
29209
29235
  }, { bar_index: c } = this._variables;
29210
29236
  if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
29211
29237
  const p = a.list.length;
29212
- a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
29238
+ o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
29213
29239
  }
29214
29240
  if (!(a.list.length < t && s))
29215
29241
  return a.list;
@@ -30661,7 +30687,7 @@ ${Uf}`);
30661
30687
  strassen3x3(e) {
30662
30688
  e = m0.checkMatrix(e);
30663
30689
  let t = new m0(3, 3);
30664
- const r = this.get(0, 0), i = this.get(0, 1), s = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), c = this.get(1, 2), p = this.get(2, 0), b = this.get(2, 1), M = this.get(2, 2), l = e.get(0, 0), u = e.get(0, 1), O = e.get(0, 2), d = e.get(1, 0), _ = e.get(1, 1), f = e.get(1, 2), A = e.get(2, 0), q = e.get(2, 1), g = e.get(2, 2), W = (r + i + s - o - a - b - M) * _, v = (r - o) * (-u + _), y = a * (-l + u + d - _ - f - A + g), L = (-r + o + a) * (l - u + _), D = (o + a) * (-l + u), N = r * l, w = (-r + p + b) * (l - O + f), x = (-r + p) * (O - f), T = (p + b) * (-l + O), S = (r + i + s - a - c - p - b) * f, k = b * (-l + O + d - _ - f - A + q), X = (-s + b + M) * (_ + A - q), Y = (s - M) * (_ - q), V = s * A, G = (b + M) * (-A + q), c0 = (-s + a + c) * (f + A - g), d0 = (s - c) * (f - g), p0 = (a + c) * (-A + g), r0 = i * d, k0 = c * q, F0 = o * O, B0 = p * u, f0 = M * g, s1 = N + V + r0, e1 = W + L + D + N + X + V + G, n1 = N + w + T + S + V + c0 + p0, V0 = v + y + L + N + V + c0 + d0, x0 = v + L + D + N + k0, $ = V + c0 + d0 + p0 + F0, K = N + w + x + k + X + Y + V, Z = X + Y + V + G + B0, i0 = N + w + x + T + f0;
30690
+ const r = this.get(0, 0), i = this.get(0, 1), s = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), c = this.get(1, 2), p = this.get(2, 0), b = this.get(2, 1), M = this.get(2, 2), l = e.get(0, 0), u = e.get(0, 1), O = e.get(0, 2), d = e.get(1, 0), _ = e.get(1, 1), f = e.get(1, 2), A = e.get(2, 0), q = e.get(2, 1), g = e.get(2, 2), W = (r + i + s - o - a - b - M) * _, v = (r - o) * (-u + _), y = a * (-l + u + d - _ - f - A + g), L = (-r + o + a) * (l - u + _), D = (o + a) * (-l + u), N = r * l, w = (-r + p + b) * (l - O + f), x = (-r + p) * (O - f), T = (p + b) * (-l + O), S = (r + i + s - a - c - p - b) * f, k = b * (-l + O + d - _ - f - A + q), X = (-s + b + M) * (_ + A - q), Y = (s - M) * (_ - q), V = s * A, G = (b + M) * (-A + q), o0 = (-s + a + c) * (f + A - g), d0 = (s - c) * (f - g), p0 = (a + c) * (-A + g), r0 = i * d, k0 = c * q, F0 = o * O, B0 = p * u, f0 = M * g, s1 = N + V + r0, e1 = W + L + D + N + X + V + G, n1 = N + w + T + S + V + o0 + p0, V0 = v + y + L + N + V + o0 + d0, x0 = v + L + D + N + k0, $ = V + o0 + d0 + p0 + F0, K = N + w + x + k + X + Y + V, Z = X + Y + V + G + B0, i0 = N + w + x + T + f0;
30665
30691
  return t.set(0, 0, s1), t.set(0, 1, e1), t.set(0, 2, n1), t.set(1, 0, V0), t.set(1, 1, x0), t.set(1, 2, $), t.set(2, 0, K), t.set(2, 1, Z), t.set(2, 2, i0), t;
30666
30692
  }
30667
30693
  mmulStrassen(e) {
@@ -30704,8 +30730,8 @@ ${Uf}`);
30704
30730
  X.sub(T), X.add(k);
30705
30731
  let Y = c1.add(w, T), V = c1.add(N, x), G = c1.sub(D, N);
30706
30732
  G.add(w), G.add(S);
30707
- let c0 = c1.zeros(2 * X.rows, 2 * X.columns);
30708
- return c0 = c0.setSubMatrix(X, 0, 0), c0 = c0.setSubMatrix(Y, X.rows, 0), c0 = c0.setSubMatrix(V, 0, X.columns), c0 = c0.setSubMatrix(G, X.rows, X.columns), c0.subMatrix(0, u - 1, 0, O - 1);
30733
+ let o0 = c1.zeros(2 * X.rows, 2 * X.columns);
30734
+ return o0 = o0.setSubMatrix(X, 0, 0), o0 = o0.setSubMatrix(Y, X.rows, 0), o0 = o0.setSubMatrix(V, 0, X.columns), o0 = o0.setSubMatrix(G, X.rows, X.columns), o0.subMatrix(0, u - 1, 0, O - 1);
30709
30735
  }
30710
30736
  return b(t, e, c, p);
30711
30737
  }
@@ -31855,9 +31881,9 @@ ${Uf}`);
31855
31881
  Math.abs(O[N]),
31856
31882
  Math.abs(f[N])
31857
31883
  ), T = O[y - 1] / x, S = O[y - 2] / x, k = f[y - 2] / x, X = O[N] / x, Y = f[N] / x, V = ((S + T) * (S - T) + k * k) / 2, G = T * k * (T * k);
31858
- let c0 = 0;
31859
- (V !== 0 || G !== 0) && (V < 0 ? c0 = 0 - Math.sqrt(V * V + G) : c0 = Math.sqrt(V * V + G), c0 = G / (V + c0));
31860
- let d0 = (X + T) * (X - T) + c0, p0 = X * Y;
31884
+ let o0 = 0;
31885
+ (V !== 0 || G !== 0) && (V < 0 ? o0 = 0 - Math.sqrt(V * V + G) : o0 = Math.sqrt(V * V + G), o0 = G / (V + o0));
31886
+ let d0 = (X + T) * (X - T) + o0, p0 = X * Y;
31861
31887
  for (let r0 = N; r0 < y - 1; r0++) {
31862
31888
  let k0 = hi(d0, p0);
31863
31889
  k0 === 0 && (k0 = Number.MIN_VALUE);
@@ -36140,6 +36166,7 @@ ${Uf}`);
36140
36166
  request;
36141
36167
  syminfo;
36142
36168
  _count = 0;
36169
+ _alertSelects = [];
36143
36170
  constructor(e, t, r) {
36144
36171
  const i = e.toString().split(".")[1]?.length || 5;
36145
36172
  this._variables = t, this._errorListener = new RC(), this.array = new Hf(this._errorListener), this.math = new Bx(i), this.color = new Ex(), this.str = new T7(this._errorListener, i, t), this.map = new X7(), this.timeframe = new E7(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new C7(this._errorListener), this.ta = new xx(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new Cx(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new I7(t) }, this.line = new _i(t, this._errorListener), this.label = new S7(t, this._errorListener), this.polyline = new cC(t, this._errorListener), this.box = new dC(t, this._errorListener), this.table = new fC(t, this._errorListener), this.linefill = new lC(t), this.log = new vC(t, this.str), this.runtime = new yC(this._errorListener), this.strategy = new mC(this._variables, this._options, e, this._errorListener, r), this.request = new gC(this._variables, r, this, this._errorListener), this.syminfo = new WC(), this._proxy = /* @__PURE__ */ new Map();
@@ -36189,7 +36216,7 @@ ${Uf}`);
36189
36216
  const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0, p = this.log.logs.length ? this.log.logs : void 0;
36190
36217
  this.log.clearLogs(), this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
36191
36218
  const b = this._plots.size > 0 ? [...this._plots.values()] : void 0, M = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, l = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, u = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, O = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, d = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0, _ = this._getDraws(), f = this._variables.chart.isUseBgColor;
36192
- return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f });
36219
+ return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f, alertSelects: this._alertSelects });
36193
36220
  }
36194
36221
  _getDataOfBarindex(e) {
36195
36222
  const t = this._alerts.size ? [...this._alerts.values()] : void 0;
@@ -36483,13 +36510,18 @@ ${Uf}`);
36483
36510
  this._alerts.delete(a);
36484
36511
  }
36485
36512
  alertcondition({ condition: e, message: t, title: r }, i) {
36486
- const { _isRealTimeBar: s } = this._variables, o = `alertcondition_${i}`;
36487
- s && e ? this._alerts.set(o, {
36513
+ const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
36514
+ this._variables.bar_index === 0 && !o && this._alertSelects.push({
36515
+ id: a,
36516
+ message: t || "警报已发出!",
36517
+ title: r || "警报",
36518
+ type: "alertcondition"
36519
+ }), !s && e ? this._alerts.set(a, {
36488
36520
  message: t,
36489
36521
  title: r,
36490
- id: o,
36522
+ id: a,
36491
36523
  type: "alertcondition"
36492
- }) : this._alerts.delete(o);
36524
+ }) : this._alerts.delete(a);
36493
36525
  }
36494
36526
  barcolor(e, t) {
36495
36527
  this._setColors(e, "barcolor", t);
@@ -37508,13 +37540,13 @@ ${u}`), u;
37508
37540
  hold_profit_short_k_count: Y = 0,
37509
37541
  hold_loss_long_k_count: V = 0,
37510
37542
  hold_loss_short_k_count: G = 0,
37511
- balanceByInterval: c0,
37543
+ balanceByInterval: o0,
37512
37544
  shapeRatioType: d0 = "NONE"
37513
37545
  } = this._preHistoryOrderCalcResult;
37514
37546
  const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
37515
- if (f0 === X0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !c0) {
37547
+ if (f0 === X0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
37516
37548
  const i0 = this._createBalanceByInterval(s1, Date.now());
37517
- c0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
37549
+ o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
37518
37550
  }
37519
37551
  const x0 = i + s;
37520
37552
  this._closedtrades = x0;
@@ -37559,9 +37591,9 @@ ${u}`), u;
37559
37591
  hold_profit_short_k_count: Y,
37560
37592
  hold_loss_long_k_count: V,
37561
37593
  hold_loss_short_k_count: G,
37562
- balanceByInterval: c0,
37594
+ balanceByInterval: o0,
37563
37595
  shapeRatioType: d0
37564
- }, d0 !== "NONE" && (c0[Gc(e1)] = $ + n1);
37596
+ }, d0 !== "NONE" && (o0[Gc(e1)] = $ + n1);
37565
37597
  } else if (this._options?.commission_value) {
37566
37598
  const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
37567
37599
  const { commission: M = 0, qty: l = 0, original_qty: u = 0 } = b, O = M * l / u;
@@ -38815,9 +38847,9 @@ ${u}`), u;
38815
38847
  }]
38816
38848
  };
38817
38849
  !t && (G || G === 0) && u.push(G);
38818
- const c0 = await UO(f, q, A, g, M, k, x, { newCacheData: _, cacheData: O }, N, w, X);
38819
- if (c0)
38820
- return c0;
38850
+ const o0 = await UO(f, q, A, g, M, k, x, { newCacheData: _, cacheData: O }, N, w, X);
38851
+ if (o0)
38852
+ return o0;
38821
38853
  k = Object.assign(V, { barIndex: G || Y, lastBarIndex: S ? G : r[D].barindex || D, lastBarTime: S ? V.time : r[D].time, nextBarTime: r[Y + 1]?.time }), th(f, q, A, g, M, k, N);
38822
38854
  const d0 = q.errors;
38823
38855
  if (d0.length && d0.some((p0) => p0.type === K0.Error))
@@ -39423,7 +39455,7 @@ ${u}`), u;
39423
39455
  }
39424
39456
  avg({ id: e }, t) {
39425
39457
  if (e)
39426
- return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value);
39458
+ return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value.filter((r) => !isNaN(r)));
39427
39459
  }
39428
39460
  binary_search({ id: e, val: t }, r) {
39429
39461
  if (e)
@@ -40150,8 +40182,10 @@ ${u}`), u;
40150
40182
  if (i === void 0 || i <= 0)
40151
40183
  return;
40152
40184
  const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
40153
- if (a?.length)
40154
- return Math.max(...a.slice(-i));
40185
+ if (!a?.length)
40186
+ return;
40187
+ const c = a.slice(-i).filter((p) => !isNaN(p));
40188
+ return Math.max(...c);
40155
40189
  }
40156
40190
  highestbars(e, t) {
40157
40191
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -40209,8 +40243,10 @@ ${u}`), u;
40209
40243
  if (i === void 0 || i <= 0)
40210
40244
  return;
40211
40245
  const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
40212
- if (a?.length)
40213
- return Math.min(...a.slice(-i));
40246
+ if (!a?.length)
40247
+ return;
40248
+ const c = a.slice(-i).filter((p) => !isNaN(p));
40249
+ return Math.min(...c);
40214
40250
  }
40215
40251
  lowestbars(e, t) {
40216
40252
  const { source: r, length: i, isSeriesLen: s } = e;
@@ -40519,18 +40555,19 @@ ${u}`), u;
40519
40555
  const s = `vwap_${i}`, o = this._verifyCacheData(s);
40520
40556
  if (o)
40521
40557
  return o?.value;
40558
+ const a = /\(\$\d+_\$\)/.test(i);
40522
40559
  t = t === void 0 ? this._timeframe.change({ timeframe: "1D" }, i) : t;
40523
- const { volume: a } = this._variables;
40524
- let { sum: c = 0, sumV: p = 0, count: b = 0, isReset: M, sumS: l = 0 } = this._getCacheData(s);
40525
- if (t && (c = p = b = l = 0, M = !0), !M)
40560
+ const { volume: c } = this._variables;
40561
+ let { sum: p = 0, sumV: b = 0, count: M = 0, isReset: l, sumS: u = 0 } = this._getCacheData(s);
40562
+ if (t ? (p = b = M = u = 0, l = !0) : a && (l = !1), !l)
40526
40563
  return r !== void 0 ? [] : void 0;
40527
- const u = e * a + c, O = a + p, d = u / O;
40528
- if (b++, r !== void 0) {
40529
- l = a * Math.pow(e, 2) + l;
40530
- const _ = this._computeBands(l, O, r, d);
40531
- return this._cacheDataHandle(s, { sum: u, sumV: O, count: b, isReset: M, sumS: l, value: _ }), _;
40564
+ const O = e * c + p, d = c + b, _ = O / d;
40565
+ if (M++, r !== void 0) {
40566
+ u = c * Math.pow(e, 2) + u;
40567
+ const f = this._computeBands(u, d, r, _);
40568
+ return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, sumS: u, value: f }), f;
40532
40569
  }
40533
- return this._cacheDataHandle(s, { sum: u, sumV: O, count: b, isReset: M, value: d }), d;
40570
+ return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, value: _ }), _;
40534
40571
  }
40535
40572
  _computeBands(e, t, r, i) {
40536
40573
  let s = e / t - Math.pow(i, 2);
@@ -40570,7 +40607,7 @@ ${u}`), u;
40570
40607
  }, { bar_index: c } = this._variables;
40571
40608
  if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
40572
40609
  const p = a.list.length;
40573
- a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
40610
+ o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
40574
40611
  }
40575
40612
  if (!(a.list.length < t && s))
40576
40613
  return a.list;
@@ -44541,6 +44578,7 @@ ${u}`), u;
44541
44578
  request;
44542
44579
  syminfo;
44543
44580
  _count = 0;
44581
+ _alertSelects = [];
44544
44582
  constructor(e, t, r) {
44545
44583
  const i = e.toString().split(".")[1]?.length || 5;
44546
44584
  this._variables = t, this._errorListener = new UE(), this.array = new ch(this._errorListener), this.math = new YC(i), this.color = new QC(), this.str = new eE(this._errorListener, i, t), this.map = new tE(), this.timeframe = new ZC(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new JC(this._errorListener), this.ta = new KC(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new GC(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new rE(t) }, this.line = new Ai(t, this._errorListener), this.label = new nE(t, this._errorListener), this.polyline = new yE(t, this._errorListener), this.box = new CE(t, this._errorListener), this.table = new EE(t, this._errorListener), this.linefill = new wE(t), this.log = new PE(t, this.str), this.runtime = new HE(this._errorListener), this.strategy = new FE(this._variables, this._options, e, this._errorListener, r), this.request = new SE(this._variables, r, this, this._errorListener), this.syminfo = new kE(), this._proxy = /* @__PURE__ */ new Map();
@@ -44590,7 +44628,7 @@ ${u}`), u;
44590
44628
  const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0, p = this.log.logs.length ? this.log.logs : void 0;
44591
44629
  this.log.clearLogs(), this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
44592
44630
  const b = this._plots.size > 0 ? [...this._plots.values()] : void 0, M = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, l = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, u = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, O = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, d = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0, _ = this._getDraws(), f = this._variables.chart.isUseBgColor;
44593
- return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f });
44631
+ return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f, alertSelects: this._alertSelects });
44594
44632
  }
44595
44633
  _getDataOfBarindex(e) {
44596
44634
  const t = this._alerts.size ? [...this._alerts.values()] : void 0;
@@ -44861,36 +44899,41 @@ ${u}`), u;
44861
44899
  }
44862
44900
  }
44863
44901
  alert({ message: e, freq: t = wr.freqOncePerBar }, r) {
44864
- const { bar_index: i, _isRealTimeBar: s, last_bar_index: o } = this._variables, a = `alert_${r}`, c = this._cacheData[a] || {}, p = c.barIndex;
44865
- if (this._paramVerfiy(t, r, "alert", [wr.freqAll, wr.freqOncePerBar, wr.freqOncePerBarClose]), t === wr.freqOncePerBar && i === p) {
44866
- this._alerts.delete(a);
44902
+ const { bar_index: i, __isFirstRun: s, _isRealTimeBar: o } = this._variables, a = !s, c = `alert_${r}`, p = this._cacheData[c] || {}, b = p.barIndex;
44903
+ if (this._paramVerfiy(t, r, "alert", [wr.freqAll, wr.freqOncePerBar, wr.freqOncePerBarClose]), t === wr.freqOncePerBar && i === b) {
44904
+ this._alerts.delete(c);
44867
44905
  return;
44868
44906
  }
44869
- this._cacheData[a] = c;
44870
- const b = {
44907
+ this._cacheData[c] = p;
44908
+ const M = {
44871
44909
  message: e,
44872
44910
  freq: t,
44873
- id: a,
44911
+ id: c,
44874
44912
  type: "alert"
44875
44913
  };
44876
- if (s) {
44877
- t !== wr.freqOncePerBarClose && this._alerts.set(a, b), c.barIndex = i;
44914
+ if (a) {
44915
+ t !== wr.freqOncePerBarClose && this._alerts.set(c, M), p.barIndex = i;
44878
44916
  return;
44879
44917
  }
44880
- if (!s && t === wr.freqOncePerBarClose && i === p && o === i - 1) {
44881
- this._alerts.set(a, b), c.barIndex = i;
44918
+ if (!o && t === wr.freqOncePerBarClose && a) {
44919
+ this._alerts.set(c, M), p.barIndex = i;
44882
44920
  return;
44883
44921
  }
44884
- this._alerts.delete(a);
44922
+ this._alerts.delete(c);
44885
44923
  }
44886
44924
  alertcondition({ condition: e, message: t, title: r }, i) {
44887
- const { _isRealTimeBar: s } = this._variables, o = `alertcondition_${i}`;
44888
- s && e ? this._alerts.set(o, {
44925
+ const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
44926
+ this._variables.bar_index === 0 && !o && this._alertSelects.push({
44927
+ id: a,
44928
+ message: t || "警报已发出!",
44929
+ title: r || "警报",
44930
+ type: "alertcondition"
44931
+ }), !s && e ? this._alerts.set(a, {
44889
44932
  message: t,
44890
44933
  title: r,
44891
- id: o,
44934
+ id: a,
44892
44935
  type: "alertcondition"
44893
- }) : this._alerts.delete(o);
44936
+ }) : this._alerts.delete(a);
44894
44937
  }
44895
44938
  barcolor(e, t) {
44896
44939
  this._setColors(e, "barcolor", t);
@@ -45256,21 +45299,21 @@ ${u}`), u;
45256
45299
  let N = M, w = v + N;
45257
45300
  const x = [];
45258
45301
  for (const [T, S] of D.entries()) {
45259
- let { time: k } = S;
45302
+ let { time: k, barIndex: X } = S;
45260
45303
  k = k * 1e3;
45261
- let X = W + T;
45304
+ let Y = X || W + T;
45262
45305
  if (k >= w)
45263
45306
  return !l && (this._cacheData[r] = {
45264
- index: X,
45307
+ index: Y,
45265
45308
  periodStamp: v
45266
45309
  }), x;
45267
45310
  if (N <= k && k < w) {
45268
- const Y = S?.result?.[r];
45269
- if (Array.isArray(Y))
45270
- for (const [V, G] of Y.entries())
45271
- x[V] || (x[V] = []), x[V].push(G);
45311
+ const V = S?.result?.[r];
45312
+ if (Array.isArray(V))
45313
+ for (const [G, o0] of V.entries())
45314
+ x[G] || (x[G] = []), x[G].push(o0);
45272
45315
  else
45273
- i || x.push(Y);
45316
+ i || x.push(V);
45274
45317
  }
45275
45318
  }
45276
45319
  return !l && (this._cacheData[r] = {
@@ -45323,7 +45366,7 @@ ${u}`), u;
45323
45366
  let { time: k, barindex: X } = S;
45324
45367
  k = k * 1e3;
45325
45368
  const Y = L[T + 1]?.time * 1e3 || k + q;
45326
- let V = W + T;
45369
+ let V = X || W + T;
45327
45370
  if (k >= N) {
45328
45371
  this._cacheData[t] = {
45329
45372
  index: V,
@@ -45342,7 +45385,7 @@ ${u}`), u;
45342
45385
  let { time: k, barindex: X } = S;
45343
45386
  k = k * 1e3;
45344
45387
  const Y = k + q, V = L[T + 1]?.time * 1e3 || Y;
45345
- let G = W + T;
45388
+ let G = X || W + T;
45346
45389
  if (k > N) {
45347
45390
  this._cacheData[t] = {
45348
45391
  index: G,
@@ -45373,7 +45416,7 @@ ${u}`), u;
45373
45416
  let { time: u, barindex: O } = l;
45374
45417
  u = u * 1e3, t.includes("M") && (i = ht(t, u) * 1e3 - (e0(u).date() - 1) * 864e5);
45375
45418
  const d = u, _ = i + d;
45376
- let f = o + M;
45419
+ let f = O || o + M;
45377
45420
  if (r <= d)
45378
45421
  return this._cacheData[c] = {
45379
45422
  index: f,
@@ -45401,7 +45444,7 @@ ${u}`), u;
45401
45444
  for (const [l, u] of e.entries()) {
45402
45445
  let { time: O, barindex: d } = u;
45403
45446
  O = O * 1e3, t.includes("M") && (i = ht(t, O) * 1e3 - (e0(O).date() - 1) * 864e5);
45404
- const _ = O, f = i + _, A = o + l;
45447
+ const _ = O, f = i + _, A = d || o + l;
45405
45448
  if (r < _)
45406
45449
  return this._cacheData[c] = {
45407
45450
  index: A,
@@ -45503,7 +45546,7 @@ ${u}`), u;
45503
45546
  const u = i.length - 1, { interval: O, symbol: d = "", mintick: _ } = s;
45504
45547
  let { syminfo: f } = this._variables;
45505
45548
  const [A, q] = d.split(":");
45506
- p.updateOptions({ interval: O, mintick: _, syminfo: { ...f.__syminfo, main_tickerid: f.main_tickerid, main_period: f.main_period, mintick: _, tickerid: d || f.tickerid, ticker: q || A || f.ticker } });
45549
+ p.__isFirstRun = r, p.updateOptions({ interval: O, mintick: _, syminfo: { ...f.__syminfo, main_tickerid: f.main_tickerid, main_period: f.main_period, mintick: _, tickerid: d || f.tickerid, ticker: q || A || f.ticker } });
45507
45550
  for (const [v, y] of i.entries()) {
45508
45551
  const { barindex: L } = y, D = Object.assign(y, { barIndex: L || v, lastBarIndex: i[u].barindex || u, lastBarTime: i[u].time, nextBarTime: i[v + 1]?.time });
45509
45552
  if (p.updateData(D), M.update({ barIndex: D?.barIndex || 0 }), y.result = Object.assign(y.result || {}, { [t]: l(p, b, M, o || [], t) }), M.endExecution(), M.errors.length && M.errors.some((N) => N.type === G0.Error))
@@ -45517,20 +45560,13 @@ ${u}`), u;
45517
45560
  }
45518
45561
  }
45519
45562
  _runScripts(e, t, r, i, s, o) {
45520
- const a = `${this._scriptId}_${t}`;
45521
- let { builtInGather: c, buildinConstants: p, buildInFunctions: b, tradingvueFunc: M } = self.workerStorage.get(a) || {};
45522
- const { interval: l, ...u } = s || {};
45523
- if (r) {
45524
- c = new Fb(a), p = new Ib(), b = new $b(this._variables.mintick || 1e-5, c, this._scriptId), M = new Function("_$_var", "_$_const", "_$_func", "$paramsExpr", "$posStr", e);
45525
- const { mintick: f, syminfo: A } = this._variables;
45526
- c.updateOptions({ interval: l, mintick: f || 1e-5, syminfo: { ...A.__syminfo } }), c.__requestName = o, self.workerStorage.set(a, { builtInGather: c, buildinConstants: p, buildInFunctions: b, tradingvueFunc: M });
45527
- }
45528
- c.updateData(u), b.update({ barIndex: u?.barindex || 0 });
45529
- const O = M(c, p, b, i || [], t), d = b.log.logs, _ = b.errors;
45530
- return b.log.clearLogs(), b.clearErrors(), b.endExecution(), {
45531
- result: O,
45532
- logs: d,
45533
- errors: _
45563
+ const a = `${this._scriptId}_${t}`, { interval: c, ...p } = s || {}, b = new Fb(a), M = new Ib(), l = new $b(this._variables.mintick || 1e-5, b, this._scriptId), u = new Function("_$_var", "_$_const", "_$_func", "$paramsExpr", "$posStr", e), { mintick: O, syminfo: d } = this._variables;
45564
+ b.updateOptions({ interval: c, mintick: O || 1e-5, syminfo: { ...d.__syminfo } }), b.__requestName = o || "", b.updateData(p), l.update({ barIndex: p?.barindex || 0 });
45565
+ const _ = u(b, M, l, i || [], t), f = l.log.logs, A = l.errors;
45566
+ return l.log.clearLogs(), l.clearErrors(), l.endExecution(), {
45567
+ result: _,
45568
+ logs: f,
45569
+ errors: A
45534
45570
  };
45535
45571
  }
45536
45572
  }, kE = class {
@@ -45918,13 +45954,13 @@ ${u}`), u;
45918
45954
  hold_profit_short_k_count: Y = 0,
45919
45955
  hold_loss_long_k_count: V = 0,
45920
45956
  hold_loss_short_k_count: G = 0,
45921
- balanceByInterval: c0,
45957
+ balanceByInterval: o0,
45922
45958
  shapeRatioType: d0 = "NONE"
45923
45959
  } = this._preHistoryOrderCalcResult;
45924
45960
  const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
45925
- if (f0 === I0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !c0) {
45961
+ if (f0 === I0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
45926
45962
  const i0 = this._createBalanceByInterval(s1, Date.now());
45927
- c0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
45963
+ o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
45928
45964
  }
45929
45965
  const x0 = i + s;
45930
45966
  this._closedtrades = x0;
@@ -45969,9 +46005,9 @@ ${u}`), u;
45969
46005
  hold_profit_short_k_count: Y,
45970
46006
  hold_loss_long_k_count: V,
45971
46007
  hold_loss_short_k_count: G,
45972
- balanceByInterval: c0,
46008
+ balanceByInterval: o0,
45973
46009
  shapeRatioType: d0
45974
- }, d0 !== "NONE" && (c0[Gc(e1)] = $ + n1);
46010
+ }, d0 !== "NONE" && (o0[Gc(e1)] = $ + n1);
45975
46011
  } else if (this._options?.commission_value) {
45976
46012
  const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
45977
46013
  const { commission: M = 0, qty: l = 0, original_qty: u = 0 } = b, O = M * l / u;
@@ -47256,9 +47292,9 @@ ${u}`), u;
47256
47292
  }]
47257
47293
  };
47258
47294
  !t && (G || G === 0) && u.push(G);
47259
- const c0 = await id(f, q, A, g, M, k, x, { newCacheData: _, cacheData: O }, N, w, X);
47260
- if (c0)
47261
- return c0;
47295
+ const o0 = await id(f, q, A, g, M, k, x, { newCacheData: _, cacheData: O }, N, w, X);
47296
+ if (o0)
47297
+ return o0;
47262
47298
  k = Object.assign(V, { barIndex: G || Y, lastBarIndex: S ? G : r[D].barindex || D, lastBarTime: S ? V.time : r[D].time, nextBarTime: r[Y + 1]?.time }), Mh(f, q, A, g, M, k, N);
47263
47299
  const d0 = q.errors;
47264
47300
  if (d0.length && d0.some((p0) => p0.type === G0.Error))