@363045841yyt/klinechart 0.5.4 → 0.5.5-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7,16 +7,16 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
7
7
  enumerable: !0
8
8
  });
9
9
  return t || k(n, Symbol.toStringTag, { value: "Module" }), n;
10
- }, F = (e, t, n, r) => {
10
+ }, ne = (e, t, n, r) => {
11
11
  if (t && typeof t == "object" || typeof t == "function") for (var i = j(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !N.call(e, s) && s !== n && k(e, s, {
12
12
  get: ((e) => t[e]).bind(null, s),
13
13
  enumerable: !(r = A(t, s)) || r.enumerable
14
14
  });
15
15
  return e;
16
- }, ne = (e, t, n) => (n = e == null ? {} : O(M(e)), F(t || !e || !e.__esModule ? k(n, "default", {
16
+ }, re = (e, t, n) => (n = e == null ? {} : O(M(e)), ne(t || !e || !e.__esModule ? k(n, "default", {
17
17
  value: e,
18
18
  enumerable: !0
19
- }) : n, e)), re = (e) => N.call(e, "module.exports") ? e["module.exports"] : F(k({}, "__esModule", { value: !0 }), e), I = class {
19
+ }) : n, e)), ie = (e) => N.call(e, "module.exports") ? e["module.exports"] : ne(k({}, "__esModule", { value: !0 }), e), F = class {
20
20
  listeners = /* @__PURE__ */ new Map();
21
21
  on(e, t) {
22
22
  this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t);
@@ -50,15 +50,15 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
50
50
  };
51
51
  //#endregion
52
52
  //#region node_modules/.pnpm/axios@1.16.0/node_modules/axios/lib/helpers/bind.js
53
- function ie(e, t) {
53
+ function ae(e, t) {
54
54
  return function() {
55
55
  return e.apply(t, arguments);
56
56
  };
57
57
  }
58
58
  //#endregion
59
59
  //#region node_modules/.pnpm/axios@1.16.0/node_modules/axios/lib/utils.js
60
- var { toString: ae } = Object.prototype, { getPrototypeOf: oe } = Object, { iterator: se, toStringTag: L } = Symbol, R = ((e) => (t) => {
61
- let n = ae.call(t);
60
+ var { toString: oe } = Object.prototype, { getPrototypeOf: se } = Object, { iterator: I, toStringTag: L } = Symbol, R = ((e) => (t) => {
61
+ let n = oe.call(t);
62
62
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
63
63
  })(Object.create(null)), z = (e) => (e = e.toLowerCase(), (t) => R(t) === e), ce = (e) => (t) => typeof t === e, { isArray: le } = Array, ue = ce("undefined");
64
64
  function de(e) {
@@ -71,8 +71,8 @@ function pe(e) {
71
71
  }
72
72
  var me = ce("string"), B = ce("function"), he = ce("number"), ge = (e) => typeof e == "object" && !!e, _e = (e) => e === !0 || e === !1, ve = (e) => {
73
73
  if (R(e) !== "object") return !1;
74
- let t = oe(e);
75
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(L in e) && !(se in e);
74
+ let t = se(e);
75
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(L in e) && !(I in e);
76
76
  }, ye = (e) => {
77
77
  if (!ge(e) || de(e)) return !1;
78
78
  try {
@@ -87,7 +87,7 @@ function De() {
87
87
  var Oe = De(), ke = Oe.FormData === void 0 ? void 0 : Oe.FormData, Ae = (e) => {
88
88
  if (!e) return !1;
89
89
  if (ke && e instanceof ke) return !0;
90
- let t = oe(e);
90
+ let t = se(e);
91
91
  if (!t || t === Object.prototype || !B(e.append)) return !1;
92
92
  let n = R(e);
93
93
  return n === "formdata" || n === "object" && B(e.toString) && e.toString() === "[object FormData]";
@@ -127,7 +127,7 @@ function V(...e) {
127
127
  var Ve = (e, t, n, { allOwnKeys: r } = {}) => (Le(t, (t, r) => {
128
128
  n && B(t) ? Object.defineProperty(e, r, {
129
129
  __proto__: null,
130
- value: ie(t, n),
130
+ value: ae(t, n),
131
131
  writable: !0,
132
132
  enumerable: !0,
133
133
  configurable: !0
@@ -154,7 +154,7 @@ var Ve = (e, t, n, { allOwnKeys: r } = {}) => (Le(t, (t, r) => {
154
154
  if (t ||= {}, e == null) return t;
155
155
  do {
156
156
  for (i = Object.getOwnPropertyNames(e), a = i.length; a-- > 0;) o = i[a], (!r || r(o, e, t)) && !s[o] && (t[o] = e[o], s[o] = !0);
157
- e = n !== !1 && oe(e);
157
+ e = n !== !1 && se(e);
158
158
  } while (e && (!n || n(e, t)) && e !== Object.prototype);
159
159
  return t;
160
160
  }, We = (e, t, n) => {
@@ -169,8 +169,8 @@ var Ve = (e, t, n, { allOwnKeys: r } = {}) => (Le(t, (t, r) => {
169
169
  let n = Array(t);
170
170
  for (; t-- > 0;) n[t] = e[t];
171
171
  return n;
172
- }, Ke = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && oe(Uint8Array)), qe = (e, t) => {
173
- let n = (e && e[se]).call(e), r;
172
+ }, Ke = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && se(Uint8Array)), qe = (e, t) => {
173
+ let n = (e && e[I]).call(e), r;
174
174
  for (; (r = n.next()) && !r.done;) {
175
175
  let n = r.value;
176
176
  t.call(e, n[0], n[1]);
@@ -214,7 +214,7 @@ var Ve = (e, t, n, { allOwnKeys: r } = {}) => (Le(t, (t, r) => {
214
214
  return le(e) ? r(e) : r(String(e).split(t)), n;
215
215
  }, nt = () => {}, rt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
216
216
  function it(e) {
217
- return !!(e && B(e.append) && e[L] === "FormData" && e[se]);
217
+ return !!(e && B(e.append) && e[L] === "FormData" && e[I]);
218
218
  }
219
219
  var at = (e) => {
220
220
  let t = Array(10), n = (e, r) => {
@@ -296,7 +296,7 @@ var at = (e) => {
296
296
  isThenable: st,
297
297
  setImmediate: ct,
298
298
  asap: typeof queueMicrotask < "u" ? queueMicrotask.bind(ze) : typeof process < "u" && process.nextTick || ct,
299
- isIterable: (e) => e != null && B(e[se])
299
+ isIterable: (e) => e != null && B(e[I])
300
300
  }, lt = U.toObjectSet([
301
301
  "age",
302
302
  "authorization",
@@ -1749,7 +1749,7 @@ Object.entries(Xn).forEach(([e, t]) => {
1749
1749
  //#endregion
1750
1750
  //#region node_modules/.pnpm/axios@1.16.0/node_modules/axios/lib/axios.js
1751
1751
  function Zn(e) {
1752
- let t = new Kn(e), n = ie(Kn.prototype.request, t);
1752
+ let t = new Kn(e), n = ae(Kn.prototype.request, t);
1753
1753
  return U.extend(n, Kn.prototype, t, { allOwnKeys: !0 }), U.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(t) {
1754
1754
  return Zn(hn(e, t));
1755
1755
  }, n;
@@ -1811,6 +1811,11 @@ function nr(e) {
1811
1811
  }
1812
1812
  var rr = "", ir = "/api/stock/kdata";
1813
1813
  async function ar(e) {
1814
+ if (typeof window < "u" && window.location.hostname.includes("github.io")) {
1815
+ let e = await (await fetch("mock-stock-data.json")).json();
1816
+ if (e.success && e.data) return e.data.map(nr).sort((e, t) => e.timestamp - t.timestamp);
1817
+ throw Error("Mock data failed");
1818
+ }
1814
1819
  let { timeout: t, ...n } = e, r = `${rr}${ir}`, i = {
1815
1820
  stock_code: n.symbol,
1816
1821
  start_date: n.start_date,
@@ -1827,6 +1832,14 @@ async function ar(e) {
1827
1832
  if (!e.success) throw Error(`获取K线数据失败: ${e.error_msg || "未知错误"} (code: ${e.error_code})`);
1828
1833
  return !e.data || e.data.length === 0 ? [] : e.data.map(nr).sort((e, t) => e.timestamp - t.timestamp);
1829
1834
  } catch (e) {
1835
+ try {
1836
+ console.log("fetch mock-stock-data.json");
1837
+ let e = await fetch("mock-stock-data.json");
1838
+ if (e.ok) {
1839
+ let t = await e.json();
1840
+ if (t.success && t.data) return t.data.map(nr).sort((e, t) => e.timestamp - t.timestamp);
1841
+ }
1842
+ } catch {}
1830
1843
  throw q.isAxiosError(e) ? Error(`获取K线数据失败: ${e.message}`) : e;
1831
1844
  }
1832
1845
  }
@@ -2706,7 +2719,7 @@ var yr = /* @__PURE__ */ P(((e) => {
2706
2719
  for (let n in t) e[n] = (e[n] || 0) - (t[n] || 0);
2707
2720
  }
2708
2721
  function j(e) {
2709
- return typeof e == "boolean" || typeof e == "number" || e === null ? !e : (0, t._)`!${F(e)}`;
2722
+ return typeof e == "boolean" || typeof e == "number" || e === null ? !e : (0, t._)`!${ne(e)}`;
2710
2723
  }
2711
2724
  e.not = j;
2712
2725
  var M = te(e.operators.AND);
@@ -2720,9 +2733,9 @@ var yr = /* @__PURE__ */ P(((e) => {
2720
2733
  }
2721
2734
  e.or = P;
2722
2735
  function te(e) {
2723
- return (n, r) => n === t.nil ? r : r === t.nil ? n : (0, t._)`${F(n)} ${e} ${F(r)}`;
2736
+ return (n, r) => n === t.nil ? r : r === t.nil ? n : (0, t._)`${ne(n)} ${e} ${ne(r)}`;
2724
2737
  }
2725
- function F(e) {
2738
+ function ne(e) {
2726
2739
  return e instanceof t.Name ? e : (0, t._)`(${e})`;
2727
2740
  }
2728
2741
  })), Y = /* @__PURE__ */ P(((e) => {
@@ -3698,7 +3711,7 @@ var yr = /* @__PURE__ */ P(((e) => {
3698
3711
  function N(e, t, n, a) {
3699
3712
  let { gen: o, schema: s, data: u, allErrors: f, opts: p, self: m } = e, { RULES: h } = m;
3700
3713
  if (s.$ref && (p.ignoreKeywordsWithRef || !(0, d.schemaHasRulesButRef)(s, h))) {
3701
- o.block(() => se(e, "$ref", h.all.$ref.definition));
3714
+ o.block(() => I(e, "$ref", h.all.$ref.definition));
3702
3715
  return;
3703
3716
  }
3704
3717
  p.jtd || P(e, t), o.block(() => {
@@ -3712,11 +3725,11 @@ var yr = /* @__PURE__ */ P(((e) => {
3712
3725
  function ee(e, t) {
3713
3726
  let { gen: n, schema: i, opts: { useDefaults: o } } = e;
3714
3727
  o && (0, a.assignDefaults)(e, t.type), n.block(() => {
3715
- for (let n of t.rules) (0, r.shouldUseRule)(i, n) && se(e, n.keyword, n.definition, t.type);
3728
+ for (let n of t.rules) (0, r.shouldUseRule)(i, n) && I(e, n.keyword, n.definition, t.type);
3716
3729
  });
3717
3730
  }
3718
3731
  function P(e, t) {
3719
- e.schemaEnv.meta || !e.opts.strictTypes || (te(e, t), e.opts.allowUnionTypes || F(e, t), ne(e, e.dataTypes));
3732
+ e.schemaEnv.meta || !e.opts.strictTypes || (te(e, t), e.opts.allowUnionTypes || ne(e, t), re(e, e.dataTypes));
3720
3733
  }
3721
3734
  function te(e, t) {
3722
3735
  if (t.length) {
@@ -3725,39 +3738,39 @@ var yr = /* @__PURE__ */ P(((e) => {
3725
3738
  return;
3726
3739
  }
3727
3740
  t.forEach((t) => {
3728
- I(e.dataTypes, t) || ae(e, `type "${t}" not allowed by context "${e.dataTypes.join(",")}"`);
3729
- }), ie(e, t);
3741
+ F(e.dataTypes, t) || oe(e, `type "${t}" not allowed by context "${e.dataTypes.join(",")}"`);
3742
+ }), ae(e, t);
3730
3743
  }
3731
3744
  }
3732
- function F(e, t) {
3733
- t.length > 1 && !(t.length === 2 && t.includes("null")) && ae(e, "use allowUnionTypes to allow union type keyword");
3734
- }
3735
3745
  function ne(e, t) {
3746
+ t.length > 1 && !(t.length === 2 && t.includes("null")) && oe(e, "use allowUnionTypes to allow union type keyword");
3747
+ }
3748
+ function re(e, t) {
3736
3749
  let n = e.self.RULES.all;
3737
3750
  for (let i in n) {
3738
3751
  let a = n[i];
3739
3752
  if (typeof a == "object" && (0, r.shouldUseRule)(e.schema, a)) {
3740
3753
  let { type: n } = a.definition;
3741
- n.length && !n.some((e) => re(t, e)) && ae(e, `missing type "${n.join(",")}" for keyword "${i}"`);
3754
+ n.length && !n.some((e) => ie(t, e)) && oe(e, `missing type "${n.join(",")}" for keyword "${i}"`);
3742
3755
  }
3743
3756
  }
3744
3757
  }
3745
- function re(e, t) {
3758
+ function ie(e, t) {
3746
3759
  return e.includes(t) || t === "number" && e.includes("integer");
3747
3760
  }
3748
- function I(e, t) {
3761
+ function F(e, t) {
3749
3762
  return e.includes(t) || t === "integer" && e.includes("number");
3750
3763
  }
3751
- function ie(e, t) {
3764
+ function ae(e, t) {
3752
3765
  let n = [];
3753
- for (let r of e.dataTypes) I(t, r) ? n.push(r) : t.includes("integer") && r === "number" && n.push("integer");
3766
+ for (let r of e.dataTypes) F(t, r) ? n.push(r) : t.includes("integer") && r === "number" && n.push("integer");
3754
3767
  e.dataTypes = n;
3755
3768
  }
3756
- function ae(e, t) {
3769
+ function oe(e, t) {
3757
3770
  let n = e.schemaEnv.baseId + e.errSchemaPath;
3758
3771
  t += ` at "${n}" (strictTypes)`, (0, d.checkStrictMode)(e, t, e.opts.strictTypes);
3759
3772
  }
3760
- var oe = class {
3773
+ var se = class {
3761
3774
  constructor(e, t, n) {
3762
3775
  if ((0, o.validateKeywordUsage)(e, t, n), this.gen = e.gen, this.allErrors = e.allErrors, this.keyword = n, this.data = e.data, this.schema = e.schema[n], this.$data = t.$data && e.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, d.schemaRefOrVal)(e, this.schema, n, this.$data), this.schemaType = t.schemaType, this.parentSchema = e.schema, this.params = {}, this.it = e, this.def = t, this.$data) this.schemaCode = e.gen.const("vSchema", z(this.$data, e));
3763
3776
  else if (this.schemaCode = this.schemaValue, !(0, o.validSchemaType)(this.schema, t.schemaType, t.allowUndefined)) throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);
@@ -3857,9 +3870,9 @@ var yr = /* @__PURE__ */ P(((e) => {
3857
3870
  if (n.opts.unevaluated && (n.props !== !0 || n.items !== !0)) return r.if(t, () => this.mergeEvaluated(e, c.Name)), !0;
3858
3871
  }
3859
3872
  };
3860
- e.KeywordCxt = oe;
3861
- function se(e, t, n, r) {
3862
- let i = new oe(e, n, t);
3873
+ e.KeywordCxt = se;
3874
+ function I(e, t, n, r) {
3875
+ let i = new se(e, n, t);
3863
3876
  "code" in n ? n.code(i, r) : i.$data && n.validate ? (0, o.funcKeywordCode)(i, n) : "macro" in n ? (0, o.macroKeywordCode)(i, n) : (n.compile || n.validate) && (0, o.funcKeywordCode)(i, n);
3864
3877
  }
3865
3878
  var L = /^\/(?:[^~]|~0|~1)*$/, R = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
@@ -4561,7 +4574,7 @@ var yr = /* @__PURE__ */ P(((e) => {
4561
4574
  return n.CodeGen;
4562
4575
  }
4563
4576
  });
4564
- var r = Fr(), i = Ir(), a = wr(), o = Lr(), s = J(), c = Nr(), l = Er(), u = Y(), d = (Gr(), re(Rr).default), f = Yr(), p = (e, t) => new RegExp(e, t);
4577
+ var r = Fr(), i = Ir(), a = wr(), o = Lr(), s = J(), c = Nr(), l = Er(), u = Y(), d = (Gr(), ie(Rr).default), f = Yr(), p = (e, t) => new RegExp(e, t);
4565
4578
  p.code = "new RegExp";
4566
4579
  var m = [
4567
4580
  "removeAdditional",
@@ -6210,9 +6223,9 @@ var yr = /* @__PURE__ */ P(((e) => {
6210
6223
  properties: Hi,
6211
6224
  default: !0
6212
6225
  };
6213
- })), Gi = /* @__PURE__ */ ne((/* @__PURE__ */ P(((e, t) => {
6226
+ })), Gi = /* @__PURE__ */ re((/* @__PURE__ */ P(((e, t) => {
6214
6227
  Object.defineProperty(e, "__esModule", { value: !0 }), e.MissingRefError = e.ValidationError = e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = e.Ajv = void 0;
6215
- var n = Xr(), r = Ni(), i = Fi(), a = (Wi(), re(Ii).default), o = ["/properties"], s = "http://json-schema.org/draft-07/schema", c = class extends n.default {
6228
+ var n = Xr(), r = Ni(), i = Fi(), a = (Wi(), ie(Ii).default), o = ["/properties"], s = "http://json-schema.org/draft-07/schema", c = class extends n.default {
6216
6229
  _addVocabularies() {
6217
6230
  super._addVocabularies(), r.default.forEach((e) => this.addVocabulary(e)), this.opts.discriminator && this.addKeyword(i.default);
6218
6231
  }
@@ -6849,7 +6862,7 @@ var Zi = (typeof document < "u" ? document.createElement("canvas") : null)?.getC
6849
6862
  validator;
6850
6863
  events;
6851
6864
  constructor(e) {
6852
- this.chart = e, this.validator = new Qi(), this.events = new I();
6865
+ this.chart = e, this.validator = new Qi(), this.events = new F();
6853
6866
  }
6854
6867
  async applyConfig(e) {
6855
6868
  let t = this.validator.validate(e);
@@ -7256,7 +7269,7 @@ var ga = Symbol("global-pane"), X = {
7256
7269
  isDestroyed = !1;
7257
7270
  logger;
7258
7271
  constructor(e) {
7259
- this.registry = new _a(), this.eventBus = new I(), this.hookSystem = new va(), this.configManager = new ya(), this.stateStore = new ba(), this.logger = e ?? console;
7272
+ this.registry = new _a(), this.eventBus = new F(), this.hookSystem = new va(), this.configManager = new ya(), this.stateStore = new ba(), this.logger = e ?? console;
7260
7273
  }
7261
7274
  events = {
7262
7275
  on: (e, t) => {
@@ -8422,19 +8435,19 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8422
8435
  ], v = f.filter((e) => e.pane === "main"), x = f.filter((e) => e.pane === "sub"), S = u, T = d, O = y(null), k = y(null), A = y(!1), j = y(null), M = y(null), N = y(!1), ee = y({
8423
8436
  left: "0",
8424
8437
  bottom: "0"
8425
- }), P = y(!1), te = y(null), F = y(null), ne = r(() => S.activeIndicators?.length ? S.activeIndicators.map((e) => f.find((t) => t.id === e)).filter((e) => e !== void 0).sort((e, t) => e.pane === t.pane ? 0 : e.pane === "main" ? -1 : 1) : []), re = r(() => ne.value.some((e) => e.pane === "main") ? ne.value.find((e) => e.pane === "sub")?.id ?? null : null), I = r(() => j.value && f.find((e) => e.id === j.value) || null);
8426
- function ie(e) {
8438
+ }), P = y(!1), te = y(null), ne = y(null), re = r(() => S.activeIndicators?.length ? S.activeIndicators.map((e) => f.find((t) => t.id === e)).filter((e) => e !== void 0).sort((e, t) => e.pane === t.pane ? 0 : e.pane === "main" ? -1 : 1) : []), ie = r(() => re.value.some((e) => e.pane === "main") ? re.value.find((e) => e.pane === "sub")?.id ?? null : null), F = r(() => j.value && f.find((e) => e.id === j.value) || null);
8439
+ function ae(e) {
8427
8440
  return S.activeIndicators?.includes(e) ?? !1;
8428
8441
  }
8429
- function ae(e) {
8430
- if (ie(e)) return;
8442
+ function oe(e) {
8443
+ if (ae(e)) return;
8431
8444
  let t = f.find((t) => t.id === e);
8432
- t && (t.pane === "main" && f.filter((t) => t.pane === "main" && t.id !== e && ie(t.id)).forEach((e) => T("toggle", e.id, !1)), T("toggle", e, !0), N.value = !1);
8445
+ t && (t.pane === "main" && f.filter((t) => t.pane === "main" && t.id !== e && ae(t.id)).forEach((e) => T("toggle", e.id, !1)), T("toggle", e, !0), N.value = !1);
8433
8446
  }
8434
- function oe(e) {
8447
+ function se(e) {
8435
8448
  T("toggle", e, !1);
8436
8449
  }
8437
- function se(e) {
8450
+ function I(e) {
8438
8451
  j.value = e, A.value = !0;
8439
8452
  }
8440
8453
  function L(e) {
@@ -8461,13 +8474,13 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8461
8474
  e.preventDefault();
8462
8475
  return;
8463
8476
  }
8464
- F.value = t, te.value = null, e.dataTransfer?.setData("text/plain", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
8477
+ ne.value = t, te.value = null, e.dataTransfer?.setData("text/plain", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
8465
8478
  }
8466
8479
  function ue(e, t) {
8467
- !F.value || !ce(t) || F.value === t || (te.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
8480
+ !ne.value || !ce(t) || ne.value === t || (te.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
8468
8481
  }
8469
8482
  function de(e, t) {
8470
- let n = F.value || e.dataTransfer?.getData("text/plain") || "";
8483
+ let n = ne.value || e.dataTransfer?.getData("text/plain") || "";
8471
8484
  if (!n || n === t) {
8472
8485
  fe();
8473
8486
  return;
@@ -8476,12 +8489,12 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8476
8489
  fe();
8477
8490
  return;
8478
8491
  }
8479
- let r = ne.value.findIndex((e) => e.id === n), i = ne.value.findIndex((e) => e.id === t);
8492
+ let r = re.value.findIndex((e) => e.id === n), i = re.value.findIndex((e) => e.id === t);
8480
8493
  if (r < 0 || i < 0) {
8481
8494
  fe();
8482
8495
  return;
8483
8496
  }
8484
- let a = [...ne.value.map((e) => e.id)], [o] = a.splice(r, 1);
8497
+ let a = [...re.value.map((e) => e.id)], [o] = a.splice(r, 1);
8485
8498
  if (!o) {
8486
8499
  fe();
8487
8500
  return;
@@ -8489,7 +8502,7 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8489
8502
  a.splice(i, 0, o), T("reorderSubIndicators", a.filter((e) => ce(e))), fe();
8490
8503
  }
8491
8504
  function fe() {
8492
- te.value = null, F.value = null;
8505
+ te.value = null, ne.value = null;
8493
8506
  }
8494
8507
  function pe() {
8495
8508
  if (!N.value && O.value && !P.value) {
@@ -8513,11 +8526,11 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8513
8526
  }), g(() => {
8514
8527
  document.removeEventListener("click", me), window.removeEventListener("resize", B);
8515
8528
  }), (r, u) => (_(), o("div", $o, [
8516
- s("div", es, [s("div", ts, [(_(!0), o(e, null, b(ne.value, (t) => (_(), o(e, { key: t.id }, [t.id === re.value ? (_(), o("div", ns)) : a("", !0), s("div", {
8529
+ s("div", es, [s("div", ts, [(_(!0), o(e, null, b(re.value, (t) => (_(), o(e, { key: t.id }, [t.id === ie.value ? (_(), o("div", ns)) : a("", !0), s("div", {
8517
8530
  class: p(["indicator-item", {
8518
8531
  draggable: ce(t.id),
8519
8532
  "drag-over": te.value === t.id,
8520
- "is-dragging": F.value === t.id
8533
+ "is-dragging": ne.value === t.id
8521
8534
  }]),
8522
8535
  draggable: ce(t.id),
8523
8536
  onDragstart: (e) => le(e, t.id),
@@ -8536,7 +8549,7 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8536
8549
  t.params ? (_(), o("button", {
8537
8550
  key: 0,
8538
8551
  class: "action-btn settings-btn",
8539
- onClick: D((e) => se(t.id), ["stop"]),
8552
+ onClick: D((e) => I(t.id), ["stop"]),
8540
8553
  title: "编辑参数"
8541
8554
  }, [...u[2] ||= [s("svg", {
8542
8555
  viewBox: "0 0 24 24",
@@ -8547,7 +8560,7 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8547
8560
  t.params ? (_(), o("span", ls)) : a("", !0),
8548
8561
  s("button", {
8549
8562
  class: "action-btn remove-btn",
8550
- onClick: D((e) => oe(t.id), ["stop"]),
8563
+ onClick: D((e) => se(t.id), ["stop"]),
8551
8564
  title: "移除指标"
8552
8565
  }, [...u[3] ||= [s("svg", {
8553
8566
  viewBox: "0 0 24 24",
@@ -8578,13 +8591,13 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8578
8591
  style: m(P.value ? void 0 : ee.value)
8579
8592
  }, [s("div", fs, [u[6] ||= s("div", { class: "menu-title" }, "主图指标", -1), s("div", ps, [(_(!0), o(e, null, b(w(v), (e) => (_(), o("button", {
8580
8593
  key: e.id,
8581
- class: p(["menu-item", { disabled: ie(e.id) }]),
8582
- disabled: ie(e.id),
8583
- onClick: (t) => ae(e.id)
8594
+ class: p(["menu-item", { disabled: ae(e.id) }]),
8595
+ disabled: ae(e.id),
8596
+ onClick: (t) => oe(e.id)
8584
8597
  }, [
8585
8598
  c(C(e.label) + " ", 1),
8586
8599
  s("span", hs, " (" + C(e.name) + ") ", 1),
8587
- ie(e.id) ? (_(), o("span", gs, [...u[5] ||= [s("svg", {
8600
+ ae(e.id) ? (_(), o("span", gs, [...u[5] ||= [s("svg", {
8588
8601
  viewBox: "0 0 24 24",
8589
8602
  width: "14",
8590
8603
  height: "14",
@@ -8592,13 +8605,13 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8592
8605
  }, [s("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" })], -1)]])) : a("", !0)
8593
8606
  ], 10, ms))), 128))])]), s("div", _s, [u[8] ||= s("div", { class: "menu-title" }, "副图指标", -1), s("div", vs, [(_(!0), o(e, null, b(w(x), (e) => (_(), o("button", {
8594
8607
  key: e.id,
8595
- class: p(["menu-item", { disabled: ie(e.id) }]),
8596
- disabled: ie(e.id),
8597
- onClick: (t) => ae(e.id)
8608
+ class: p(["menu-item", { disabled: ae(e.id) }]),
8609
+ disabled: ae(e.id),
8610
+ onClick: (t) => oe(e.id)
8598
8611
  }, [
8599
8612
  c(C(e.label) + " ", 1),
8600
8613
  s("span", bs, " (" + C(e.name) + ") ", 1),
8601
- ie(e.id) ? (_(), o("span", xs, [...u[7] ||= [s("svg", {
8614
+ ae(e.id) ? (_(), o("span", xs, [...u[7] ||= [s("svg", {
8602
8615
  viewBox: "0 0 24 24",
8603
8616
  width: "14",
8604
8617
  height: "14",
@@ -8607,14 +8620,14 @@ var mo = { class: "kline-tooltip__title" }, ho = { key: 0 }, go = { class: "klin
8607
8620
  ], 10, ys))), 128))])])], 6)) : a("", !0)]),
8608
8621
  _: 1
8609
8622
  })])),
8610
- I.value ? (_(), i(Qo, {
8623
+ F.value ? (_(), i(Qo, {
8611
8624
  key: 0,
8612
8625
  visible: A.value,
8613
- "indicator-id": I.value.id,
8614
- "indicator-name": I.value.name,
8615
- "indicator-description": I.value.description,
8616
- params: I.value.params || [],
8617
- values: L(I.value.id),
8626
+ "indicator-id": F.value.id,
8627
+ "indicator-name": F.value.name,
8628
+ "indicator-description": F.value.description,
8629
+ params: F.value.params || [],
8630
+ values: L(F.value.id),
8618
8631
  onClose: u[1] ||= (e) => A.value = !1,
8619
8632
  onConfirm: z
8620
8633
  }, null, 8, [
@@ -9171,9 +9184,9 @@ var Ls = class {
9171
9184
  let S = x + this.visibleRange.start, C = this.chart.getData(), w = this.getPaneByY(i);
9172
9185
  if (this.activePaneId = w?.id || null, S >= 0 && S < (C?.length ?? 0)) {
9173
9186
  this.crosshairIndex = S;
9174
- let e = this.kLinePositions[x] + (this.kWidthPx - 1) / 2 / f - d;
9187
+ let e = this.kLinePositions[x], t = (Math.round(e * f) + (this.kWidthPx - 1) / 2) / f - d;
9175
9188
  if (this.crosshairPos = {
9176
- x: Math.min(Math.max(e, 0), l),
9189
+ x: Math.min(Math.max(t, 0), l),
9177
9190
  y: Math.min(Math.max(i, 0), u)
9178
9191
  }, w) {
9179
9192
  let e = i - w.top;
@@ -9185,8 +9198,8 @@ var Ls = class {
9185
9198
  this.hoveredIndex = null;
9186
9199
  return;
9187
9200
  }
9188
- let E = i - w.top, D = w.yAxis.priceToY(T.open), O = w.yAxis.priceToY(T.close), k = w.yAxis.priceToY(T.high), A = w.yAxis.priceToY(T.low), j = Math.min(D, O), M = Math.max(D, O), N = h - this.kLinePositions[x], ee = v / 2, P = Math.abs(M - j), te = P < 8 ? (j + M) / 2 - 8 / 2 : j, F = P < 8 ? (j + M) / 2 + 8 / 2 : M, ne = E >= te && E <= F && N >= 0 && N <= v, re = Math.abs(N - ee) <= 3 && E >= Math.min(k, A) && E <= Math.max(k, A);
9189
- if (!ne && !re) {
9201
+ let E = i - w.top, D = w.yAxis.priceToY(T.open), O = w.yAxis.priceToY(T.close), k = w.yAxis.priceToY(T.high), A = w.yAxis.priceToY(T.low), j = Math.min(D, O), M = Math.max(D, O), N = h - this.kLinePositions[x], ee = v / 2, P = Math.abs(M - j), te = P < 8 ? (j + M) / 2 - 8 / 2 : j, ne = P < 8 ? (j + M) / 2 + 8 / 2 : M, re = E >= te && E <= ne && N >= 0 && N <= v, ie = Math.abs(N - ee) <= 3 && E >= Math.min(k, A) && E <= Math.max(k, A);
9202
+ if (!re && !ie) {
9190
9203
  this.hoveredIndex = null;
9191
9204
  return;
9192
9205
  }
@@ -9198,9 +9211,9 @@ var Ls = class {
9198
9211
  };
9199
9212
  return;
9200
9213
  }
9201
- let I = this.tooltipSize.width, ie = this.tooltipSize.height, ae = r + 14, oe = r - 14 - I, se = ae + I + 12 <= s ? ae : oe, L = i + 14, R = Math.max(12, s - I - 12), z = Math.max(12, c - ie - 12);
9214
+ let F = this.tooltipSize.width, ae = this.tooltipSize.height, oe = r + 14, se = r - 14 - F, I = oe + F + 12 <= s ? oe : se, L = i + 14, R = Math.max(12, s - F - 12), z = Math.max(12, c - ae - 12);
9202
9215
  this.tooltipPos = {
9203
- x: Math.min(Math.max(se, 12), R),
9216
+ x: Math.min(Math.max(I, 12), R),
9204
9217
  y: Math.min(Math.max(L, 12), z)
9205
9218
  };
9206
9219
  }
@@ -9327,38 +9340,38 @@ function Us(e = {}) {
9327
9340
  return [n];
9328
9341
  },
9329
9342
  draw(e) {
9330
- let { ctx: i, pane: a, data: o, range: s, scrollLeft: c, kWidth: l, kGap: u, dpr: d, kLinePositions: f } = e, p = o;
9331
- if (!p.length) return;
9343
+ let { ctx: i, pane: a, data: o, range: s, scrollLeft: c, dpr: l } = e, u = o;
9344
+ if (!u.length) return;
9332
9345
  i.save(), i.translate(-c, 0);
9333
- let { start: m, end: h } = s, g = 0, _ = Infinity;
9334
- for (let e = m; e < h && e < p.length; e++) {
9335
- let t = p[e];
9346
+ let { start: d, end: f } = s, p = 0, m = Infinity;
9347
+ for (let e = d; e < f && e < u.length; e++) {
9348
+ let t = u[e];
9336
9349
  if (!t) continue;
9337
9350
  let n = t.volume;
9338
- n != null && (g = Math.max(g, n), _ = Math.min(_, n));
9351
+ n != null && (p = Math.max(p, n), m = Math.min(m, n));
9339
9352
  }
9340
- if (g === 0 || !Number.isFinite(_)) {
9353
+ if (p === 0 || !Number.isFinite(m)) {
9341
9354
  i.restore();
9342
9355
  return;
9343
9356
  }
9344
- let v = Math.max(.05, (g - _) * .1), y = Math.max(0, _ - v), b = g + v, x = a.yAxis.getDisplayRange({
9345
- minPrice: y,
9346
- maxPrice: b
9347
- }), S = x.minPrice, C = x.maxPrice - S || 1, w = a.height - (0 - S) / C * a.height;
9357
+ let h = Math.max(.05, (p - m) * .1), g = Math.max(0, m - h), _ = p + h, v = a.yAxis.getDisplayRange({
9358
+ minPrice: g,
9359
+ maxPrice: _
9360
+ }), y = v.minPrice, b = v.maxPrice - y || 1, x = a.height - (0 - y) / b * a.height;
9348
9361
  r?.setSharedState(n, {
9349
- valueMin: y,
9350
- valueMax: b,
9362
+ valueMin: g,
9363
+ valueMax: _,
9351
9364
  timestamp: Date.now()
9352
9365
  }, `volume_${t}`);
9353
- for (let e = m; e < h; e++) {
9354
- let t = p[e];
9355
- if (!t) continue;
9356
- let n = t.volume;
9366
+ for (let t = d; t < f; t++) {
9367
+ let n = u[t];
9357
9368
  if (!n) continue;
9358
- let r = f[e - m];
9359
- if (r === void 0) continue;
9360
- let o = f[e - m + 1], s = f[e - m - 1], c = Math.max(1, Math.round((l + u) * d)), h = o === void 0 ? s === void 0 ? c : Math.max(1, Math.round((r - s) * d)) : Math.max(1, Math.round((o - r) * d)), g = Math.max(1, h - 1) / d;
9361
- Ws(i, Math.round((r + (l - g) / 2) * d) / d, Gs(t), n, g, S, C, w, a.height, d);
9369
+ let r = n.volume;
9370
+ if (!r) continue;
9371
+ let o = e.kBarRects[t - d];
9372
+ if (!o) continue;
9373
+ let s = o.x, c = o.width;
9374
+ Ws(i, s, Gs(n), r, c, y, b, x, a.height, l);
9362
9375
  }
9363
9376
  i.restore();
9364
9377
  }
@@ -9457,14 +9470,16 @@ function Xs(e = {}) {
9457
9470
  }), r = e, a;
9458
9471
  }
9459
9472
  function a(e, t, n, r) {
9460
- let { pane: i, range: a, kWidth: o, dpr: s, kLinePositions: c } = n;
9473
+ let { pane: i, range: a, dpr: o, kLineCenters: s } = n;
9461
9474
  e.strokeStyle = r, e.lineWidth = 1, e.lineJoin = "round", e.lineCap = "round", e.beginPath();
9462
- let l = !0;
9475
+ let c = !0;
9463
9476
  for (let n = a.start; n < a.end && n < t.length; n++) {
9464
9477
  let r = t[n];
9465
9478
  if (r === void 0) continue;
9466
- let u = c[n - a.start] + o / 2, d = i.yAxis.priceToY(r), f = Q(u, s), p = Q(d, s);
9467
- l ? (e.moveTo(f, p), l = !1) : e.lineTo(f, p);
9479
+ let l = s[n - a.start];
9480
+ if (l === void 0) continue;
9481
+ let u = i.yAxis.priceToY(r), d = l, f = Q(u, o);
9482
+ c ? (e.moveTo(d, f), c = !1) : e.lineTo(d, f);
9468
9483
  }
9469
9484
  e.stroke();
9470
9485
  }
@@ -9546,41 +9561,47 @@ function Qs(e = {}) {
9546
9561
  paneId: "main",
9547
9562
  priority: X.INDICATOR,
9548
9563
  draw(e) {
9549
- let { ctx: n, pane: r, data: i, range: a, scrollLeft: s, kWidth: c, dpr: l, kLinePositions: u } = e, d = i;
9550
- if (d.length < t.period) return;
9551
- let f = o(d);
9564
+ let { ctx: n, pane: r, data: i, range: a, scrollLeft: s, dpr: c, kLineCenters: l } = e, u = i;
9565
+ if (u.length < t.period) return;
9566
+ let d = o(u);
9552
9567
  n.save(), n.translate(-s, 0);
9553
- let p = Math.max(a.start, t.period - 1), m = Math.min(a.end, d.length);
9568
+ let f = Math.max(a.start, t.period - 1), p = Math.min(a.end, u.length);
9554
9569
  if (t.showBand) {
9555
9570
  n.fillStyle = Wa.BAND_FILL, n.beginPath();
9556
9571
  let e = !0;
9557
- for (let t = p; t < m; t++) {
9558
- let i = f[t];
9572
+ for (let t = f; t < p; t++) {
9573
+ let i = d[t];
9559
9574
  if (!i) continue;
9560
- let o = u[t - a.start] + c / 2, s = r.yAxis.priceToY(i.upper), d = Q(o, l), p = Q(s, l);
9561
- e ? (n.moveTo(d, p), e = !1) : n.lineTo(d, p);
9575
+ let o = l[t - a.start];
9576
+ if (o === void 0) continue;
9577
+ let s = r.yAxis.priceToY(i.upper), u = o, f = Q(s, c);
9578
+ e ? (n.moveTo(u, f), e = !1) : n.lineTo(u, f);
9562
9579
  }
9563
- for (let e = m - 1; e >= p; e--) {
9564
- let t = f[e];
9580
+ for (let e = p - 1; e >= f; e--) {
9581
+ let t = d[e];
9565
9582
  if (!t) continue;
9566
- let i = u[e - a.start] + c / 2, o = r.yAxis.priceToY(t.lower), s = Q(i, l), d = Q(o, l);
9567
- n.lineTo(s, d);
9583
+ let i = l[e - a.start];
9584
+ if (i === void 0) continue;
9585
+ let o = r.yAxis.priceToY(t.lower), s = i, u = Q(o, c);
9586
+ n.lineTo(s, u);
9568
9587
  }
9569
9588
  n.closePath(), n.fill();
9570
9589
  }
9571
9590
  n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round";
9572
- let h = (e, t) => {
9591
+ let m = (e, t) => {
9573
9592
  n.strokeStyle = t, n.beginPath();
9574
9593
  let i = !0;
9575
- for (let t = p; t < m; t++) {
9576
- let o = f[t];
9594
+ for (let t = f; t < p; t++) {
9595
+ let o = d[t];
9577
9596
  if (!o) continue;
9578
- let s = u[t - a.start] + c / 2, d = r.yAxis.priceToY(o[e]), p = Q(s, l), m = Q(d, l);
9579
- i ? (n.moveTo(p, m), i = !1) : n.lineTo(p, m);
9597
+ let s = l[t - a.start];
9598
+ if (s === void 0) continue;
9599
+ let u = r.yAxis.priceToY(o[e]), f = s, p = Q(u, c);
9600
+ i ? (n.moveTo(f, p), i = !1) : n.lineTo(f, p);
9580
9601
  }
9581
9602
  n.stroke();
9582
9603
  };
9583
- t.showUpper && h("upper", Wa.UPPER), t.showMiddle && h("middle", Wa.MIDDLE), t.showLower && h("lower", Wa.LOWER), n.restore();
9604
+ t.showUpper && m("upper", Wa.UPPER), t.showMiddle && m("middle", Wa.MIDDLE), t.showLower && m("lower", Wa.LOWER), n.restore();
9584
9605
  },
9585
9606
  onDataUpdate() {
9586
9607
  n = null;
@@ -9666,14 +9687,16 @@ function nc(e = {}) {
9666
9687
  if (u.length < 2) return;
9667
9688
  let d = o(u);
9668
9689
  t.save(), t.translate(-a, 0);
9669
- let f = i.start, p = Math.min(i.end, u.length), m = $a.FAST, h = $a.SLOW, g = (e, r) => {
9670
- t.strokeStyle = r, t.lineWidth = 1, t.lineJoin = "round", t.lineCap = "round", t.beginPath();
9671
- let a = !0;
9672
- for (let r = f; r < p; r++) {
9673
- let o = d[r];
9674
- if (!o) continue;
9675
- let u = l[r - i.start] + s / 2, f = n.yAxis.priceToY(o[e]), p = Q(u, c), m = Q(f, c);
9676
- a ? (t.moveTo(p, m), a = !1) : t.lineTo(p, m);
9690
+ let f = i.start, p = Math.min(i.end, u.length), m = $a.FAST, h = $a.SLOW, g = (r, a) => {
9691
+ t.strokeStyle = a, t.lineWidth = 1, t.lineJoin = "round", t.lineCap = "round", t.beginPath();
9692
+ let o = !0;
9693
+ for (let a = f; a < p; a++) {
9694
+ let s = d[a];
9695
+ if (!s) continue;
9696
+ let l = e.kLineCenters[a - i.start];
9697
+ if (l === void 0) continue;
9698
+ let u = n.yAxis.priceToY(s[r]), f = l, p = Q(u, c);
9699
+ o ? (t.moveTo(f, p), o = !1) : t.lineTo(f, p);
9677
9700
  }
9678
9701
  t.stroke();
9679
9702
  };
@@ -9752,38 +9775,44 @@ function ac(e = {}) {
9752
9775
  paneId: "main",
9753
9776
  priority: X.INDICATOR,
9754
9777
  draw(e) {
9755
- let { ctx: n, pane: r, data: i, range: a, scrollLeft: s, kWidth: c, dpr: l, kLinePositions: u } = e, d = i;
9756
- if (d.length < t.period) return;
9757
- let f = o(d);
9778
+ let { ctx: n, pane: r, data: i, range: a, scrollLeft: s, dpr: c, kLineCenters: l } = e, u = i;
9779
+ if (u.length < t.period) return;
9780
+ let d = o(u);
9758
9781
  n.save(), n.translate(-s, 0);
9759
- let p = Math.max(a.start, t.period - 1), m = Math.min(a.end, d.length);
9782
+ let f = Math.max(a.start, t.period - 1), p = Math.min(a.end, u.length);
9760
9783
  n.fillStyle = "rgba(69, 112, 249, 0.08)", n.beginPath();
9761
- let h = !0;
9762
- for (let e = p; e < m; e++) {
9763
- let t = f[e];
9784
+ let m = !0;
9785
+ for (let e = f; e < p; e++) {
9786
+ let t = d[e];
9764
9787
  if (!t) continue;
9765
- let i = u[e - a.start] + c / 2, o = r.yAxis.priceToY(t.upper), s = Q(i, l), d = Q(o, l);
9766
- h ? (n.moveTo(s, d), h = !1) : n.lineTo(s, d);
9788
+ let i = l[e - a.start];
9789
+ if (i === void 0) continue;
9790
+ let o = r.yAxis.priceToY(t.upper), s = i, u = Q(o, c);
9791
+ m ? (n.moveTo(s, u), m = !1) : n.lineTo(s, u);
9767
9792
  }
9768
- for (let e = m - 1; e >= p; e--) {
9769
- let t = f[e];
9793
+ for (let e = p - 1; e >= f; e--) {
9794
+ let t = d[e];
9770
9795
  if (!t) continue;
9771
- let i = u[e - a.start] + c / 2, o = r.yAxis.priceToY(t.lower), s = Q(i, l), d = Q(o, l);
9772
- n.lineTo(s, d);
9796
+ let i = l[e - a.start];
9797
+ if (i === void 0) continue;
9798
+ let o = r.yAxis.priceToY(t.lower), s = i, u = Q(o, c);
9799
+ n.lineTo(s, u);
9773
9800
  }
9774
9801
  n.closePath(), n.fill(), n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round";
9775
- let g = (e, t) => {
9802
+ let h = (e, t) => {
9776
9803
  n.strokeStyle = t, n.beginPath();
9777
9804
  let i = !0;
9778
- for (let t = p; t < m; t++) {
9779
- let o = f[t];
9805
+ for (let t = f; t < p; t++) {
9806
+ let o = d[t];
9780
9807
  if (!o) continue;
9781
- let s = u[t - a.start] + c / 2, d = r.yAxis.priceToY(o[e]), p = Q(s, l), m = Q(d, l);
9782
- i ? (n.moveTo(p, m), i = !1) : n.lineTo(p, m);
9808
+ let s = l[t - a.start];
9809
+ if (s === void 0) continue;
9810
+ let u = r.yAxis.priceToY(o[e]), f = s, p = Q(u, c);
9811
+ i ? (n.moveTo(f, p), i = !1) : n.lineTo(f, p);
9783
9812
  }
9784
9813
  n.stroke();
9785
9814
  };
9786
- g("upper", "rgba(214, 10, 34, 1)"), g("middle", "rgba(69, 112, 249, 1)"), g("lower", "rgba(3, 123, 102, 1)"), n.restore();
9815
+ h("upper", "rgba(214, 10, 34, 1)"), h("middle", "rgba(69, 112, 249, 1)"), h("lower", "rgba(3, 123, 102, 1)"), n.restore();
9787
9816
  },
9788
9817
  onDataUpdate() {
9789
9818
  n = null;
@@ -9990,77 +10019,77 @@ function dc(e = {}) {
9990
10019
  return [r];
9991
10020
  },
9992
10021
  draw(e) {
9993
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: l, kWidth: u, kGap: f, dpr: p, kLinePositions: m } = e, h = s;
9994
- if (h.length < a.slowPeriod) return;
9995
- let g = d(h), _ = -Infinity, v = Infinity;
9996
- for (let e = c.start; e < c.end && e < g.length; e++) {
9997
- let t = g[e];
9998
- t && (_ = Math.max(_, t.dif, t.dea, t.macd), v = Math.min(v, t.dif, t.dea, t.macd));
9999
- }
10000
- if (!Number.isFinite(_) || !Number.isFinite(v)) return;
10001
- let y = Math.max(.05, (_ - v) * .1), b = v - y, x = _ + y;
10002
- x - b;
10003
- let S = c.end - 1, C = S >= 0 && S < g.length ? g[S] : null, w = {
10004
- valueMin: b,
10005
- valueMax: x,
10022
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: l, dpr: u } = e, f = s;
10023
+ if (f.length < a.slowPeriod) return;
10024
+ let p = d(f), m = -Infinity, h = Infinity;
10025
+ for (let e = c.start; e < c.end && e < p.length; e++) {
10026
+ let t = p[e];
10027
+ t && (m = Math.max(m, t.dif, t.dea, t.macd), h = Math.min(h, t.dif, t.dea, t.macd));
10028
+ }
10029
+ if (!Number.isFinite(m) || !Number.isFinite(h)) return;
10030
+ let g = Math.max(.05, (m - h) * .1), _ = h - g, v = m + g;
10031
+ v - _;
10032
+ let y = c.end - 1, b = y >= 0 && y < p.length ? p[y] : null, x = {
10033
+ valueMin: _,
10034
+ valueMax: v,
10006
10035
  timestamp: Date.now(),
10007
- latestValues: C ? {
10008
- dif: C.dif,
10009
- dea: C.dea,
10010
- macd: C.macd
10036
+ latestValues: b ? {
10037
+ dif: b.dif,
10038
+ dea: b.dea,
10039
+ macd: b.macd
10011
10040
  } : void 0
10012
10041
  };
10013
- i?.setSharedState(r, w, `macd_${t}`);
10014
- let T = o.yAxis.getDisplayRange({
10015
- minPrice: b,
10016
- maxPrice: x
10017
- }), E = T.minPrice, D = T.maxPrice - E || 1, O = o.height - (0 - E) / D * o.height;
10042
+ i?.setSharedState(r, x, `macd_${t}`);
10043
+ let S = o.yAxis.getDisplayRange({
10044
+ minPrice: _,
10045
+ maxPrice: v
10046
+ }), C = S.minPrice, w = S.maxPrice - C || 1, T = o.height - (0 - C) / w * o.height;
10018
10047
  n.save(), n.translate(-l, 0);
10019
- let k = Math.max(c.start, a.slowPeriod - 1), A = Math.min(c.end, h.length);
10048
+ let E = Math.max(c.start, a.slowPeriod - 1), D = Math.min(c.end, f.length);
10020
10049
  if (a.showBAR) {
10021
- let e = Math.round(O * p) / p, t = Math.max(1, Math.round((u + f) * p));
10022
- for (let r = k; r < A; r++) {
10023
- let i = g[r];
10050
+ let t = Math.round(T * u) / u;
10051
+ for (let r = E; r < D; r++) {
10052
+ let i = p[r];
10024
10053
  if (!i) continue;
10025
- let a = m[r - c.start];
10026
- if (a === void 0) continue;
10027
- let s = m[r - c.start + 1], l = m[r - c.start - 1], d = s === void 0 ? l === void 0 ? t : Math.max(1, Math.round((a - l) * p)) : Math.max(1, Math.round((s - a) * p)), f = Math.max(1, d - 1) / p, h = Math.round((a + (u - f) / 2) * p) / p, _ = o.height - (i.macd - E) / D * o.height, v = i.macd >= 0, y = r > 0 ? g[r - 1] : null, b;
10028
- b = y ? i.macd >= y.macd : !0;
10029
- let x;
10030
- x = v ? b ? Ga.BAR_UP : Ga.BAR_UP_LIGHT : b ? Ga.BAR_DOWN_LIGHT : Ga.BAR_DOWN, n.fillStyle = x;
10031
- let S = Math.round(_ * p) / p, C = 1 / p;
10032
- if (v) {
10033
- let t = e - S, r = t <= 0 ? C : Math.max(t, C), i = t <= 0 ? e - C : e - r;
10034
- n.fillRect(h, i, f, r);
10054
+ let a = e.kBarRects[r - c.start];
10055
+ if (!a) continue;
10056
+ let s = a.x, l = a.width, d = o.height - (i.macd - C) / w * o.height, f = i.macd >= 0, m = r > 0 ? p[r - 1] : null, h;
10057
+ h = m ? i.macd >= m.macd : !0;
10058
+ let g;
10059
+ g = f ? h ? Ga.BAR_UP : Ga.BAR_UP_LIGHT : h ? Ga.BAR_DOWN_LIGHT : Ga.BAR_DOWN, n.fillStyle = g;
10060
+ let _ = Math.round(d * u) / u, v = 1 / u;
10061
+ if (f) {
10062
+ let e = t - _, r = e <= 0 ? v : Math.max(e, v), i = e <= 0 ? t - v : t - r;
10063
+ n.fillRect(s, i, l, r);
10035
10064
  } else {
10036
- let t = S - e, r = t <= 0 ? C : Math.max(t, C);
10037
- n.fillRect(h, e, f, r);
10065
+ let e = _ - t, r = e <= 0 ? v : Math.max(e, v);
10066
+ n.fillRect(s, t, l, r);
10038
10067
  }
10039
10068
  }
10040
10069
  }
10041
10070
  if (a.showDIF) {
10042
10071
  n.strokeStyle = Ga.DIF, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10043
- let e = !0;
10044
- for (let t = k; t < A; t++) {
10045
- let r = g[t];
10046
- if (!r) continue;
10047
- let i = m[t - c.start];
10048
- if (i === void 0) continue;
10049
- let a = i + u / 2, s = o.height - (r.dif - E) / D * o.height, l = Q(a, p), d = Q(s, p);
10050
- e ? (n.moveTo(l, d), e = !1) : n.lineTo(l, d);
10072
+ let t = !0;
10073
+ for (let r = E; r < D; r++) {
10074
+ let i = p[r];
10075
+ if (!i) continue;
10076
+ let a = e.kLineCenters[r - c.start];
10077
+ if (a === void 0) continue;
10078
+ let s = o.height - (i.dif - C) / w * o.height, l = a, d = Q(s, u);
10079
+ t ? (n.moveTo(l, d), t = !1) : n.lineTo(l, d);
10051
10080
  }
10052
10081
  n.stroke();
10053
10082
  }
10054
10083
  if (a.showDEA) {
10055
10084
  n.strokeStyle = Ga.DEA, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10056
- let e = !0;
10057
- for (let t = k; t < A; t++) {
10058
- let r = g[t];
10059
- if (!r) continue;
10060
- let i = m[t - c.start];
10061
- if (i === void 0) continue;
10062
- let a = i + u / 2, s = o.height - (r.dea - E) / D * o.height, l = Q(a, p), d = Q(s, p);
10063
- e ? (n.moveTo(l, d), e = !1) : n.lineTo(l, d);
10085
+ let t = !0;
10086
+ for (let r = E; r < D; r++) {
10087
+ let i = p[r];
10088
+ if (!i) continue;
10089
+ let a = e.kLineCenters[r - c.start];
10090
+ if (a === void 0) continue;
10091
+ let s = o.height - (i.dea - C) / w * o.height, l = a, d = Q(s, u);
10092
+ t ? (n.moveTo(l, d), t = !1) : n.lineTo(l, d);
10064
10093
  }
10065
10094
  n.stroke();
10066
10095
  }
@@ -10163,35 +10192,35 @@ function hc(e = {}) {
10163
10192
  return [r];
10164
10193
  },
10165
10194
  draw(e) {
10166
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: l, kWidth: u, dpr: d, kLinePositions: f } = e, m = s;
10167
- if (m.length < a.period1 + 1) return;
10168
- let { rsi1: h, rsi2: g, rsi3: _ } = p(m), v = {
10195
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: l, dpr: u, kLineCenters: d } = e, f = s;
10196
+ if (f.length < a.period1 + 1) return;
10197
+ let { rsi1: m, rsi2: h, rsi3: g } = p(f), _ = {
10169
10198
  valueMin: 0,
10170
10199
  valueMax: 100,
10171
10200
  timestamp: Date.now()
10172
10201
  };
10173
- i?.setSharedState(r, v, `rsi_${t}`);
10174
- let y = o.yAxis.getDisplayRange({
10202
+ i?.setSharedState(r, _, `rsi_${t}`);
10203
+ let v = o.yAxis.getDisplayRange({
10175
10204
  minPrice: 0,
10176
10205
  maxPrice: 100
10177
- }), b = y.minPrice, x = y.maxPrice - b || 1;
10206
+ }), y = v.minPrice, b = v.maxPrice - y || 1;
10178
10207
  n.save(), n.translate(-l, 0);
10179
- let S = o.height - (80 - b) / x * o.height, C = o.height - (50 - b) / x * o.height, w = o.height - (20 - b) / x * o.height, T = l, E = l + e.paneWidth;
10180
- n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(T, S), n.lineTo(E, S), n.moveTo(T, C), n.lineTo(E, C), n.moveTo(T, w), n.lineTo(E, w), n.stroke(), n.setLineDash([]);
10181
- let D = Math.max(c.start, a.period1), O = Math.min(c.end, m.length), k = (e, t) => {
10208
+ let x = o.height - (80 - y) / b * o.height, S = o.height - (50 - y) / b * o.height, C = o.height - (20 - y) / b * o.height, w = l, T = l + e.paneWidth;
10209
+ n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(w, x), n.lineTo(T, x), n.moveTo(w, S), n.lineTo(T, S), n.moveTo(w, C), n.lineTo(T, C), n.stroke(), n.setLineDash([]);
10210
+ let E = Math.max(c.start, a.period1), D = Math.min(c.end, f.length), O = (e, t) => {
10182
10211
  n.strokeStyle = t, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10183
10212
  let r = !0;
10184
- for (let t = D; t < O; t++) {
10213
+ for (let t = E; t < D; t++) {
10185
10214
  let i = e[t];
10186
10215
  if (i === void 0) continue;
10187
- let a = f[t - c.start];
10216
+ let a = d[t - c.start];
10188
10217
  if (a === void 0) continue;
10189
- let s = a + u / 2, l = o.height - (i - b) / x * o.height, p = Q(s, d), m = Q(l, d);
10190
- r ? (n.moveTo(p, m), r = !1) : n.lineTo(p, m);
10218
+ let s = o.height - (i - y) / b * o.height, l = a, f = Q(s, u);
10219
+ r ? (n.moveTo(l, f), r = !1) : n.lineTo(l, f);
10191
10220
  }
10192
10221
  n.stroke();
10193
10222
  };
10194
- a.showRSI1 && k(h, qa.RSI1), a.showRSI2 && k(g, qa.RSI2), a.showRSI3 && k(_, qa.RSI3), n.restore();
10223
+ a.showRSI1 && O(m, qa.RSI1), a.showRSI2 && O(h, qa.RSI2), a.showRSI3 && O(g, qa.RSI3), n.restore();
10195
10224
  },
10196
10225
  onDataUpdate() {
10197
10226
  o = null;
@@ -10268,39 +10297,39 @@ function vc(e = {}) {
10268
10297
  return [r];
10269
10298
  },
10270
10299
  draw(e) {
10271
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, kWidth: d, dpr: f, kLinePositions: p } = e, m = s;
10272
- if (m.length < a.period) return;
10273
- let h = l(m), g = -Infinity, _ = Infinity;
10274
- for (let e = c.start; e < c.end && e < h.length; e++) {
10275
- let t = h[e];
10276
- t !== void 0 && (g = Math.max(g, t), _ = Math.min(_, t));
10277
- }
10278
- if (!Number.isFinite(g) || !Number.isFinite(_)) return;
10279
- g = Math.max(g, 150), _ = Math.min(_, -150), g - _;
10280
- let v = {
10281
- valueMin: _,
10282
- valueMax: g,
10300
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, dpr: d, kLineCenters: f } = e, p = s;
10301
+ if (p.length < a.period) return;
10302
+ let m = l(p), h = -Infinity, g = Infinity;
10303
+ for (let e = c.start; e < c.end && e < m.length; e++) {
10304
+ let t = m[e];
10305
+ t !== void 0 && (h = Math.max(h, t), g = Math.min(g, t));
10306
+ }
10307
+ if (!Number.isFinite(h) || !Number.isFinite(g)) return;
10308
+ h = Math.max(h, 150), g = Math.min(g, -150), h - g;
10309
+ let _ = {
10310
+ valueMin: g,
10311
+ valueMax: h,
10283
10312
  timestamp: Date.now()
10284
10313
  };
10285
- i?.setSharedState(r, v, `cci_${t}`);
10286
- let y = o.yAxis.getDisplayRange({
10287
- minPrice: _,
10288
- maxPrice: g
10289
- }), b = y.minPrice, x = y.maxPrice - b || 1, S = o.height - (0 - b) / x * o.height;
10314
+ i?.setSharedState(r, _, `cci_${t}`);
10315
+ let v = o.yAxis.getDisplayRange({
10316
+ minPrice: g,
10317
+ maxPrice: h
10318
+ }), y = v.minPrice, b = v.maxPrice - y || 1, x = o.height - (0 - y) / b * o.height;
10290
10319
  n.save(), n.translate(-u, 0);
10291
- let C = o.height - (100 - b) / x * o.height, w = o.height - (-100 - b) / x * o.height, T = u, E = u + e.paneWidth;
10292
- n.strokeStyle = Ja.OVERBOUGHT, n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(T, C), n.lineTo(E, C), n.stroke(), n.strokeStyle = Ja.OVERSOLD, n.beginPath(), n.moveTo(T, w), n.lineTo(E, w), n.stroke(), n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.beginPath(), n.moveTo(T, S), n.lineTo(E, S), n.stroke(), n.setLineDash([]);
10293
- let D = Math.max(c.start, a.period - 1), O = Math.min(c.end, m.length);
10320
+ let S = o.height - (100 - y) / b * o.height, C = o.height - (-100 - y) / b * o.height, w = u, T = u + e.paneWidth;
10321
+ n.strokeStyle = Ja.OVERBOUGHT, n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(w, S), n.lineTo(T, S), n.stroke(), n.strokeStyle = Ja.OVERSOLD, n.beginPath(), n.moveTo(w, C), n.lineTo(T, C), n.stroke(), n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.beginPath(), n.moveTo(w, x), n.lineTo(T, x), n.stroke(), n.setLineDash([]);
10322
+ let E = Math.max(c.start, a.period - 1), D = Math.min(c.end, p.length);
10294
10323
  if (a.showCCI) {
10295
10324
  n.strokeStyle = Ja.CCI, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10296
10325
  let e = !0;
10297
- for (let t = D; t < O; t++) {
10298
- let r = h[t];
10326
+ for (let t = E; t < D; t++) {
10327
+ let r = m[t];
10299
10328
  if (r === void 0) continue;
10300
- let i = p[t - c.start];
10329
+ let i = f[t - c.start];
10301
10330
  if (i === void 0) continue;
10302
- let a = i + d / 2, s = o.height - (r - b) / x * o.height, l = Q(a, f), u = Q(s, f);
10303
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10331
+ let a = o.height - (r - y) / b * o.height, s = i, l = Q(a, d);
10332
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10304
10333
  }
10305
10334
  n.stroke();
10306
10335
  }
@@ -10388,45 +10417,45 @@ function Sc(e = {}) {
10388
10417
  return [r];
10389
10418
  },
10390
10419
  draw(e) {
10391
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: l, kWidth: d, dpr: f, kLinePositions: p } = e, m = s;
10392
- if (m.length < a.n + a.m - 1) return;
10393
- let h = u(m), g = {
10420
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: l, dpr: d, kLineCenters: f } = e, p = s;
10421
+ if (p.length < a.n + a.m - 1) return;
10422
+ let m = u(p), h = {
10394
10423
  valueMin: 0,
10395
10424
  valueMax: 100,
10396
10425
  timestamp: Date.now()
10397
10426
  };
10398
- i?.setSharedState(r, g, `stoch_${t}`);
10399
- let _ = o.yAxis.getDisplayRange({
10427
+ i?.setSharedState(r, h, `stoch_${t}`);
10428
+ let g = o.yAxis.getDisplayRange({
10400
10429
  minPrice: 0,
10401
10430
  maxPrice: 100
10402
- }), v = _.minPrice, y = _.maxPrice - v || 1;
10431
+ }), _ = g.minPrice, v = g.maxPrice - _ || 1;
10403
10432
  n.save(), n.translate(-l, 0);
10404
- let b = o.height - (80 - v) / y * o.height, x = o.height - (20 - v) / y * o.height, S = l, C = l + e.paneWidth;
10405
- n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(S, b), n.lineTo(C, b), n.moveTo(S, x), n.lineTo(C, x), n.stroke(), n.setLineDash([]);
10406
- let w = Math.max(c.start, a.n + a.m - 2), T = Math.min(c.end, m.length);
10433
+ let y = o.height - (80 - _) / v * o.height, b = o.height - (20 - _) / v * o.height, x = l, S = l + e.paneWidth;
10434
+ n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(x, y), n.lineTo(S, y), n.moveTo(x, b), n.lineTo(S, b), n.stroke(), n.setLineDash([]);
10435
+ let C = Math.max(c.start, a.n + a.m - 2), w = Math.min(c.end, p.length);
10407
10436
  if (a.showK) {
10408
10437
  n.strokeStyle = Ya.K, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10409
10438
  let e = !0;
10410
- for (let t = w; t < T; t++) {
10411
- let r = h[t];
10439
+ for (let t = C; t < w; t++) {
10440
+ let r = m[t];
10412
10441
  if (!r) continue;
10413
- let i = p[t - c.start];
10442
+ let i = f[t - c.start];
10414
10443
  if (i === void 0) continue;
10415
- let a = i + d / 2, s = o.height - (r.k - v) / y * o.height, l = Q(a, f), u = Q(s, f);
10416
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10444
+ let a = o.height - (r.k - _) / v * o.height, s = i, l = Q(a, d);
10445
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10417
10446
  }
10418
10447
  n.stroke();
10419
10448
  }
10420
10449
  if (a.showD) {
10421
10450
  n.strokeStyle = Ya.D, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10422
10451
  let e = !0;
10423
- for (let t = w; t < T; t++) {
10424
- let r = h[t];
10452
+ for (let t = C; t < w; t++) {
10453
+ let r = m[t];
10425
10454
  if (!r) continue;
10426
- let i = p[t - c.start];
10455
+ let i = f[t - c.start];
10427
10456
  if (i === void 0) continue;
10428
- let a = i + d / 2, s = o.height - (r.d - v) / y * o.height, l = Q(a, f), u = Q(s, f);
10429
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10457
+ let a = o.height - (r.d - _) / v * o.height, s = i, l = Q(a, d);
10458
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10430
10459
  }
10431
10460
  n.stroke();
10432
10461
  }
@@ -10497,40 +10526,40 @@ function Ec(e = {}) {
10497
10526
  return [r];
10498
10527
  },
10499
10528
  draw(e) {
10500
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, kWidth: d, dpr: f, kLinePositions: p } = e, m = s;
10501
- if (m.length < a.period + 1) return;
10502
- let h = l(m), g = -Infinity, _ = Infinity;
10503
- for (let e = c.start; e < c.end && e < h.length; e++) {
10504
- let t = h[e];
10505
- t !== void 0 && (g = Math.max(g, t), _ = Math.min(_, t));
10506
- }
10507
- if (!Number.isFinite(g) || !Number.isFinite(_)) return;
10508
- let v = Math.max(Math.abs(g), Math.abs(_)) * .1;
10509
- g += v, _ -= v, g - _;
10510
- let y = {
10511
- valueMin: _,
10512
- valueMax: g,
10529
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, dpr: d, kLineCenters: f } = e, p = s;
10530
+ if (p.length < a.period + 1) return;
10531
+ let m = l(p), h = -Infinity, g = Infinity;
10532
+ for (let e = c.start; e < c.end && e < m.length; e++) {
10533
+ let t = m[e];
10534
+ t !== void 0 && (h = Math.max(h, t), g = Math.min(g, t));
10535
+ }
10536
+ if (!Number.isFinite(h) || !Number.isFinite(g)) return;
10537
+ let _ = Math.max(Math.abs(h), Math.abs(g)) * .1;
10538
+ h += _, g -= _, h - g;
10539
+ let v = {
10540
+ valueMin: g,
10541
+ valueMax: h,
10513
10542
  timestamp: Date.now()
10514
10543
  };
10515
- i?.setSharedState(r, y, `mom_${t}`);
10516
- let b = o.yAxis.getDisplayRange({
10517
- minPrice: _,
10518
- maxPrice: g
10519
- }), x = b.minPrice, S = b.maxPrice - x || 1, C = o.height - (0 - x) / S * o.height;
10544
+ i?.setSharedState(r, v, `mom_${t}`);
10545
+ let y = o.yAxis.getDisplayRange({
10546
+ minPrice: g,
10547
+ maxPrice: h
10548
+ }), b = y.minPrice, x = y.maxPrice - b || 1, S = o.height - (0 - b) / x * o.height;
10520
10549
  n.save(), n.translate(-u, 0);
10521
- let w = u, T = u + e.paneWidth;
10522
- n.strokeStyle = Xa.ZERO, n.lineWidth = 1, n.beginPath(), n.moveTo(w, C), n.lineTo(T, C), n.stroke();
10523
- let E = Math.max(c.start, a.period), D = Math.min(c.end, m.length);
10550
+ let C = u, w = u + e.paneWidth;
10551
+ n.strokeStyle = Xa.ZERO, n.lineWidth = 1, n.beginPath(), n.moveTo(C, S), n.lineTo(w, S), n.stroke();
10552
+ let T = Math.max(c.start, a.period), E = Math.min(c.end, p.length);
10524
10553
  if (a.showMOM) {
10525
10554
  n.strokeStyle = Xa.MOM, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10526
10555
  let e = !0;
10527
- for (let t = E; t < D; t++) {
10528
- let r = h[t];
10556
+ for (let t = T; t < E; t++) {
10557
+ let r = m[t];
10529
10558
  if (r === void 0) continue;
10530
- let i = p[t - c.start];
10559
+ let i = f[t - c.start];
10531
10560
  if (i === void 0) continue;
10532
- let a = i + d / 2, s = o.height - (r - x) / S * o.height, l = Q(a, f), u = Q(s, f);
10533
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10561
+ let a = o.height - (r - b) / x * o.height, s = i, l = Q(a, d);
10562
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10534
10563
  }
10535
10564
  n.stroke();
10536
10565
  }
@@ -10602,34 +10631,34 @@ function Ac(e = {}) {
10602
10631
  return [r];
10603
10632
  },
10604
10633
  draw(e) {
10605
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, kWidth: d, dpr: f, kLinePositions: p } = e, m = s;
10606
- if (m.length < a.period) return;
10607
- let h = l(m), g = -100;
10608
- 0 - g;
10609
- let _ = {
10610
- valueMin: g,
10634
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, dpr: d, kLineCenters: f } = e, p = s;
10635
+ if (p.length < a.period) return;
10636
+ let m = l(p), h = -100;
10637
+ 0 - h;
10638
+ let g = {
10639
+ valueMin: h,
10611
10640
  valueMax: 0,
10612
10641
  timestamp: Date.now()
10613
10642
  };
10614
- i?.setSharedState(r, _, `wmsr_${t}`);
10615
- let v = o.yAxis.getDisplayRange({
10616
- minPrice: g,
10643
+ i?.setSharedState(r, g, `wmsr_${t}`);
10644
+ let _ = o.yAxis.getDisplayRange({
10645
+ minPrice: h,
10617
10646
  maxPrice: 0
10618
- }), y = v.minPrice, b = v.maxPrice - y || 1;
10647
+ }), v = _.minPrice, y = _.maxPrice - v || 1;
10619
10648
  n.save(), n.translate(-u, 0);
10620
- let x = o.height - (-20 - y) / b * o.height, S = o.height - (-80 - y) / b * o.height, C = o.height - (-50 - y) / b * o.height, w = u, T = u + e.paneWidth;
10621
- n.strokeStyle = Za.OVERBOUGHT, n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(w, x), n.lineTo(T, x), n.stroke(), n.strokeStyle = Za.OVERSOLD, n.beginPath(), n.moveTo(w, S), n.lineTo(T, S), n.stroke(), n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.beginPath(), n.moveTo(w, C), n.lineTo(T, C), n.stroke(), n.setLineDash([]);
10622
- let E = Math.max(c.start, a.period - 1), D = Math.min(c.end, m.length);
10649
+ let b = o.height - (-20 - v) / y * o.height, x = o.height - (-80 - v) / y * o.height, S = o.height - (-50 - v) / y * o.height, C = u, w = u + e.paneWidth;
10650
+ n.strokeStyle = Za.OVERBOUGHT, n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(C, b), n.lineTo(w, b), n.stroke(), n.strokeStyle = Za.OVERSOLD, n.beginPath(), n.moveTo(C, x), n.lineTo(w, x), n.stroke(), n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.beginPath(), n.moveTo(C, S), n.lineTo(w, S), n.stroke(), n.setLineDash([]);
10651
+ let T = Math.max(c.start, a.period - 1), E = Math.min(c.end, p.length);
10623
10652
  if (a.showWMSR) {
10624
10653
  n.strokeStyle = Za.WMSR, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10625
10654
  let e = !0;
10626
- for (let t = E; t < D; t++) {
10627
- let r = h[t];
10655
+ for (let t = T; t < E; t++) {
10656
+ let r = m[t];
10628
10657
  if (r === void 0) continue;
10629
- let i = p[t - c.start];
10658
+ let i = f[t - c.start];
10630
10659
  if (i === void 0) continue;
10631
- let a = i + d / 2, s = o.height - (r - y) / b * o.height, l = Q(a, f), u = Q(s, f);
10632
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10660
+ let a = o.height - (r - v) / y * o.height, s = i, l = Q(a, d);
10661
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10633
10662
  }
10634
10663
  n.stroke();
10635
10664
  }
@@ -10732,53 +10761,53 @@ function Ic(e = {}) {
10732
10761
  return [r];
10733
10762
  },
10734
10763
  draw(e) {
10735
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, kWidth: d, dpr: f, kLinePositions: p } = e, m = s;
10736
- if (m.length < a.roc4 + 15 + a.signalPeriod) return;
10737
- let h = l(m), g = -Infinity, _ = Infinity;
10738
- for (let e = c.start; e < c.end && e < h.length; e++) {
10739
- let t = h[e];
10740
- t && (g = Math.max(g, t.kst, t.signal), _ = Math.min(_, t.kst, t.signal));
10741
- }
10742
- if (!Number.isFinite(g) || !Number.isFinite(_)) return;
10743
- let v = (g - _) * .1 || 1;
10744
- g += v, _ -= v, g - _;
10745
- let y = {
10746
- valueMin: _,
10747
- valueMax: g,
10764
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, dpr: d, kLineCenters: f } = e, p = s;
10765
+ if (p.length < a.roc4 + 15 + a.signalPeriod) return;
10766
+ let m = l(p), h = -Infinity, g = Infinity;
10767
+ for (let e = c.start; e < c.end && e < m.length; e++) {
10768
+ let t = m[e];
10769
+ t && (h = Math.max(h, t.kst, t.signal), g = Math.min(g, t.kst, t.signal));
10770
+ }
10771
+ if (!Number.isFinite(h) || !Number.isFinite(g)) return;
10772
+ let _ = (h - g) * .1 || 1;
10773
+ h += _, g -= _, h - g;
10774
+ let v = {
10775
+ valueMin: g,
10776
+ valueMax: h,
10748
10777
  timestamp: Date.now()
10749
10778
  };
10750
- i?.setSharedState(r, y, `kst_${t}`);
10751
- let b = o.yAxis.getDisplayRange({
10752
- minPrice: _,
10753
- maxPrice: g
10754
- }), x = b.minPrice, S = b.maxPrice - x || 1, C = o.height - (0 - x) / S * o.height;
10779
+ i?.setSharedState(r, v, `kst_${t}`);
10780
+ let y = o.yAxis.getDisplayRange({
10781
+ minPrice: g,
10782
+ maxPrice: h
10783
+ }), b = y.minPrice, x = y.maxPrice - b || 1, S = o.height - (0 - b) / x * o.height;
10755
10784
  n.save(), n.translate(-u, 0);
10756
- let w = u, T = u + e.paneWidth;
10757
- n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.beginPath(), n.moveTo(w, C), n.lineTo(T, C), n.stroke();
10758
- let E = Math.max(c.start, a.roc4 + 15 + a.signalPeriod - 1), D = Math.min(c.end, m.length);
10785
+ let C = u, w = u + e.paneWidth;
10786
+ n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.beginPath(), n.moveTo(C, S), n.lineTo(w, S), n.stroke();
10787
+ let T = Math.max(c.start, a.roc4 + 15 + a.signalPeriod - 1), E = Math.min(c.end, p.length);
10759
10788
  if (a.showKST) {
10760
10789
  n.strokeStyle = Qa.KST, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10761
10790
  let e = !0;
10762
- for (let t = E; t < D; t++) {
10763
- let r = h[t];
10791
+ for (let t = T; t < E; t++) {
10792
+ let r = m[t];
10764
10793
  if (!r) continue;
10765
- let i = p[t - c.start];
10794
+ let i = f[t - c.start];
10766
10795
  if (i === void 0) continue;
10767
- let a = i + d / 2, s = o.height - (r.kst - x) / S * o.height, l = Q(a, f), u = Q(s, f);
10768
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10796
+ let a = o.height - (r.kst - b) / x * o.height, s = i, l = Q(a, d);
10797
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10769
10798
  }
10770
10799
  n.stroke();
10771
10800
  }
10772
10801
  if (a.showSignal) {
10773
10802
  n.strokeStyle = Qa.SIGNAL, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10774
10803
  let e = !0;
10775
- for (let t = E; t < D; t++) {
10776
- let r = h[t];
10804
+ for (let t = T; t < E; t++) {
10805
+ let r = m[t];
10777
10806
  if (!r) continue;
10778
- let i = p[t - c.start];
10807
+ let i = f[t - c.start];
10779
10808
  if (i === void 0) continue;
10780
- let a = i + d / 2, s = o.height - (r.signal - x) / S * o.height, l = Q(a, f), u = Q(s, f);
10781
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10809
+ let a = o.height - (r.signal - b) / x * o.height, s = i, l = Q(a, d);
10810
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10782
10811
  }
10783
10812
  n.stroke();
10784
10813
  }
@@ -10860,32 +10889,32 @@ function Bc(e = {}) {
10860
10889
  return [r];
10861
10890
  },
10862
10891
  draw(e) {
10863
- let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, kWidth: d, dpr: f, kLinePositions: p } = e, m = s;
10864
- if (m.length < a.period) return;
10865
- let h = l(m), g = {
10892
+ let { ctx: n, pane: o, data: s, range: c, scrollLeft: u, dpr: d, kLineCenters: f } = e, p = s;
10893
+ if (p.length < a.period) return;
10894
+ let m = l(p), h = {
10866
10895
  valueMin: 0,
10867
10896
  valueMax: 100,
10868
10897
  timestamp: Date.now()
10869
10898
  };
10870
- i?.setSharedState(r, g, `fastk_${t}`);
10871
- let _ = o.yAxis.getDisplayRange({
10899
+ i?.setSharedState(r, h, `fastk_${t}`);
10900
+ let g = o.yAxis.getDisplayRange({
10872
10901
  minPrice: 0,
10873
10902
  maxPrice: 100
10874
- }), v = _.minPrice, y = _.maxPrice - v || 1;
10903
+ }), _ = g.minPrice, v = g.maxPrice - _ || 1;
10875
10904
  n.save(), n.translate(-u, 0);
10876
- let b = o.height - (80 - v) / y * o.height, x = o.height - (20 - v) / y * o.height, S = u, C = u + e.paneWidth;
10877
- n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(S, b), n.lineTo(C, b), n.moveTo(S, x), n.lineTo(C, x), n.stroke(), n.setLineDash([]);
10878
- let w = Math.max(c.start, a.period - 1), T = Math.min(c.end, m.length);
10905
+ let y = o.height - (80 - _) / v * o.height, b = o.height - (20 - _) / v * o.height, x = u, S = u + e.paneWidth;
10906
+ n.strokeStyle = "rgba(0, 0, 0, 0.1)", n.lineWidth = 1, n.setLineDash([4, 4]), n.beginPath(), n.moveTo(x, y), n.lineTo(S, y), n.moveTo(x, b), n.lineTo(S, b), n.stroke(), n.setLineDash([]);
10907
+ let C = Math.max(c.start, a.period - 1), w = Math.min(c.end, p.length);
10879
10908
  if (a.showFASTK) {
10880
10909
  n.strokeStyle = Ya.K, n.lineWidth = 1, n.lineJoin = "round", n.lineCap = "round", n.beginPath();
10881
10910
  let e = !0;
10882
- for (let t = w; t < T; t++) {
10883
- let r = h[t];
10911
+ for (let t = C; t < w; t++) {
10912
+ let r = m[t];
10884
10913
  if (r === void 0) continue;
10885
- let i = p[t - c.start];
10914
+ let i = f[t - c.start];
10886
10915
  if (i === void 0) continue;
10887
- let a = i + d / 2, s = o.height - (r - v) / y * o.height, l = Q(a, f), u = Q(s, f);
10888
- e ? (n.moveTo(l, u), e = !1) : n.lineTo(l, u);
10916
+ let a = o.height - (r - _) / v * o.height, s = i, l = Q(a, d);
10917
+ e ? (n.moveTo(s, l), e = !1) : n.lineTo(s, l);
10889
10918
  }
10890
10919
  n.stroke();
10891
10920
  }
@@ -12075,50 +12104,52 @@ function fl(e) {
12075
12104
  paneId: e.paneId ?? "main",
12076
12105
  priority: X.OVERLAY,
12077
12106
  draw(e) {
12078
- let { ctx: i, pane: a, data: o, range: s, dpr: c, paneWidth: l, kLinePositions: u, kWidth: d, kGap: f } = e, p = e.viewport ?? {
12107
+ let { ctx: i, pane: a, data: o, range: s, dpr: c, paneWidth: l, kLinePositions: u, kLineCenters: d, kBarRects: f, kWidth: p, kGap: m } = e, h = e.viewport ?? {
12079
12108
  scrollLeft: e.scrollLeft,
12080
12109
  plotWidth: l,
12081
12110
  plotHeight: a.height
12082
- }, { startXPx: m, unitPx: h } = Ms(d, f, c), g = o, _ = g.slice(s.start, s.end), v = t.getVisibleByPane(a.id);
12083
- if (v.length === 0) return;
12084
- let y = {
12111
+ }, { startXPx: g, unitPx: _ } = Ms(p, m, c), v = o, y = v.slice(s.start, s.end), b = t.getVisibleByPane(a.id);
12112
+ if (b.length === 0) return;
12113
+ let x = {
12085
12114
  left: 0,
12086
12115
  top: 0,
12087
- right: p.plotWidth,
12116
+ right: h.plotWidth,
12088
12117
  bottom: a.height
12089
12118
  };
12090
- i.save(), i.beginPath(), i.rect(0, 0, p.plotWidth, a.height), i.clip();
12091
- for (let e of v) {
12119
+ i.save(), i.beginPath(), i.rect(0, 0, h.plotWidth, a.height), i.clip();
12120
+ for (let e of b) {
12092
12121
  let o = n.compute(e, {
12093
12122
  pane: a,
12094
- visibleData: _,
12095
- seriesData: g,
12123
+ visibleData: y,
12124
+ seriesData: v,
12096
12125
  range: s,
12097
12126
  kLinePositions: u,
12098
- kWidth: d,
12099
- kGap: f,
12127
+ kLineCenters: d,
12128
+ kBarRects: f,
12129
+ kWidth: p,
12130
+ kGap: m,
12100
12131
  dpr: c,
12101
12132
  paneWidth: l,
12102
- viewport: p,
12133
+ viewport: h,
12103
12134
  toScreen(e) {
12104
12135
  return !Number.isFinite(e.index) || e.index < 0 ? {
12105
- x: -d,
12136
+ x: -p,
12106
12137
  y: a.yAxis.priceToY(e.price)
12107
12138
  } : {
12108
- x: (m + e.index * h + (h - 1) / 2) / c - p.scrollLeft,
12139
+ x: (g + e.index * _ + (_ - 1) / 2) / c - h.scrollLeft,
12109
12140
  y: a.yAxis.priceToY(e.price)
12110
12141
  };
12111
12142
  }
12112
12143
  });
12113
12144
  if (!o) continue;
12114
- let v = t.getSelectedId() === e.id ? o.primitives.map((t) => pl(t, e.style)) : o.primitives;
12115
- for (let e of v) {
12145
+ let b = t.getSelectedId() === e.id ? o.primitives.map((t) => pl(t, e.style)) : o.primitives;
12146
+ for (let e of b) {
12116
12147
  if (e.kind === "point") {
12117
12148
  r.point(i, e, c);
12118
12149
  continue;
12119
12150
  }
12120
12151
  if (e.kind === "line") {
12121
- r.line(i, e, y, c);
12152
+ r.line(i, e, x, c);
12122
12153
  continue;
12123
12154
  }
12124
12155
  if (e.kind === "area") {
@@ -12266,15 +12297,25 @@ var ml = class e {
12266
12297
  let { start: t, end: n } = Ns(e.scrollLeft, e.plotWidth, this.opt.kWidth, this.opt.kGap, this.data.length, e.dpr), r = {
12267
12298
  start: t,
12268
12299
  end: n
12269
- }, i = this.calcKLinePositions(r), { kWidthPx: a } = Ms(this.opt.kWidth, this.opt.kGap, e.dpr);
12270
- this.interaction.setKLinePositions(i, r, a);
12300
+ }, i = this.calcKLinePositions(r), a = Ms(this.opt.kWidth, this.opt.kGap, e.dpr), o = Math.max(1, a.unitPx - 1);
12301
+ o % 2 == 0 && --o;
12302
+ let s = Array(i.length), c = Array(i.length);
12303
+ for (let t = 0; t < i.length; t++) {
12304
+ let n = i[t], r = Math.round(n * e.dpr) + (a.kWidthPx - 1) / 2;
12305
+ s[t] = r / e.dpr, c[t] = {
12306
+ x: (r - (o - 1) / 2) / e.dpr,
12307
+ width: o / e.dpr
12308
+ };
12309
+ }
12310
+ let { kWidthPx: l } = Ms(this.opt.kWidth, this.opt.kGap, e.dpr);
12311
+ this.interaction.setKLinePositions(i, r, l);
12271
12312
  for (let t of this.paneRenderers) {
12272
12313
  let n = t.getPane(), a = t.getDom().plotCanvas.getContext("2d"), o = t.getDom().yAxisCanvas.getContext("2d");
12273
12314
  if (n.updateRange(this.data, r), a && (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(e.dpr, e.dpr), a.clearRect(0, 0, e.plotWidth + 1, n.height + 2 / e.dpr)), o) {
12274
12315
  let t = o.canvas.width / e.dpr;
12275
12316
  o.setTransform(1, 0, 0, 1, 0, 0), o.scale(e.dpr, e.dpr), o.clearRect(0, 0, t, n.height + 2 / e.dpr);
12276
12317
  }
12277
- let s = {
12318
+ let l = {
12278
12319
  ctx: a,
12279
12320
  pane: ha(n),
12280
12321
  data: this.data,
@@ -12285,6 +12326,8 @@ var ml = class e {
12285
12326
  dpr: e.dpr,
12286
12327
  paneWidth: e.plotWidth,
12287
12328
  kLinePositions: i,
12329
+ kLineCenters: s,
12330
+ kBarRects: c,
12288
12331
  markerManager: this.markerManager,
12289
12332
  crosshairIndex: this.interaction.getCrosshairIndex(),
12290
12333
  yAxisCtx: o ?? void 0,
@@ -12298,17 +12341,17 @@ var ml = class e {
12298
12341
  };
12299
12342
  if (a) {
12300
12343
  a.save();
12301
- let e = this.rendererPluginManager.render(n.id, s);
12344
+ let e = this.rendererPluginManager.render(n.id, l);
12302
12345
  e.length > 0 && this.pluginHost.events.emit("renderer:error", {
12303
12346
  paneId: n.id,
12304
12347
  errors: e
12305
12348
  }), a.restore();
12306
12349
  }
12307
12350
  }
12308
- let o = this.dom.xAxisCanvas.getContext("2d");
12309
- if (o) {
12351
+ let u = this.dom.xAxisCanvas.getContext("2d");
12352
+ if (u) {
12310
12353
  let t = {
12311
- ctx: o,
12354
+ ctx: u,
12312
12355
  pane: {
12313
12356
  id: "xAxis",
12314
12357
  role: "auxiliary",
@@ -12344,7 +12387,9 @@ var ml = class e {
12344
12387
  dpr: e.dpr,
12345
12388
  paneWidth: e.plotWidth,
12346
12389
  kLinePositions: i,
12347
- xAxisCtx: o,
12390
+ kLineCenters: s,
12391
+ kBarRects: c,
12392
+ xAxisCtx: u,
12348
12393
  viewport: {
12349
12394
  scrollLeft: e.scrollLeft,
12350
12395
  plotWidth: e.plotWidth,
@@ -13990,29 +14035,29 @@ var Gu = d({
13990
14035
  zoomLevelCount: d.zoomLevels,
13991
14036
  dpr: M.state.viewportDpr
13992
14037
  }), _l(M.state.viewportDpr)), r(() => M.state.dataLength), r(() => M.state.viewportDpr);
13993
- let N = r(() => M.state.zoomLevel), ee = r(() => M.state.kWidth), P = r(() => M.state.kGap), te = r(() => M.state.paneRatios), F = r(() => M.state.selectedDrawingId), ne = r(() => M.state.dataVersion);
13994
- function re() {
14038
+ let N = r(() => M.state.zoomLevel), ee = r(() => M.state.kWidth), P = r(() => M.state.kGap), te = r(() => M.state.paneRatios), ne = r(() => M.state.selectedDrawingId), re = r(() => M.state.dataVersion);
14039
+ function ie() {
13995
14040
  A.value?.scheduleDraw();
13996
14041
  }
13997
- function I(e, t, n) {
14042
+ function F(e, t, n) {
13998
14043
  let r = e.getBoundingClientRect();
13999
14044
  return {
14000
14045
  width: Math.max(t, Math.round(r.width)),
14001
14046
  height: Math.max(n, Math.round(r.height))
14002
14047
  };
14003
14048
  }
14004
- function ie(e) {
14049
+ function ae(e) {
14005
14050
  if (!e) return;
14006
- let t = I(e, 180, 80);
14051
+ let t = F(e, 180, 80);
14007
14052
  A.value?.interaction.setTooltipSize(t);
14008
14053
  }
14009
- function ae(e) {
14010
- e && (le.value = I(e, 120, 60));
14054
+ function oe(e) {
14055
+ e && (le.value = F(e, 120, 60));
14011
14056
  }
14012
- let oe = y({
14057
+ let se = y({
14013
14058
  x: 0,
14014
14059
  y: 0
14015
- }), se = y(!1), L = S({
14060
+ }), I = y(!1), L = S({
14016
14061
  crosshairPos: null,
14017
14062
  crosshairIndex: null,
14018
14063
  crosshairPrice: null,
@@ -14031,7 +14076,7 @@ var Gu = d({
14031
14076
  hoveredPaneBoundaryId: null,
14032
14077
  isHoveringRightAxis: !1
14033
14078
  }), R = S(null), z = r(() => {
14034
- let e = F.value;
14079
+ let e = ne.value;
14035
14080
  return e ? M.state.drawings.find((t) => t.id === e) ?? null : null;
14036
14081
  }), ce = y([]), le = y({
14037
14082
  width: 220,
@@ -14048,7 +14093,7 @@ var Gu = d({
14048
14093
  }), de = r(() => L.value.hoveredMarkerData), fe = r(() => L.value.hoveredCustomMarker), pe = r(() => L.value.isDragging), me = r(() => L.value.isResizingPaneBoundary), B = r(() => L.value.isHoveringPaneBoundary), he = r(() => L.value.hoveredPaneBoundaryId), ge = r(() => L.value.isHoveringRightAxis), _e = r(() => L.value.hoveredIndex), ve = r(() => L.value.crosshairIndex), ye = r(() => {
14049
14094
  let e = L.value.hoveredIndex;
14050
14095
  if (typeof e != "number") return null;
14051
- ne.value;
14096
+ re.value;
14052
14097
  let t = A.value?.getData();
14053
14098
  return t && e >= 0 && e < t.length ? t[e] : null;
14054
14099
  }), be = r(() => L.value.hoveredIndex), xe = r(() => L.value.tooltipPos), Se = r(() => ({
@@ -14058,15 +14103,15 @@ var Gu = d({
14058
14103
  left: `${Se.value.x}px`,
14059
14104
  top: `${Se.value.y}px`
14060
14105
  })), we = r(() => ({
14061
- x: oe.value.x + ue.value.x,
14062
- y: oe.value.y + ue.value.y
14106
+ x: se.value.x + ue.value.x,
14107
+ y: se.value.y + ue.value.y
14063
14108
  })), Te = r(() => ({
14064
14109
  left: `${we.value.x}px`,
14065
14110
  top: `${we.value.y}px`
14066
14111
  })), Ee = r(() => L.value.tooltipAnchorPlacement), De = r(() => {
14067
14112
  let e = A.value?.getViewport(), t = D.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
14068
- return oe.value.x + 12 + le.value.width + 12 > n ? "left-bottom" : "right-bottom";
14069
- }), Oe = r(() => (ne.value, A.value?.getData() ?? []));
14113
+ return se.value.x + 12 + le.value.width + 12 > n ? "left-bottom" : "right-bottom";
14114
+ }), Oe = r(() => (re.value, A.value?.getData() ?? []));
14070
14115
  function ke(e) {
14071
14116
  R.value?.setTool(e);
14072
14117
  }
@@ -14092,7 +14137,7 @@ var Gu = d({
14092
14137
  let t = D.value;
14093
14138
  if (t) {
14094
14139
  let n = t.getBoundingClientRect();
14095
- if (oe.value = {
14140
+ if (se.value = {
14096
14141
  x: e.clientX - n.left,
14097
14142
  y: e.clientY - n.top
14098
14143
  }, R.value?.onPointerMove(e, t)) {
@@ -14225,7 +14270,7 @@ var Gu = d({
14225
14270
  rendererName: `${e.toLowerCase()}_${n}`,
14226
14271
  paneTitleRendererName: r.name,
14227
14272
  params: t ?? Ge(e)
14228
- }), V.value.includes(e) || V.value.push(e), re(), !0;
14273
+ }), V.value.includes(e) || V.value.push(e), ie(), !0;
14229
14274
  }
14230
14275
  function qe(e) {
14231
14276
  let t = H.value.findIndex((t) => t.id === e);
@@ -14260,7 +14305,7 @@ var Gu = d({
14260
14305
  enabled: e.includes("ENE"),
14261
14306
  params: Ve.value.ENE || {}
14262
14307
  }
14263
- } }), t.setRendererEnabled("ma", e.includes("MA")), t.setRendererEnabled("boll", e.includes("BOLL")), t.setRendererEnabled("expma", e.includes("EXPMA")), t.setRendererEnabled("ene", e.includes("ENE")), re());
14308
+ } }), t.setRendererEnabled("ma", e.includes("MA")), t.setRendererEnabled("boll", e.includes("BOLL")), t.setRendererEnabled("expma", e.includes("EXPMA")), t.setRendererEnabled("ene", e.includes("ENE")), ie());
14264
14309
  }, { deep: !0 });
14265
14310
  function Xe() {
14266
14311
  let e = A.value?.getSubPaneIndicators() ?? [];
@@ -14279,7 +14324,7 @@ var Gu = d({
14279
14324
  params: Ge(t)
14280
14325
  }), V.value.includes(t) || V.value.push(t);
14281
14326
  }
14282
- re();
14327
+ ie();
14283
14328
  }
14284
14329
  function Ze(e, t) {
14285
14330
  let n = H.value.find((t) => t.id === e);
@@ -14322,7 +14367,7 @@ var Gu = d({
14322
14367
  t && Ze(t.id, e);
14323
14368
  }
14324
14369
  } else V.value = V.value.filter((t) => t !== e), H.value.filter((t) => t.indicatorId === e).forEach((e) => qe(e.id));
14325
- re();
14370
+ ie();
14326
14371
  }
14327
14372
  }
14328
14373
  function et() {
@@ -14347,12 +14392,12 @@ var Gu = d({
14347
14392
  }
14348
14393
  function tt(e, t) {
14349
14394
  if (Ve.value[e] = t, e === "MA" || e === "BOLL" || e === "EXPMA" || e === "ENE") {
14350
- e === "BOLL" && A.value?.updateRendererConfig("boll", t), e === "EXPMA" && A.value?.updateRendererConfig("expma", t), e === "ENE" && A.value?.updateRendererConfig("ene", t), et(), re();
14395
+ e === "BOLL" && A.value?.updateRendererConfig("boll", t), e === "EXPMA" && A.value?.updateRendererConfig("expma", t), e === "ENE" && A.value?.updateRendererConfig("ene", t), et(), ie();
14351
14396
  return;
14352
14397
  }
14353
14398
  Ue.includes(e) && H.value.filter((t) => t.indicatorId === e).forEach((e) => {
14354
14399
  e.params = { ...t }, A.value?.updateRendererConfig(e.rendererName, t);
14355
- }), re();
14400
+ }), ie();
14356
14401
  }
14357
14402
  function nt(e) {
14358
14403
  if (!e.length || H.value.length <= 1) return;
@@ -14380,7 +14425,7 @@ var Gu = d({
14380
14425
  let n = t.getData()?.length ?? 0;
14381
14426
  if (n === 0) return;
14382
14427
  let r = t.getCurrentDpr(), { unitPx: i, startXPx: a } = Ms(ee.value, P.value, r), o = (a + n * i) / r, s = Math.max(0, e.scrollWidth - e.clientWidth), c = Math.min(s, Math.max(0, o - e.clientWidth));
14383
- e.scrollLeft = Math.round(c * r) / r, re();
14428
+ e.scrollLeft = Math.round(c * r) / r, ie();
14384
14429
  }
14385
14430
  function ot(e, t) {
14386
14431
  let n = A.value, r = D.value;
@@ -14399,7 +14444,7 @@ var Gu = d({
14399
14444
  }));
14400
14445
  }
14401
14446
  return c({
14402
- scheduleRender: re,
14447
+ scheduleRender: ie,
14403
14448
  scrollToRight: at,
14404
14449
  addSubPane: Ke,
14405
14450
  removeSubPane: qe,
@@ -14414,7 +14459,7 @@ var Gu = d({
14414
14459
  getZoomLevel: () => N.value,
14415
14460
  getZoomLevelCount: () => A.value?.getZoomLevelCount() ?? 10
14416
14461
  }), h(() => {
14417
- se.value = typeof CSS < "u" && CSS.supports("anchor-name: --kmap-anchor") && CSS.supports("position-anchor: --kmap-anchor");
14462
+ I.value = typeof CSS < "u" && CSS.supports("anchor-name: --kmap-anchor") && CSS.supports("position-anchor: --kmap-anchor");
14418
14463
  let e = D.value, t = C.value, n = E.value, r = x.value;
14419
14464
  if (!e || !t || !n || !r) return;
14420
14465
  let i = (t) => {
@@ -14561,7 +14606,7 @@ var Gu = d({
14561
14606
  onDrawingSelected: (e) => {
14562
14607
  M.actions.setSelectedDrawingId(e?.id ?? null);
14563
14608
  }
14564
- }), a.interaction.setTooltipAnchorPositioning(se.value), a.interaction.setOnInteractionChange((e) => {
14609
+ }), a.interaction.setTooltipAnchorPositioning(I.value), a.interaction.setOnInteractionChange((e) => {
14565
14610
  L.value = e;
14566
14611
  }), a.interaction.setOnPinchZoom((e, t) => {
14567
14612
  let n = D.value;
@@ -14658,12 +14703,12 @@ var Gu = d({
14658
14703
  }, [
14659
14704
  ye.value ? (_(), o("div", {
14660
14705
  key: 0,
14661
- class: p(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": se.value }]),
14706
+ class: p(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": I.value }]),
14662
14707
  style: m(Ce.value)
14663
14708
  }, null, 6)) : a("", !0),
14664
14709
  de.value || fe.value ? (_(), o("div", {
14665
14710
  key: 1,
14666
- class: p(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": se.value }]),
14711
+ class: p(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": I.value }]),
14667
14712
  style: m(Te.value)
14668
14713
  }, null, 6)) : a("", !0),
14669
14714
  ye.value ? (_(), i(ko, {
@@ -14672,8 +14717,8 @@ var Gu = d({
14672
14717
  index: be.value,
14673
14718
  data: Oe.value,
14674
14719
  pos: Se.value,
14675
- "set-el": ie,
14676
- "use-anchor": se.value,
14720
+ "set-el": ae,
14721
+ "use-anchor": I.value,
14677
14722
  "anchor-placement": Ee.value
14678
14723
  }, null, 8, [
14679
14724
  "k",
@@ -14687,9 +14732,9 @@ var Gu = d({
14687
14732
  key: 3,
14688
14733
  marker: de.value || fe.value,
14689
14734
  pos: we.value,
14690
- "use-anchor": se.value,
14735
+ "use-anchor": I.value,
14691
14736
  "anchor-placement": De.value,
14692
- "set-el": ae
14737
+ "set-el": oe
14693
14738
  }, null, 8, [
14694
14739
  "marker",
14695
14740
  "pos",
@@ -14719,4 +14764,4 @@ var Gu = d({
14719
14764
  e.component("KLineChart", id);
14720
14765
  } };
14721
14766
  //#endregion
14722
- export { ya as ConfigManager, I as EventBus, ga as GLOBAL_PANE_ID, va as HookSystem, id as KLineChart, ad as KMapPlugin, xa as PluginHostImpl, _a as PluginRegistry, ma as PluginState, X as RENDERER_PRIORITY, wa as RendererPluginManager, Sa as createPluginHost, ha as wrapPaneInfo };
14767
+ export { ya as ConfigManager, F as EventBus, ga as GLOBAL_PANE_ID, va as HookSystem, id as KLineChart, ad as KMapPlugin, xa as PluginHostImpl, _a as PluginRegistry, ma as PluginState, X as RENDERER_PRIORITY, wa as RendererPluginManager, Sa as createPluginHost, ha as wrapPaneInfo };