@ironflock/widget-value 1.1.36 → 1.1.38
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/widget-value.js +371 -349
- package/dist/widget-value.js.map +1 -1
- package/package.json +2 -8
- package/src/definition-schema.d.ts +2 -2
- package/src/definition-schema.json +2 -2
- package/src/widget-value.ts +117 -76
package/dist/widget-value.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const N = globalThis,
|
|
2
|
-
let
|
|
3
|
-
constructor(t, e,
|
|
4
|
-
if (this._$cssResult$ = !0,
|
|
1
|
+
const N = globalThis, F = N.ShadowRoot && (N.ShadyCSS === void 0 || N.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Z = /* @__PURE__ */ Symbol(), tt = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let $t = class {
|
|
3
|
+
constructor(t, e, r) {
|
|
4
|
+
if (this._$cssResult$ = !0, r !== Z) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
if (F && t === void 0) {
|
|
11
|
+
const r = e !== void 0 && e.length === 1;
|
|
12
|
+
r && (t = tt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && tt.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,28 +17,28 @@ let dt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e = i.length === 1 ? i[0] : t.reduce(((
|
|
20
|
+
const At = (i) => new $t(typeof i == "string" ? i : i + "", void 0, Z), bt = (i, ...t) => {
|
|
21
|
+
const e = i.length === 1 ? i[0] : t.reduce(((r, s, n) => r + ((o) => {
|
|
22
22
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
23
23
|
if (typeof o == "number") return o;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
25
|
+
})(s) + i[n + 1]), i[0]);
|
|
26
|
+
return new $t(e, i, Z);
|
|
27
|
+
}, xt = (i, t) => {
|
|
28
|
+
if (F) i.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const r = document.createElement("style"), s = N.litNonce;
|
|
31
|
+
s !== void 0 && r.setAttribute("nonce", s), r.textContent = e.cssText, i.appendChild(r);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, et = F ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
|
-
for (const
|
|
36
|
-
return
|
|
35
|
+
for (const r of t.cssRules) e += r.cssText;
|
|
36
|
+
return At(e);
|
|
37
37
|
})(i) : i;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: St, defineProperty: wt, getOwnPropertyDescriptor: Ct, getOwnPropertyNames: Et, getOwnPropertySymbols: Tt, getPrototypeOf: Pt } = Object, k = globalThis, it = k.trustedTypes, Mt = it ? it.emptyScript : "", Ot = k.reactiveElementPolyfillSupport, M = (i, t) => i, R = { toAttribute(i, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
i = i ?
|
|
41
|
+
i = i ? Mt : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,8 +63,8 @@ const { is: At, defineProperty: bt, getOwnPropertyDescriptor: xt, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
66
|
+
} }, J = (i, t) => !St(i, t), st = { attribute: !0, type: String, converter: R, reflect: !1, useDefault: !1, hasChanged: J };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), k.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let w = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
@@ -72,60 +72,60 @@ let w = class extends HTMLElement {
|
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(t, e =
|
|
75
|
+
static createProperty(t, e = st) {
|
|
76
76
|
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) {
|
|
77
|
-
const
|
|
78
|
-
|
|
77
|
+
const r = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(t, r, e);
|
|
78
|
+
s !== void 0 && wt(this.prototype, t, s);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
static getPropertyDescriptor(t, e,
|
|
82
|
-
const { get:
|
|
81
|
+
static getPropertyDescriptor(t, e, r) {
|
|
82
|
+
const { get: s, set: n } = Ct(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(o) {
|
|
85
85
|
this[e] = o;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const
|
|
89
|
-
n?.call(this, o), this.requestUpdate(t,
|
|
87
|
+
return { get: s, set(o) {
|
|
88
|
+
const h = s?.call(this);
|
|
89
|
+
n?.call(this, o), this.requestUpdate(t, h, r);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? st;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const t =
|
|
96
|
+
if (this.hasOwnProperty(M("elementProperties"))) return;
|
|
97
|
+
const t = Pt(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const e = this.properties,
|
|
104
|
-
for (const
|
|
101
|
+
if (this.hasOwnProperty(M("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
|
|
103
|
+
const e = this.properties, r = [...Et(e), ...Tt(e)];
|
|
104
|
+
for (const s of r) this.createProperty(s, e[s]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
107
107
|
if (t !== null) {
|
|
108
108
|
const e = litPropertyMetadata.get(t);
|
|
109
|
-
if (e !== void 0) for (const [
|
|
109
|
+
if (e !== void 0) for (const [r, s] of e) this.elementProperties.set(r, s);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
|
-
for (const [e,
|
|
113
|
-
const
|
|
114
|
-
|
|
112
|
+
for (const [e, r] of this.elementProperties) {
|
|
113
|
+
const s = this._$Eu(e, r);
|
|
114
|
+
s !== void 0 && this._$Eh.set(s, e);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
118
118
|
static finalizeStyles(t) {
|
|
119
119
|
const e = [];
|
|
120
120
|
if (Array.isArray(t)) {
|
|
121
|
-
const
|
|
122
|
-
for (const
|
|
123
|
-
} else t !== void 0 && e.push(
|
|
121
|
+
const r = new Set(t.flat(1 / 0).reverse());
|
|
122
|
+
for (const s of r) e.unshift(et(s));
|
|
123
|
+
} else t !== void 0 && e.push(et(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(t, e) {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
127
|
+
const r = e.attribute;
|
|
128
|
+
return r === !1 ? void 0 : typeof r == "string" ? r : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
129
129
|
}
|
|
130
130
|
constructor() {
|
|
131
131
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -141,12 +141,12 @@ let w = class extends HTMLElement {
|
|
|
141
141
|
}
|
|
142
142
|
_$E_() {
|
|
143
143
|
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
144
|
-
for (const
|
|
144
|
+
for (const r of e.keys()) this.hasOwnProperty(r) && (t.set(r, this[r]), delete this[r]);
|
|
145
145
|
t.size > 0 && (this._$Ep = t);
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return xt(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
@@ -156,33 +156,33 @@ let w = class extends HTMLElement {
|
|
|
156
156
|
disconnectedCallback() {
|
|
157
157
|
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
158
158
|
}
|
|
159
|
-
attributeChangedCallback(t, e,
|
|
160
|
-
this._$AK(t,
|
|
159
|
+
attributeChangedCallback(t, e, r) {
|
|
160
|
+
this._$AK(t, r);
|
|
161
161
|
}
|
|
162
162
|
_$ET(t, e) {
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
const n = (
|
|
166
|
-
this._$Em = t, n == null ? this.removeAttribute(
|
|
163
|
+
const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
|
|
164
|
+
if (s !== void 0 && r.reflect === !0) {
|
|
165
|
+
const n = (r.converter?.toAttribute !== void 0 ? r.converter : R).toAttribute(e, r.type);
|
|
166
|
+
this._$Em = t, n == null ? this.removeAttribute(s) : this.setAttribute(s, n), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
const n =
|
|
173
|
-
this._$Em =
|
|
170
|
+
const r = this.constructor, s = r._$Eh.get(t);
|
|
171
|
+
if (s !== void 0 && this._$Em !== s) {
|
|
172
|
+
const n = r.getPropertyOptions(s), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : R;
|
|
173
|
+
this._$Em = s, this[s] = o.fromAttribute(e, n.type) ?? this._$Ej?.get(s) ?? null, this._$Em = null;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
requestUpdate(t, e,
|
|
176
|
+
requestUpdate(t, e, r) {
|
|
177
177
|
if (t !== void 0) {
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
this.C(t, e,
|
|
178
|
+
const s = this.constructor, n = this[t];
|
|
179
|
+
if (r ??= s.getPropertyOptions(t), !((r.hasChanged ?? J)(n, e) || r.useDefault && r.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(s._$Eu(t, r)))) return;
|
|
180
|
+
this.C(t, e, r);
|
|
181
181
|
}
|
|
182
182
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
183
183
|
}
|
|
184
|
-
C(t, e, { useDefault:
|
|
185
|
-
|
|
184
|
+
C(t, e, { useDefault: r, reflect: s, wrapped: n }, o) {
|
|
185
|
+
r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || r || (e = void 0), this._$AL.set(t, e)), s === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
186
186
|
}
|
|
187
187
|
async _$EP() {
|
|
188
188
|
this.isUpdatePending = !0;
|
|
@@ -201,21 +201,21 @@ let w = class extends HTMLElement {
|
|
|
201
201
|
if (!this.isUpdatePending) return;
|
|
202
202
|
if (!this.hasUpdated) {
|
|
203
203
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
204
|
-
for (const [
|
|
204
|
+
for (const [s, n] of this._$Ep) this[s] = n;
|
|
205
205
|
this._$Ep = void 0;
|
|
206
206
|
}
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const { wrapped: o } = n,
|
|
210
|
-
o !== !0 || this._$AL.has(
|
|
207
|
+
const r = this.constructor.elementProperties;
|
|
208
|
+
if (r.size > 0) for (const [s, n] of r) {
|
|
209
|
+
const { wrapped: o } = n, h = this[s];
|
|
210
|
+
o !== !0 || this._$AL.has(s) || h === void 0 || this.C(s, void 0, n, h);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
let t = !1;
|
|
214
214
|
const e = this._$AL;
|
|
215
215
|
try {
|
|
216
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((
|
|
217
|
-
} catch (
|
|
218
|
-
throw t = !1, this._$EM(),
|
|
216
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((r) => r.hostUpdate?.())), this.update(e)) : this._$EM();
|
|
217
|
+
} catch (r) {
|
|
218
|
+
throw t = !1, this._$EM(), r;
|
|
219
219
|
}
|
|
220
220
|
t && this._$AE(e);
|
|
221
221
|
}
|
|
@@ -244,70 +244,70 @@ let w = class extends HTMLElement {
|
|
|
244
244
|
firstUpdated(t) {
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
|
-
w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[
|
|
248
|
-
const
|
|
249
|
-
\f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
250
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
251
|
-
function
|
|
252
|
-
if (!
|
|
253
|
-
return
|
|
247
|
+
w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[M("elementProperties")] = /* @__PURE__ */ new Map(), w[M("finalized")] = /* @__PURE__ */ new Map(), Ot?.({ ReactiveElement: w }), (k.reactiveElementVersions ??= []).push("2.1.0");
|
|
248
|
+
const K = globalThis, j = K.trustedTypes, rt = j ? j.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ft = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, gt = "?" + _, Ut = `<${gt}>`, x = document, U = () => x.createComment(""), D = (i) => i === null || typeof i != "object" && typeof i != "function", Q = Array.isArray, Dt = (i) => Q(i) || typeof i?.[Symbol.iterator] == "function", V = `[
|
|
249
|
+
\f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, nt = /-->/g, ot = />/g, y = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
|
|
250
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), at = /'/g, lt = /"/g, mt = /^(?:script|style|textarea|title)$/i, zt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), W = zt(1), S = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), b = x.createTreeWalker(x, 129);
|
|
251
|
+
function vt(i, t) {
|
|
252
|
+
if (!Q(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
253
|
+
return rt !== void 0 ? rt.createHTML(t) : t;
|
|
254
254
|
}
|
|
255
|
-
const
|
|
256
|
-
const e = i.length - 1,
|
|
257
|
-
let
|
|
258
|
-
for (let
|
|
259
|
-
const a = i[
|
|
260
|
-
let
|
|
261
|
-
for (;
|
|
262
|
-
const
|
|
263
|
-
n += o === T ? a +
|
|
264
|
-
}
|
|
265
|
-
return [
|
|
255
|
+
const Nt = (i, t) => {
|
|
256
|
+
const e = i.length - 1, r = [];
|
|
257
|
+
let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = T;
|
|
258
|
+
for (let h = 0; h < e; h++) {
|
|
259
|
+
const a = i[h];
|
|
260
|
+
let u, c, l = -1, d = 0;
|
|
261
|
+
for (; d < a.length && (o.lastIndex = d, c = o.exec(a), c !== null); ) d = o.lastIndex, o === T ? c[1] === "!--" ? o = nt : c[1] !== void 0 ? o = ot : c[2] !== void 0 ? (mt.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = y) : c[3] !== void 0 && (o = y) : o === y ? c[0] === ">" ? (o = s ?? T, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, u = c[1], o = c[3] === void 0 ? y : c[3] === '"' ? lt : at) : o === lt || o === at ? o = y : o === nt || o === ot ? o = T : (o = y, s = void 0);
|
|
262
|
+
const p = o === y && i[h + 1].startsWith("/>") ? " " : "";
|
|
263
|
+
n += o === T ? a + Ut : l >= 0 ? (r.push(u), a.slice(0, l) + ft + a.slice(l) + _ + p) : a + _ + (l === -2 ? h : p);
|
|
264
|
+
}
|
|
265
|
+
return [vt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
266
266
|
};
|
|
267
|
-
class
|
|
268
|
-
constructor({ strings: t, _$litType$: e },
|
|
269
|
-
let
|
|
267
|
+
class z {
|
|
268
|
+
constructor({ strings: t, _$litType$: e }, r) {
|
|
269
|
+
let s;
|
|
270
270
|
this.parts = [];
|
|
271
271
|
let n = 0, o = 0;
|
|
272
|
-
const
|
|
273
|
-
if (this.el =
|
|
272
|
+
const h = t.length - 1, a = this.parts, [u, c] = Nt(t, e);
|
|
273
|
+
if (this.el = z.createElement(u, r), b.currentNode = this.el.content, e === 2 || e === 3) {
|
|
274
274
|
const l = this.el.content.firstChild;
|
|
275
275
|
l.replaceWith(...l.childNodes);
|
|
276
276
|
}
|
|
277
|
-
for (; (
|
|
278
|
-
if (
|
|
279
|
-
if (
|
|
280
|
-
const
|
|
281
|
-
a.push({ type: 1, index: n, name:
|
|
282
|
-
} else l.startsWith(_) && (a.push({ type: 6, index: n }),
|
|
283
|
-
if (
|
|
284
|
-
const l =
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
for (let
|
|
288
|
-
|
|
277
|
+
for (; (s = b.nextNode()) !== null && a.length < h; ) {
|
|
278
|
+
if (s.nodeType === 1) {
|
|
279
|
+
if (s.hasAttributes()) for (const l of s.getAttributeNames()) if (l.endsWith(ft)) {
|
|
280
|
+
const d = c[o++], p = s.getAttribute(l).split(_), $ = /([.?@])?(.*)/.exec(d);
|
|
281
|
+
a.push({ type: 1, index: n, name: $[2], strings: p, ctor: $[1] === "." ? Rt : $[1] === "?" ? jt : $[1] === "@" ? kt : L }), s.removeAttribute(l);
|
|
282
|
+
} else l.startsWith(_) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
|
|
283
|
+
if (mt.test(s.tagName)) {
|
|
284
|
+
const l = s.textContent.split(_), d = l.length - 1;
|
|
285
|
+
if (d > 0) {
|
|
286
|
+
s.textContent = j ? j.emptyScript : "";
|
|
287
|
+
for (let p = 0; p < d; p++) s.append(l[p], U()), b.nextNode(), a.push({ type: 2, index: ++n });
|
|
288
|
+
s.append(l[d], U());
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
} else if (
|
|
291
|
+
} else if (s.nodeType === 8) if (s.data === gt) a.push({ type: 2, index: n });
|
|
292
292
|
else {
|
|
293
293
|
let l = -1;
|
|
294
|
-
for (; (l =
|
|
294
|
+
for (; (l = s.data.indexOf(_, l + 1)) !== -1; ) a.push({ type: 7, index: n }), l += _.length - 1;
|
|
295
295
|
}
|
|
296
296
|
n++;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
static createElement(t, e) {
|
|
300
|
-
const
|
|
301
|
-
return
|
|
300
|
+
const r = x.createElement("template");
|
|
301
|
+
return r.innerHTML = t, r;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
function C(i, t, e = i,
|
|
304
|
+
function C(i, t, e = i, r) {
|
|
305
305
|
if (t === S) return t;
|
|
306
|
-
let
|
|
307
|
-
const n =
|
|
308
|
-
return
|
|
306
|
+
let s = r !== void 0 ? e._$Co?.[r] : e._$Cl;
|
|
307
|
+
const n = D(t) ? void 0 : t._$litDirective$;
|
|
308
|
+
return s?.constructor !== n && (s?._$AO?.(!1), n === void 0 ? s = void 0 : (s = new n(i), s._$AT(i, e, r)), r !== void 0 ? (e._$Co ??= [])[r] = s : e._$Cl = s), s !== void 0 && (t = C(i, s._$AS(i, t.values), s, r)), t;
|
|
309
309
|
}
|
|
310
|
-
let
|
|
310
|
+
let Ht = class {
|
|
311
311
|
constructor(t, e) {
|
|
312
312
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
313
313
|
}
|
|
@@ -318,29 +318,29 @@ let zt = class {
|
|
|
318
318
|
return this._$AM._$AU;
|
|
319
319
|
}
|
|
320
320
|
u(t) {
|
|
321
|
-
const { el: { content: e }, parts:
|
|
322
|
-
b.currentNode =
|
|
323
|
-
let n = b.nextNode(), o = 0,
|
|
321
|
+
const { el: { content: e }, parts: r } = this._$AD, s = (t?.creationScope ?? x).importNode(e, !0);
|
|
322
|
+
b.currentNode = s;
|
|
323
|
+
let n = b.nextNode(), o = 0, h = 0, a = r[0];
|
|
324
324
|
for (; a !== void 0; ) {
|
|
325
325
|
if (o === a.index) {
|
|
326
|
-
let
|
|
327
|
-
a.type === 2 ?
|
|
326
|
+
let u;
|
|
327
|
+
a.type === 2 ? u = new E(n, n.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (u = new Lt(n, this, t)), this._$AV.push(u), a = r[++h];
|
|
328
328
|
}
|
|
329
329
|
o !== a?.index && (n = b.nextNode(), o++);
|
|
330
330
|
}
|
|
331
|
-
return b.currentNode = x,
|
|
331
|
+
return b.currentNode = x, s;
|
|
332
332
|
}
|
|
333
333
|
p(t) {
|
|
334
334
|
let e = 0;
|
|
335
|
-
for (const
|
|
335
|
+
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, e), e += r.strings.length - 2) : r._$AI(t[e])), e++;
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
class E {
|
|
339
339
|
get _$AU() {
|
|
340
340
|
return this._$AM?._$AU ?? this._$Cv;
|
|
341
341
|
}
|
|
342
|
-
constructor(t, e,
|
|
343
|
-
this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM =
|
|
342
|
+
constructor(t, e, r, s) {
|
|
343
|
+
this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = r, this.options = s, this._$Cv = s?.isConnected ?? !0;
|
|
344
344
|
}
|
|
345
345
|
get parentNode() {
|
|
346
346
|
let t = this._$AA.parentNode;
|
|
@@ -354,7 +354,7 @@ class E {
|
|
|
354
354
|
return this._$AB;
|
|
355
355
|
}
|
|
356
356
|
_$AI(t, e = this) {
|
|
357
|
-
t = C(this, t, e),
|
|
357
|
+
t = C(this, t, e), D(t) ? t === f || t == null || t === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Dt(t) ? this.k(t) : this._(t);
|
|
358
358
|
}
|
|
359
359
|
O(t) {
|
|
360
360
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -363,31 +363,31 @@ class E {
|
|
|
363
363
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
364
364
|
}
|
|
365
365
|
_(t) {
|
|
366
|
-
this._$AH !== f &&
|
|
366
|
+
this._$AH !== f && D(this._$AH) ? this._$AA.nextSibling.data = t : this.T(x.createTextNode(t)), this._$AH = t;
|
|
367
367
|
}
|
|
368
368
|
$(t) {
|
|
369
|
-
const { values: e, _$litType$:
|
|
370
|
-
if (this._$AH?._$AD ===
|
|
369
|
+
const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = z.createElement(vt(r.h, r.h[0]), this.options)), r);
|
|
370
|
+
if (this._$AH?._$AD === s) this._$AH.p(e);
|
|
371
371
|
else {
|
|
372
|
-
const n = new
|
|
372
|
+
const n = new Ht(s, this), o = n.u(this.options);
|
|
373
373
|
n.p(e), this.T(o), this._$AH = n;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
_$AC(t) {
|
|
377
|
-
let e =
|
|
378
|
-
return e === void 0 &&
|
|
377
|
+
let e = ht.get(t.strings);
|
|
378
|
+
return e === void 0 && ht.set(t.strings, e = new z(t)), e;
|
|
379
379
|
}
|
|
380
380
|
k(t) {
|
|
381
|
-
|
|
381
|
+
Q(this._$AH) || (this._$AH = [], this._$AR());
|
|
382
382
|
const e = this._$AH;
|
|
383
|
-
let
|
|
384
|
-
for (const n of t)
|
|
385
|
-
|
|
383
|
+
let r, s = 0;
|
|
384
|
+
for (const n of t) s === e.length ? e.push(r = new E(this.O(U()), this.O(U()), this, this.options)) : r = e[s], r._$AI(n), s++;
|
|
385
|
+
s < e.length && (this._$AR(r && r._$AB.nextSibling, s), e.length = s);
|
|
386
386
|
}
|
|
387
387
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
388
388
|
for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
|
|
389
|
-
const
|
|
390
|
-
t.remove(), t =
|
|
389
|
+
const r = t.nextSibling;
|
|
390
|
+
t.remove(), t = r;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
setConnected(t) {
|
|
@@ -401,25 +401,25 @@ class L {
|
|
|
401
401
|
get _$AU() {
|
|
402
402
|
return this._$AM._$AU;
|
|
403
403
|
}
|
|
404
|
-
constructor(t, e,
|
|
405
|
-
this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM =
|
|
404
|
+
constructor(t, e, r, s, n) {
|
|
405
|
+
this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = f;
|
|
406
406
|
}
|
|
407
|
-
_$AI(t, e = this,
|
|
407
|
+
_$AI(t, e = this, r, s) {
|
|
408
408
|
const n = this.strings;
|
|
409
409
|
let o = !1;
|
|
410
|
-
if (n === void 0) t = C(this, t, e, 0), o = !
|
|
410
|
+
if (n === void 0) t = C(this, t, e, 0), o = !D(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
|
|
411
411
|
else {
|
|
412
|
-
const
|
|
413
|
-
let a,
|
|
414
|
-
for (t = n[0], a = 0; a < n.length - 1; a++)
|
|
412
|
+
const h = t;
|
|
413
|
+
let a, u;
|
|
414
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) u = C(this, h[r + a], e, a), u === S && (u = this._$AH[a]), o ||= !D(u) || u !== this._$AH[a], u === f ? t = f : t !== f && (t += (u ?? "") + n[a + 1]), this._$AH[a] = u;
|
|
415
415
|
}
|
|
416
|
-
o && !
|
|
416
|
+
o && !s && this.j(t);
|
|
417
417
|
}
|
|
418
418
|
j(t) {
|
|
419
419
|
t === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
class
|
|
422
|
+
class Rt extends L {
|
|
423
423
|
constructor() {
|
|
424
424
|
super(...arguments), this.type = 3;
|
|
425
425
|
}
|
|
@@ -427,7 +427,7 @@ class Dt extends L {
|
|
|
427
427
|
this.element[this.name] = t === f ? void 0 : t;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
class
|
|
430
|
+
class jt extends L {
|
|
431
431
|
constructor() {
|
|
432
432
|
super(...arguments), this.type = 4;
|
|
433
433
|
}
|
|
@@ -435,22 +435,22 @@ class Nt extends L {
|
|
|
435
435
|
this.element.toggleAttribute(this.name, !!t && t !== f);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class
|
|
439
|
-
constructor(t, e,
|
|
440
|
-
super(t, e,
|
|
438
|
+
class kt extends L {
|
|
439
|
+
constructor(t, e, r, s, n) {
|
|
440
|
+
super(t, e, r, s, n), this.type = 5;
|
|
441
441
|
}
|
|
442
442
|
_$AI(t, e = this) {
|
|
443
443
|
if ((t = C(this, t, e, 0) ?? f) === S) return;
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const r = this._$AH, s = t === f && r !== f || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, n = t !== f && (r === f || s);
|
|
445
|
+
s && this.element.removeEventListener(this.name, this, r), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
446
446
|
}
|
|
447
447
|
handleEvent(t) {
|
|
448
448
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
class
|
|
452
|
-
constructor(t, e,
|
|
453
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
451
|
+
class Lt {
|
|
452
|
+
constructor(t, e, r) {
|
|
453
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
|
|
454
454
|
}
|
|
455
455
|
get _$AU() {
|
|
456
456
|
return this._$AM._$AU;
|
|
@@ -459,19 +459,19 @@ class Rt {
|
|
|
459
459
|
C(this, t);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
const
|
|
466
|
-
let
|
|
467
|
-
if (
|
|
462
|
+
const Bt = { I: E }, It = K.litHtmlPolyfillSupport;
|
|
463
|
+
It?.(z, E), (K.litHtmlVersions ??= []).push("3.3.0");
|
|
464
|
+
const Vt = (i, t, e) => {
|
|
465
|
+
const r = e?.renderBefore ?? t;
|
|
466
|
+
let s = r._$litPart$;
|
|
467
|
+
if (s === void 0) {
|
|
468
468
|
const n = e?.renderBefore ?? null;
|
|
469
|
-
|
|
469
|
+
r._$litPart$ = s = new E(t.insertBefore(U(), n), n, void 0, e ?? {});
|
|
470
470
|
}
|
|
471
|
-
return
|
|
471
|
+
return s._$AI(i), s;
|
|
472
472
|
};
|
|
473
|
-
const
|
|
474
|
-
let
|
|
473
|
+
const G = globalThis;
|
|
474
|
+
let O = class extends w {
|
|
475
475
|
constructor() {
|
|
476
476
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
477
477
|
}
|
|
@@ -481,7 +481,7 @@ let M = class extends w {
|
|
|
481
481
|
}
|
|
482
482
|
update(t) {
|
|
483
483
|
const e = this.render();
|
|
484
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
484
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Vt(e, this.renderRoot, this.renderOptions);
|
|
485
485
|
}
|
|
486
486
|
connectedCallback() {
|
|
487
487
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -493,19 +493,19 @@ let M = class extends w {
|
|
|
493
493
|
return S;
|
|
494
494
|
}
|
|
495
495
|
};
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
(
|
|
500
|
-
const
|
|
501
|
-
class
|
|
496
|
+
O._$litElement$ = !0, O.finalized = !0, G.litElementHydrateSupport?.({ LitElement: O });
|
|
497
|
+
const Wt = G.litElementPolyfillSupport;
|
|
498
|
+
Wt?.({ LitElement: O });
|
|
499
|
+
(G.litElementVersions ??= []).push("4.2.0");
|
|
500
|
+
const qt = { CHILD: 2 }, Ft = (i) => (...t) => ({ _$litDirective$: i, values: t });
|
|
501
|
+
class Zt {
|
|
502
502
|
constructor(t) {
|
|
503
503
|
}
|
|
504
504
|
get _$AU() {
|
|
505
505
|
return this._$AM._$AU;
|
|
506
506
|
}
|
|
507
|
-
_$AT(t, e,
|
|
508
|
-
this._$Ct = t, this._$AM = e, this._$Ci =
|
|
507
|
+
_$AT(t, e, r) {
|
|
508
|
+
this._$Ct = t, this._$AM = e, this._$Ci = r;
|
|
509
509
|
}
|
|
510
510
|
_$AS(t, e) {
|
|
511
511
|
return this.update(t, e);
|
|
@@ -514,160 +514,170 @@ class Wt {
|
|
|
514
514
|
return this.render(...e);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
const { I:
|
|
518
|
-
const
|
|
517
|
+
const { I: Jt } = Bt, ct = () => document.createComment(""), P = (i, t, e) => {
|
|
518
|
+
const r = i._$AA.parentNode, s = t === void 0 ? i._$AB : t._$AA;
|
|
519
519
|
if (e === void 0) {
|
|
520
|
-
const n =
|
|
521
|
-
e = new
|
|
520
|
+
const n = r.insertBefore(ct(), s), o = r.insertBefore(ct(), s);
|
|
521
|
+
e = new Jt(n, o, i, i.options);
|
|
522
522
|
} else {
|
|
523
|
-
const n = e._$AB.nextSibling, o = e._$AM,
|
|
524
|
-
if (
|
|
523
|
+
const n = e._$AB.nextSibling, o = e._$AM, h = o !== i;
|
|
524
|
+
if (h) {
|
|
525
525
|
let a;
|
|
526
526
|
e._$AQ?.(i), e._$AM = i, e._$AP !== void 0 && (a = i._$AU) !== o._$AU && e._$AP(a);
|
|
527
527
|
}
|
|
528
|
-
if (n !==
|
|
528
|
+
if (n !== s || h) {
|
|
529
529
|
let a = e._$AA;
|
|
530
530
|
for (; a !== n; ) {
|
|
531
|
-
const
|
|
532
|
-
|
|
531
|
+
const u = a.nextSibling;
|
|
532
|
+
r.insertBefore(a, s), a = u;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
return e;
|
|
537
|
-
}, A = (i, t, e = i) => (i._$AI(t, e), i),
|
|
537
|
+
}, A = (i, t, e = i) => (i._$AI(t, e), i), Kt = {}, Qt = (i, t = Kt) => i._$AH = t, Gt = (i) => i._$AH, q = (i) => {
|
|
538
538
|
i._$AP?.(!1, !0);
|
|
539
539
|
let t = i._$AA;
|
|
540
540
|
const e = i._$AB.nextSibling;
|
|
541
541
|
for (; t !== e; ) {
|
|
542
|
-
const
|
|
543
|
-
t.remove(), t =
|
|
542
|
+
const r = t.nextSibling;
|
|
543
|
+
t.remove(), t = r;
|
|
544
544
|
}
|
|
545
545
|
};
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
for (let
|
|
549
|
-
return
|
|
550
|
-
},
|
|
546
|
+
const ut = (i, t, e) => {
|
|
547
|
+
const r = /* @__PURE__ */ new Map();
|
|
548
|
+
for (let s = t; s <= e; s++) r.set(i[s], s);
|
|
549
|
+
return r;
|
|
550
|
+
}, dt = Ft(class extends Zt {
|
|
551
551
|
constructor(i) {
|
|
552
|
-
if (super(i), i.type !==
|
|
552
|
+
if (super(i), i.type !== qt.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
553
553
|
}
|
|
554
554
|
dt(i, t, e) {
|
|
555
|
-
let
|
|
556
|
-
e === void 0 ? e = t : t !== void 0 && (
|
|
557
|
-
const
|
|
555
|
+
let r;
|
|
556
|
+
e === void 0 ? e = t : t !== void 0 && (r = t);
|
|
557
|
+
const s = [], n = [];
|
|
558
558
|
let o = 0;
|
|
559
|
-
for (const
|
|
560
|
-
return { values: n, keys:
|
|
559
|
+
for (const h of i) s[o] = r ? r(h, o) : o, n[o] = e(h, o), o++;
|
|
560
|
+
return { values: n, keys: s };
|
|
561
561
|
}
|
|
562
562
|
render(i, t, e) {
|
|
563
563
|
return this.dt(i, t, e).values;
|
|
564
564
|
}
|
|
565
|
-
update(i, [t, e,
|
|
566
|
-
const
|
|
567
|
-
if (!Array.isArray(
|
|
568
|
-
const
|
|
569
|
-
let
|
|
570
|
-
for (; l <=
|
|
571
|
-
else if (
|
|
572
|
-
else if (
|
|
573
|
-
else if (
|
|
574
|
-
else if (
|
|
575
|
-
else if (
|
|
576
|
-
else if (
|
|
577
|
-
const g =
|
|
578
|
-
if (
|
|
579
|
-
const
|
|
580
|
-
A(
|
|
581
|
-
} else a[
|
|
582
|
-
|
|
583
|
-
} else
|
|
584
|
-
else
|
|
585
|
-
for (;
|
|
586
|
-
const g = P(i, a[
|
|
587
|
-
A(g, n[
|
|
565
|
+
update(i, [t, e, r]) {
|
|
566
|
+
const s = Gt(i), { values: n, keys: o } = this.dt(t, e, r);
|
|
567
|
+
if (!Array.isArray(s)) return this.ut = o, n;
|
|
568
|
+
const h = this.ut ??= [], a = [];
|
|
569
|
+
let u, c, l = 0, d = s.length - 1, p = 0, $ = n.length - 1;
|
|
570
|
+
for (; l <= d && p <= $; ) if (s[l] === null) l++;
|
|
571
|
+
else if (s[d] === null) d--;
|
|
572
|
+
else if (h[l] === o[p]) a[p] = A(s[l], n[p]), l++, p++;
|
|
573
|
+
else if (h[d] === o[$]) a[$] = A(s[d], n[$]), d--, $--;
|
|
574
|
+
else if (h[l] === o[$]) a[$] = A(s[l], n[$]), P(i, a[$ + 1], s[l]), l++, $--;
|
|
575
|
+
else if (h[d] === o[p]) a[p] = A(s[d], n[p]), P(i, s[l], s[d]), d--, p++;
|
|
576
|
+
else if (u === void 0 && (u = ut(o, p, $), c = ut(h, l, d)), u.has(h[l])) if (u.has(h[d])) {
|
|
577
|
+
const g = c.get(o[p]), I = g !== void 0 ? s[g] : null;
|
|
578
|
+
if (I === null) {
|
|
579
|
+
const Y = P(i, s[l]);
|
|
580
|
+
A(Y, n[p]), a[p] = Y;
|
|
581
|
+
} else a[p] = A(I, n[p]), P(i, s[l], I), s[g] = null;
|
|
582
|
+
p++;
|
|
583
|
+
} else q(s[d]), d--;
|
|
584
|
+
else q(s[l]), l++;
|
|
585
|
+
for (; p <= $; ) {
|
|
586
|
+
const g = P(i, a[$ + 1]);
|
|
587
|
+
A(g, n[p]), a[p++] = g;
|
|
588
588
|
}
|
|
589
|
-
for (; l <=
|
|
590
|
-
const g =
|
|
591
|
-
g !== null &&
|
|
589
|
+
for (; l <= d; ) {
|
|
590
|
+
const g = s[l++];
|
|
591
|
+
g !== null && q(g);
|
|
592
592
|
}
|
|
593
|
-
return this.ut = o,
|
|
593
|
+
return this.ut = o, Qt(i, a), S;
|
|
594
594
|
}
|
|
595
595
|
});
|
|
596
|
-
const
|
|
596
|
+
const Xt = (i) => (t, e) => {
|
|
597
597
|
e !== void 0 ? e.addInitializer((() => {
|
|
598
598
|
customElements.define(i, t);
|
|
599
599
|
})) : customElements.define(i, t);
|
|
600
600
|
};
|
|
601
|
-
const
|
|
602
|
-
const { kind:
|
|
603
|
-
let n = globalThis.litPropertyMetadata.get(
|
|
604
|
-
if (n === void 0 && globalThis.litPropertyMetadata.set(
|
|
601
|
+
const Yt = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: J }, te = (i = Yt, t, e) => {
|
|
602
|
+
const { kind: r, metadata: s } = e;
|
|
603
|
+
let n = globalThis.litPropertyMetadata.get(s);
|
|
604
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(s, n = /* @__PURE__ */ new Map()), r === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(e.name, i), r === "accessor") {
|
|
605
605
|
const { name: o } = e;
|
|
606
|
-
return { set(
|
|
606
|
+
return { set(h) {
|
|
607
607
|
const a = t.get.call(this);
|
|
608
|
-
t.set.call(this,
|
|
609
|
-
}, init(
|
|
610
|
-
return
|
|
608
|
+
t.set.call(this, h), this.requestUpdate(o, a, i);
|
|
609
|
+
}, init(h) {
|
|
610
|
+
return h !== void 0 && this.C(o, void 0, i, h), h;
|
|
611
611
|
} };
|
|
612
612
|
}
|
|
613
|
-
if (
|
|
613
|
+
if (r === "setter") {
|
|
614
614
|
const { name: o } = e;
|
|
615
|
-
return function(
|
|
615
|
+
return function(h) {
|
|
616
616
|
const a = this[o];
|
|
617
|
-
t.call(this,
|
|
617
|
+
t.call(this, h), this.requestUpdate(o, a, i);
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
throw Error("Unsupported decorator location: " +
|
|
620
|
+
throw Error("Unsupported decorator location: " + r);
|
|
621
621
|
};
|
|
622
|
-
function
|
|
623
|
-
return (t, e) => typeof e == "object" ?
|
|
624
|
-
const o =
|
|
625
|
-
return
|
|
622
|
+
function X(i) {
|
|
623
|
+
return (t, e) => typeof e == "object" ? te(i, t, e) : ((r, s, n) => {
|
|
624
|
+
const o = s.hasOwnProperty(n);
|
|
625
|
+
return s.constructor.createProperty(n, r), o ? Object.getOwnPropertyDescriptor(s, n) : void 0;
|
|
626
626
|
})(i, t, e);
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
return
|
|
628
|
+
function B(i) {
|
|
629
|
+
return X({ ...i, state: !0, attribute: !1 });
|
|
630
630
|
}
|
|
631
|
-
const
|
|
632
|
-
function
|
|
633
|
-
return (e,
|
|
631
|
+
const ee = (i, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(i, t, e), e);
|
|
632
|
+
function _t(i, t) {
|
|
633
|
+
return (e, r, s) => {
|
|
634
634
|
const n = (o) => o.renderRoot?.querySelector(i) ?? null;
|
|
635
|
-
return
|
|
635
|
+
return ee(e, r, { get() {
|
|
636
636
|
return n(this);
|
|
637
637
|
} });
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
|
-
var
|
|
641
|
-
for (var
|
|
642
|
-
(o = i[n]) && (
|
|
643
|
-
return
|
|
640
|
+
var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, v = (i, t, e, r) => {
|
|
641
|
+
for (var s = r > 1 ? void 0 : r ? se(t, e) : t, n = i.length - 1, o; n >= 0; n--)
|
|
642
|
+
(o = i[n]) && (s = (r ? o(t, e, s) : o(s)) || s);
|
|
643
|
+
return r && s && ie(t, e, s), s;
|
|
644
644
|
};
|
|
645
|
-
const
|
|
645
|
+
const re = new Intl.DateTimeFormat(void 0, {
|
|
646
646
|
year: "numeric",
|
|
647
647
|
month: "short",
|
|
648
648
|
day: "numeric",
|
|
649
649
|
hour: "2-digit",
|
|
650
650
|
minute: "2-digit"
|
|
651
|
-
}),
|
|
651
|
+
}), yt = (i) => {
|
|
652
652
|
if (i == null || i === "") return;
|
|
653
653
|
const t = /^\s*-?\d+(\.\d+)?\s*$/.test(String(i)) ? Number(i) : Date.parse(String(i));
|
|
654
654
|
return Number.isFinite(t) ? new Date(t) : void 0;
|
|
655
|
+
}, H = (i) => {
|
|
656
|
+
if (i == null || i === "") return;
|
|
657
|
+
const t = typeof i == "number" ? i : Number(i);
|
|
658
|
+
return Number.isFinite(t) ? t : void 0;
|
|
659
|
+
}, pt = (i) => {
|
|
660
|
+
const t = Math.floor(Number(i));
|
|
661
|
+
return Number.isFinite(t) ? Math.min(100, Math.max(0, t)) : 0;
|
|
662
|
+
}, ne = (i, t) => {
|
|
663
|
+
const e = H(t), r = yt(i[i.length - 1]?.tsp);
|
|
664
|
+
return e === void 0 || !r ? void 0 : r.getTime() + e * 1e3;
|
|
655
665
|
};
|
|
656
|
-
let
|
|
666
|
+
let m = class extends O {
|
|
657
667
|
constructor() {
|
|
658
|
-
super(), this.dataSets = /* @__PURE__ */ new Map(), this.textActive = !0, this.version = "1.1.
|
|
668
|
+
super(), this.dataSets = /* @__PURE__ */ new Map(), this.textActive = !0, this.version = "1.1.38", this.origWidth = 0, this.origHeight = 0, this.resizeObserver = new ResizeObserver(this.applyData.bind(this));
|
|
659
669
|
}
|
|
660
|
-
|
|
661
|
-
super.
|
|
670
|
+
connectedCallback() {
|
|
671
|
+
super.connectedCallback(), this.resizeObserver.observe(this), this.hasUpdated && this.transformData();
|
|
662
672
|
}
|
|
663
|
-
|
|
664
|
-
this.
|
|
673
|
+
disconnectedCallback() {
|
|
674
|
+
super.disconnectedCallback(), this.resizeObserver.disconnect(), clearTimeout(this.staleTimer), this.staleTimer = void 0;
|
|
665
675
|
}
|
|
666
676
|
update(i) {
|
|
667
|
-
i.has("inputData") && this.transformData(), super.update(i);
|
|
677
|
+
(i.has("theme") || !this.hasUpdated) && this.registerTheme(this.theme), i.has("inputData") && this.transformData(), super.update(i);
|
|
668
678
|
}
|
|
669
679
|
updated(i) {
|
|
670
|
-
i.has("inputData") &&
|
|
680
|
+
i.has("inputData") && this.sizingSetup(), this.applyData(), super.updated(i);
|
|
671
681
|
}
|
|
672
682
|
registerTheme(i) {
|
|
673
683
|
this.theme?.theme_object?.backgroundColor;
|
|
@@ -677,90 +687,102 @@ let v = class extends M {
|
|
|
677
687
|
subTitleText() {
|
|
678
688
|
const i = this.inputData?.subTitle;
|
|
679
689
|
if (this.inputData?.subTitleType !== "timestamp") return i;
|
|
680
|
-
const t =
|
|
681
|
-
return t ?
|
|
690
|
+
const t = yt(i);
|
|
691
|
+
return t ? re.format(t) : i;
|
|
682
692
|
}
|
|
683
693
|
sizingSetup() {
|
|
684
694
|
const i = Array.from(
|
|
685
695
|
this.sizingContainer?.querySelectorAll(".single-value")
|
|
686
696
|
);
|
|
687
697
|
let t = 0, e = 0;
|
|
688
|
-
for (const
|
|
689
|
-
const
|
|
690
|
-
t = Math.max(
|
|
698
|
+
for (const r of i) {
|
|
699
|
+
const s = r.getBoundingClientRect();
|
|
700
|
+
t = Math.max(s.width, t), e = Math.max(s.height, e);
|
|
691
701
|
}
|
|
692
702
|
t < this.origWidth ? (!this.lastLargerWidthTime || Date.now() - this.lastLargerWidthTime > 5e3) && (this.origWidth = t) : (this.origWidth = t, this.lastLargerWidthTime = Date.now()), this.origHeight = e;
|
|
693
703
|
}
|
|
694
704
|
applyData() {
|
|
695
705
|
if (!this.valueContainer) return;
|
|
696
|
-
const i = this.valueContainer.getBoundingClientRect().width, t = this.valueContainer.getBoundingClientRect().height, e = this.dataSets.size,
|
|
697
|
-
if (!i || !t || !
|
|
706
|
+
const i = this.valueContainer.getBoundingClientRect().width, t = this.valueContainer.getBoundingClientRect().height, e = this.dataSets.size, r = this.origWidth, s = this.origHeight;
|
|
707
|
+
if (!i || !t || !r || !s) return;
|
|
698
708
|
const n = [];
|
|
699
|
-
for (let
|
|
700
|
-
const l = Math.ceil(e /
|
|
701
|
-
l *
|
|
709
|
+
for (let c = 1; c <= e; c++) {
|
|
710
|
+
const l = Math.ceil(e / c), d = i - 12 * (c - 1), p = t - 12 * (l - 1), $ = d / r / c, g = $ * $ * r * s * e;
|
|
711
|
+
l * $ * s <= p && n.push({ r: l, c, m: $, size: g, width: r, height: s, userWidth: i, userHeight: t });
|
|
702
712
|
}
|
|
703
|
-
for (let
|
|
704
|
-
const l = Math.ceil(e /
|
|
705
|
-
l *
|
|
713
|
+
for (let c = 1; c <= e; c++) {
|
|
714
|
+
const l = Math.ceil(e / c), d = i - 12 * (l - 1), $ = (t - 12 * (c - 1)) / s / c, g = $ * $ * r * s * e;
|
|
715
|
+
l * $ * r <= d && n.push({ r: c, c: l, m: $, size: g, width: r, height: s, userWidth: i, userHeight: t });
|
|
706
716
|
}
|
|
707
|
-
const o = n.reduce((
|
|
708
|
-
if (!
|
|
709
|
-
const a =
|
|
717
|
+
const o = n.reduce((c, l) => l.size < c ? c : l.size, 0), h = n.find((c) => c.size === o);
|
|
718
|
+
if (!h) return;
|
|
719
|
+
const a = h.m ?? 1, u = Array.from(
|
|
710
720
|
this.valueContainer?.querySelectorAll(".single-value")
|
|
711
721
|
);
|
|
712
|
-
this.valueContainer.style.gridTemplateColumns = `repeat(${
|
|
713
|
-
for (const
|
|
714
|
-
|
|
722
|
+
this.valueContainer.style.gridTemplateColumns = `repeat(${h.c}, 1fr)`;
|
|
723
|
+
for (const c of u) {
|
|
724
|
+
c.setAttribute(
|
|
715
725
|
"style",
|
|
716
|
-
`width:${a *
|
|
726
|
+
`width:${a * r}px; height:${a * s}px; padding:${a * 6}px`
|
|
717
727
|
);
|
|
718
|
-
const l =
|
|
719
|
-
|
|
728
|
+
const l = c.getAttribute("label"), d = this.dataSets.get(l ?? "");
|
|
729
|
+
c.querySelector(".label").setAttribute(
|
|
720
730
|
"style",
|
|
721
731
|
`font-size: ${26 * a}px;
|
|
722
|
-
color: ${
|
|
723
|
-
),
|
|
732
|
+
color: ${d?.styling?.labelColor || this.themeTitleColor};`
|
|
733
|
+
), c.querySelector(".current-value").setAttribute(
|
|
724
734
|
"style",
|
|
725
735
|
`font-size: ${32 * a}px;
|
|
726
|
-
color: ${
|
|
727
|
-
),
|
|
736
|
+
color: ${d?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor};`
|
|
737
|
+
), c.querySelector(".unit").setAttribute("style", `font-size: ${26 * a}px;`);
|
|
728
738
|
}
|
|
729
739
|
this.textActive = !0;
|
|
730
740
|
}
|
|
731
|
-
|
|
732
|
-
this.
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
const
|
|
738
|
-
label:
|
|
739
|
-
order:
|
|
740
|
-
unit:
|
|
741
|
-
precision:
|
|
742
|
-
advanced:
|
|
743
|
-
styling:
|
|
744
|
-
multiChart:
|
|
745
|
-
value:
|
|
746
|
-
data:
|
|
741
|
+
transformData() {
|
|
742
|
+
this.dataSets = /* @__PURE__ */ new Map();
|
|
743
|
+
const i = this.inputData?.dataseries;
|
|
744
|
+
(Array.isArray(i) ? i.filter((s) => !!s && typeof s == "object") : []).forEach((s) => {
|
|
745
|
+
const n = Array.isArray(s.data) ? s.data.filter((h) => !!h && typeof h == "object") : [], o = s.multiChart ? [...new Set(n.map((h) => h.pivot))].sort() : [""];
|
|
746
|
+
o.forEach((h) => {
|
|
747
|
+
const a = h ?? "", u = s.label ?? "", c = {
|
|
748
|
+
label: a + (a && u ? " - " : "") + u,
|
|
749
|
+
order: s.order,
|
|
750
|
+
unit: s.unit,
|
|
751
|
+
precision: s.precision,
|
|
752
|
+
advanced: s.advanced,
|
|
753
|
+
styling: s.styling,
|
|
754
|
+
multiChart: s.multiChart,
|
|
755
|
+
value: s.value,
|
|
756
|
+
data: o.length === 1 ? n : n.filter((l) => l.pivot === h),
|
|
747
757
|
needleValue: void 0
|
|
748
758
|
};
|
|
749
|
-
this.dataSets.set(
|
|
759
|
+
this.dataSets.set(c.label ?? "", c);
|
|
750
760
|
});
|
|
751
|
-
})
|
|
752
|
-
|
|
753
|
-
|
|
761
|
+
});
|
|
762
|
+
const e = Date.now();
|
|
763
|
+
let r = 1 / 0;
|
|
764
|
+
this.dataSets.forEach((s) => {
|
|
765
|
+
const n = H(s.advanced?.averageLatest), o = n !== void 0 && n >= 1 ? Math.floor(n) : 1;
|
|
766
|
+
if (!s.multiChart)
|
|
767
|
+
s.needleValue = H(s.value);
|
|
754
768
|
else {
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
|
|
769
|
+
const h = s.data?.slice(-o) ?? [], a = h.map((c) => H(c.value)).filter((c) => c !== void 0);
|
|
770
|
+
s.needleValue = a.length ? a.reduce((c, l) => c + l, 0) / a.length : void 0;
|
|
771
|
+
const u = ne(h, s.advanced?.maxLatency);
|
|
772
|
+
u !== void 0 && e > u ? s.needleValue = void 0 : u !== void 0 && (r = Math.min(r, u));
|
|
759
773
|
}
|
|
760
|
-
}));
|
|
774
|
+
}), this.scheduleStaleCheck(r);
|
|
775
|
+
}
|
|
776
|
+
/** Runs transformData again just after `at` (epoch ms), when the next readout goes stale. */
|
|
777
|
+
scheduleStaleCheck(i) {
|
|
778
|
+
if (clearTimeout(this.staleTimer), this.staleTimer = void 0, !Number.isFinite(i) || !this.isConnected) return;
|
|
779
|
+
const t = Math.min(Math.max(i - Date.now(), 0) + 1, 2 ** 31 - 1);
|
|
780
|
+
this.staleTimer = setTimeout(() => {
|
|
781
|
+
this.staleTimer = void 0, this.transformData();
|
|
782
|
+
}, t);
|
|
761
783
|
}
|
|
762
784
|
render() {
|
|
763
|
-
return
|
|
785
|
+
return W`
|
|
764
786
|
<div class="wrapper" style="color: ${this.themeTitleColor}">
|
|
765
787
|
<header>
|
|
766
788
|
<h3 class="paging" ?active=${this.inputData?.title}>${this.inputData?.title}</h3>
|
|
@@ -773,10 +795,10 @@ let v = class extends M {
|
|
|
773
795
|
</p>
|
|
774
796
|
</header>
|
|
775
797
|
<div class="sizing-container">
|
|
776
|
-
${
|
|
798
|
+
${dt(
|
|
777
799
|
this.dataSets,
|
|
778
800
|
([i]) => i,
|
|
779
|
-
([i, t]) =>
|
|
801
|
+
([i, t]) => W`
|
|
780
802
|
<div class="single-value" label="${i}">
|
|
781
803
|
<div class="label paging" ?active=${this.textActive}>${i}</div>
|
|
782
804
|
<span
|
|
@@ -784,7 +806,7 @@ let v = class extends M {
|
|
|
784
806
|
?active=${this.textActive}
|
|
785
807
|
style="color: ${t?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor}"
|
|
786
808
|
>
|
|
787
|
-
${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(
|
|
809
|
+
${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(pt(t.precision))}
|
|
788
810
|
<span class="unit paging" ?active=${this.textActive}>${t.unit}</span>
|
|
789
811
|
</span>
|
|
790
812
|
</div>
|
|
@@ -793,10 +815,10 @@ let v = class extends M {
|
|
|
793
815
|
</div>
|
|
794
816
|
<div class="paging no-data" ?active=${!this.dataSets.size}>No Data</div>
|
|
795
817
|
<div class="value-container">
|
|
796
|
-
${
|
|
818
|
+
${dt(
|
|
797
819
|
[...this.dataSets.entries()].sort(),
|
|
798
820
|
([i]) => i,
|
|
799
|
-
([i, t]) =>
|
|
821
|
+
([i, t]) => W`
|
|
800
822
|
<div class="single-value" label="${i}">
|
|
801
823
|
<div
|
|
802
824
|
class="label paging"
|
|
@@ -810,7 +832,7 @@ let v = class extends M {
|
|
|
810
832
|
?active=${this.textActive}
|
|
811
833
|
style="color: ${t?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor}"
|
|
812
834
|
>
|
|
813
|
-
${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(
|
|
835
|
+
${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(pt(t.precision))}
|
|
814
836
|
<span class="unit paging" ?active=${this.textActive}>${t.unit}</span>
|
|
815
837
|
</span>
|
|
816
838
|
</div>
|
|
@@ -821,7 +843,7 @@ let v = class extends M {
|
|
|
821
843
|
`;
|
|
822
844
|
}
|
|
823
845
|
};
|
|
824
|
-
|
|
846
|
+
m.styles = bt`
|
|
825
847
|
:host {
|
|
826
848
|
display: block;
|
|
827
849
|
font-family: sans-serif;
|
|
@@ -910,34 +932,34 @@ v.styles = _t`
|
|
|
910
932
|
justify-content: center;
|
|
911
933
|
}
|
|
912
934
|
`;
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
],
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
],
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
],
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
],
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
],
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
],
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
],
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
],
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
],
|
|
935
|
+
v([
|
|
936
|
+
X({ type: Object })
|
|
937
|
+
], m.prototype, "inputData", 2);
|
|
938
|
+
v([
|
|
939
|
+
X({ type: Object })
|
|
940
|
+
], m.prototype, "theme", 2);
|
|
941
|
+
v([
|
|
942
|
+
B()
|
|
943
|
+
], m.prototype, "dataSets", 2);
|
|
944
|
+
v([
|
|
945
|
+
B()
|
|
946
|
+
], m.prototype, "textActive", 2);
|
|
947
|
+
v([
|
|
948
|
+
B()
|
|
949
|
+
], m.prototype, "themeTitleColor", 2);
|
|
950
|
+
v([
|
|
951
|
+
B()
|
|
952
|
+
], m.prototype, "themeSubtitleColor", 2);
|
|
953
|
+
v([
|
|
954
|
+
_t(".value-container")
|
|
955
|
+
], m.prototype, "valueContainer", 2);
|
|
956
|
+
v([
|
|
957
|
+
_t(".sizing-container")
|
|
958
|
+
], m.prototype, "sizingContainer", 2);
|
|
959
|
+
m = v([
|
|
960
|
+
Xt("widget-value-1.1.38")
|
|
961
|
+
], m);
|
|
940
962
|
export {
|
|
941
|
-
|
|
963
|
+
m as WidgetValue
|
|
942
964
|
};
|
|
943
965
|
//# sourceMappingURL=widget-value.js.map
|