@record-evolution/widget-linechart 1.7.1 → 1.7.2

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.
@@ -1,21 +1,21 @@
1
- import * as F from "echarts/core";
2
- import { GridComponent as St, TitleComponent as Et, ToolboxComponent as Tt, TooltipComponent as Dt, LegendComponent as Lt, DataZoomComponent as Ot } from "echarts/components";
3
- import { LineChart as Pt, BarChart as Mt, ScatterChart as Ut } from "echarts/charts";
4
- import { UniversalTransition as Nt, LegacyGridContainLabel as Rt } from "echarts/features";
5
- import { CanvasRenderer as zt } from "echarts/renderers";
6
- import lt from "tinycolor2";
7
- const k = globalThis, Q = k.ShadowRoot && (k.ShadyCSS === void 0 || k.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, tt = /* @__PURE__ */ Symbol(), ct = /* @__PURE__ */ new WeakMap();
8
- let vt = class {
1
+ import * as nt from "echarts/core";
2
+ import { GridComponent as Pt, TitleComponent as Mt, ToolboxComponent as Nt, TooltipComponent as Ut, LegendComponent as zt, DataZoomComponent as Rt } from "echarts/components";
3
+ import { LineChart as It, BarChart as Ht, ScatterChart as jt } from "echarts/charts";
4
+ import { UniversalTransition as kt, LegacyGridContainLabel as Bt } from "echarts/features";
5
+ import { CanvasRenderer as Wt } from "echarts/renderers";
6
+ import ft from "tinycolor2";
7
+ const G = globalThis, at = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, rt = /* @__PURE__ */ Symbol(), yt = /* @__PURE__ */ new WeakMap();
8
+ let Tt = class {
9
9
  constructor(t, e, s) {
10
- if (this._$cssResult$ = !0, s !== tt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ if (this._$cssResult$ = !0, s !== rt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
11
11
  this.cssText = t, this.t = e;
12
12
  }
13
13
  get styleSheet() {
14
14
  let t = this.o;
15
15
  const e = this.t;
16
- if (Q && t === void 0) {
16
+ if (at && t === void 0) {
17
17
  const s = e !== void 0 && e.length === 1;
18
- s && (t = ct.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && ct.set(e, t));
18
+ s && (t = yt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && yt.set(e, t));
19
19
  }
20
20
  return t;
21
21
  }
@@ -23,101 +23,101 @@ let vt = class {
23
23
  return this.cssText;
24
24
  }
25
25
  };
26
- const Ht = (i) => new vt(typeof i == "string" ? i : i + "", void 0, tt), jt = (i, ...t) => {
27
- const e = i.length === 1 ? i[0] : t.reduce((s, n, o) => s + ((r) => {
28
- if (r._$cssResult$ === !0) return r.cssText;
29
- if (typeof r == "number") return r;
30
- throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
31
- })(n) + i[o + 1], i[0]);
32
- return new vt(e, i, tt);
33
- }, It = (i, t) => {
34
- if (Q) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
26
+ const Zt = (o) => new Tt(typeof o == "string" ? o : o + "", void 0, rt), Vt = (o, ...t) => {
27
+ const e = o.length === 1 ? o[0] : t.reduce((s, i, n) => s + ((a) => {
28
+ if (a._$cssResult$ === !0) return a.cssText;
29
+ if (typeof a == "number") return a;
30
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
31
+ })(i) + o[n + 1], o[0]);
32
+ return new Tt(e, o, rt);
33
+ }, qt = (o, t) => {
34
+ if (at) o.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
35
35
  else for (const e of t) {
36
- const s = document.createElement("style"), n = k.litNonce;
37
- n !== void 0 && s.setAttribute("nonce", n), s.textContent = e.cssText, i.appendChild(s);
36
+ const s = document.createElement("style"), i = G.litNonce;
37
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, o.appendChild(s);
38
38
  }
39
- }, pt = Q ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
39
+ }, gt = at ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
40
40
  let e = "";
41
41
  for (const s of t.cssRules) e += s.cssText;
42
- return Ht(e);
43
- })(i) : i;
44
- const { is: kt, defineProperty: Bt, getOwnPropertyDescriptor: Wt, getOwnPropertyNames: qt, getOwnPropertySymbols: Vt, getPrototypeOf: Xt } = Object, q = globalThis, dt = q.trustedTypes, Yt = dt ? dt.emptyScript : "", Zt = q.reactiveElementPolyfillSupport, N = (i, t) => i, B = { toAttribute(i, t) {
42
+ return Zt(e);
43
+ })(o) : o;
44
+ const { is: Xt, defineProperty: Yt, getOwnPropertyDescriptor: Gt, getOwnPropertyNames: Kt, getOwnPropertySymbols: Ft, getPrototypeOf: Jt } = Object, J = globalThis, xt = J.trustedTypes, Qt = xt ? xt.emptyScript : "", te = J.reactiveElementPolyfillSupport, j = (o, t) => o, K = { toAttribute(o, t) {
45
45
  switch (t) {
46
46
  case Boolean:
47
- i = i ? Yt : null;
47
+ o = o ? Qt : null;
48
48
  break;
49
49
  case Object:
50
50
  case Array:
51
- i = i == null ? i : JSON.stringify(i);
51
+ o = o == null ? o : JSON.stringify(o);
52
52
  }
53
- return i;
54
- }, fromAttribute(i, t) {
55
- let e = i;
53
+ return o;
54
+ }, fromAttribute(o, t) {
55
+ let e = o;
56
56
  switch (t) {
57
57
  case Boolean:
58
- e = i !== null;
58
+ e = o !== null;
59
59
  break;
60
60
  case Number:
61
- e = i === null ? null : Number(i);
61
+ e = o === null ? null : Number(o);
62
62
  break;
63
63
  case Object:
64
64
  case Array:
65
65
  try {
66
- e = JSON.parse(i);
66
+ e = JSON.parse(o);
67
67
  } catch {
68
68
  e = null;
69
69
  }
70
70
  }
71
71
  return e;
72
- } }, et = (i, t) => !kt(i, t), ut = { attribute: !0, type: String, converter: B, reflect: !1, useDefault: !1, hasChanged: et };
73
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), q.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
74
- let S = class extends HTMLElement {
72
+ } }, ht = (o, t) => !Xt(o, t), $t = { attribute: !0, type: String, converter: K, reflect: !1, useDefault: !1, hasChanged: ht };
73
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), J.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
74
+ let O = class extends HTMLElement {
75
75
  static addInitializer(t) {
76
76
  this._$Ei(), (this.l ??= []).push(t);
77
77
  }
78
78
  static get observedAttributes() {
79
79
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
80
80
  }
81
- static createProperty(t, e = ut) {
81
+ static createProperty(t, e = $t) {
82
82
  if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
83
- const s = /* @__PURE__ */ Symbol(), n = this.getPropertyDescriptor(t, s, e);
84
- n !== void 0 && Bt(this.prototype, t, n);
83
+ const s = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(t, s, e);
84
+ i !== void 0 && Yt(this.prototype, t, i);
85
85
  }
86
86
  }
87
87
  static getPropertyDescriptor(t, e, s) {
88
- const { get: n, set: o } = Wt(this.prototype, t) ?? { get() {
88
+ const { get: i, set: n } = Gt(this.prototype, t) ?? { get() {
89
89
  return this[e];
90
- }, set(r) {
91
- this[e] = r;
90
+ }, set(a) {
91
+ this[e] = a;
92
92
  } };
93
- return { get: n, set(r) {
94
- const l = n?.call(this);
95
- o?.call(this, r), this.requestUpdate(t, l, s);
93
+ return { get: i, set(a) {
94
+ const l = i?.call(this);
95
+ n?.call(this, a), this.requestUpdate(t, l, s);
96
96
  }, configurable: !0, enumerable: !0 };
97
97
  }
98
98
  static getPropertyOptions(t) {
99
- return this.elementProperties.get(t) ?? ut;
99
+ return this.elementProperties.get(t) ?? $t;
100
100
  }
101
101
  static _$Ei() {
102
- if (this.hasOwnProperty(N("elementProperties"))) return;
103
- const t = Xt(this);
102
+ if (this.hasOwnProperty(j("elementProperties"))) return;
103
+ const t = Jt(this);
104
104
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
105
105
  }
106
106
  static finalize() {
107
- if (this.hasOwnProperty(N("finalized"))) return;
108
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(N("properties"))) {
109
- const e = this.properties, s = [...qt(e), ...Vt(e)];
110
- for (const n of s) this.createProperty(n, e[n]);
107
+ if (this.hasOwnProperty(j("finalized"))) return;
108
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
109
+ const e = this.properties, s = [...Kt(e), ...Ft(e)];
110
+ for (const i of s) this.createProperty(i, e[i]);
111
111
  }
112
112
  const t = this[Symbol.metadata];
113
113
  if (t !== null) {
114
114
  const e = litPropertyMetadata.get(t);
115
- if (e !== void 0) for (const [s, n] of e) this.elementProperties.set(s, n);
115
+ if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
116
116
  }
117
117
  this._$Eh = /* @__PURE__ */ new Map();
118
118
  for (const [e, s] of this.elementProperties) {
119
- const n = this._$Eu(e, s);
120
- n !== void 0 && this._$Eh.set(n, e);
119
+ const i = this._$Eu(e, s);
120
+ i !== void 0 && this._$Eh.set(i, e);
121
121
  }
122
122
  this.elementStyles = this.finalizeStyles(this.styles);
123
123
  }
@@ -125,8 +125,8 @@ let S = class extends HTMLElement {
125
125
  const e = [];
126
126
  if (Array.isArray(t)) {
127
127
  const s = new Set(t.flat(1 / 0).reverse());
128
- for (const n of s) e.unshift(pt(n));
129
- } else t !== void 0 && e.push(pt(t));
128
+ for (const i of s) e.unshift(gt(i));
129
+ } else t !== void 0 && e.push(gt(t));
130
130
  return e;
131
131
  }
132
132
  static _$Eu(t, e) {
@@ -152,7 +152,7 @@ let S = class extends HTMLElement {
152
152
  }
153
153
  createRenderRoot() {
154
154
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
155
- return It(t, this.constructor.elementStyles), t;
155
+ return qt(t, this.constructor.elementStyles), t;
156
156
  }
157
157
  connectedCallback() {
158
158
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
@@ -166,31 +166,31 @@ let S = class extends HTMLElement {
166
166
  this._$AK(t, s);
167
167
  }
168
168
  _$ET(t, e) {
169
- const s = this.constructor.elementProperties.get(t), n = this.constructor._$Eu(t, s);
170
- if (n !== void 0 && s.reflect === !0) {
171
- const o = (s.converter?.toAttribute !== void 0 ? s.converter : B).toAttribute(e, s.type);
172
- this._$Em = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$Em = null;
169
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
170
+ if (i !== void 0 && s.reflect === !0) {
171
+ const n = (s.converter?.toAttribute !== void 0 ? s.converter : K).toAttribute(e, s.type);
172
+ this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
173
173
  }
174
174
  }
175
175
  _$AK(t, e) {
176
- const s = this.constructor, n = s._$Eh.get(t);
177
- if (n !== void 0 && this._$Em !== n) {
178
- const o = s.getPropertyOptions(n), r = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : B;
179
- this._$Em = n;
180
- const l = r.fromAttribute(e, o.type);
181
- this[n] = l ?? this._$Ej?.get(n) ?? l, this._$Em = null;
176
+ const s = this.constructor, i = s._$Eh.get(t);
177
+ if (i !== void 0 && this._$Em !== i) {
178
+ const n = s.getPropertyOptions(i), a = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : K;
179
+ this._$Em = i;
180
+ const l = a.fromAttribute(e, n.type);
181
+ this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null;
182
182
  }
183
183
  }
184
- requestUpdate(t, e, s, n = !1, o) {
184
+ requestUpdate(t, e, s, i = !1, n) {
185
185
  if (t !== void 0) {
186
- const r = this.constructor;
187
- if (n === !1 && (o = this[t]), s ??= r.getPropertyOptions(t), !((s.hasChanged ?? et)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, s)))) return;
186
+ const a = this.constructor;
187
+ if (i === !1 && (n = this[t]), s ??= a.getPropertyOptions(t), !((s.hasChanged ?? ht)(n, e) || s.useDefault && s.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(a._$Eu(t, s)))) return;
188
188
  this.C(t, e, s);
189
189
  }
190
190
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
191
191
  }
192
- C(t, e, { useDefault: s, reflect: n, wrapped: o }, r) {
193
- s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, r ?? e ?? this[t]), o !== !0 || r !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), n === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
192
+ C(t, e, { useDefault: s, reflect: i, wrapped: n }, a) {
193
+ s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, a ?? e ?? this[t]), n !== !0 || a !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
194
194
  }
195
195
  async _$EP() {
196
196
  this.isUpdatePending = !0;
@@ -209,13 +209,13 @@ let S = class extends HTMLElement {
209
209
  if (!this.isUpdatePending) return;
210
210
  if (!this.hasUpdated) {
211
211
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
212
- for (const [n, o] of this._$Ep) this[n] = o;
212
+ for (const [i, n] of this._$Ep) this[i] = n;
213
213
  this._$Ep = void 0;
214
214
  }
215
215
  const s = this.constructor.elementProperties;
216
- if (s.size > 0) for (const [n, o] of s) {
217
- const { wrapped: r } = o, l = this[n];
218
- r !== !0 || this._$AL.has(n) || l === void 0 || this.C(n, void 0, o, l);
216
+ if (s.size > 0) for (const [i, n] of s) {
217
+ const { wrapped: a } = n, l = this[i];
218
+ a !== !0 || this._$AL.has(i) || l === void 0 || this.C(i, void 0, n, l);
219
219
  }
220
220
  }
221
221
  let t = !1;
@@ -252,70 +252,70 @@ let S = class extends HTMLElement {
252
252
  firstUpdated(t) {
253
253
  }
254
254
  };
255
- S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[N("elementProperties")] = /* @__PURE__ */ new Map(), S[N("finalized")] = /* @__PURE__ */ new Map(), Zt?.({ ReactiveElement: S }), (q.reactiveElementVersions ??= []).push("2.1.2");
256
- const it = globalThis, mt = (i) => i, W = it.trustedTypes, ft = W ? W.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, _t = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, bt = "?" + v, Gt = `<${bt}>`, C = document, z = () => C.createComment(""), H = (i) => i === null || typeof i != "object" && typeof i != "function", st = Array.isArray, Jt = (i) => st(i) || typeof i?.[Symbol.iterator] == "function", K = `[
257
- \f\r]`, U = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, yt = /-->/g, gt = />/g, b = RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
258
- \f\r"'\`<>=]|("|')|))|$)`, "g"), xt = /'/g, $t = /"/g, wt = /^(?:script|style|textarea|title)$/i, Kt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), Ft = Kt(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), u = /* @__PURE__ */ Symbol.for("lit-nothing"), At = /* @__PURE__ */ new WeakMap(), w = C.createTreeWalker(C, 129);
259
- function Ct(i, t) {
260
- if (!st(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
261
- return ft !== void 0 ? ft.createHTML(t) : t;
255
+ O.elementStyles = [], O.shadowRootOptions = { mode: "open" }, O[j("elementProperties")] = /* @__PURE__ */ new Map(), O[j("finalized")] = /* @__PURE__ */ new Map(), te?.({ ReactiveElement: O }), (J.reactiveElementVersions ??= []).push("2.1.2");
256
+ const lt = globalThis, vt = (o) => o, F = lt.trustedTypes, At = F ? F.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, Et = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, Lt = "?" + A, ee = `<${Lt}>`, L = document, B = () => L.createComment(""), W = (o) => o === null || typeof o != "object" && typeof o != "function", ct = Array.isArray, ie = (o) => ct(o) || typeof o?.[Symbol.iterator] == "function", ot = `[
257
+ \f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, bt = /-->/g, _t = />/g, T = RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
258
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), wt = /'/g, St = /"/g, Dt = /^(?:script|style|textarea|title)$/i, se = (o) => (t, ...e) => ({ _$litType$: o, strings: t, values: e }), oe = se(1), P = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), E = L.createTreeWalker(L, 129);
259
+ function Ot(o, t) {
260
+ if (!ct(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
261
+ return At !== void 0 ? At.createHTML(t) : t;
262
262
  }
263
- const Qt = (i, t) => {
264
- const e = i.length - 1, s = [];
265
- let n, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", r = U;
263
+ const ne = (o, t) => {
264
+ const e = o.length - 1, s = [];
265
+ let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = H;
266
266
  for (let l = 0; l < e; l++) {
267
- const a = i[l];
268
- let h, c, p = -1, y = 0;
269
- for (; y < a.length && (r.lastIndex = y, c = r.exec(a), c !== null); ) y = r.lastIndex, r === U ? c[1] === "!--" ? r = yt : c[1] !== void 0 ? r = gt : c[2] !== void 0 ? (wt.test(c[2]) && (n = RegExp("</" + c[2], "g")), r = b) : c[3] !== void 0 && (r = b) : r === b ? c[0] === ">" ? (r = n ?? U, p = -1) : c[1] === void 0 ? p = -2 : (p = r.lastIndex - c[2].length, h = c[1], r = c[3] === void 0 ? b : c[3] === '"' ? $t : xt) : r === $t || r === xt ? r = b : r === yt || r === gt ? r = U : (r = b, n = void 0);
270
- const m = r === b && i[l + 1].startsWith("/>") ? " " : "";
271
- o += r === U ? a + Gt : p >= 0 ? (s.push(h), a.slice(0, p) + _t + a.slice(p) + v + m) : a + v + (p === -2 ? l : m);
267
+ const r = o[l];
268
+ let d, h, c = -1, p = 0;
269
+ for (; p < r.length && (a.lastIndex = p, h = a.exec(r), h !== null); ) p = a.lastIndex, a === H ? h[1] === "!--" ? a = bt : h[1] !== void 0 ? a = _t : h[2] !== void 0 ? (Dt.test(h[2]) && (i = RegExp("</" + h[2], "g")), a = T) : h[3] !== void 0 && (a = T) : a === T ? h[0] === ">" ? (a = i ?? H, c = -1) : h[1] === void 0 ? c = -2 : (c = a.lastIndex - h[2].length, d = h[1], a = h[3] === void 0 ? T : h[3] === '"' ? St : wt) : a === St || a === wt ? a = T : a === bt || a === _t ? a = H : (a = T, i = void 0);
270
+ const y = a === T && o[l + 1].startsWith("/>") ? " " : "";
271
+ n += a === H ? r + ee : c >= 0 ? (s.push(d), r.slice(0, c) + Et + r.slice(c) + A + y) : r + A + (c === -2 ? l : y);
272
272
  }
273
- return [Ct(i, o + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
273
+ return [Ot(o, n + (o[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
274
274
  };
275
- class j {
275
+ class Z {
276
276
  constructor({ strings: t, _$litType$: e }, s) {
277
- let n;
277
+ let i;
278
278
  this.parts = [];
279
- let o = 0, r = 0;
280
- const l = t.length - 1, a = this.parts, [h, c] = Qt(t, e);
281
- if (this.el = j.createElement(h, s), w.currentNode = this.el.content, e === 2 || e === 3) {
282
- const p = this.el.content.firstChild;
283
- p.replaceWith(...p.childNodes);
279
+ let n = 0, a = 0;
280
+ const l = t.length - 1, r = this.parts, [d, h] = ne(t, e);
281
+ if (this.el = Z.createElement(d, s), E.currentNode = this.el.content, e === 2 || e === 3) {
282
+ const c = this.el.content.firstChild;
283
+ c.replaceWith(...c.childNodes);
284
284
  }
285
- for (; (n = w.nextNode()) !== null && a.length < l; ) {
286
- if (n.nodeType === 1) {
287
- if (n.hasAttributes()) for (const p of n.getAttributeNames()) if (p.endsWith(_t)) {
288
- const y = c[r++], m = n.getAttribute(p).split(v), g = /([.?@])?(.*)/.exec(y);
289
- a.push({ type: 1, index: o, name: g[2], strings: m, ctor: g[1] === "." ? ee : g[1] === "?" ? ie : g[1] === "@" ? se : V }), n.removeAttribute(p);
290
- } else p.startsWith(v) && (a.push({ type: 6, index: o }), n.removeAttribute(p));
291
- if (wt.test(n.tagName)) {
292
- const p = n.textContent.split(v), y = p.length - 1;
293
- if (y > 0) {
294
- n.textContent = W ? W.emptyScript : "";
295
- for (let m = 0; m < y; m++) n.append(p[m], z()), w.nextNode(), a.push({ type: 2, index: ++o });
296
- n.append(p[y], z());
285
+ for (; (i = E.nextNode()) !== null && r.length < l; ) {
286
+ if (i.nodeType === 1) {
287
+ if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(Et)) {
288
+ const p = h[a++], y = i.getAttribute(c).split(A), x = /([.?@])?(.*)/.exec(p);
289
+ r.push({ type: 1, index: n, name: x[2], strings: y, ctor: x[1] === "." ? re : x[1] === "?" ? he : x[1] === "@" ? le : Q }), i.removeAttribute(c);
290
+ } else c.startsWith(A) && (r.push({ type: 6, index: n }), i.removeAttribute(c));
291
+ if (Dt.test(i.tagName)) {
292
+ const c = i.textContent.split(A), p = c.length - 1;
293
+ if (p > 0) {
294
+ i.textContent = F ? F.emptyScript : "";
295
+ for (let y = 0; y < p; y++) i.append(c[y], B()), E.nextNode(), r.push({ type: 2, index: ++n });
296
+ i.append(c[p], B());
297
297
  }
298
298
  }
299
- } else if (n.nodeType === 8) if (n.data === bt) a.push({ type: 2, index: o });
299
+ } else if (i.nodeType === 8) if (i.data === Lt) r.push({ type: 2, index: n });
300
300
  else {
301
- let p = -1;
302
- for (; (p = n.data.indexOf(v, p + 1)) !== -1; ) a.push({ type: 7, index: o }), p += v.length - 1;
301
+ let c = -1;
302
+ for (; (c = i.data.indexOf(A, c + 1)) !== -1; ) r.push({ type: 7, index: n }), c += A.length - 1;
303
303
  }
304
- o++;
304
+ n++;
305
305
  }
306
306
  }
307
307
  static createElement(t, e) {
308
- const s = C.createElement("template");
308
+ const s = L.createElement("template");
309
309
  return s.innerHTML = t, s;
310
310
  }
311
311
  }
312
- function T(i, t, e = i, s) {
313
- if (t === E) return t;
314
- let n = s !== void 0 ? e._$Co?.[s] : e._$Cl;
315
- const o = H(t) ? void 0 : t._$litDirective$;
316
- return n?.constructor !== o && (n?._$AO?.(!1), o === void 0 ? n = void 0 : (n = new o(i), n._$AT(i, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = n : e._$Cl = n), n !== void 0 && (t = T(i, n._$AS(i, t.values), n, s)), t;
312
+ function M(o, t, e = o, s) {
313
+ if (t === P) return t;
314
+ let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
315
+ const n = W(t) ? void 0 : t._$litDirective$;
316
+ return i?.constructor !== n && (i?._$AO?.(!1), n === void 0 ? i = void 0 : (i = new n(o), i._$AT(o, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = M(o, i._$AS(o, t.values), i, s)), t;
317
317
  }
318
- class te {
318
+ class ae {
319
319
  constructor(t, e) {
320
320
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
321
321
  }
@@ -326,29 +326,29 @@ class te {
326
326
  return this._$AM._$AU;
327
327
  }
328
328
  u(t) {
329
- const { el: { content: e }, parts: s } = this._$AD, n = (t?.creationScope ?? C).importNode(e, !0);
330
- w.currentNode = n;
331
- let o = w.nextNode(), r = 0, l = 0, a = s[0];
332
- for (; a !== void 0; ) {
333
- if (r === a.index) {
334
- let h;
335
- a.type === 2 ? h = new I(o, o.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (h = new ne(o, this, t)), this._$AV.push(h), a = s[++l];
329
+ const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? L).importNode(e, !0);
330
+ E.currentNode = i;
331
+ let n = E.nextNode(), a = 0, l = 0, r = s[0];
332
+ for (; r !== void 0; ) {
333
+ if (a === r.index) {
334
+ let d;
335
+ r.type === 2 ? d = new V(n, n.nextSibling, this, t) : r.type === 1 ? d = new r.ctor(n, r.name, r.strings, this, t) : r.type === 6 && (d = new ce(n, this, t)), this._$AV.push(d), r = s[++l];
336
336
  }
337
- r !== a?.index && (o = w.nextNode(), r++);
337
+ a !== r?.index && (n = E.nextNode(), a++);
338
338
  }
339
- return w.currentNode = C, n;
339
+ return E.currentNode = L, i;
340
340
  }
341
341
  p(t) {
342
342
  let e = 0;
343
343
  for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
344
344
  }
345
345
  }
346
- class I {
346
+ class V {
347
347
  get _$AU() {
348
348
  return this._$AM?._$AU ?? this._$Cv;
349
349
  }
350
- constructor(t, e, s, n) {
351
- this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = n, this._$Cv = n?.isConnected ?? !0;
350
+ constructor(t, e, s, i) {
351
+ this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
352
352
  }
353
353
  get parentNode() {
354
354
  let t = this._$AA.parentNode;
@@ -362,7 +362,7 @@ class I {
362
362
  return this._$AB;
363
363
  }
364
364
  _$AI(t, e = this) {
365
- t = T(this, t, e), H(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Jt(t) ? this.k(t) : this._(t);
365
+ t = M(this, t, e), W(t) ? t === f || t == null || t === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ie(t) ? this.k(t) : this._(t);
366
366
  }
367
367
  O(t) {
368
368
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -371,92 +371,92 @@ class I {
371
371
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
372
372
  }
373
373
  _(t) {
374
- this._$AH !== u && H(this._$AH) ? this._$AA.nextSibling.data = t : this.T(C.createTextNode(t)), this._$AH = t;
374
+ this._$AH !== f && W(this._$AH) ? this._$AA.nextSibling.data = t : this.T(L.createTextNode(t)), this._$AH = t;
375
375
  }
376
376
  $(t) {
377
- const { values: e, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = j.createElement(Ct(s.h, s.h[0]), this.options)), s);
378
- if (this._$AH?._$AD === n) this._$AH.p(e);
377
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = Z.createElement(Ot(s.h, s.h[0]), this.options)), s);
378
+ if (this._$AH?._$AD === i) this._$AH.p(e);
379
379
  else {
380
- const o = new te(n, this), r = o.u(this.options);
381
- o.p(e), this.T(r), this._$AH = o;
380
+ const n = new ae(i, this), a = n.u(this.options);
381
+ n.p(e), this.T(a), this._$AH = n;
382
382
  }
383
383
  }
384
384
  _$AC(t) {
385
- let e = At.get(t.strings);
386
- return e === void 0 && At.set(t.strings, e = new j(t)), e;
385
+ let e = Ct.get(t.strings);
386
+ return e === void 0 && Ct.set(t.strings, e = new Z(t)), e;
387
387
  }
388
388
  k(t) {
389
- st(this._$AH) || (this._$AH = [], this._$AR());
389
+ ct(this._$AH) || (this._$AH = [], this._$AR());
390
390
  const e = this._$AH;
391
- let s, n = 0;
392
- for (const o of t) n === e.length ? e.push(s = new I(this.O(z()), this.O(z()), this, this.options)) : s = e[n], s._$AI(o), n++;
393
- n < e.length && (this._$AR(s && s._$AB.nextSibling, n), e.length = n);
391
+ let s, i = 0;
392
+ for (const n of t) i === e.length ? e.push(s = new V(this.O(B()), this.O(B()), this, this.options)) : s = e[i], s._$AI(n), i++;
393
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
394
394
  }
395
395
  _$AR(t = this._$AA.nextSibling, e) {
396
396
  for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
397
- const s = mt(t).nextSibling;
398
- mt(t).remove(), t = s;
397
+ const s = vt(t).nextSibling;
398
+ vt(t).remove(), t = s;
399
399
  }
400
400
  }
401
401
  setConnected(t) {
402
402
  this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
403
403
  }
404
404
  }
405
- class V {
405
+ class Q {
406
406
  get tagName() {
407
407
  return this.element.tagName;
408
408
  }
409
409
  get _$AU() {
410
410
  return this._$AM._$AU;
411
411
  }
412
- constructor(t, e, s, n, o) {
413
- this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = n, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = u;
412
+ constructor(t, e, s, i, n) {
413
+ this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
414
414
  }
415
- _$AI(t, e = this, s, n) {
416
- const o = this.strings;
417
- let r = !1;
418
- if (o === void 0) t = T(this, t, e, 0), r = !H(t) || t !== this._$AH && t !== E, r && (this._$AH = t);
415
+ _$AI(t, e = this, s, i) {
416
+ const n = this.strings;
417
+ let a = !1;
418
+ if (n === void 0) t = M(this, t, e, 0), a = !W(t) || t !== this._$AH && t !== P, a && (this._$AH = t);
419
419
  else {
420
420
  const l = t;
421
- let a, h;
422
- for (t = o[0], a = 0; a < o.length - 1; a++) h = T(this, l[s + a], e, a), h === E && (h = this._$AH[a]), r ||= !H(h) || h !== this._$AH[a], h === u ? t = u : t !== u && (t += (h ?? "") + o[a + 1]), this._$AH[a] = h;
421
+ let r, d;
422
+ for (t = n[0], r = 0; r < n.length - 1; r++) d = M(this, l[s + r], e, r), d === P && (d = this._$AH[r]), a ||= !W(d) || d !== this._$AH[r], d === f ? t = f : t !== f && (t += (d ?? "") + n[r + 1]), this._$AH[r] = d;
423
423
  }
424
- r && !n && this.j(t);
424
+ a && !i && this.j(t);
425
425
  }
426
426
  j(t) {
427
- t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
427
+ t === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
428
428
  }
429
429
  }
430
- class ee extends V {
430
+ class re extends Q {
431
431
  constructor() {
432
432
  super(...arguments), this.type = 3;
433
433
  }
434
434
  j(t) {
435
- this.element[this.name] = t === u ? void 0 : t;
435
+ this.element[this.name] = t === f ? void 0 : t;
436
436
  }
437
437
  }
438
- class ie extends V {
438
+ class he extends Q {
439
439
  constructor() {
440
440
  super(...arguments), this.type = 4;
441
441
  }
442
442
  j(t) {
443
- this.element.toggleAttribute(this.name, !!t && t !== u);
443
+ this.element.toggleAttribute(this.name, !!t && t !== f);
444
444
  }
445
445
  }
446
- class se extends V {
447
- constructor(t, e, s, n, o) {
448
- super(t, e, s, n, o), this.type = 5;
446
+ class le extends Q {
447
+ constructor(t, e, s, i, n) {
448
+ super(t, e, s, i, n), this.type = 5;
449
449
  }
450
450
  _$AI(t, e = this) {
451
- if ((t = T(this, t, e, 0) ?? u) === E) return;
452
- const s = this._$AH, n = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== u && (s === u || n);
453
- n && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
451
+ if ((t = M(this, t, e, 0) ?? f) === P) return;
452
+ const s = this._$AH, i = t === f && s !== f || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== f && (s === f || i);
453
+ i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
454
454
  }
455
455
  handleEvent(t) {
456
456
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
457
457
  }
458
458
  }
459
- class ne {
459
+ class ce {
460
460
  constructor(t, e, s) {
461
461
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
462
462
  }
@@ -464,22 +464,22 @@ class ne {
464
464
  return this._$AM._$AU;
465
465
  }
466
466
  _$AI(t) {
467
- T(this, t);
467
+ M(this, t);
468
468
  }
469
469
  }
470
- const oe = it.litHtmlPolyfillSupport;
471
- oe?.(j, I), (it.litHtmlVersions ??= []).push("3.3.2");
472
- const re = (i, t, e) => {
470
+ const de = lt.litHtmlPolyfillSupport;
471
+ de?.(Z, V), (lt.litHtmlVersions ??= []).push("3.3.2");
472
+ const pe = (o, t, e) => {
473
473
  const s = e?.renderBefore ?? t;
474
- let n = s._$litPart$;
475
- if (n === void 0) {
476
- const o = e?.renderBefore ?? null;
477
- s._$litPart$ = n = new I(t.insertBefore(z(), o), o, void 0, e ?? {});
474
+ let i = s._$litPart$;
475
+ if (i === void 0) {
476
+ const n = e?.renderBefore ?? null;
477
+ s._$litPart$ = i = new V(t.insertBefore(B(), n), n, void 0, e ?? {});
478
478
  }
479
- return n._$AI(i), n;
479
+ return i._$AI(o), i;
480
480
  };
481
- const nt = globalThis;
482
- class R extends S {
481
+ const dt = globalThis;
482
+ class k extends O {
483
483
  constructor() {
484
484
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
485
485
  }
@@ -489,7 +489,7 @@ class R extends S {
489
489
  }
490
490
  update(t) {
491
491
  const e = this.render();
492
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = re(e, this.renderRoot, this.renderOptions);
492
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = pe(e, this.renderRoot, this.renderOptions);
493
493
  }
494
494
  connectedCallback() {
495
495
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -498,79 +498,79 @@ class R extends S {
498
498
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
499
499
  }
500
500
  render() {
501
- return E;
501
+ return P;
502
502
  }
503
503
  }
504
- R._$litElement$ = !0, R.finalized = !0, nt.litElementHydrateSupport?.({ LitElement: R });
505
- const ae = nt.litElementPolyfillSupport;
506
- ae?.({ LitElement: R });
507
- (nt.litElementVersions ??= []).push("4.2.2");
508
- const he = (i) => (t, e) => {
504
+ k._$litElement$ = !0, k.finalized = !0, dt.litElementHydrateSupport?.({ LitElement: k });
505
+ const ue = dt.litElementPolyfillSupport;
506
+ ue?.({ LitElement: k });
507
+ (dt.litElementVersions ??= []).push("4.2.2");
508
+ const me = (o) => (t, e) => {
509
509
  e !== void 0 ? e.addInitializer(() => {
510
- customElements.define(i, t);
511
- }) : customElements.define(i, t);
510
+ customElements.define(o, t);
511
+ }) : customElements.define(o, t);
512
512
  };
513
- const le = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: et }, ce = (i = le, t, e) => {
514
- const { kind: s, metadata: n } = e;
515
- let o = globalThis.litPropertyMetadata.get(n);
516
- if (o === void 0 && globalThis.litPropertyMetadata.set(n, o = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), o.set(e.name, i), s === "accessor") {
517
- const { name: r } = e;
513
+ const fe = { attribute: !0, type: String, converter: K, reflect: !1, hasChanged: ht }, ye = (o = fe, t, e) => {
514
+ const { kind: s, metadata: i } = e;
515
+ let n = globalThis.litPropertyMetadata.get(i);
516
+ if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((o = Object.create(o)).wrapped = !0), n.set(e.name, o), s === "accessor") {
517
+ const { name: a } = e;
518
518
  return { set(l) {
519
- const a = t.get.call(this);
520
- t.set.call(this, l), this.requestUpdate(r, a, i, !0, l);
519
+ const r = t.get.call(this);
520
+ t.set.call(this, l), this.requestUpdate(a, r, o, !0, l);
521
521
  }, init(l) {
522
- return l !== void 0 && this.C(r, void 0, i, l), l;
522
+ return l !== void 0 && this.C(a, void 0, o, l), l;
523
523
  } };
524
524
  }
525
525
  if (s === "setter") {
526
- const { name: r } = e;
526
+ const { name: a } = e;
527
527
  return function(l) {
528
- const a = this[r];
529
- t.call(this, l), this.requestUpdate(r, a, i, !0, l);
528
+ const r = this[a];
529
+ t.call(this, l), this.requestUpdate(a, r, o, !0, l);
530
530
  };
531
531
  }
532
532
  throw Error("Unsupported decorator location: " + s);
533
533
  };
534
- function X(i) {
535
- return (t, e) => typeof e == "object" ? ce(i, t, e) : ((s, n, o) => {
536
- const r = n.hasOwnProperty(o);
537
- return n.constructor.createProperty(o, s), r ? Object.getOwnPropertyDescriptor(n, o) : void 0;
538
- })(i, t, e);
534
+ function tt(o) {
535
+ return (t, e) => typeof e == "object" ? ye(o, t, e) : ((s, i, n) => {
536
+ const a = i.hasOwnProperty(n);
537
+ return i.constructor.createProperty(n, s), a ? Object.getOwnPropertyDescriptor(i, n) : void 0;
538
+ })(o, t, e);
539
539
  }
540
- function Y(i) {
541
- return X({ ...i, state: !0, attribute: !1 });
540
+ function et(o) {
541
+ return tt({ ...o, state: !0, attribute: !1 });
542
542
  }
543
- const pe = (i, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(i, t, e), e);
544
- function de(i, t) {
545
- return (e, s, n) => {
546
- const o = (r) => r.renderRoot?.querySelector(i) ?? null;
547
- return pe(e, s, { get() {
548
- return o(this);
543
+ const ge = (o, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(o, t, e), e);
544
+ function xe(o, t) {
545
+ return (e, s, i) => {
546
+ const n = (a) => a.renderRoot?.querySelector(o) ?? null;
547
+ return ge(e, s, { get() {
548
+ return n(this);
549
549
  } });
550
550
  };
551
551
  }
552
- var ue = Object.defineProperty, me = Object.getOwnPropertyDescriptor, $ = (i, t, e, s) => {
553
- for (var n = s > 1 ? void 0 : s ? me(t, e) : t, o = i.length - 1, r; o >= 0; o--)
554
- (r = i[o]) && (n = (s ? r(t, e, n) : r(n)) || n);
555
- return s && n && ue(t, e, n), n;
552
+ var $e = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, $ = (o, t, e, s) => {
553
+ for (var i = s > 1 ? void 0 : s ? ve(t, e) : t, n = o.length - 1, a; n >= 0; n--)
554
+ (a = o[n]) && (i = (s ? a(t, e, i) : a(i)) || i);
555
+ return s && i && $e(t, e, i), i;
556
556
  };
557
- F.use([
558
- St,
559
- Et,
560
- Tt,
561
- Dt,
562
- Lt,
563
- Ot,
557
+ nt.use([
564
558
  Pt,
565
559
  Mt,
560
+ Nt,
566
561
  Ut,
567
562
  zt,
568
- Nt,
569
- Rt
563
+ Rt,
564
+ It,
565
+ Ht,
566
+ jt,
567
+ Wt,
568
+ kt,
569
+ Bt
570
570
  ]);
571
- let x = class extends R {
571
+ let g = class extends k {
572
572
  constructor() {
573
- super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.7.1", this.updateThresholdMs = 300, this.maxIntervalSamples = 3, this.template = {
573
+ super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.7.2", this.updateThresholdMs = 300, this.maxIntervalSamples = 3, this.template = {
574
574
  title: {
575
575
  text: "Temperature Change in the Coming Week",
576
576
  left: "center",
@@ -693,82 +693,130 @@ let x = class extends R {
693
693
  ]
694
694
  };
695
695
  }
696
- update(i) {
697
- i.has("inputData") && (this.cachedXAxisType = void 0, this.cachedYAxisType = void 0), i.has("inputData") && this.chartContainer && (this.transformData(), this.applyData()), i.has("theme") && (this.registerTheme(this.theme), this.deleteCharts(), this.transformData(), this.applyData()), super.update(i);
696
+ update(o) {
697
+ o.has("inputData") && (this.cachedXAxisType = void 0, this.cachedYAxisType = void 0), o.has("inputData") && this.chartContainer && (this.transformData(), this.applyData()), o.has("theme") && (this.registerTheme(this.theme), this.deleteCharts(), this.transformData(), this.applyData()), super.update(o);
698
698
  }
699
- firstUpdated(i) {
699
+ firstUpdated(o) {
700
700
  this.registerTheme(this.theme), this.transformData(), this.applyData(), this.chartContainer && (this.resizeObserver = new ResizeObserver(() => {
701
701
  this.canvasList.forEach((t) => {
702
702
  t.echart?.resize();
703
703
  });
704
704
  }), this.resizeObserver.observe(this.chartContainer));
705
705
  }
706
- registerTheme(i) {
706
+ registerTheme(o) {
707
707
  const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), e = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
708
- if (this.themeBgColor = e || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = t || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = t || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor, !i || !i.theme_object || !i.theme_name) return;
709
- const s = ["parallel", "geo", "timeline", "visualMap", "markPoint"], n = Object.fromEntries(
710
- Object.entries(i.theme_object).filter(([o]) => !s.includes(o))
708
+ if (this.themeBgColor = e || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = t || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = t || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor, !o || !o.theme_object || !o.theme_name) return;
709
+ const s = ["parallel", "geo", "timeline", "visualMap", "markPoint"], i = Object.fromEntries(
710
+ Object.entries(o.theme_object).filter(([n]) => !s.includes(n))
711
711
  );
712
- F.registerTheme(i.theme_name, n);
712
+ nt.registerTheme(o.theme_name, i);
713
+ }
714
+ /** True when bars grow to the right instead of upwards (axis.orientation). */
715
+ isHorizontal() {
716
+ return this.inputData?.axis?.orientation === "horizontal";
717
+ }
718
+ /**
719
+ * Index of the measured y-value inside a data point's `value` tuple.
720
+ *
721
+ * A point is stored as `[x, y, r]` for a vertical chart. A horizontal chart
722
+ * swaps the first two entries to `[y, x, r]`, because ECharts always maps
723
+ * tuple index 0 to the x axis and index 1 to the y axis — and in a
724
+ * horizontal chart the measured value is what belongs on the x axis.
725
+ */
726
+ valueIndex() {
727
+ return this.isHorizontal() ? 0 : 1;
728
+ }
729
+ /** Index of the x-value (category/timestamp) inside a data point's `value` tuple. */
730
+ categoryIndex() {
731
+ return this.isHorizontal() ? 1 : 0;
732
+ }
733
+ /**
734
+ * Formatter for the on-chart value labels (styling.showValueLabels).
735
+ * Rounds to two decimals to match the numeric axis labels, and leaves
736
+ * categorical y-values untouched.
737
+ */
738
+ valueLabelFormatter(o) {
739
+ return (t) => {
740
+ const e = Array.isArray(t?.value) ? t.value[o] : t?.value;
741
+ if (e == null || e === "") return "";
742
+ const s = Number(e);
743
+ return isNaN(s) ? String(e) : String(Math.round(s * 100) / 100);
744
+ };
713
745
  }
714
746
  transformData() {
715
747
  if (!this?.inputData?.dataseries?.length) return;
716
- this.canvasList.forEach((t) => {
717
- t.series = [], t.doomed = !0;
718
- }), this.inputData.dataseries.sort((t, e) => (t.advanced?.drawOrder ?? 0) - (e.advanced?.drawOrder ?? 0)), this.inputData.dataseries.forEach((t) => {
719
- t.advanced ??= {}, t.advanced.chartName ??= "", t.data ??= [];
720
- const e = [...new Set(t.data.map((o) => o.pivot ?? ""))].sort(), s = lt(t.backgroundColor).monochromatic(e.length).map((o) => o.toHexString()), n = lt(t.borderColor).monochromatic(e.length).map((o) => o.toHexString());
721
- e.forEach((o, r) => {
722
- const l = o ?? "", a = t.label ?? "", h = l + (l && a ? " - " : "") + a, c = t.borderColor ? t.advanced?.chartName?.includes("#split#") ? t.borderColor : n[r] : void 0, p = t.backgroundColor ? t.advanced?.chartName?.includes("#split#") ? t.backgroundColor : s[r] : void 0, y = e.length === 1 ? t.data : t.data?.filter((d) => d.pivot === o);
723
- let m = this.inputData?.axis?.timeseries ? y?.map((d) => ({ name: d.x, value: [new Date(d.x ?? "").getTime(), d.y, d.r] })) ?? [] : y?.map((d) => ({ name: d.x, value: [d.x, d.y, d.r] })) ?? [], g = 0, D = 0;
724
- if (this.xAxisType() === "time" && m) {
725
- const d = m.map((f) => f.value[0]);
726
- g = Math.min(...d), D = Math.max(...d);
748
+ const o = this.isHorizontal(), t = this.valueIndex(), e = this.categoryIndex();
749
+ this.canvasList.forEach((i) => {
750
+ i.series = [], i.doomed = !0;
751
+ }), this.inputData.dataseries.sort((i, n) => (i.advanced?.drawOrder ?? 0) - (n.advanced?.drawOrder ?? 0)), this.inputData.dataseries.forEach((i) => {
752
+ i.advanced ??= {}, i.advanced.chartName ??= "", i.data ??= [];
753
+ const n = [...new Set(i.data.map((r) => r.pivot ?? ""))].sort(), a = ft(i.backgroundColor).monochromatic(n.length).map((r) => r.toHexString()), l = ft(i.borderColor).monochromatic(n.length).map((r) => r.toHexString());
754
+ n.forEach((r, d) => {
755
+ const h = r ?? "", c = i.label ?? "", p = h + (h && c ? " - " : "") + c, y = i.borderColor ? i.advanced?.chartName?.includes("#split#") ? i.borderColor : l[d] : void 0, x = i.backgroundColor ? i.advanced?.chartName?.includes("#split#") ? i.backgroundColor : a[d] : void 0, q = n.length === 1 ? i.data : i.data?.filter((u) => u.pivot === r), b = (u, S, m) => o ? [S, u, m] : [u, S, m];
756
+ let v = this.inputData?.axis?.timeseries ? q?.map((u) => ({
757
+ name: u.x,
758
+ value: b(new Date(u.x ?? "").getTime(), u.y, u.r)
759
+ })) ?? [] : q?.map((u) => ({ name: u.x, value: b(u.x, u.y, u.r) })) ?? [], N = 0, U = 0;
760
+ if (this.xAxisType() === "time" && v) {
761
+ const u = v.map((S) => S.value[e]);
762
+ N = Math.min(...u), U = Math.max(...u);
727
763
  }
728
- const L = {
729
- id: h,
730
- name: h,
731
- minDate: g,
732
- maxDate: D,
733
- type: t.type ?? "line",
764
+ const z = i.yAxis === "right" ? 1 : 0, R = {
765
+ id: p,
766
+ name: p,
767
+ minDate: N,
768
+ maxDate: U,
769
+ type: i.type ?? "line",
734
770
  lineStyle: {
735
- color: c,
736
- width: t.styling?.borderWidth ?? 2,
737
- type: t.styling?.borderDash ?? "solid"
771
+ color: y,
772
+ width: i.styling?.borderWidth ?? 2,
773
+ type: i.styling?.borderDash ?? "solid"
738
774
  },
739
775
  smooth: !1,
740
776
  itemStyle: {
741
- color: p,
742
- borderColor: c,
743
- borderWidth: t.styling?.borderWidth ?? 2
777
+ color: x,
778
+ borderColor: y,
779
+ borderWidth: i.styling?.borderWidth ?? 2
744
780
  },
745
- areaStyle: t.styling?.fill ? { color: p } : void 0,
746
- symbol: t.styling?.pointStyle ?? "circle",
747
- symbolSize: (d) => d[2] ?? 0,
748
- showSymbol: t.styling?.pointStyle !== "none",
749
- data: m ?? [],
750
- drawOrder: t.advanced?.drawOrder ?? 0,
751
- yAxisIndex: t.yAxis === "right" ? 1 : 0
781
+ areaStyle: i.styling?.fill ? { color: x } : void 0,
782
+ symbol: i.styling?.pointStyle ?? "circle",
783
+ symbolSize: (u) => u[2] ?? 0,
784
+ showSymbol: i.styling?.pointStyle !== "none",
785
+ label: {
786
+ show: i.styling?.showValueLabels ?? !1,
787
+ // Bars grow upwards when vertical and rightwards when
788
+ // horizontal, so the label sits past the growing end.
789
+ position: o ? "right" : "top",
790
+ fontSize: 12,
791
+ formatter: this.valueLabelFormatter(t)
792
+ },
793
+ data: v ?? [],
794
+ drawOrder: i.advanced?.drawOrder ?? 0,
795
+ valueAxisIndex: z,
796
+ // The secondary value axis is the right y axis when vertical
797
+ // and the top x axis when horizontal.
798
+ xAxisIndex: o ? z : 0,
799
+ yAxisIndex: o ? 0 : z
752
800
  };
753
- let O = t.advanced?.chartName ?? "";
754
- O = O.replace("#split#", l);
755
- const P = this.setupChart(O), M = P?.series.map((d) => d.id) ?? [];
756
- let A = h, Z = 2;
757
- for (; M.includes(A); )
758
- A = `${h}_${Z++}`;
759
- L.id = A, P?.series.push(L);
801
+ let _ = i.advanced?.chartName ?? "";
802
+ _ = _.replace("#split#", h);
803
+ const w = this.setupChart(_), X = w?.series.map((u) => u.id) ?? [];
804
+ let D = p, it = 2;
805
+ for (; X.includes(D); )
806
+ D = `${p}_${it++}`;
807
+ R.id = D, w?.series.push(R);
760
808
  });
761
809
  });
762
- const i = [];
763
- this.canvasList.forEach((t, e) => {
764
- t.doomed && (t.echart?.dispose(), t.element?.remove(), i.push(e));
765
- }), i.forEach((t) => this.canvasList.delete(t)), this.canvasList = new Map(
766
- [...this.canvasList.entries()].sort(([t, e], [s, n]) => {
767
- const o = e.series?.[0].drawOrder ?? 0, r = n.series?.[0].drawOrder ?? 0;
768
- return o !== r ? o - r : t.localeCompare(s);
810
+ const s = [];
811
+ this.canvasList.forEach((i, n) => {
812
+ i.doomed && (i.echart?.dispose(), i.element?.remove(), s.push(n));
813
+ }), s.forEach((i) => this.canvasList.delete(i)), this.canvasList = new Map(
814
+ [...this.canvasList.entries()].sort(([i, n], [a, l]) => {
815
+ const r = n.series?.[0].drawOrder ?? 0, d = l.series?.[0].drawOrder ?? 0;
816
+ return r !== d ? r - d : i.localeCompare(a);
769
817
  })
770
- ), i.length > 0 && this.canvasList.forEach((t) => {
771
- t.echart?.resize();
818
+ ), s.length > 0 && this.canvasList.forEach((i) => {
819
+ i.echart?.resize();
772
820
  });
773
821
  }
774
822
  xAxisType() {
@@ -776,8 +824,8 @@ let x = class extends R {
776
824
  if (this.inputData?.axis?.timeseries)
777
825
  return this.cachedXAxisType = "time", this.cachedXAxisType;
778
826
  this.cachedXAxisType = "value";
779
- for (const i of this.inputData?.dataseries ?? []) {
780
- const t = i.data?.find((e) => e.x !== void 0 && e.x !== null);
827
+ for (const o of this.inputData?.dataseries ?? []) {
828
+ const t = o.data?.find((e) => e.x !== void 0 && e.x !== null);
781
829
  if (t) {
782
830
  this.cachedXAxisType = isNaN(Number(t.x)) ? "category" : "value";
783
831
  break;
@@ -788,8 +836,8 @@ let x = class extends R {
788
836
  yAxisType() {
789
837
  if (this.cachedYAxisType) return this.cachedYAxisType;
790
838
  this.cachedYAxisType = "value";
791
- for (const i of this.inputData?.dataseries ?? []) {
792
- const t = i.data?.find((e) => e.y !== void 0 && e.y !== null);
839
+ for (const o of this.inputData?.dataseries ?? []) {
840
+ const t = o.data?.find((e) => e.y !== void 0 && e.y !== null);
793
841
  if (t) {
794
842
  this.cachedYAxisType = isNaN(Number(t.y)) ? "category" : "value";
795
843
  break;
@@ -797,124 +845,165 @@ let x = class extends R {
797
845
  }
798
846
  return this.cachedYAxisType;
799
847
  }
800
- calculateAnimationDuration(i, t) {
848
+ calculateAnimationDuration(o, t) {
801
849
  const e = Date.now();
802
- if (!(i.series.length === 1) || !this.inputData?.axis?.timeseries)
850
+ if (!(o.series.length === 1) || !this.inputData?.axis?.timeseries)
803
851
  return this.updateThresholdMs;
804
- let n = 0;
852
+ let i = 0;
805
853
  if (this.xAxisType() === "time")
806
- for (const l of i.series) {
807
- const a = l.data;
808
- for (const h of a || []) {
809
- const c = h.value?.[0] || 0;
810
- c > n && (n = c);
854
+ for (const l of o.series) {
855
+ const r = l.data;
856
+ for (const d of r || []) {
857
+ const h = d.value?.[0] || 0;
858
+ h > i && (i = h);
811
859
  }
812
860
  }
813
861
  else
814
- n = e;
815
- if (i.lastMaxTimestamp = i.lastMaxTimestamp ?? 0, n > i.lastMaxTimestamp) {
816
- if (i.updateIntervals ??= [], i.lastUpdateTime > 0) {
817
- const l = e - i.lastUpdateTime;
818
- i.updateIntervals.push(l), i.updateIntervals.length > this.maxIntervalSamples && i.updateIntervals.shift();
862
+ i = e;
863
+ if (o.lastMaxTimestamp = o.lastMaxTimestamp ?? 0, i > o.lastMaxTimestamp) {
864
+ if (o.updateIntervals ??= [], o.lastUpdateTime > 0) {
865
+ const l = e - o.lastUpdateTime;
866
+ o.updateIntervals.push(l), o.updateIntervals.length > this.maxIntervalSamples && o.updateIntervals.shift();
819
867
  }
820
- i.lastUpdateTime = e, i.lastMaxTimestamp = n;
868
+ o.lastUpdateTime = e, o.lastMaxTimestamp = i;
821
869
  }
822
- return i.updateIntervals && i.updateIntervals.length > 0 ? i.updateIntervals.reduce((l, a) => l + a, 0) / i.updateIntervals.length : this.updateThresholdMs;
870
+ return o.updateIntervals && o.updateIntervals.length > 0 ? o.updateIntervals.reduce((l, r) => l + r, 0) / o.updateIntervals.length : this.updateThresholdMs;
823
871
  }
824
872
  applyData() {
825
- if (this.chartContainer) {
826
- for (const i of this.canvasList.values())
827
- i.element && this.chartContainer.appendChild(i.element);
828
- this.canvasList.forEach((i, t) => {
829
- i.series.sort((f, G) => f.name > G.name ? 1 : -1);
830
- const e = this.inputData?.axis?.showLegend ?? !0, s = this.inputData?.axis?.showTitle ?? !0, n = this.inputData?.axis?.showXAxis ?? !0, o = this.inputData?.axis?.showYAxis ?? !0, r = this.inputData?.axis?.showBox ?? !1, l = JSON.stringify({
831
- showLegend: e,
832
- showTitle: s,
833
- showXAxis: n,
834
- showYAxis: o,
835
- showBox: r,
836
- xAxisLabel: this.inputData?.axis?.xAxisLabel,
837
- yAxisLabel: this.inputData?.axis?.yAxisLabel,
838
- xAxisZoom: this.inputData?.axis?.xAxisZoom,
839
- yAxisScaling: this.inputData?.axis?.yAxisScaling,
840
- yAxisLabelRight: this.inputData?.axis?.yAxisLabelRight,
841
- yAxisScalingRight: this.inputData?.axis?.yAxisScalingRight,
842
- xAxisType: this.xAxisType(),
843
- yAxisType: this.yAxisType(),
844
- seriesCount: i.series.length,
845
- seriesNames: i.series.map((f) => f.name).join(","),
846
- seriesAxes: i.series.map((f) => f.yAxisIndex ?? 0).join(",")
847
- }), a = i.lastConfig !== l;
848
- i.lastConfig = l;
849
- const h = a ? window.structuredClone(this.template) : i.echart?.getOption() ?? window.structuredClone(this.template);
850
- if (h.title.text = t, h.title.show = s, h.xAxis.name = this.inputData?.axis?.xAxisLabel ?? "", h.xAxis.type = this.xAxisType(), h.xAxis.show = n, this.xAxisType() === "time") {
851
- const f = i.series.map((_) => _.minDate ?? 1 / 0).reduce((_, J) => Math.min(_, J), 1 / 0), G = i.series.map((_) => _.maxDate ?? 0).reduce((_, J) => Math.max(_, J), 0), ot = Number(this.timeRange?.start), rt = Number(this.timeRange?.end), at = isNaN(ot) ? f : ot, ht = isNaN(rt) ? G : rt;
852
- h.xAxis = {
853
- ...h.xAxis,
854
- min: at !== 1 / 0 ? at : (/* @__PURE__ */ new Date()).getTime() - 1440 * 60 * 1e3,
855
- max: ht !== 0 ? ht : (/* @__PURE__ */ new Date()).getTime()
856
- };
857
- }
858
- h.dataZoom[0].show = this.inputData?.axis?.xAxisZoom ?? !1, h.toolbox.show = this.inputData?.axis?.xAxisZoom ?? !1;
859
- const c = Array.isArray(h.yAxis) ? h.yAxis : [h.yAxis ?? {}];
860
- for (; c.length < 2; ) c.push({});
861
- h.yAxis = c;
862
- const p = i.series.some((f) => (f.yAxisIndex ?? 0) === 1), y = i.series.length === 0 || i.series.some((f) => (f.yAxisIndex ?? 0) === 0), m = o && y, g = o && p, D = this.inputData?.axis?.yAxisLabel ?? "", L = this.inputData?.axis?.yAxisLabelRight ?? "", O = m && !!D, P = g && !!L, M = this.yAxisType(), A = ["value", "log"].includes(M ?? "") ? { fontSize: 14, formatter: (f) => Math.round(f * 100) / 100 } : void 0;
863
- Object.assign(c[0], {
864
- type: M,
865
- name: D,
866
- scale: this.inputData?.axis?.yAxisScaling ?? !1,
867
- show: m,
868
- position: "left",
869
- nameLocation: "end",
870
- nameGap: 10,
871
- nameTextStyle: { align: "left" },
872
- axisLine: { show: !0 }
873
- }), A && (c[0].axisLabel = A), Object.assign(c[1], {
874
- type: M,
875
- name: g ? L : "",
876
- scale: this.inputData?.axis?.yAxisScalingRight ?? !1,
877
- show: g,
878
- position: "right",
879
- nameLocation: "end",
880
- nameGap: 10,
881
- nameTextStyle: { align: "right" },
882
- axisLine: { show: !0 },
883
- splitLine: { show: !1 }
884
- }), A && (c[1].axisLabel = A), h.series = i.series, h.legend.show = e;
885
- const Z = (s || O || P ? 30 : 0) + (e && P ? 25 : 0);
886
- h.grid = {
887
- ...h.grid,
888
- show: r,
889
- backgroundColor: "transparent",
890
- borderWidth: r ? 1 : 0,
891
- borderColor: this.themeTitleColor ?? "#ccc",
892
- top: Z,
893
- bottom: n ? 20 : 0,
894
- left: m ? 20 : 0,
895
- right: 0,
896
- containLabel: n || o
873
+ if (!this.chartContainer) return;
874
+ const o = this.isHorizontal();
875
+ for (const t of this.canvasList.values())
876
+ t.element && this.chartContainer.appendChild(t.element);
877
+ this.canvasList.forEach((t, e) => {
878
+ t.series.sort((m, I) => m.name > I.name ? 1 : -1);
879
+ const s = this.inputData?.axis?.showLegend ?? !0, i = this.inputData?.axis?.showTitle ?? !0, n = this.inputData?.axis?.showXAxis ?? !0, a = this.inputData?.axis?.showYAxis ?? !0, l = this.inputData?.axis?.showBox ?? !1, r = JSON.stringify({
880
+ showLegend: s,
881
+ showTitle: i,
882
+ showXAxis: n,
883
+ showYAxis: a,
884
+ showBox: l,
885
+ xAxisLabel: this.inputData?.axis?.xAxisLabel,
886
+ yAxisLabel: this.inputData?.axis?.yAxisLabel,
887
+ xAxisZoom: this.inputData?.axis?.xAxisZoom,
888
+ yAxisScaling: this.inputData?.axis?.yAxisScaling,
889
+ yAxisLabelRight: this.inputData?.axis?.yAxisLabelRight,
890
+ yAxisScalingRight: this.inputData?.axis?.yAxisScalingRight,
891
+ xAxisType: this.xAxisType(),
892
+ yAxisType: this.yAxisType(),
893
+ // Flipping the orientation swaps which option key holds the
894
+ // single category axis and which holds the value-axis array,
895
+ // so it must force a notMerge rebuild rather than a merge.
896
+ orientation: this.inputData?.axis?.orientation ?? "vertical",
897
+ seriesCount: t.series.length,
898
+ seriesNames: t.series.map((m) => m.name).join(","),
899
+ seriesAxes: t.series.map((m) => m.valueAxisIndex ?? 0).join(","),
900
+ seriesLabels: t.series.map((m) => m.label?.show ? 1 : 0).join(",")
901
+ }), d = t.lastConfig !== r;
902
+ t.lastConfig = r;
903
+ const h = d ? window.structuredClone(this.template) : t.echart?.getOption() ?? window.structuredClone(this.template);
904
+ if (h.title.text = e, h.title.show = i, h.xAxis.name = this.inputData?.axis?.xAxisLabel ?? "", h.xAxis.type = this.xAxisType(), h.xAxis.show = n, this.xAxisType() === "time") {
905
+ const m = t.series.map((C) => C.minDate ?? 1 / 0).reduce((C, st) => Math.min(C, st), 1 / 0), I = t.series.map((C) => C.maxDate ?? 0).reduce((C, st) => Math.max(C, st), 0), Y = Number(this.timeRange?.start), pt = Number(this.timeRange?.end), ut = isNaN(Y) ? m : Y, mt = isNaN(pt) ? I : pt;
906
+ h.xAxis = {
907
+ ...h.xAxis,
908
+ min: ut !== 1 / 0 ? ut : (/* @__PURE__ */ new Date()).getTime() - 1440 * 60 * 1e3,
909
+ max: mt !== 0 ? mt : (/* @__PURE__ */ new Date()).getTime()
897
910
  };
898
- const d = this.updateThresholdMs;
899
- h.animation = !0, h.animationEasing = "linear", h.animationDuration = d, h.animationDurationUpdate = d, i.echart?.on("finished", () => i.drawing = !1), i.drawing = !0, i.echart?.setOption(h, { notMerge: a, lazyUpdate: !0 });
900
- });
901
- }
911
+ }
912
+ const c = this.inputData?.axis?.xAxisZoom ?? !1;
913
+ h.dataZoom[0].show = c, h.toolbox.show = c;
914
+ const p = Array.isArray(h.yAxis) ? h.yAxis : [h.yAxis ?? {}];
915
+ for (; p.length < 2; ) p.push({});
916
+ h.yAxis = p;
917
+ const y = t.series.some((m) => !!m.label?.show), x = t.series.some((m) => (m.valueAxisIndex ?? 0) === 1), q = t.series.length === 0 || t.series.some((m) => (m.valueAxisIndex ?? 0) === 0), b = a && q, v = a && x, N = this.inputData?.axis?.yAxisLabel ?? "", U = this.inputData?.axis?.yAxisLabelRight ?? "", z = b && !!N, R = v && !!U, _ = this.yAxisType(), w = ["value", "log"].includes(_ ?? "") ? { fontSize: 14, formatter: (m) => Math.round(m * 100) / 100 } : void 0;
918
+ if (Object.assign(p[0], {
919
+ type: _,
920
+ name: N,
921
+ scale: this.inputData?.axis?.yAxisScaling ?? !1,
922
+ show: b,
923
+ position: "left",
924
+ nameLocation: "end",
925
+ nameGap: 10,
926
+ nameTextStyle: { align: "left" },
927
+ axisLine: { show: !0 }
928
+ }), w && (p[0].axisLabel = w), Object.assign(p[1], {
929
+ type: _,
930
+ name: v ? U : "",
931
+ scale: this.inputData?.axis?.yAxisScalingRight ?? !1,
932
+ show: v,
933
+ position: "right",
934
+ nameLocation: "end",
935
+ nameGap: 10,
936
+ nameTextStyle: { align: "right" },
937
+ axisLine: { show: !0 },
938
+ splitLine: { show: !1 }
939
+ }), w && (p[1].axisLabel = w), o) {
940
+ const m = Array.isArray(h.xAxis) ? h.xAxis[0] : h.xAxis;
941
+ h.yAxis = {
942
+ ...m,
943
+ position: "left",
944
+ // Read top-to-bottom, so the first data point is the top
945
+ // bar — the convention for ranked horizontal bar charts.
946
+ inverse: !0,
947
+ // 'start' is the top of an inverted axis, which keeps the
948
+ // axis name clear of the value axis running along the bottom.
949
+ // When a secondary value axis is in use it is drawn along
950
+ // the top, so the name has to clear its tick labels too.
951
+ nameLocation: "start",
952
+ nameGap: v ? 30 : 10,
953
+ nameTextStyle: { align: "left" }
954
+ }, h.xAxis = p.map((I, Y) => ({
955
+ ...I,
956
+ position: Y === 0 ? "bottom" : "top",
957
+ nameLocation: "middle",
958
+ nameGap: 27,
959
+ nameTextStyle: { align: "center" }
960
+ })), h.dataZoom = [
961
+ { ...h.dataZoom?.[0] ?? {}, xAxisIndex: void 0, yAxisIndex: [0] }
962
+ ];
963
+ }
964
+ h.series = t.series, h.legend.show = s;
965
+ const X = (i || z || R ? 30 : 0) + (s && R ? 25 : 0), D = 40, it = c && !o ? D : 0, u = c && o ? D : 0;
966
+ h.grid = {
967
+ ...h.grid,
968
+ show: l,
969
+ backgroundColor: "transparent",
970
+ borderWidth: l ? 1 : 0,
971
+ borderColor: this.themeTitleColor ?? "#ccc",
972
+ top: X,
973
+ // The category axis sits at the bottom when vertical and on the
974
+ // left when horizontal; the value axis is the other way round.
975
+ // The zoom slider is not accounted for by `containLabel`, so its
976
+ // thickness has to be reserved here as well — see ZOOM_THICKNESS.
977
+ bottom: ((o ? b : n) ? 20 : 0) + it,
978
+ left: (o ? n : b) ? 20 : 0,
979
+ // A horizontal chart grows towards the right edge, so the last
980
+ // axis tick and any value label printed past the end of a bar
981
+ // need room that `containLabel` does not reserve for them.
982
+ right: (o ? y ? 45 : 15 : 0) + u,
983
+ containLabel: n || a
984
+ }, c && Object.assign(
985
+ h.dataZoom[0],
986
+ o ? { right: 0, top: X, bottom: 20, left: void 0 } : { bottom: 0, left: void 0, right: void 0, top: void 0 }
987
+ );
988
+ const S = this.updateThresholdMs;
989
+ h.animation = !0, h.animationEasing = "linear", h.animationDuration = S, h.animationDurationUpdate = S, t.echart?.on("finished", () => t.drawing = !1), t.drawing = !0, t.echart?.setOption(h, { notMerge: d, lazyUpdate: !0 });
990
+ });
902
991
  }
903
992
  deleteCharts() {
904
- this.canvasList.forEach((i, t) => {
905
- i.echart?.dispose(), i.element?.remove(), this.canvasList.delete(t);
993
+ this.canvasList.forEach((o, t) => {
994
+ o.echart?.dispose(), o.element?.remove(), this.canvasList.delete(t);
906
995
  });
907
996
  }
908
- setupChart(i) {
909
- const t = this.canvasList.get(i);
997
+ setupChart(o) {
998
+ const t = this.canvasList.get(o);
910
999
  if (t)
911
1000
  return delete t.doomed, t;
912
1001
  if (!this.chartContainer)
913
1002
  return;
914
1003
  const e = document.createElement("div");
915
- e.setAttribute("name", i), e.setAttribute("class", "sizer"), this.chartContainer.appendChild(e);
916
- const n = {
917
- echart: F.init(e, this.theme?.theme_name),
1004
+ e.setAttribute("name", o), e.setAttribute("class", "sizer"), this.chartContainer.appendChild(e);
1005
+ const i = {
1006
+ echart: nt.init(e, this.theme?.theme_name),
918
1007
  series: [],
919
1008
  element: e,
920
1009
  drawing: !1,
@@ -922,13 +1011,13 @@ let x = class extends R {
922
1011
  updateIntervals: [],
923
1012
  lastMaxTimestamp: 0
924
1013
  };
925
- return this.canvasList.set(i, n), n;
1014
+ return this.canvasList.set(o, i), i;
926
1015
  }
927
1016
  disconnectedCallback() {
928
1017
  this.resizeObserver && this.chartContainer && (this.resizeObserver.unobserve(this.chartContainer), this.resizeObserver.disconnect()), super.disconnectedCallback();
929
1018
  }
930
1019
  render() {
931
- return Ft`
1020
+ return oe`
932
1021
  <div
933
1022
  class="wrapper"
934
1023
  style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
@@ -951,7 +1040,7 @@ let x = class extends R {
951
1040
  `;
952
1041
  }
953
1042
  };
954
- x.styles = jt`
1043
+ g.styles = Vt`
955
1044
  :host {
956
1045
  display: block;
957
1046
  font-family: sans-serif;
@@ -1029,33 +1118,33 @@ x.styles = jt`
1029
1118
  }
1030
1119
  `;
1031
1120
  $([
1032
- X({ type: Object })
1033
- ], x.prototype, "inputData", 2);
1121
+ tt({ type: Object })
1122
+ ], g.prototype, "inputData", 2);
1034
1123
  $([
1035
- X({ type: Object })
1036
- ], x.prototype, "theme", 2);
1124
+ tt({ type: Object })
1125
+ ], g.prototype, "theme", 2);
1037
1126
  $([
1038
- X({ type: Object })
1039
- ], x.prototype, "timeRange", 2);
1127
+ tt({ type: Object })
1128
+ ], g.prototype, "timeRange", 2);
1040
1129
  $([
1041
- Y()
1042
- ], x.prototype, "canvasList", 2);
1130
+ et()
1131
+ ], g.prototype, "canvasList", 2);
1043
1132
  $([
1044
- Y()
1045
- ], x.prototype, "themeBgColor", 2);
1133
+ et()
1134
+ ], g.prototype, "themeBgColor", 2);
1046
1135
  $([
1047
- Y()
1048
- ], x.prototype, "themeTitleColor", 2);
1136
+ et()
1137
+ ], g.prototype, "themeTitleColor", 2);
1049
1138
  $([
1050
- Y()
1051
- ], x.prototype, "themeSubtitleColor", 2);
1139
+ et()
1140
+ ], g.prototype, "themeSubtitleColor", 2);
1052
1141
  $([
1053
- de(".chart-container")
1054
- ], x.prototype, "chartContainer", 2);
1055
- x = $([
1056
- he("widget-linechart-1.7.1")
1057
- ], x);
1142
+ xe(".chart-container")
1143
+ ], g.prototype, "chartContainer", 2);
1144
+ g = $([
1145
+ me("widget-linechart-1.7.2")
1146
+ ], g);
1058
1147
  export {
1059
- x as WidgetLinechart
1148
+ g as WidgetLinechart
1060
1149
  };
1061
1150
  //# sourceMappingURL=widget-linechart.js.map