@record-evolution/widget-overlay 1.0.6 → 1.0.7
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-overlay.js +872 -1269
- package/dist/widget-overlay.js.map +1 -1
- package/package.json +8 -14
- package/src/default-data.json +1 -0
- package/src/definition-schema.d.ts +1 -0
- package/src/definition-schema.json +8 -1
- package/src/linear-progress.ts +2 -1
- package/src/widget-overlay.ts +4 -4
- package/dist/src/linear-progress.d.ts +0 -7
- package/dist/src/widget-overlay.d.ts +0 -35
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/widget-overlay.js
CHANGED
|
@@ -1,1035 +1,719 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
17
|
-
|
|
18
|
-
function __decorate(decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length,
|
|
20
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
21
|
-
d;
|
|
22
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
23
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
24
|
-
}
|
|
25
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
26
|
-
var e = new Error(message);
|
|
27
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2019 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const t$5 = globalThis,
|
|
36
|
-
e$6 = t$5.ShadowRoot && (void 0 === t$5.ShadyCSS || t$5.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
|
37
|
-
s$3 = Symbol(),
|
|
38
|
-
o$6 = new WeakMap();
|
|
39
|
-
let n$4 = class n {
|
|
40
|
-
constructor(t, e, o) {
|
|
41
|
-
if (this._$cssResult$ = !0, o !== s$3) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
42
|
-
this.cssText = t, this.t = e;
|
|
43
|
-
}
|
|
44
|
-
get styleSheet() {
|
|
45
|
-
let t = this.o;
|
|
46
|
-
const s = this.t;
|
|
47
|
-
if (e$6 && void 0 === t) {
|
|
48
|
-
const e = void 0 !== s && 1 === s.length;
|
|
49
|
-
e && (t = o$6.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$6.set(s, t));
|
|
50
|
-
}
|
|
51
|
-
return t;
|
|
52
|
-
}
|
|
53
|
-
toString() {
|
|
54
|
-
return this.cssText;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const r$5 = t => new n$4("string" == typeof t ? t : t + "", void 0, s$3),
|
|
58
|
-
i$5 = (t, ...e) => {
|
|
59
|
-
const o = 1 === t.length ? t[0] : e.reduce((e, s, o) => e + (t => {
|
|
60
|
-
if (!0 === t._$cssResult$) return t.cssText;
|
|
61
|
-
if ("number" == typeof t) return t;
|
|
62
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " + t + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
63
|
-
})(s) + t[o + 1], t[0]);
|
|
64
|
-
return new n$4(o, t, s$3);
|
|
65
|
-
},
|
|
66
|
-
S$1 = (s, o) => {
|
|
67
|
-
if (e$6) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
|
|
68
|
-
const o = document.createElement("style"),
|
|
69
|
-
n = t$5.litNonce;
|
|
70
|
-
void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
c$3 = e$6 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
|
|
74
|
-
let e = "";
|
|
75
|
-
for (const s of t.cssRules) e += s.cssText;
|
|
76
|
-
return r$5(e);
|
|
77
|
-
})(t) : t;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @license
|
|
81
|
-
* Copyright 2017 Google LLC
|
|
82
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
83
|
-
*/
|
|
84
|
-
const {
|
|
85
|
-
is: i$4,
|
|
86
|
-
defineProperty: e$5,
|
|
87
|
-
getOwnPropertyDescriptor: h$1,
|
|
88
|
-
getOwnPropertyNames: r$4,
|
|
89
|
-
getOwnPropertySymbols: o$5,
|
|
90
|
-
getPrototypeOf: n$3
|
|
91
|
-
} = Object,
|
|
92
|
-
a$1 = globalThis,
|
|
93
|
-
c$2 = a$1.trustedTypes,
|
|
94
|
-
l$1 = c$2 ? c$2.emptyScript : "",
|
|
95
|
-
p$2 = a$1.reactiveElementPolyfillSupport,
|
|
96
|
-
d$1 = (t, s) => t,
|
|
97
|
-
u$3 = {
|
|
98
|
-
toAttribute(t, s) {
|
|
99
|
-
switch (s) {
|
|
100
|
-
case Boolean:
|
|
101
|
-
t = t ? l$1 : null;
|
|
102
|
-
break;
|
|
103
|
-
case Object:
|
|
104
|
-
case Array:
|
|
105
|
-
t = null == t ? t : JSON.stringify(t);
|
|
106
|
-
}
|
|
107
|
-
return t;
|
|
108
|
-
},
|
|
109
|
-
fromAttribute(t, s) {
|
|
110
|
-
let i = t;
|
|
111
|
-
switch (s) {
|
|
112
|
-
case Boolean:
|
|
113
|
-
i = null !== t;
|
|
114
|
-
break;
|
|
115
|
-
case Number:
|
|
116
|
-
i = null === t ? null : Number(t);
|
|
117
|
-
break;
|
|
118
|
-
case Object:
|
|
119
|
-
case Array:
|
|
120
|
-
try {
|
|
121
|
-
i = JSON.parse(t);
|
|
122
|
-
} catch (t) {
|
|
123
|
-
i = null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return i;
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
f$1 = (t, s) => !i$4(t, s),
|
|
130
|
-
b = {
|
|
131
|
-
attribute: !0,
|
|
132
|
-
type: String,
|
|
133
|
-
converter: u$3,
|
|
134
|
-
reflect: !1,
|
|
135
|
-
useDefault: !1,
|
|
136
|
-
hasChanged: f$1
|
|
137
|
-
};
|
|
138
|
-
Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= new WeakMap();
|
|
139
|
-
let y$1 = class y extends HTMLElement {
|
|
140
|
-
static addInitializer(t) {
|
|
141
|
-
this._$Ei(), (this.l ??= []).push(t);
|
|
142
|
-
}
|
|
143
|
-
static get observedAttributes() {
|
|
144
|
-
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
145
|
-
}
|
|
146
|
-
static createProperty(t, s = b) {
|
|
147
|
-
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) {
|
|
148
|
-
const i = Symbol(),
|
|
149
|
-
h = this.getPropertyDescriptor(t, i, s);
|
|
150
|
-
void 0 !== h && e$5(this.prototype, t, h);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
static getPropertyDescriptor(t, s, i) {
|
|
154
|
-
const {
|
|
155
|
-
get: e,
|
|
156
|
-
set: r
|
|
157
|
-
} = h$1(this.prototype, t) ?? {
|
|
158
|
-
get() {
|
|
159
|
-
return this[s];
|
|
160
|
-
},
|
|
161
|
-
set(t) {
|
|
162
|
-
this[s] = t;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
return {
|
|
166
|
-
get: e,
|
|
167
|
-
set(s) {
|
|
168
|
-
const h = e?.call(this);
|
|
169
|
-
r?.call(this, s), this.requestUpdate(t, h, i);
|
|
170
|
-
},
|
|
171
|
-
configurable: !0,
|
|
172
|
-
enumerable: !0
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
static getPropertyOptions(t) {
|
|
176
|
-
return this.elementProperties.get(t) ?? b;
|
|
177
|
-
}
|
|
178
|
-
static _$Ei() {
|
|
179
|
-
if (this.hasOwnProperty(d$1("elementProperties"))) return;
|
|
180
|
-
const t = n$3(this);
|
|
181
|
-
t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
182
|
-
}
|
|
183
|
-
static finalize() {
|
|
184
|
-
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
185
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
186
|
-
const t = this.properties,
|
|
187
|
-
s = [...r$4(t), ...o$5(t)];
|
|
188
|
-
for (const i of s) this.createProperty(i, t[i]);
|
|
189
|
-
}
|
|
190
|
-
const t = this[Symbol.metadata];
|
|
191
|
-
if (null !== t) {
|
|
192
|
-
const s = litPropertyMetadata.get(t);
|
|
193
|
-
if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
|
|
194
|
-
}
|
|
195
|
-
this._$Eh = new Map();
|
|
196
|
-
for (const [t, s] of this.elementProperties) {
|
|
197
|
-
const i = this._$Eu(t, s);
|
|
198
|
-
void 0 !== i && this._$Eh.set(i, t);
|
|
199
|
-
}
|
|
200
|
-
this.elementStyles = this.finalizeStyles(this.styles);
|
|
201
|
-
}
|
|
202
|
-
static finalizeStyles(s) {
|
|
203
|
-
const i = [];
|
|
204
|
-
if (Array.isArray(s)) {
|
|
205
|
-
const e = new Set(s.flat(1 / 0).reverse());
|
|
206
|
-
for (const s of e) i.unshift(c$3(s));
|
|
207
|
-
} else void 0 !== s && i.push(c$3(s));
|
|
208
|
-
return i;
|
|
209
|
-
}
|
|
210
|
-
static _$Eu(t, s) {
|
|
211
|
-
const i = s.attribute;
|
|
212
|
-
return !1 === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
|
|
213
|
-
}
|
|
214
|
-
constructor() {
|
|
215
|
-
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
216
|
-
}
|
|
217
|
-
_$Ev() {
|
|
218
|
-
this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
|
|
219
|
-
}
|
|
220
|
-
addController(t) {
|
|
221
|
-
(this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
|
|
222
|
-
}
|
|
223
|
-
removeController(t) {
|
|
224
|
-
this._$EO?.delete(t);
|
|
225
|
-
}
|
|
226
|
-
_$E_() {
|
|
227
|
-
const t = new Map(),
|
|
228
|
-
s = this.constructor.elementProperties;
|
|
229
|
-
for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
230
|
-
t.size > 0 && (this._$Ep = t);
|
|
231
|
-
}
|
|
232
|
-
createRenderRoot() {
|
|
233
|
-
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
234
|
-
return S$1(t, this.constructor.elementStyles), t;
|
|
235
|
-
}
|
|
236
|
-
connectedCallback() {
|
|
237
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(t => t.hostConnected?.());
|
|
238
|
-
}
|
|
239
|
-
enableUpdating(t) {}
|
|
240
|
-
disconnectedCallback() {
|
|
241
|
-
this._$EO?.forEach(t => t.hostDisconnected?.());
|
|
242
|
-
}
|
|
243
|
-
attributeChangedCallback(t, s, i) {
|
|
244
|
-
this._$AK(t, i);
|
|
245
|
-
}
|
|
246
|
-
_$ET(t, s) {
|
|
247
|
-
const i = this.constructor.elementProperties.get(t),
|
|
248
|
-
e = this.constructor._$Eu(t, i);
|
|
249
|
-
if (void 0 !== e && !0 === i.reflect) {
|
|
250
|
-
const h = (void 0 !== i.converter?.toAttribute ? i.converter : u$3).toAttribute(s, i.type);
|
|
251
|
-
this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
_$AK(t, s) {
|
|
255
|
-
const i = this.constructor,
|
|
256
|
-
e = i._$Eh.get(t);
|
|
257
|
-
if (void 0 !== e && this._$Em !== e) {
|
|
258
|
-
const t = i.getPropertyOptions(e),
|
|
259
|
-
h = "function" == typeof t.converter ? {
|
|
260
|
-
fromAttribute: t.converter
|
|
261
|
-
} : void 0 !== t.converter?.fromAttribute ? t.converter : u$3;
|
|
262
|
-
this._$Em = e, this[e] = h.fromAttribute(s, t.type) ?? this._$Ej?.get(e) ?? null, this._$Em = null;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
requestUpdate(t, s, i) {
|
|
266
|
-
if (void 0 !== t) {
|
|
267
|
-
const e = this.constructor,
|
|
268
|
-
h = this[t];
|
|
269
|
-
if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f$1)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
|
|
270
|
-
this.C(t, s, i);
|
|
271
|
-
}
|
|
272
|
-
!1 === this.isUpdatePending && (this._$ES = this._$EP());
|
|
273
|
-
}
|
|
274
|
-
C(t, s, {
|
|
275
|
-
useDefault: i,
|
|
276
|
-
reflect: e,
|
|
277
|
-
wrapped: h
|
|
278
|
-
}, r) {
|
|
279
|
-
i && !(this._$Ej ??= new Map()).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), !0 !== h || void 0 !== r) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), !0 === e && this._$Em !== t && (this._$Eq ??= new Set()).add(t));
|
|
280
|
-
}
|
|
281
|
-
async _$EP() {
|
|
282
|
-
this.isUpdatePending = !0;
|
|
283
|
-
try {
|
|
284
|
-
await this._$ES;
|
|
285
|
-
} catch (t) {
|
|
286
|
-
Promise.reject(t);
|
|
287
|
-
}
|
|
288
|
-
const t = this.scheduleUpdate();
|
|
289
|
-
return null != t && (await t), !this.isUpdatePending;
|
|
290
|
-
}
|
|
291
|
-
scheduleUpdate() {
|
|
292
|
-
return this.performUpdate();
|
|
293
|
-
}
|
|
294
|
-
performUpdate() {
|
|
295
|
-
if (!this.isUpdatePending) return;
|
|
296
|
-
if (!this.hasUpdated) {
|
|
297
|
-
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
298
|
-
for (const [t, s] of this._$Ep) this[t] = s;
|
|
299
|
-
this._$Ep = void 0;
|
|
300
|
-
}
|
|
301
|
-
const t = this.constructor.elementProperties;
|
|
302
|
-
if (t.size > 0) for (const [s, i] of t) {
|
|
303
|
-
const {
|
|
304
|
-
wrapped: t
|
|
305
|
-
} = i,
|
|
306
|
-
e = this[s];
|
|
307
|
-
!0 !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
let t = !1;
|
|
311
|
-
const s = this._$AL;
|
|
312
|
-
try {
|
|
313
|
-
t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
|
|
314
|
-
} catch (s) {
|
|
315
|
-
throw t = !1, this._$EM(), s;
|
|
316
|
-
}
|
|
317
|
-
t && this._$AE(s);
|
|
318
|
-
}
|
|
319
|
-
willUpdate(t) {}
|
|
320
|
-
_$AE(t) {
|
|
321
|
-
this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
322
|
-
}
|
|
323
|
-
_$EM() {
|
|
324
|
-
this._$AL = new Map(), this.isUpdatePending = !1;
|
|
325
|
-
}
|
|
326
|
-
get updateComplete() {
|
|
327
|
-
return this.getUpdateComplete();
|
|
328
|
-
}
|
|
329
|
-
getUpdateComplete() {
|
|
330
|
-
return this._$ES;
|
|
331
|
-
}
|
|
332
|
-
shouldUpdate(t) {
|
|
333
|
-
return !0;
|
|
334
|
-
}
|
|
335
|
-
update(t) {
|
|
336
|
-
this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
|
|
337
|
-
}
|
|
338
|
-
updated(t) {}
|
|
339
|
-
firstUpdated(t) {}
|
|
1
|
+
import { css as ve, LitElement as Te, html as y, nothing as P } from "lit";
|
|
2
|
+
import { property as te, customElement as Re, state as M, query as ke } from "lit/decorators.js";
|
|
3
|
+
const $ = globalThis, u = (o) => {
|
|
4
|
+
$.emitLitDebugLogEvents && $.dispatchEvent(new CustomEvent("lit-debug", {
|
|
5
|
+
detail: o
|
|
6
|
+
}));
|
|
340
7
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
o
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
_$litType$: t,
|
|
376
|
-
strings: i,
|
|
377
|
-
values: s
|
|
378
|
-
}),
|
|
379
|
-
x = y(1),
|
|
380
|
-
T = Symbol.for("lit-noChange"),
|
|
381
|
-
E = Symbol.for("lit-nothing"),
|
|
382
|
-
A = new WeakMap(),
|
|
383
|
-
C = r$3.createTreeWalker(r$3, 129);
|
|
384
|
-
function P(t, i) {
|
|
385
|
-
if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
386
|
-
return void 0 !== s$2 ? s$2.createHTML(i) : i;
|
|
8
|
+
let I;
|
|
9
|
+
$.litIssuedWarnings ??= /* @__PURE__ */ new Set(), I = (o, e) => {
|
|
10
|
+
e += o ? ` See https://lit.dev/msg/${o} for more information.` : "", !$.litIssuedWarnings.has(e) && !$.litIssuedWarnings.has(o) && (console.warn(e), $.litIssuedWarnings.add(e));
|
|
11
|
+
}, queueMicrotask(() => {
|
|
12
|
+
I("dev-mode", "Lit is in dev mode. Not recommended for production!");
|
|
13
|
+
});
|
|
14
|
+
const x = $.ShadyDOM?.inUse && $.ShadyDOM?.noPatch === !0 ? $.ShadyDOM.wrap : (o) => o, z = $.trustedTypes, pe = z ? z.createPolicy("lit-html", {
|
|
15
|
+
createHTML: (o) => o
|
|
16
|
+
}) : void 0, De = (o) => o, Ce = (o, e, t) => De, ue = (o, e, t) => j(), Ne = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, Se = "?" + v, Ue = `<${Se}>`, V = document, O = () => V.createComment(""), D = (o) => o === null || typeof o != "object" && typeof o != "function", ie = Array.isArray, Ie = (o) => ie(o) || // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
typeof o?.[Symbol.iterator] == "function", K = `[
|
|
18
|
+
\f\r]`, ze = `[^
|
|
19
|
+
\f\r"'\`<>=]`, Oe = `[^\\s"'>=/]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, fe = 1, G = 2, He = 3, ge = /-->/g, _e = />/g, S = new RegExp(`>|${K}(?:(${Oe}+)(${K}*=${K}*(?:${ze}|("|')|))|$)`, "g"), Be = 0, ye = 1, je = 2, $e = 3, Y = /'/g, Z = /"/g, Ee = /^(?:script|style|textarea|title)$/i, J = 2, ee = 3, se = 1, H = 2, We = 3, Fe = 4, Ke = 5, ne = 6, Ge = 7, N = /* @__PURE__ */ Symbol.for("lit-noChange"), _ = /* @__PURE__ */ Symbol.for("lit-nothing"), be = /* @__PURE__ */ new WeakMap(), A = V.createTreeWalker(
|
|
20
|
+
V,
|
|
21
|
+
129
|
|
22
|
+
/* NodeFilter.SHOW_{ELEMENT|COMMENT} */
|
|
23
|
+
);
|
|
24
|
+
let j = Ce;
|
|
25
|
+
function Ae(o, e) {
|
|
26
|
+
if (!ie(o) || !o.hasOwnProperty("raw")) {
|
|
27
|
+
let t = "invalid template strings array";
|
|
28
|
+
throw t = `
|
|
29
|
+
Internal Error: expected template strings to be an array
|
|
30
|
+
with a 'raw' field. Faking a template strings array by
|
|
31
|
+
calling html or svg like an ordinary function is effectively
|
|
32
|
+
the same as calling unsafeHtml and can lead to major security
|
|
33
|
+
issues, e.g. opening your code up to XSS attacks.
|
|
34
|
+
If you're using the html or svg tagged template functions normally
|
|
35
|
+
and still seeing this error, please file a bug at
|
|
36
|
+
https://github.com/lit/lit/issues/new?template=bug_report.md
|
|
37
|
+
and include information about your build tooling, if any.
|
|
38
|
+
`.trim().replace(/\n */g, `
|
|
39
|
+
`), new Error(t);
|
|
40
|
+
}
|
|
41
|
+
return pe !== void 0 ? pe.createHTML(e) : e;
|
|
387
42
|
}
|
|
388
|
-
const
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
let
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
43
|
+
const Ye = (o, e) => {
|
|
44
|
+
const t = o.length - 1, i = [];
|
|
45
|
+
let s = e === J ? "<svg>" : e === ee ? "<math>" : "", n, r = R;
|
|
46
|
+
for (let a = 0; a < t; a++) {
|
|
47
|
+
const c = o[a];
|
|
48
|
+
let f = -1, m, d = 0, l;
|
|
49
|
+
for (; d < c.length && (r.lastIndex = d, l = r.exec(c), l !== null); )
|
|
50
|
+
if (d = r.lastIndex, r === R) {
|
|
51
|
+
if (l[fe] === "!--")
|
|
52
|
+
r = ge;
|
|
53
|
+
else if (l[fe] !== void 0)
|
|
54
|
+
r = _e;
|
|
55
|
+
else if (l[G] !== void 0)
|
|
56
|
+
Ee.test(l[G]) && (n = new RegExp(`</${l[G]}`, "g")), r = S;
|
|
57
|
+
else if (l[He] !== void 0)
|
|
58
|
+
throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions");
|
|
59
|
+
} else r === S ? l[Be] === ">" ? (r = n ?? R, f = -1) : l[ye] === void 0 ? f = -2 : (f = r.lastIndex - l[je].length, m = l[ye], r = l[$e] === void 0 ? S : l[$e] === '"' ? Z : Y) : r === Z || r === Y ? r = S : r === ge || r === _e ? r = R : (r = S, n = void 0);
|
|
60
|
+
console.assert(f === -1 || r === S || r === Y || r === Z, "unexpected parse state B");
|
|
61
|
+
const p = r === S && o[a + 1].startsWith("/>") ? " " : "";
|
|
62
|
+
s += r === R ? c + Ue : f >= 0 ? (i.push(m), c.slice(0, f) + Ne + c.slice(f) + v + p) : c + v + (f === -2 ? a : p);
|
|
63
|
+
}
|
|
64
|
+
const h = s + (o[t] || "<?>") + (e === J ? "</svg>" : e === ee ? "</math>" : "");
|
|
65
|
+
return [Ae(o, h), i];
|
|
405
66
|
};
|
|
406
|
-
class
|
|
407
|
-
constructor({
|
|
408
|
-
strings: t,
|
|
409
|
-
_$litType$: s
|
|
410
|
-
}, n) {
|
|
411
|
-
let r;
|
|
67
|
+
class U {
|
|
68
|
+
constructor({ strings: e, ["_$litType$"]: t }, i) {
|
|
412
69
|
this.parts = [];
|
|
413
|
-
let
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (this.el = N.createElement(f, n), C.currentNode = this.el.content, 2 === s || 3 === s) {
|
|
419
|
-
const t = this.el.content.firstChild;
|
|
420
|
-
t.replaceWith(...t.childNodes);
|
|
70
|
+
let s, n = 0, r = 0;
|
|
71
|
+
const h = e.length - 1, a = this.parts, [c, f] = Ye(e, t);
|
|
72
|
+
if (this.el = U.createElement(c, i), A.currentNode = this.el.content, t === J || t === ee) {
|
|
73
|
+
const m = this.el.content.firstChild;
|
|
74
|
+
m.replaceWith(...m.childNodes);
|
|
421
75
|
}
|
|
422
|
-
for (;
|
|
423
|
-
if (
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
name: e[2],
|
|
432
|
-
strings: s,
|
|
433
|
-
ctor: "." === e[1] ? H : "?" === e[1] ? I : "@" === e[1] ? L : k
|
|
434
|
-
}), r.removeAttribute(t);
|
|
435
|
-
} else t.startsWith(h) && (d.push({
|
|
436
|
-
type: 6,
|
|
437
|
-
index: c
|
|
438
|
-
}), r.removeAttribute(t));
|
|
439
|
-
if ($.test(r.tagName)) {
|
|
440
|
-
const t = r.textContent.split(h),
|
|
441
|
-
s = t.length - 1;
|
|
442
|
-
if (s > 0) {
|
|
443
|
-
r.textContent = i$3 ? i$3.emptyScript : "";
|
|
444
|
-
for (let i = 0; i < s; i++) r.append(t[i], l()), C.nextNode(), d.push({
|
|
445
|
-
type: 2,
|
|
446
|
-
index: ++c
|
|
447
|
-
});
|
|
448
|
-
r.append(t[s], l());
|
|
76
|
+
for (; (s = A.nextNode()) !== null && a.length < h; ) {
|
|
77
|
+
if (s.nodeType === 1) {
|
|
78
|
+
{
|
|
79
|
+
const m = s.localName;
|
|
80
|
+
if (/^(?:textarea|template)$/i.test(m) && s.innerHTML.includes(v)) {
|
|
81
|
+
const d = `Expressions are not supported inside \`${m}\` elements. See https://lit.dev/msg/expression-in-${m} for more information.`;
|
|
82
|
+
if (m === "template")
|
|
83
|
+
throw new Error(d);
|
|
84
|
+
I("", d);
|
|
449
85
|
}
|
|
450
86
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
87
|
+
if (s.hasAttributes())
|
|
88
|
+
for (const m of s.getAttributeNames())
|
|
89
|
+
if (m.endsWith(Ne)) {
|
|
90
|
+
const d = f[r++], p = s.getAttribute(m).split(v), g = /([.?@])?(.*)/.exec(d);
|
|
91
|
+
a.push({
|
|
92
|
+
type: se,
|
|
93
|
+
index: n,
|
|
94
|
+
name: g[2],
|
|
95
|
+
strings: p,
|
|
96
|
+
ctor: g[1] === "." ? qe : g[1] === "?" ? Qe : g[1] === "@" ? Xe : W
|
|
97
|
+
}), s.removeAttribute(m);
|
|
98
|
+
} else m.startsWith(v) && (a.push({
|
|
99
|
+
type: ne,
|
|
100
|
+
index: n
|
|
101
|
+
}), s.removeAttribute(m));
|
|
102
|
+
if (Ee.test(s.tagName)) {
|
|
103
|
+
const m = s.textContent.split(v), d = m.length - 1;
|
|
104
|
+
if (d > 0) {
|
|
105
|
+
s.textContent = z ? z.emptyScript : "";
|
|
106
|
+
for (let l = 0; l < d; l++)
|
|
107
|
+
s.append(m[l], O()), A.nextNode(), a.push({ type: H, index: ++n });
|
|
108
|
+
s.append(m[d], O());
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} else if (s.nodeType === 8)
|
|
112
|
+
if (s.data === Se)
|
|
113
|
+
a.push({ type: H, index: n });
|
|
114
|
+
else {
|
|
115
|
+
let d = -1;
|
|
116
|
+
for (; (d = s.data.indexOf(v, d + 1)) !== -1; )
|
|
117
|
+
a.push({ type: Ge, index: n }), d += v.length - 1;
|
|
118
|
+
}
|
|
119
|
+
n++;
|
|
462
120
|
}
|
|
121
|
+
if (f.length !== r)
|
|
122
|
+
throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`' + e.join("${...}") + "`");
|
|
123
|
+
u && u({
|
|
124
|
+
kind: "template prep",
|
|
125
|
+
template: this,
|
|
126
|
+
clonableTemplate: this.el,
|
|
127
|
+
parts: this.parts,
|
|
128
|
+
strings: e
|
|
129
|
+
});
|
|
463
130
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
131
|
+
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
132
|
+
/** @nocollapse */
|
|
133
|
+
static createElement(e, t) {
|
|
134
|
+
const i = V.createElement("template");
|
|
135
|
+
return i.innerHTML = e, i;
|
|
467
136
|
}
|
|
468
137
|
}
|
|
469
|
-
function
|
|
470
|
-
if (
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
138
|
+
function L(o, e, t = o, i) {
|
|
139
|
+
if (e === N)
|
|
140
|
+
return e;
|
|
141
|
+
let s = i !== void 0 ? t.__directives?.[i] : t.__directive;
|
|
142
|
+
const n = D(e) ? void 0 : (
|
|
143
|
+
// This property needs to remain unminified.
|
|
144
|
+
e._$litDirective$
|
|
145
|
+
);
|
|
146
|
+
return s?.constructor !== n && (s?._$notifyDirectiveConnectionChanged?.(!1), n === void 0 ? s = void 0 : (s = new n(o), s._$initialize(o, t, i)), i !== void 0 ? (t.__directives ??= [])[i] = s : t.__directive = s), s !== void 0 && (e = L(o, s._$resolve(o, e.values), s, i)), e;
|
|
474
147
|
}
|
|
475
|
-
|
|
476
|
-
constructor(
|
|
477
|
-
this._$
|
|
148
|
+
class Ze {
|
|
149
|
+
constructor(e, t) {
|
|
150
|
+
this._$parts = [], this._$disconnectableChildren = void 0, this._$template = e, this._$parent = t;
|
|
478
151
|
}
|
|
152
|
+
// Called by ChildPart parentNode getter
|
|
479
153
|
get parentNode() {
|
|
480
|
-
return this._$
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
n = 0,
|
|
497
|
-
l = s[0];
|
|
498
|
-
for (; void 0 !== l;) {
|
|
499
|
-
if (o === l.index) {
|
|
500
|
-
let i;
|
|
501
|
-
2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
|
|
154
|
+
return this._$parent.parentNode;
|
|
155
|
+
}
|
|
156
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
157
|
+
get _$isConnected() {
|
|
158
|
+
return this._$parent._$isConnected;
|
|
159
|
+
}
|
|
160
|
+
// This method is separate from the constructor because we need to return a
|
|
161
|
+
// DocumentFragment and we don't want to hold onto it with an instance field.
|
|
162
|
+
_clone(e) {
|
|
163
|
+
const { el: { content: t }, parts: i } = this._$template, s = (e?.creationScope ?? V).importNode(t, !0);
|
|
164
|
+
A.currentNode = s;
|
|
165
|
+
let n = A.nextNode(), r = 0, h = 0, a = i[0];
|
|
166
|
+
for (; a !== void 0; ) {
|
|
167
|
+
if (r === a.index) {
|
|
168
|
+
let c;
|
|
169
|
+
a.type === H ? c = new oe(n, n.nextSibling, this, e) : a.type === se ? c = new a.ctor(n, a.name, a.strings, this, e) : a.type === ne && (c = new Je(n, this, e)), this._$parts.push(c), a = i[++h];
|
|
502
170
|
}
|
|
503
|
-
|
|
171
|
+
r !== a?.index && (n = A.nextNode(), r++);
|
|
504
172
|
}
|
|
505
|
-
return
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
let
|
|
509
|
-
for (const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
173
|
+
return A.currentNode = V, s;
|
|
174
|
+
}
|
|
175
|
+
_update(e) {
|
|
176
|
+
let t = 0;
|
|
177
|
+
for (const i of this._$parts)
|
|
178
|
+
i !== void 0 && (u && u({
|
|
179
|
+
kind: "set part",
|
|
180
|
+
part: i,
|
|
181
|
+
value: e[t],
|
|
182
|
+
valueIndex: t,
|
|
183
|
+
values: e,
|
|
184
|
+
templateInstance: this
|
|
185
|
+
}), i.strings !== void 0 ? (i._$setValue(e, i, t), t += i.strings.length - 2) : i._$setValue(e[t])), t++;
|
|
518
186
|
}
|
|
187
|
+
}
|
|
188
|
+
let oe = class Ve {
|
|
189
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
190
|
+
get _$isConnected() {
|
|
191
|
+
return this._$parent?._$isConnected ?? this.__isConnected;
|
|
192
|
+
}
|
|
193
|
+
constructor(e, t, i, s) {
|
|
194
|
+
this.type = H, this._$committedValue = _, this._$disconnectableChildren = void 0, this._$startNode = e, this._$endNode = t, this._$parent = i, this.options = s, this.__isConnected = s?.isConnected ?? !0, this._textSanitizer = void 0;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The parent node into which the part renders its content.
|
|
198
|
+
*
|
|
199
|
+
* A ChildPart's content consists of a range of adjacent child nodes of
|
|
200
|
+
* `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and
|
|
201
|
+
* `.endNode`).
|
|
202
|
+
*
|
|
203
|
+
* - If both `.startNode` and `.endNode` are non-null, then the part's content
|
|
204
|
+
* consists of all siblings between `.startNode` and `.endNode`, exclusively.
|
|
205
|
+
*
|
|
206
|
+
* - If `.startNode` is non-null but `.endNode` is null, then the part's
|
|
207
|
+
* content consists of all siblings following `.startNode`, up to and
|
|
208
|
+
* including the last child of `.parentNode`. If `.endNode` is non-null, then
|
|
209
|
+
* `.startNode` will always be non-null.
|
|
210
|
+
*
|
|
211
|
+
* - If both `.endNode` and `.startNode` are null, then the part's content
|
|
212
|
+
* consists of all child nodes of `.parentNode`.
|
|
213
|
+
*/
|
|
519
214
|
get parentNode() {
|
|
520
|
-
let
|
|
521
|
-
const
|
|
522
|
-
return void 0
|
|
523
|
-
}
|
|
215
|
+
let e = x(this._$startNode).parentNode;
|
|
216
|
+
const t = this._$parent;
|
|
217
|
+
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* The part's leading marker node, if any. See `.parentNode` for more
|
|
221
|
+
* information.
|
|
222
|
+
*/
|
|
524
223
|
get startNode() {
|
|
525
|
-
return this._$
|
|
224
|
+
return this._$startNode;
|
|
526
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* The part's trailing marker node, if any. See `.parentNode` for more
|
|
228
|
+
* information.
|
|
229
|
+
*/
|
|
527
230
|
get endNode() {
|
|
528
|
-
return this._$
|
|
529
|
-
}
|
|
530
|
-
_$
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
231
|
+
return this._$endNode;
|
|
232
|
+
}
|
|
233
|
+
_$setValue(e, t = this) {
|
|
234
|
+
if (this.parentNode === null)
|
|
235
|
+
throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");
|
|
236
|
+
if (e = L(this, e, t), D(e))
|
|
237
|
+
e === _ || e == null || e === "" ? (this._$committedValue !== _ && (u && u({
|
|
238
|
+
kind: "commit nothing to child",
|
|
239
|
+
start: this._$startNode,
|
|
240
|
+
end: this._$endNode,
|
|
241
|
+
parent: this._$parent,
|
|
242
|
+
options: this.options
|
|
243
|
+
}), this._$clear()), this._$committedValue = _) : e !== this._$committedValue && e !== N && this._commitText(e);
|
|
244
|
+
else if (e._$litType$ !== void 0)
|
|
245
|
+
this._commitTemplateResult(e);
|
|
246
|
+
else if (e.nodeType !== void 0) {
|
|
247
|
+
if (this.options?.host === e) {
|
|
248
|
+
this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"), console.warn("Attempted to render the template host", e, "inside itself. This is almost always a mistake, and in dev mode ", "we render some warning text. In production however, we'll ", "render it, which will usually result in an error, and sometimes ", "in the element disappearing from the DOM.");
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this._commitNode(e);
|
|
252
|
+
} else Ie(e) ? this._commitIterable(e) : this._commitText(e);
|
|
253
|
+
}
|
|
254
|
+
_insert(e) {
|
|
255
|
+
return x(x(this._$startNode).parentNode).insertBefore(e, this._$endNode);
|
|
256
|
+
}
|
|
257
|
+
_commitNode(e) {
|
|
258
|
+
if (this._$committedValue !== e) {
|
|
259
|
+
if (this._$clear(), j !== Ce) {
|
|
260
|
+
const t = this._$startNode.parentNode?.nodeName;
|
|
261
|
+
if (t === "STYLE" || t === "SCRIPT") {
|
|
262
|
+
let i = "Forbidden";
|
|
263
|
+
throw t === "STYLE" ? i = "Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets." : i = "Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.", new Error(i);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
u && u({
|
|
267
|
+
kind: "commit node",
|
|
268
|
+
start: this._$startNode,
|
|
269
|
+
parent: this._$parent,
|
|
270
|
+
value: e,
|
|
271
|
+
options: this.options
|
|
272
|
+
}), this._$committedValue = this._insert(e);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
_commitText(e) {
|
|
276
|
+
if (this._$committedValue !== _ && D(this._$committedValue)) {
|
|
277
|
+
const t = x(this._$startNode).nextSibling;
|
|
278
|
+
this._textSanitizer === void 0 && (this._textSanitizer = ue()), e = this._textSanitizer(e), u && u({
|
|
279
|
+
kind: "commit text",
|
|
280
|
+
node: t,
|
|
281
|
+
value: e,
|
|
282
|
+
options: this.options
|
|
283
|
+
}), t.data = e;
|
|
284
|
+
} else {
|
|
285
|
+
const t = V.createTextNode("");
|
|
286
|
+
this._commitNode(t), this._textSanitizer === void 0 && (this._textSanitizer = ue()), e = this._textSanitizer(e), u && u({
|
|
287
|
+
kind: "commit text",
|
|
288
|
+
node: t,
|
|
289
|
+
value: e,
|
|
290
|
+
options: this.options
|
|
291
|
+
}), t.data = e;
|
|
292
|
+
}
|
|
293
|
+
this._$committedValue = e;
|
|
294
|
+
}
|
|
295
|
+
_commitTemplateResult(e) {
|
|
296
|
+
const { values: t, ["_$litType$"]: i } = e, s = typeof i == "number" ? this._$getTemplate(e) : (i.el === void 0 && (i.el = U.createElement(Ae(i.h, i.h[0]), this.options)), i);
|
|
297
|
+
if (this._$committedValue?._$template === s)
|
|
298
|
+
u && u({
|
|
299
|
+
kind: "template updating",
|
|
300
|
+
template: s,
|
|
301
|
+
instance: this._$committedValue,
|
|
302
|
+
parts: this._$committedValue._$parts,
|
|
303
|
+
options: this.options,
|
|
304
|
+
values: t
|
|
305
|
+
}), this._$committedValue._update(t);
|
|
306
|
+
else {
|
|
307
|
+
const n = new Ze(s, this), r = n._clone(this.options);
|
|
308
|
+
u && u({
|
|
309
|
+
kind: "template instantiated",
|
|
310
|
+
template: s,
|
|
311
|
+
instance: n,
|
|
312
|
+
parts: n._$parts,
|
|
313
|
+
options: this.options,
|
|
314
|
+
fragment: r,
|
|
315
|
+
values: t
|
|
316
|
+
}), n._update(t), u && u({
|
|
317
|
+
kind: "template instantiated and updated",
|
|
318
|
+
template: s,
|
|
319
|
+
instance: n,
|
|
320
|
+
parts: n._$parts,
|
|
321
|
+
options: this.options,
|
|
322
|
+
fragment: r,
|
|
323
|
+
values: t
|
|
324
|
+
}), this._commitNode(r), this._$committedValue = n;
|
|
552
325
|
}
|
|
553
326
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
327
|
+
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
328
|
+
/** @internal */
|
|
329
|
+
_$getTemplate(e) {
|
|
330
|
+
let t = be.get(e.strings);
|
|
331
|
+
return t === void 0 && be.set(e.strings, t = new U(e)), t;
|
|
332
|
+
}
|
|
333
|
+
_commitIterable(e) {
|
|
334
|
+
ie(this._$committedValue) || (this._$committedValue = [], this._$clear());
|
|
335
|
+
const t = this._$committedValue;
|
|
336
|
+
let i = 0, s;
|
|
337
|
+
for (const n of e)
|
|
338
|
+
i === t.length ? t.push(s = new Ve(this._insert(O()), this._insert(O()), this, this.options)) : s = t[i], s._$setValue(n), i++;
|
|
339
|
+
i < t.length && (this._$clear(s && x(s._$endNode).nextSibling, i), t.length = i);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Removes the nodes contained within this Part from the DOM.
|
|
343
|
+
*
|
|
344
|
+
* @param start Start node to clear from, for clearing a subset of the part's
|
|
345
|
+
* DOM (used when truncating iterables)
|
|
346
|
+
* @param from When `start` is specified, the index within the iterable from
|
|
347
|
+
* which ChildParts are being removed, used for disconnecting directives in
|
|
348
|
+
* those Parts.
|
|
349
|
+
*
|
|
350
|
+
* @internal
|
|
351
|
+
*/
|
|
352
|
+
_$clear(e = x(this._$startNode).nextSibling, t) {
|
|
353
|
+
for (this._$notifyConnectionChanged?.(!1, !0, t); e && e !== this._$endNode; ) {
|
|
354
|
+
const i = x(e).nextSibling;
|
|
355
|
+
x(e).remove(), e = i;
|
|
570
356
|
}
|
|
571
357
|
}
|
|
572
|
-
|
|
573
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Implementation of RootPart's `isConnected`. Note that this method
|
|
360
|
+
* should only be called on `RootPart`s (the `ChildPart` returned from a
|
|
361
|
+
* top-level `render()` call). It has no effect on non-root ChildParts.
|
|
362
|
+
* @param isConnected Whether to set
|
|
363
|
+
* @internal
|
|
364
|
+
*/
|
|
365
|
+
setConnected(e) {
|
|
366
|
+
if (this._$parent === void 0)
|
|
367
|
+
this.__isConnected = e, this._$notifyConnectionChanged?.(e);
|
|
368
|
+
else
|
|
369
|
+
throw new Error("part.setConnected() may only be called on a RootPart returned from render().");
|
|
574
370
|
}
|
|
575
|
-
}
|
|
576
|
-
class
|
|
371
|
+
};
|
|
372
|
+
class W {
|
|
577
373
|
get tagName() {
|
|
578
374
|
return this.element.tagName;
|
|
579
375
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
376
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
377
|
+
get _$isConnected() {
|
|
378
|
+
return this._$parent._$isConnected;
|
|
379
|
+
}
|
|
380
|
+
constructor(e, t, i, s, n) {
|
|
381
|
+
this.type = se, this._$committedValue = _, this._$disconnectableChildren = void 0, this.element = e, this.name = t, this._$parent = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$committedValue = new Array(i.length - 1).fill(new String()), this.strings = i) : this._$committedValue = _, this._sanitizer = void 0;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Sets the value of this part by resolving the value from possibly multiple
|
|
385
|
+
* values and static strings and committing it to the DOM.
|
|
386
|
+
* If this part is single-valued, `this._strings` will be undefined, and the
|
|
387
|
+
* method will be called with a single value argument. If this part is
|
|
388
|
+
* multi-value, `this._strings` will be defined, and the method is called
|
|
389
|
+
* with the value array of the part's owning TemplateInstance, and an offset
|
|
390
|
+
* into the value array from which the values should be read.
|
|
391
|
+
* This method is overloaded this way to eliminate short-lived array slices
|
|
392
|
+
* of the template instance values, and allow a fast-path for single-valued
|
|
393
|
+
* parts.
|
|
394
|
+
*
|
|
395
|
+
* @param value The part value, or an array of values for multi-valued parts
|
|
396
|
+
* @param valueIndex the index to start reading values from. `undefined` for
|
|
397
|
+
* single-valued parts
|
|
398
|
+
* @param noCommit causes the part to not commit its value to the DOM. Used
|
|
399
|
+
* in hydration to prime attribute parts with their first-rendered value,
|
|
400
|
+
* but not set the attribute, and in SSR to no-op the DOM operation and
|
|
401
|
+
* capture the value for serialization.
|
|
402
|
+
*
|
|
403
|
+
* @internal
|
|
404
|
+
*/
|
|
405
|
+
_$setValue(e, t = this, i, s) {
|
|
406
|
+
const n = this.strings;
|
|
407
|
+
let r = !1;
|
|
408
|
+
if (n === void 0)
|
|
409
|
+
e = L(this, e, t, 0), r = !D(e) || e !== this._$committedValue && e !== N, r && (this._$committedValue = e);
|
|
410
|
+
else {
|
|
411
|
+
const h = e;
|
|
412
|
+
e = n[0];
|
|
413
|
+
let a, c;
|
|
414
|
+
for (a = 0; a < n.length - 1; a++)
|
|
415
|
+
c = L(this, h[i + a], t, a), c === N && (c = this._$committedValue[a]), r ||= !D(c) || c !== this._$committedValue[a], c === _ ? e = _ : e !== _ && (e += (c ?? "") + n[a + 1]), this._$committedValue[a] = c;
|
|
593
416
|
}
|
|
594
|
-
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
|
|
417
|
+
r && !s && this._commitValue(e);
|
|
418
|
+
}
|
|
419
|
+
/** @internal */
|
|
420
|
+
_commitValue(e) {
|
|
421
|
+
e === _ ? x(this.element).removeAttribute(this.name) : (this._sanitizer === void 0 && (this._sanitizer = j(this.element, this.name)), e = this._sanitizer(e ?? ""), u && u({
|
|
422
|
+
kind: "commit attribute",
|
|
423
|
+
element: this.element,
|
|
424
|
+
name: this.name,
|
|
425
|
+
value: e,
|
|
426
|
+
options: this.options
|
|
427
|
+
}), x(this.element).setAttribute(this.name, e ?? ""));
|
|
598
428
|
}
|
|
599
429
|
}
|
|
600
|
-
class
|
|
430
|
+
class qe extends W {
|
|
601
431
|
constructor() {
|
|
602
|
-
super(...arguments), this.type =
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
|
|
432
|
+
super(...arguments), this.type = We;
|
|
433
|
+
}
|
|
434
|
+
/** @internal */
|
|
435
|
+
_commitValue(e) {
|
|
436
|
+
this._sanitizer === void 0 && (this._sanitizer = j(this.element, this.name)), e = this._sanitizer(e), u && u({
|
|
437
|
+
kind: "commit property",
|
|
438
|
+
element: this.element,
|
|
439
|
+
name: this.name,
|
|
440
|
+
value: e,
|
|
441
|
+
options: this.options
|
|
442
|
+
}), this.element[this.name] = e === _ ? void 0 : e;
|
|
606
443
|
}
|
|
607
444
|
}
|
|
608
|
-
class
|
|
445
|
+
class Qe extends W {
|
|
609
446
|
constructor() {
|
|
610
|
-
super(...arguments), this.type =
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
|
|
447
|
+
super(...arguments), this.type = Fe;
|
|
448
|
+
}
|
|
449
|
+
/** @internal */
|
|
450
|
+
_commitValue(e) {
|
|
451
|
+
u && u({
|
|
452
|
+
kind: "commit boolean attribute",
|
|
453
|
+
element: this.element,
|
|
454
|
+
name: this.name,
|
|
455
|
+
value: !!(e && e !== _),
|
|
456
|
+
options: this.options
|
|
457
|
+
}), x(this.element).toggleAttribute(this.name, !!e && e !== _);
|
|
614
458
|
}
|
|
615
459
|
}
|
|
616
|
-
class
|
|
617
|
-
constructor(t, i, s,
|
|
618
|
-
super(t, i, s,
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
e
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
460
|
+
class Xe extends W {
|
|
461
|
+
constructor(e, t, i, s, n) {
|
|
462
|
+
if (super(e, t, i, s, n), this.type = Ke, this.strings !== void 0)
|
|
463
|
+
throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`);
|
|
464
|
+
}
|
|
465
|
+
// EventPart does not use the base _$setValue/_resolveValue implementation
|
|
466
|
+
// since the dirty checking is more complex
|
|
467
|
+
/** @internal */
|
|
468
|
+
_$setValue(e, t = this) {
|
|
469
|
+
if (e = L(this, e, t, 0) ?? _, e === N)
|
|
470
|
+
return;
|
|
471
|
+
const i = this._$committedValue, s = e === _ && i !== _ || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, n = e !== _ && (i === _ || s);
|
|
472
|
+
u && u({
|
|
473
|
+
kind: "commit event listener",
|
|
474
|
+
element: this.element,
|
|
475
|
+
name: this.name,
|
|
476
|
+
value: e,
|
|
477
|
+
options: this.options,
|
|
478
|
+
removeListener: s,
|
|
479
|
+
addListener: n,
|
|
480
|
+
oldListener: i
|
|
481
|
+
}), s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, e), this._$committedValue = e;
|
|
482
|
+
}
|
|
483
|
+
handleEvent(e) {
|
|
484
|
+
typeof this._$committedValue == "function" ? this._$committedValue.call(this.options?.host ?? this.element, e) : this._$committedValue.handleEvent(e);
|
|
629
485
|
}
|
|
630
486
|
}
|
|
631
|
-
class
|
|
632
|
-
constructor(t, i
|
|
633
|
-
this.element =
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
487
|
+
class Je {
|
|
488
|
+
constructor(e, t, i) {
|
|
489
|
+
this.element = e, this.type = ne, this._$disconnectableChildren = void 0, this._$parent = t, this.options = i;
|
|
490
|
+
}
|
|
491
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
492
|
+
get _$isConnected() {
|
|
493
|
+
return this._$parent._$isConnected;
|
|
494
|
+
}
|
|
495
|
+
_$setValue(e) {
|
|
496
|
+
u && u({
|
|
497
|
+
kind: "commit to element binding",
|
|
498
|
+
element: this.element,
|
|
499
|
+
value: e,
|
|
500
|
+
options: this.options
|
|
501
|
+
}), L(this, e);
|
|
640
502
|
}
|
|
641
503
|
}
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
const B = (t, i, s) => {
|
|
661
|
-
const e = s?.renderBefore ?? i;
|
|
662
|
-
let h = e._$litPart$;
|
|
663
|
-
if (void 0 === h) {
|
|
664
|
-
const t = s?.renderBefore ?? null;
|
|
665
|
-
e._$litPart$ = h = new R(i.insertBefore(l(), t), t, void 0, s ?? {});
|
|
666
|
-
}
|
|
667
|
-
return h._$AI(t), h;
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* @license
|
|
672
|
-
* Copyright 2017 Google LLC
|
|
673
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
674
|
-
*/
|
|
675
|
-
const s$1 = globalThis;
|
|
676
|
-
let i$2 = class i extends y$1 {
|
|
677
|
-
constructor() {
|
|
678
|
-
super(...arguments), this.renderOptions = {
|
|
679
|
-
host: this
|
|
680
|
-
}, this._$Do = void 0;
|
|
681
|
-
}
|
|
682
|
-
createRenderRoot() {
|
|
683
|
-
const t = super.createRenderRoot();
|
|
684
|
-
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
504
|
+
const et = {
|
|
505
|
+
_ChildPart: oe
|
|
506
|
+
}, tt = $.litHtmlPolyfillSupportDevMode;
|
|
507
|
+
tt?.(U, oe);
|
|
508
|
+
($.litHtmlVersions ??= []).push("3.3.0");
|
|
509
|
+
$.litHtmlVersions.length > 1 && queueMicrotask(() => {
|
|
510
|
+
I("multiple-versions", "Multiple versions of Lit loaded. Loading multiple versions is not recommended.");
|
|
511
|
+
});
|
|
512
|
+
const re = {
|
|
513
|
+
ATTRIBUTE: 1,
|
|
514
|
+
CHILD: 2
|
|
515
|
+
}, ae = (o) => (...e) => ({
|
|
516
|
+
// This property needs to remain unminified.
|
|
517
|
+
_$litDirective$: o,
|
|
518
|
+
values: e
|
|
519
|
+
});
|
|
520
|
+
class le {
|
|
521
|
+
constructor(e) {
|
|
685
522
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
523
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
524
|
+
get _$isConnected() {
|
|
525
|
+
return this._$parent._$isConnected;
|
|
689
526
|
}
|
|
690
|
-
|
|
691
|
-
|
|
527
|
+
/** @internal */
|
|
528
|
+
_$initialize(e, t, i) {
|
|
529
|
+
this.__part = e, this._$parent = t, this.__attributeIndex = i;
|
|
692
530
|
}
|
|
693
|
-
|
|
694
|
-
|
|
531
|
+
/** @internal */
|
|
532
|
+
_$resolve(e, t) {
|
|
533
|
+
return this.update(e, t);
|
|
695
534
|
}
|
|
696
|
-
|
|
697
|
-
return
|
|
535
|
+
update(e, t) {
|
|
536
|
+
return this.render(...t);
|
|
698
537
|
}
|
|
699
|
-
};
|
|
700
|
-
i$2._$litElement$ = !0, i$2["finalized"] = !0, s$1.litElementHydrateSupport?.({
|
|
701
|
-
LitElement: i$2
|
|
702
|
-
});
|
|
703
|
-
const o$3 = s$1.litElementPolyfillSupport;
|
|
704
|
-
o$3?.({
|
|
705
|
-
LitElement: i$2
|
|
706
|
-
});
|
|
707
|
-
(s$1.litElementVersions ??= []).push("4.2.0");
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* @license
|
|
711
|
-
* Copyright 2017 Google LLC
|
|
712
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
713
|
-
*/
|
|
714
|
-
const t$3 = t => (e, o) => {
|
|
715
|
-
void 0 !== o ? o.addInitializer(() => {
|
|
716
|
-
customElements.define(t, e);
|
|
717
|
-
}) : customElements.define(t, e);
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* @license
|
|
722
|
-
* Copyright 2017 Google LLC
|
|
723
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
724
|
-
*/
|
|
725
|
-
const o$2 = {
|
|
726
|
-
attribute: !0,
|
|
727
|
-
type: String,
|
|
728
|
-
converter: u$3,
|
|
729
|
-
reflect: !1,
|
|
730
|
-
hasChanged: f$1
|
|
731
|
-
},
|
|
732
|
-
r$2 = (t = o$2, e, r) => {
|
|
733
|
-
const {
|
|
734
|
-
kind: n,
|
|
735
|
-
metadata: i
|
|
736
|
-
} = r;
|
|
737
|
-
let s = globalThis.litPropertyMetadata.get(i);
|
|
738
|
-
if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = new Map()), "setter" === n && ((t = Object.create(t)).wrapped = !0), s.set(r.name, t), "accessor" === n) {
|
|
739
|
-
const {
|
|
740
|
-
name: o
|
|
741
|
-
} = r;
|
|
742
|
-
return {
|
|
743
|
-
set(r) {
|
|
744
|
-
const n = e.get.call(this);
|
|
745
|
-
e.set.call(this, r), this.requestUpdate(o, n, t);
|
|
746
|
-
},
|
|
747
|
-
init(e) {
|
|
748
|
-
return void 0 !== e && this.C(o, void 0, t, e), e;
|
|
749
|
-
}
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
if ("setter" === n) {
|
|
753
|
-
const {
|
|
754
|
-
name: o
|
|
755
|
-
} = r;
|
|
756
|
-
return function (r) {
|
|
757
|
-
const n = this[o];
|
|
758
|
-
e.call(this, r), this.requestUpdate(o, n, t);
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
throw Error("Unsupported decorator location: " + n);
|
|
762
|
-
};
|
|
763
|
-
function n$1(t) {
|
|
764
|
-
return (e, o) => "object" == typeof o ? r$2(t, e, o) : ((t, e, o) => {
|
|
765
|
-
const r = e.hasOwnProperty(o);
|
|
766
|
-
return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
|
|
767
|
-
})(t, e, o);
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
/**
|
|
771
|
-
* @license
|
|
772
|
-
* Copyright 2017 Google LLC
|
|
773
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
774
|
-
*/
|
|
775
|
-
function r$1(r) {
|
|
776
|
-
return n$1({
|
|
777
|
-
...r,
|
|
778
|
-
state: !0,
|
|
779
|
-
attribute: !1
|
|
780
|
-
});
|
|
781
538
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* @license
|
|
808
|
-
* Copyright 2017 Google LLC
|
|
809
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
810
|
-
*/
|
|
811
|
-
const t$2 = {
|
|
812
|
-
ATTRIBUTE: 1,
|
|
813
|
-
CHILD: 2,
|
|
814
|
-
PROPERTY: 3,
|
|
815
|
-
BOOLEAN_ATTRIBUTE: 4,
|
|
816
|
-
EVENT: 5,
|
|
817
|
-
ELEMENT: 6
|
|
818
|
-
},
|
|
819
|
-
e$1 = t => (...e) => ({
|
|
820
|
-
_$litDirective$: t,
|
|
821
|
-
values: e
|
|
822
|
-
});
|
|
823
|
-
let i$1 = class i {
|
|
824
|
-
constructor(t) {}
|
|
825
|
-
get _$AU() {
|
|
826
|
-
return this._$AM._$AU;
|
|
827
|
-
}
|
|
828
|
-
_$AT(t, e, i) {
|
|
829
|
-
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
830
|
-
}
|
|
831
|
-
_$AS(t, e) {
|
|
832
|
-
return this.update(t, e);
|
|
833
|
-
}
|
|
834
|
-
update(t, e) {
|
|
835
|
-
return this.render(...e);
|
|
836
|
-
}
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* @license
|
|
841
|
-
* Copyright 2018 Google LLC
|
|
842
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
843
|
-
*/
|
|
844
|
-
const n = "important",
|
|
845
|
-
i = " !" + n,
|
|
846
|
-
o$1 = e$1(class extends i$1 {
|
|
847
|
-
constructor(t) {
|
|
848
|
-
if (super(t), t.type !== t$2.ATTRIBUTE || "style" !== t.name || t.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
849
|
-
}
|
|
850
|
-
render(t) {
|
|
851
|
-
return Object.keys(t).reduce((e, r) => {
|
|
852
|
-
const s = t[r];
|
|
853
|
-
return null == s ? e : e + `${r = r.includes("-") ? r : r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
854
|
-
}, "");
|
|
855
|
-
}
|
|
856
|
-
update(e, [r]) {
|
|
857
|
-
const {
|
|
858
|
-
style: s
|
|
859
|
-
} = e.element;
|
|
860
|
-
if (void 0 === this.ft) return this.ft = new Set(Object.keys(r)), this.render(r);
|
|
861
|
-
for (const t of this.ft) null == r[t] && (this.ft.delete(t), t.includes("-") ? s.removeProperty(t) : s[t] = null);
|
|
862
|
-
for (const t in r) {
|
|
863
|
-
const e = r[t];
|
|
864
|
-
if (null != e) {
|
|
865
|
-
this.ft.add(t);
|
|
866
|
-
const r = "string" == typeof e && e.endsWith(i);
|
|
867
|
-
t.includes("-") || r ? s.setProperty(t, r ? e.slice(0, -11) : e, r ? n : "") : s[t] = e;
|
|
868
|
-
}
|
|
539
|
+
const Le = "important", Me = " !" + Le, it = 0 - Me.length;
|
|
540
|
+
class st extends le {
|
|
541
|
+
constructor(e) {
|
|
542
|
+
if (super(e), e.type !== re.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2)
|
|
543
|
+
throw new Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
544
|
+
}
|
|
545
|
+
render(e) {
|
|
546
|
+
return Object.keys(e).reduce((t, i) => {
|
|
547
|
+
const s = e[i];
|
|
548
|
+
return s == null ? t : (i = i.includes("-") ? i : i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase(), t + `${i}:${s};`);
|
|
549
|
+
}, "");
|
|
550
|
+
}
|
|
551
|
+
update(e, [t]) {
|
|
552
|
+
const { style: i } = e.element;
|
|
553
|
+
if (this._previousStyleProperties === void 0)
|
|
554
|
+
return this._previousStyleProperties = new Set(Object.keys(t)), this.render(t);
|
|
555
|
+
for (const s of this._previousStyleProperties)
|
|
556
|
+
t[s] == null && (this._previousStyleProperties.delete(s), s.includes("-") ? i.removeProperty(s) : i[s] = null);
|
|
557
|
+
for (const s in t) {
|
|
558
|
+
const n = t[s];
|
|
559
|
+
if (n != null) {
|
|
560
|
+
this._previousStyleProperties.add(s);
|
|
561
|
+
const r = typeof n == "string" && n.endsWith(Me);
|
|
562
|
+
s.includes("-") || r ? i.setProperty(s, r ? n.slice(0, it) : n, r ? Le : "") : i[s] = n;
|
|
869
563
|
}
|
|
870
|
-
return T;
|
|
871
564
|
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
if (
|
|
886
|
-
|
|
887
|
-
if (
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
565
|
+
return N;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
const q = ae(st);
|
|
569
|
+
const nt = 1;
|
|
570
|
+
class de extends le {
|
|
571
|
+
constructor(e) {
|
|
572
|
+
if (super(e), this._value = _, e.type !== re.CHILD)
|
|
573
|
+
throw new Error(`${this.constructor.directiveName}() can only be used in child bindings`);
|
|
574
|
+
}
|
|
575
|
+
render(e) {
|
|
576
|
+
if (e === _ || e == null)
|
|
577
|
+
return this._templateResult = void 0, this._value = e;
|
|
578
|
+
if (e === N)
|
|
579
|
+
return e;
|
|
580
|
+
if (typeof e != "string")
|
|
581
|
+
throw new Error(`${this.constructor.directiveName}() called with a non-string value`);
|
|
582
|
+
if (e === this._value)
|
|
583
|
+
return this._templateResult;
|
|
584
|
+
this._value = e;
|
|
585
|
+
const t = [e];
|
|
586
|
+
return t.raw = t, this._templateResult = {
|
|
587
|
+
// Cast to a known set of integers that satisfy ResultType so that we
|
|
588
|
+
// don't have to export ResultType and possibly encourage this pattern.
|
|
589
|
+
// This property needs to remain unminified.
|
|
891
590
|
_$litType$: this.constructor.resultType,
|
|
892
|
-
strings:
|
|
591
|
+
strings: t,
|
|
893
592
|
values: []
|
|
894
593
|
};
|
|
895
594
|
}
|
|
896
595
|
}
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
const o = e$
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
s = () => document.createComment(""),
|
|
917
|
-
r = (o, i, n) => {
|
|
918
|
-
const e = o._$AA.parentNode,
|
|
919
|
-
l = void 0 === i ? o._$AB : i._$AA;
|
|
920
|
-
if (void 0 === n) {
|
|
921
|
-
const i = e.insertBefore(s(), l),
|
|
922
|
-
c = e.insertBefore(s(), l);
|
|
923
|
-
n = new t(i, c, o, o.options);
|
|
924
|
-
} else {
|
|
925
|
-
const t = n._$AB.nextSibling,
|
|
926
|
-
i = n._$AM,
|
|
927
|
-
c = i !== o;
|
|
928
|
-
if (c) {
|
|
929
|
-
let t;
|
|
930
|
-
n._$AQ?.(o), n._$AM = o, void 0 !== n._$AP && (t = o._$AU) !== i._$AU && n._$AP(t);
|
|
931
|
-
}
|
|
932
|
-
if (t !== l || c) {
|
|
933
|
-
let o = n._$AA;
|
|
934
|
-
for (; o !== t;) {
|
|
935
|
-
const t = o.nextSibling;
|
|
936
|
-
e.insertBefore(o, l), o = t;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
return n;
|
|
941
|
-
},
|
|
942
|
-
v = (o, t, i = o) => (o._$AI(t, i), o),
|
|
943
|
-
u$1 = {},
|
|
944
|
-
m = (o, t = u$1) => o._$AH = t,
|
|
945
|
-
p = o => o._$AH,
|
|
946
|
-
M = o => {
|
|
947
|
-
o._$AP?.(!1, !0);
|
|
948
|
-
let t = o._$AA;
|
|
949
|
-
const i = o._$AB.nextSibling;
|
|
950
|
-
for (; t !== i;) {
|
|
951
|
-
const o = t.nextSibling;
|
|
952
|
-
t.remove(), t = o;
|
|
953
|
-
}
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
/**
|
|
957
|
-
* @license
|
|
958
|
-
* Copyright 2017 Google LLC
|
|
959
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
960
|
-
*/
|
|
961
|
-
const u = (e, s, t) => {
|
|
962
|
-
const r = new Map();
|
|
963
|
-
for (let l = s; l <= t; l++) r.set(e[l], l);
|
|
964
|
-
return r;
|
|
965
|
-
},
|
|
966
|
-
c = e$1(class extends i$1 {
|
|
967
|
-
constructor(e) {
|
|
968
|
-
if (super(e), e.type !== t$2.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
969
|
-
}
|
|
970
|
-
dt(e, s, t) {
|
|
971
|
-
let r;
|
|
972
|
-
void 0 === t ? t = s : void 0 !== s && (r = s);
|
|
973
|
-
const l = [],
|
|
974
|
-
o = [];
|
|
975
|
-
let i = 0;
|
|
976
|
-
for (const s of e) l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
|
|
977
|
-
return {
|
|
978
|
-
values: o,
|
|
979
|
-
keys: l
|
|
980
|
-
};
|
|
981
|
-
}
|
|
982
|
-
render(e, s, t) {
|
|
983
|
-
return this.dt(e, s, t).values;
|
|
596
|
+
de.directiveName = "unsafeHTML";
|
|
597
|
+
de.resultType = nt;
|
|
598
|
+
const ot = 2;
|
|
599
|
+
class ce extends de {
|
|
600
|
+
}
|
|
601
|
+
ce.directiveName = "unsafeSVG";
|
|
602
|
+
ce.resultType = ot;
|
|
603
|
+
const rt = ae(ce);
|
|
604
|
+
const { _ChildPart: at } = et, T = window.ShadyDOM?.inUse && window.ShadyDOM?.noPatch === !0 ? window.ShadyDOM.wrap : (o) => o, xe = () => document.createComment(""), k = (o, e, t) => {
|
|
605
|
+
const i = T(o._$startNode).parentNode, s = e === void 0 ? o._$endNode : e._$startNode;
|
|
606
|
+
if (t === void 0) {
|
|
607
|
+
const n = T(i).insertBefore(xe(), s), r = T(i).insertBefore(xe(), s);
|
|
608
|
+
t = new at(n, r, o, o.options);
|
|
609
|
+
} else {
|
|
610
|
+
const n = T(t._$endNode).nextSibling, r = t._$parent, h = r !== o;
|
|
611
|
+
if (h) {
|
|
612
|
+
t._$reparentDisconnectables?.(o), t._$parent = o;
|
|
613
|
+
let a;
|
|
614
|
+
t._$notifyConnectionChanged !== void 0 && (a = o._$isConnected) !== r._$isConnected && t._$notifyConnectionChanged(a);
|
|
984
615
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
} = this.dt(t, r$1, c);
|
|
991
|
-
if (!Array.isArray(d)) return this.ut = a, p$1;
|
|
992
|
-
const h = this.ut ??= [],
|
|
993
|
-
v$1 = [];
|
|
994
|
-
let m$1,
|
|
995
|
-
y,
|
|
996
|
-
x = 0,
|
|
997
|
-
j = d.length - 1,
|
|
998
|
-
k = 0,
|
|
999
|
-
w = p$1.length - 1;
|
|
1000
|
-
for (; x <= j && k <= w;) if (null === d[x]) x++;else if (null === d[j]) j--;else if (h[x] === a[k]) v$1[k] = v(d[x], p$1[k]), x++, k++;else if (h[j] === a[w]) v$1[w] = v(d[j], p$1[w]), j--, w--;else if (h[x] === a[w]) v$1[w] = v(d[x], p$1[w]), r(s, v$1[w + 1], d[x]), x++, w--;else if (h[j] === a[k]) v$1[k] = v(d[j], p$1[k]), r(s, d[x], d[j]), j--, k++;else if (void 0 === m$1 && (m$1 = u(a, k, w), y = u(h, x, j)), m$1.has(h[x])) {
|
|
1001
|
-
if (m$1.has(h[j])) {
|
|
1002
|
-
const e = y.get(a[k]),
|
|
1003
|
-
t = void 0 !== e ? d[e] : null;
|
|
1004
|
-
if (null === t) {
|
|
1005
|
-
const e = r(s, d[x]);
|
|
1006
|
-
v(e, p$1[k]), v$1[k] = e;
|
|
1007
|
-
} else v$1[k] = v(t, p$1[k]), r(s, d[x], t), d[e] = null;
|
|
1008
|
-
k++;
|
|
1009
|
-
} else M(d[j]), j--;
|
|
1010
|
-
} else M(d[x]), x++;
|
|
1011
|
-
for (; k <= w;) {
|
|
1012
|
-
const e = r(s, v$1[w + 1]);
|
|
1013
|
-
v(e, p$1[k]), v$1[k++] = e;
|
|
616
|
+
if (n !== s || h) {
|
|
617
|
+
let a = t._$startNode;
|
|
618
|
+
for (; a !== n; ) {
|
|
619
|
+
const c = T(a).nextSibling;
|
|
620
|
+
T(i).insertBefore(a, s), a = c;
|
|
1014
621
|
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return t;
|
|
625
|
+
}, E = (o, e, t = o) => (o._$setValue(e, t), o), lt = {}, dt = (o, e = lt) => o._$committedValue = e, ct = (o) => o._$committedValue, Q = (o) => {
|
|
626
|
+
o._$notifyConnectionChanged?.(!1, !0);
|
|
627
|
+
let e = o._$startNode;
|
|
628
|
+
const t = T(o._$endNode).nextSibling;
|
|
629
|
+
for (; e !== t; ) {
|
|
630
|
+
const i = T(e).nextSibling;
|
|
631
|
+
T(e).remove(), e = i;
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
const we = (o, e, t) => {
|
|
635
|
+
const i = /* @__PURE__ */ new Map();
|
|
636
|
+
for (let s = e; s <= t; s++)
|
|
637
|
+
i.set(o[s], s);
|
|
638
|
+
return i;
|
|
639
|
+
};
|
|
640
|
+
class ht extends le {
|
|
641
|
+
constructor(e) {
|
|
642
|
+
if (super(e), e.type !== re.CHILD)
|
|
643
|
+
throw new Error("repeat() can only be used in text expressions");
|
|
644
|
+
}
|
|
645
|
+
_getValuesAndKeys(e, t, i) {
|
|
646
|
+
let s;
|
|
647
|
+
i === void 0 ? i = t : t !== void 0 && (s = t);
|
|
648
|
+
const n = [], r = [];
|
|
649
|
+
let h = 0;
|
|
650
|
+
for (const a of e)
|
|
651
|
+
n[h] = s ? s(a, h) : h, r[h] = i(a, h), h++;
|
|
652
|
+
return {
|
|
653
|
+
values: r,
|
|
654
|
+
keys: n
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
render(e, t, i) {
|
|
658
|
+
return this._getValuesAndKeys(e, t, i).values;
|
|
659
|
+
}
|
|
660
|
+
update(e, [t, i, s]) {
|
|
661
|
+
const n = ct(e), { values: r, keys: h } = this._getValuesAndKeys(t, i, s);
|
|
662
|
+
if (!Array.isArray(n))
|
|
663
|
+
return this._itemKeys = h, r;
|
|
664
|
+
const a = this._itemKeys ??= [], c = [];
|
|
665
|
+
let f, m, d = 0, l = n.length - 1, p = 0, g = r.length - 1;
|
|
666
|
+
for (; d <= l && p <= g; )
|
|
667
|
+
if (n[d] === null)
|
|
668
|
+
d++;
|
|
669
|
+
else if (n[l] === null)
|
|
670
|
+
l--;
|
|
671
|
+
else if (a[d] === h[p])
|
|
672
|
+
c[p] = E(n[d], r[p]), d++, p++;
|
|
673
|
+
else if (a[l] === h[g])
|
|
674
|
+
c[g] = E(n[l], r[g]), l--, g--;
|
|
675
|
+
else if (a[d] === h[g])
|
|
676
|
+
c[g] = E(n[d], r[g]), k(e, c[g + 1], n[d]), d++, g--;
|
|
677
|
+
else if (a[l] === h[p])
|
|
678
|
+
c[p] = E(n[l], r[p]), k(e, n[d], n[l]), l--, p++;
|
|
679
|
+
else if (f === void 0 && (f = we(h, p, g), m = we(a, d, l)), !f.has(a[d]))
|
|
680
|
+
Q(n[d]), d++;
|
|
681
|
+
else if (!f.has(a[l]))
|
|
682
|
+
Q(n[l]), l--;
|
|
683
|
+
else {
|
|
684
|
+
const w = m.get(h[p]), F = w !== void 0 ? n[w] : null;
|
|
685
|
+
if (F === null) {
|
|
686
|
+
const me = k(e, n[d]);
|
|
687
|
+
E(me, r[p]), c[p] = me;
|
|
688
|
+
} else
|
|
689
|
+
c[p] = E(F, r[p]), k(e, n[d], F), n[w] = null;
|
|
690
|
+
p++;
|
|
1018
691
|
}
|
|
1019
|
-
|
|
692
|
+
for (; p <= g; ) {
|
|
693
|
+
const w = k(e, c[g + 1]);
|
|
694
|
+
E(w, r[p]), c[p++] = w;
|
|
1020
695
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
render() {
|
|
1025
|
-
return x `
|
|
1026
|
-
${this.value !== undefined
|
|
1027
|
-
? x `<div class="bar" style="width: ${this.value * 100}%;"></div>`
|
|
1028
|
-
: x `<div class="indeterminate"></div>`}
|
|
1029
|
-
`;
|
|
696
|
+
for (; d <= l; ) {
|
|
697
|
+
const w = n[d++];
|
|
698
|
+
w !== null && Q(w);
|
|
1030
699
|
}
|
|
700
|
+
return this._itemKeys = h, dt(e, c), N;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
const X = ae(ht);
|
|
704
|
+
var mt = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, Pe = (o, e, t, i) => {
|
|
705
|
+
for (var s = i > 1 ? void 0 : i ? pt(e, t) : e, n = o.length - 1, r; n >= 0; n--)
|
|
706
|
+
(r = o[n]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
707
|
+
return i && s && mt(e, t, s), s;
|
|
1031
708
|
};
|
|
1032
|
-
|
|
709
|
+
let B = class extends Te {
|
|
710
|
+
render() {
|
|
711
|
+
return y`
|
|
712
|
+
${this.value !== void 0 ? y`<div class="bar" style="width: ${this.value * 100}%;"></div>` : y`<div class="indeterminate"></div>`}
|
|
713
|
+
`;
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
B.styles = ve`
|
|
1033
717
|
:host {
|
|
1034
718
|
display: inline-block;
|
|
1035
719
|
width: var(--progress-width, 200px);
|
|
@@ -1071,301 +755,219 @@ LinearProgress.styles = i$5 `
|
|
|
1071
755
|
}
|
|
1072
756
|
}
|
|
1073
757
|
`;
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
],
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
],
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
758
|
+
Pe([
|
|
759
|
+
te({ type: Number })
|
|
760
|
+
], B.prototype, "value", 2);
|
|
761
|
+
B = Pe([
|
|
762
|
+
Re("linear-progress")
|
|
763
|
+
], B);
|
|
764
|
+
var ut = Object.defineProperty, C = (o, e, t, i) => {
|
|
765
|
+
for (var s = void 0, n = o.length - 1, r; n >= 0; n--)
|
|
766
|
+
(r = o[n]) && (s = r(e, t, s) || s);
|
|
767
|
+
return s && ut(e, t, s), s;
|
|
768
|
+
};
|
|
769
|
+
const he = class he extends Te {
|
|
770
|
+
constructor() {
|
|
771
|
+
super(), this.version = "1.0.7", this.getModifier = this.getModifier.bind(this);
|
|
772
|
+
}
|
|
773
|
+
update(e) {
|
|
774
|
+
e.has("inputData") && (this.transform(), this.modifier || this.getModifier()), e.has("theme") && this.registerTheme(this.theme), super.update(e);
|
|
775
|
+
}
|
|
776
|
+
firstUpdated(e) {
|
|
777
|
+
this.registerTheme(this.theme), new ResizeObserver(this.getModifier).observe(this);
|
|
778
|
+
}
|
|
779
|
+
registerTheme(e) {
|
|
780
|
+
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), i = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
781
|
+
this.themeBgColor = i || 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;
|
|
782
|
+
}
|
|
783
|
+
handleFileChange(e) {
|
|
784
|
+
const i = e.target.files?.[0];
|
|
785
|
+
i && (this.previewUrl && URL.revokeObjectURL(this.previewUrl), this.previewUrl = URL.createObjectURL(i), this.dispatchEvent(
|
|
786
|
+
new CustomEvent("overlay-file-selected", {
|
|
787
|
+
detail: { file: i, name: i.name, size: i.size, type: i.type, url: this.previewUrl },
|
|
788
|
+
bubbles: !0,
|
|
789
|
+
composed: !0
|
|
790
|
+
})
|
|
791
|
+
));
|
|
792
|
+
}
|
|
793
|
+
transform() {
|
|
794
|
+
if (this.inlineSvg = void 0, !this.inputData?.image) {
|
|
795
|
+
this.previewUrl = void 0;
|
|
796
|
+
return;
|
|
1086
797
|
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
this.getModifier();
|
|
1092
|
-
}
|
|
1093
|
-
if (changedProperties.has('theme')) {
|
|
1094
|
-
this.registerTheme(this.theme);
|
|
1095
|
-
}
|
|
1096
|
-
super.update(changedProperties);
|
|
798
|
+
const e = this.inputData.image.trim(), i = e.replace(/^\uFEFF/, "").trimStart().match(/<svg[\s\S]*?<\/svg>/i);
|
|
799
|
+
if (i) {
|
|
800
|
+
this.inlineSvg = i[0].trim(), this.previewUrl = void 0;
|
|
801
|
+
return;
|
|
1097
802
|
}
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
ro.observe(this);
|
|
803
|
+
if (/^data:image\/svg\+xml[,;]/.test(e)) {
|
|
804
|
+
this.previewUrl = e;
|
|
805
|
+
return;
|
|
1102
806
|
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
const cssBgColor = getComputedStyle(this).getPropertyValue('--re-tile-background-color').trim();
|
|
1107
|
-
this.themeBgColor = cssBgColor || ((_b = (_a = this.theme) === null || _a === void 0 ? void 0 : _a.theme_object) === null || _b === void 0 ? void 0 : _b.backgroundColor);
|
|
1108
|
-
this.themeTitleColor = cssTextColor || ((_f = (_e = (_d = (_c = this.theme) === null || _c === void 0 ? void 0 : _c.theme_object) === null || _d === void 0 ? void 0 : _d.title) === null || _e === void 0 ? void 0 : _e.textStyle) === null || _f === void 0 ? void 0 : _f.color);
|
|
1109
|
-
this.themeSubtitleColor =
|
|
1110
|
-
cssTextColor || ((_k = (_j = (_h = (_g = this.theme) === null || _g === void 0 ? void 0 : _g.theme_object) === null || _h === void 0 ? void 0 : _h.title) === null || _j === void 0 ? void 0 : _j.subtextStyle) === null || _k === void 0 ? void 0 : _k.color) || this.themeTitleColor;
|
|
807
|
+
if (/^data:image\/[a-zA-Z.+-]+;base64,/.test(e)) {
|
|
808
|
+
this.previewUrl = e;
|
|
809
|
+
return;
|
|
1111
810
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
const file = (_a = input.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
1116
|
-
if (!file)
|
|
1117
|
-
return;
|
|
1118
|
-
// Revoke previous object URL
|
|
1119
|
-
if (this.previewUrl)
|
|
1120
|
-
URL.revokeObjectURL(this.previewUrl);
|
|
1121
|
-
this.previewUrl = URL.createObjectURL(file);
|
|
1122
|
-
this.dispatchEvent(new CustomEvent('overlay-file-selected', {
|
|
1123
|
-
detail: { file, name: file.name, size: file.size, type: file.type, url: this.previewUrl },
|
|
1124
|
-
bubbles: true,
|
|
1125
|
-
composed: true
|
|
1126
|
-
}));
|
|
811
|
+
if (/^[A-Za-z0-9+/]+=*$/.test(e) && e.length > 100) {
|
|
812
|
+
this.previewUrl = `data:image/*;base64,${e}`;
|
|
813
|
+
return;
|
|
1127
814
|
}
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
// Dynamically load progress bar element if needed
|
|
1137
|
-
// if (this.inputData?.overlays?.some((o) => o.layerType === 'progress')) {
|
|
1138
|
-
// import('./linear-progress.js')
|
|
1139
|
-
// }
|
|
1140
|
-
// Inline SVG markup (optionally starting with an XML declaration or other preamble)
|
|
1141
|
-
const trimmed = raw.replace(/^\uFEFF/, '').trimStart();
|
|
1142
|
-
// Find the actual <svg ...>...</svg> block even if preceded by <?xml ...?> or <!DOCTYPE ...>
|
|
1143
|
-
const svgBlockMatch = trimmed.match(/<svg[\s\S]*?<\/svg>/i);
|
|
1144
|
-
if (svgBlockMatch) {
|
|
1145
|
-
this.inlineSvg = svgBlockMatch[0].trim();
|
|
1146
|
-
this.previewUrl = undefined;
|
|
1147
|
-
return;
|
|
1148
|
-
}
|
|
1149
|
-
// Full data URL (already encoded)
|
|
1150
|
-
if (/^data:image\/svg\+xml[,;]/.test(raw)) {
|
|
1151
|
-
// It's an SVG data URL; we could theoretically decode, but safer to keep as src
|
|
1152
|
-
this.previewUrl = raw;
|
|
1153
|
-
return;
|
|
1154
|
-
}
|
|
1155
|
-
if (/^data:image\/[a-zA-Z.+-]+;base64,/.test(raw)) {
|
|
1156
|
-
this.previewUrl = raw;
|
|
1157
|
-
return;
|
|
1158
|
-
}
|
|
1159
|
-
// Bare base64 string (heuristic)
|
|
1160
|
-
if (/^[A-Za-z0-9+/]+=*$/.test(raw) && raw.length > 100) {
|
|
1161
|
-
this.previewUrl = `data:image/*;base64,${raw}`;
|
|
1162
|
-
return;
|
|
1163
|
-
}
|
|
1164
|
-
// Absolute URL
|
|
1165
|
-
try {
|
|
1166
|
-
new URL(raw);
|
|
1167
|
-
this.previewUrl = raw;
|
|
1168
|
-
return;
|
|
1169
|
-
}
|
|
1170
|
-
catch (_b) {
|
|
1171
|
-
// Relative path
|
|
1172
|
-
if (/^([./]|\/)/.test(raw)) {
|
|
1173
|
-
this.previewUrl = raw;
|
|
1174
|
-
return;
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
// Fallback
|
|
1178
|
-
this.previewUrl = undefined;
|
|
815
|
+
try {
|
|
816
|
+
new URL(e), this.previewUrl = e;
|
|
817
|
+
return;
|
|
818
|
+
} catch {
|
|
819
|
+
if (/^([./]|\/)/.test(e)) {
|
|
820
|
+
this.previewUrl = e;
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
1179
823
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
824
|
+
this.previewUrl = void 0;
|
|
825
|
+
}
|
|
826
|
+
async getModifier() {
|
|
827
|
+
if (!this.baseLayer) return;
|
|
828
|
+
const e = this.baseLayer.getBoundingClientRect();
|
|
829
|
+
if (!e) return;
|
|
830
|
+
const t = this.baseLayer.parentElement?.getBoundingClientRect();
|
|
831
|
+
if (!t) return;
|
|
832
|
+
let i, s;
|
|
833
|
+
if (this.baseLayer instanceof HTMLImageElement)
|
|
834
|
+
i = this.baseLayer.naturalWidth, s = this.baseLayer.naturalHeight;
|
|
835
|
+
else {
|
|
836
|
+
const d = this.baseLayer.querySelector("svg");
|
|
837
|
+
if (d) {
|
|
838
|
+
const l = d.viewBox.baseVal;
|
|
839
|
+
if (console.log(l), l && l.width > 0 && l.height > 0)
|
|
840
|
+
i = l.width, s = l.height;
|
|
1197
841
|
else {
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
// For <svg>
|
|
1201
|
-
const viewBox = innerSvg.viewBox.baseVal;
|
|
1202
|
-
console.log(viewBox);
|
|
1203
|
-
if (viewBox && viewBox.width > 0 && viewBox.height > 0) {
|
|
1204
|
-
intrinsicWidth = viewBox.width;
|
|
1205
|
-
intrinsicHeight = viewBox.height;
|
|
1206
|
-
}
|
|
1207
|
-
else {
|
|
1208
|
-
// fallback to width/height attributes if set
|
|
1209
|
-
const widthAttr = this.baseLayer.getAttribute('width');
|
|
1210
|
-
const heightAttr = this.baseLayer.getAttribute('height');
|
|
1211
|
-
if (widthAttr && heightAttr) {
|
|
1212
|
-
intrinsicWidth = parseFloat(widthAttr);
|
|
1213
|
-
intrinsicHeight = parseFloat(heightAttr);
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
842
|
+
const p = this.baseLayer.getAttribute("width"), g = this.baseLayer.getAttribute("height");
|
|
843
|
+
p && g && (i = parseFloat(p), s = parseFloat(g));
|
|
1217
844
|
}
|
|
1218
|
-
|
|
1219
|
-
return;
|
|
1220
|
-
// Actual visible area of the image/svg
|
|
1221
|
-
const scaleX = rect.width / intrinsicWidth;
|
|
1222
|
-
const scaleY = rect.height / intrinsicHeight;
|
|
1223
|
-
const scale = Math.min(scaleX, scaleY);
|
|
1224
|
-
const visibleWidth = intrinsicWidth * scale;
|
|
1225
|
-
const visibleHeight = intrinsicHeight * scale;
|
|
1226
|
-
const xOffset = (containerRect.width - visibleWidth) / 2;
|
|
1227
|
-
const yOffset = (containerRect.height - visibleHeight) / 2;
|
|
1228
|
-
this.modifier = { scaler: scale, xOffset, yOffset, visibleWidth, visibleHeight };
|
|
845
|
+
}
|
|
1229
846
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
847
|
+
if (!i || !s) return;
|
|
848
|
+
const n = e.width / i, r = e.height / s, h = Math.min(n, r), a = i * h, c = s * h, f = (t.width - a) / 2, m = (t.height - c) / 2;
|
|
849
|
+
this.modifier = { scaler: h, xOffset: f, yOffset: m, visibleWidth: a, visibleHeight: c };
|
|
850
|
+
}
|
|
851
|
+
getOverlayItemPosition(e, t, i) {
|
|
852
|
+
return {
|
|
853
|
+
left: e * i.visibleWidth,
|
|
854
|
+
top: t * i.visibleHeight
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
renderText(e, t, i) {
|
|
858
|
+
const s = e, n = this.getOverlayItemPosition(t.relXPos, t.relYPos, i);
|
|
859
|
+
if (!n) return P;
|
|
860
|
+
const r = s.textStyle?.precision ?? 1;
|
|
861
|
+
let h = t.data;
|
|
862
|
+
const a = Number(h);
|
|
863
|
+
let c = "#333";
|
|
864
|
+
if (!Number.isNaN(a) && typeof r == "number" && r >= 0) {
|
|
865
|
+
h = a.toFixed(r);
|
|
866
|
+
const m = s.sections?.sectionLimits.findIndex((d) => a <= d) ?? -2;
|
|
867
|
+
c = (m >= 1 ? s.sections?.colors[m - 1] : "#333") ?? "#333";
|
|
1235
868
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
color = (_f = (sectionIndex >= 1 ? (_e = overlay.sections) === null || _e === void 0 ? void 0 : _e.colors[sectionIndex - 1] : '#333')) !== null && _f !== void 0 ? _f : '#333';
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
const styles = {
|
|
1254
|
-
'font-size': ((_g = overlay.textStyle.fontSize) !== null && _g !== void 0 ? _g : 14) * modifier.scaler + 'px',
|
|
1255
|
-
color,
|
|
1256
|
-
'background-color': overlay.textStyle.backgroundColor,
|
|
1257
|
-
'font-weight': overlay.textStyle.fontWeight,
|
|
1258
|
-
left: `${pos.left}px`,
|
|
1259
|
-
top: `${pos.top}px`,
|
|
1260
|
-
'border-radius': 10 * modifier.scaler + 'px',
|
|
1261
|
-
'transform-origin': '50% 50%',
|
|
1262
|
-
transform: `translate(-50%, -50%)`,
|
|
1263
|
-
padding: `${6 * modifier.scaler}px ${12 * modifier.scaler}px`
|
|
1264
|
-
};
|
|
1265
|
-
return x `
|
|
1266
|
-
<div class="overlay-item" style=${o$1(styles)}>${item.prefix}${value}${item.suffix}</div>
|
|
869
|
+
const f = {
|
|
870
|
+
"font-size": (s.textStyle.fontSize ?? 14) * i.scaler + "px",
|
|
871
|
+
color: c,
|
|
872
|
+
"background-color": s.textStyle.backgroundColor,
|
|
873
|
+
"font-weight": s.textStyle.fontWeight,
|
|
874
|
+
left: `${n.left}px`,
|
|
875
|
+
top: `${n.top}px`,
|
|
876
|
+
"border-radius": 10 * i.scaler + "px",
|
|
877
|
+
"transform-origin": "50% 50%",
|
|
878
|
+
transform: "translate(-50%, -50%)",
|
|
879
|
+
padding: `${6 * i.scaler}px ${12 * i.scaler}px`
|
|
880
|
+
};
|
|
881
|
+
return y`
|
|
882
|
+
<div class="overlay-item" style=${q(f)}>${t.prefix}${h}${t.suffix}</div>
|
|
1267
883
|
`;
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
// percent now holds the normalized 0-100 percentage for rawValue
|
|
1297
|
-
return x ` <linear-progress .value=${percent} style=${o$1(styles)}></linear-progress> `;
|
|
1298
|
-
}
|
|
1299
|
-
renderLayer(overlay) {
|
|
1300
|
-
const modifier = this.modifier;
|
|
1301
|
-
if (!modifier)
|
|
1302
|
-
return E;
|
|
1303
|
-
const containerStyles = {
|
|
1304
|
-
left: modifier.xOffset + 'px',
|
|
1305
|
-
top: modifier.yOffset + 'px',
|
|
1306
|
-
width: modifier.visibleWidth + 'px',
|
|
1307
|
-
height: modifier.visibleHeight + 'px'
|
|
1308
|
-
};
|
|
1309
|
-
return x `<div
|
|
884
|
+
}
|
|
885
|
+
renderProgress(e, t, i) {
|
|
886
|
+
const s = e, n = this.getOverlayItemPosition(t.relXPos, t.relYPos, i);
|
|
887
|
+
if (!n) return P;
|
|
888
|
+
const r = s.sections?.sectionLimits.findIndex((p) => Number(t.data) <= p) ?? -2, a = {
|
|
889
|
+
"--progress-color": (r >= 1 ? s.sections?.colors[r - 1] : void 0) ?? "#333",
|
|
890
|
+
"--progress-width": (s.progressStyle?.width ?? 10) * i.scaler + "px",
|
|
891
|
+
"--progress-height": (s.progressStyle?.height ?? 100) * i.scaler + "px",
|
|
892
|
+
"--progress-background": s.progressStyle?.backgroundColor ?? "#fff",
|
|
893
|
+
"border-radius": 10 * i.scaler + "px",
|
|
894
|
+
"transform-origin": "50% 50%",
|
|
895
|
+
transform: `translate(-50%, -50%) rotate(${s.progressStyle?.rotate ?? 0}deg)`,
|
|
896
|
+
left: `${n.left}px`,
|
|
897
|
+
top: `${n.top}px`
|
|
898
|
+
}, c = Number(t.data), f = s.sections ?? {}, m = Math.min(...f.sectionLimits.map(Number)), d = Math.max(...f.sectionLimits.map(Number));
|
|
899
|
+
let l = d === m ? 0 : (c - m) / (d - m);
|
|
900
|
+
return l = Math.min(1, Math.max(0, l)), y` <linear-progress .value=${l} style=${q(a)}></linear-progress> `;
|
|
901
|
+
}
|
|
902
|
+
renderLayer(e) {
|
|
903
|
+
const t = this.modifier;
|
|
904
|
+
if (!t) return P;
|
|
905
|
+
const i = {
|
|
906
|
+
left: t.xOffset + "px",
|
|
907
|
+
top: t.yOffset + "px",
|
|
908
|
+
width: t.visibleWidth + "px",
|
|
909
|
+
height: t.visibleHeight + "px"
|
|
910
|
+
};
|
|
911
|
+
return y`<div
|
|
1310
912
|
class="overlay"
|
|
1311
|
-
style=${
|
|
1312
|
-
type="${
|
|
1313
|
-
name="${
|
|
913
|
+
style=${q(i)}
|
|
914
|
+
type="${e.layerType}"
|
|
915
|
+
name="${e.layerName}"
|
|
1314
916
|
>
|
|
1315
|
-
${
|
|
1316
|
-
? this.renderTextLayer(overlay)
|
|
1317
|
-
: this.renderProgressLayer(overlay)}
|
|
917
|
+
${e.layerType === "text" ? this.renderTextLayer(e) : this.renderProgressLayer(e)}
|
|
1318
918
|
</div>`;
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
919
|
+
}
|
|
920
|
+
renderTextLayer(e) {
|
|
921
|
+
const t = this.modifier;
|
|
922
|
+
return t ? y`${X(
|
|
923
|
+
e.textPins ?? [],
|
|
924
|
+
(i, s) => s,
|
|
925
|
+
(i) => y`${this.renderText(e, i, t)}`
|
|
926
|
+
)}` : P;
|
|
927
|
+
}
|
|
928
|
+
renderProgressLayer(e) {
|
|
929
|
+
const t = this.modifier;
|
|
930
|
+
return t ? y`${X(
|
|
931
|
+
e.progressPins ?? [],
|
|
932
|
+
(i, s) => s,
|
|
933
|
+
(i) => y`${this.renderProgress(e, i, t)}`
|
|
934
|
+
)}` : P;
|
|
935
|
+
}
|
|
936
|
+
render() {
|
|
937
|
+
const e = !!this.inlineSvg || !!this.previewUrl;
|
|
938
|
+
return y`
|
|
1338
939
|
<div class="wrapper" style="background-color: ${this.themeBgColor}">
|
|
1339
|
-
<h3 class="paging" ?active=${
|
|
1340
|
-
${
|
|
940
|
+
<h3 class="paging" ?active=${this.inputData?.title} style="color: ${this.themeTitleColor}">
|
|
941
|
+
${this.inputData?.title}
|
|
1341
942
|
</h3>
|
|
1342
943
|
<p
|
|
1343
944
|
class="paging"
|
|
1344
|
-
?active=${
|
|
945
|
+
?active=${this.inputData?.subTitle}
|
|
1345
946
|
style="color: ${this.themeSubtitleColor}"
|
|
1346
947
|
>
|
|
1347
|
-
${
|
|
948
|
+
${this.inputData?.subTitle}
|
|
1348
949
|
</p>
|
|
1349
950
|
|
|
1350
|
-
<div class="paging no-data" ?active=${!
|
|
1351
|
-
<div class="img-container paging" ?active="${
|
|
1352
|
-
${this.inlineSvg
|
|
1353
|
-
? x `<div id="base-layer" class="svg-wrapper">${o(this.inlineSvg)}</div>`
|
|
1354
|
-
: this.previewUrl
|
|
1355
|
-
? x `<img
|
|
951
|
+
<div class="paging no-data" ?active=${!e}>No Image</div>
|
|
952
|
+
<div class="img-container paging" ?active="${e}">
|
|
953
|
+
${this.inlineSvg ? y`<div id="base-layer" class="svg-wrapper">${rt(this.inlineSvg)}</div>` : this.previewUrl ? y`<img
|
|
1356
954
|
id="base-layer"
|
|
1357
955
|
@load="${this.getModifier}"
|
|
1358
956
|
src="${this.previewUrl}"
|
|
1359
957
|
alt="Image Widget"
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
${
|
|
958
|
+
style="object-fit: ${this.inputData?.stretchToFit ? "fill" : "contain"}"
|
|
959
|
+
/>` : ""}
|
|
960
|
+
${X(
|
|
961
|
+
this.inputData?.overlays ?? [],
|
|
962
|
+
(t) => t.layerName,
|
|
963
|
+
(t) => y` ${this.renderLayer(t)} `
|
|
964
|
+
)}
|
|
1363
965
|
</div>
|
|
1364
966
|
</div>
|
|
1365
967
|
`;
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
he.styles = ve`
|
|
1369
971
|
:host {
|
|
1370
972
|
display: block;
|
|
1371
973
|
font-family: sans-serif;
|
|
@@ -1382,7 +984,7 @@ WidgetImage.styles = i$5 `
|
|
|
1382
984
|
flex-direction: column;
|
|
1383
985
|
height: 100%;
|
|
1384
986
|
width: 100%;
|
|
1385
|
-
padding:
|
|
987
|
+
padding: 2%;
|
|
1386
988
|
box-sizing: border-box;
|
|
1387
989
|
}
|
|
1388
990
|
|
|
@@ -1427,7 +1029,6 @@ WidgetImage.styles = i$5 `
|
|
|
1427
1029
|
img {
|
|
1428
1030
|
width: 100%; /* Set the width of the container */
|
|
1429
1031
|
height: 100%;
|
|
1430
|
-
object-fit: contain;
|
|
1431
1032
|
}
|
|
1432
1033
|
.no-data {
|
|
1433
1034
|
font-size: 20px;
|
|
@@ -1449,34 +1050,36 @@ WidgetImage.styles = i$5 `
|
|
|
1449
1050
|
pointer-events: auto;
|
|
1450
1051
|
}
|
|
1451
1052
|
`;
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
export {
|
|
1053
|
+
let b = he;
|
|
1054
|
+
C([
|
|
1055
|
+
te({ type: Object })
|
|
1056
|
+
], b.prototype, "inputData");
|
|
1057
|
+
C([
|
|
1058
|
+
te({ type: Object })
|
|
1059
|
+
], b.prototype, "theme");
|
|
1060
|
+
C([
|
|
1061
|
+
M()
|
|
1062
|
+
], b.prototype, "themeBgColor");
|
|
1063
|
+
C([
|
|
1064
|
+
M()
|
|
1065
|
+
], b.prototype, "themeTitleColor");
|
|
1066
|
+
C([
|
|
1067
|
+
M()
|
|
1068
|
+
], b.prototype, "themeSubtitleColor");
|
|
1069
|
+
C([
|
|
1070
|
+
M()
|
|
1071
|
+
], b.prototype, "previewUrl");
|
|
1072
|
+
C([
|
|
1073
|
+
M()
|
|
1074
|
+
], b.prototype, "inlineSvg");
|
|
1075
|
+
C([
|
|
1076
|
+
M()
|
|
1077
|
+
], b.prototype, "modifier");
|
|
1078
|
+
C([
|
|
1079
|
+
ke("#base-layer")
|
|
1080
|
+
], b.prototype, "baseLayer");
|
|
1081
|
+
window.customElements.define("widget-overlay-1.0.7", b);
|
|
1082
|
+
export {
|
|
1083
|
+
b as WidgetImage
|
|
1084
|
+
};
|
|
1482
1085
|
//# sourceMappingURL=widget-overlay.js.map
|