@vouchfor/embeds 0.0.0-experiment.cbb21a3 → 0.0.0-experiment.d892f46
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/embeds.js +365 -287
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/{components → src/components}/Embed/controllers/tracking.d.ts +2 -0
- package/dist/iife/embeds.iife.js +69 -69
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Embed/controllers/fetcher.ts +3 -3
- package/src/components/Embed/controllers/tracking.ts +54 -50
- /package/dist/es/{components → src/components}/Embed/controllers/fetcher.d.ts +0 -0
- /package/dist/es/{components → src/components}/Embed/index.d.ts +0 -0
- /package/dist/es/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/es/{utils → src/utils}/env.d.ts +0 -0
- /package/dist/es/{utils → src/utils}/events.d.ts +0 -0
package/dist/es/embeds.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { property as
|
1
|
+
import { property as y, state as jt, customElement as he } from "lit/decorators.js";
|
2
2
|
import { ifDefined as ft } from "lit/directives/if-defined.js";
|
3
|
-
import { createRef as
|
4
|
-
import { Task as
|
3
|
+
import { createRef as Bt, ref as Wt } from "lit/directives/ref.js";
|
4
|
+
import { Task as le } from "@lit/task";
|
5
5
|
import { v4 as P } from "uuid";
|
6
6
|
import "@vouchfor/media-player";
|
7
7
|
/**
|
@@ -9,10 +9,10 @@ import "@vouchfor/media-player";
|
|
9
9
|
* Copyright 2019 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
11
|
*/
|
12
|
-
const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
13
|
-
let
|
12
|
+
const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, qt = Symbol(), gt = /* @__PURE__ */ new WeakMap();
|
13
|
+
let ce = class {
|
14
14
|
constructor(t, e, i) {
|
15
|
-
if (this._$cssResult$ = !0, i !==
|
15
|
+
if (this._$cssResult$ = !0, i !== qt)
|
16
16
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
17
17
|
this.cssText = t, this.t = e;
|
18
18
|
}
|
@@ -29,7 +29,7 @@ let le = class {
|
|
29
29
|
return this.cssText;
|
30
30
|
}
|
31
31
|
};
|
32
|
-
const
|
32
|
+
const de = (r) => new ce(typeof r == "string" ? r : r + "", void 0, qt), pe = (r, t) => {
|
33
33
|
if (_t)
|
34
34
|
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
35
35
|
else
|
@@ -37,21 +37,21 @@ const ce = (r) => new le(typeof r == "string" ? r : r + "", void 0, Wt), de = (r
|
|
37
37
|
const i = document.createElement("style"), s = G.litNonce;
|
38
38
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
|
39
39
|
}
|
40
|
-
},
|
40
|
+
}, yt = _t ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
41
41
|
let e = "";
|
42
42
|
for (const i of t.cssRules)
|
43
43
|
e += i.cssText;
|
44
|
-
return
|
44
|
+
return de(e);
|
45
45
|
})(r) : r;
|
46
46
|
/**
|
47
47
|
* @license
|
48
48
|
* Copyright 2017 Google LLC
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
50
50
|
*/
|
51
|
-
const { is:
|
51
|
+
const { is: ue, defineProperty: _e, getOwnPropertyDescriptor: me, getOwnPropertyNames: $e, getOwnPropertySymbols: fe, getPrototypeOf: ge } = Object, b = globalThis, vt = b.trustedTypes, ye = vt ? vt.emptyScript : "", rt = b.reactiveElementPolyfillSupport, I = (r, t) => r, dt = { toAttribute(r, t) {
|
52
52
|
switch (t) {
|
53
53
|
case Boolean:
|
54
|
-
r = r ?
|
54
|
+
r = r ? ye : null;
|
55
55
|
break;
|
56
56
|
case Object:
|
57
57
|
case Array:
|
@@ -76,9 +76,9 @@ const { is: pe, defineProperty: ue, getOwnPropertyDescriptor: _e, getOwnProperty
|
|
76
76
|
}
|
77
77
|
}
|
78
78
|
return e;
|
79
|
-
} },
|
80
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
81
|
-
let
|
79
|
+
} }, Xt = (r, t) => !ue(r, t), At = { attribute: !0, type: String, converter: dt, reflect: !1, hasChanged: Xt };
|
80
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
81
|
+
let N = class extends HTMLElement {
|
82
82
|
static addInitializer(t) {
|
83
83
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
84
84
|
}
|
@@ -88,11 +88,11 @@ let L = class extends HTMLElement {
|
|
88
88
|
static createProperty(t, e = At) {
|
89
89
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
90
90
|
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
91
|
-
s !== void 0 &&
|
91
|
+
s !== void 0 && _e(this.prototype, t, s);
|
92
92
|
}
|
93
93
|
}
|
94
94
|
static getPropertyDescriptor(t, e, i) {
|
95
|
-
const { get: s, set: n } =
|
95
|
+
const { get: s, set: n } = me(this.prototype, t) ?? { get() {
|
96
96
|
return this[e];
|
97
97
|
}, set(o) {
|
98
98
|
this[e] = o;
|
@@ -100,8 +100,8 @@ let L = class extends HTMLElement {
|
|
100
100
|
return { get() {
|
101
101
|
return s == null ? void 0 : s.call(this);
|
102
102
|
}, set(o) {
|
103
|
-
const
|
104
|
-
n.call(this, o), this.requestUpdate(t,
|
103
|
+
const h = s == null ? void 0 : s.call(this);
|
104
|
+
n.call(this, o), this.requestUpdate(t, h, i);
|
105
105
|
}, configurable: !0, enumerable: !0 };
|
106
106
|
}
|
107
107
|
static getPropertyOptions(t) {
|
@@ -110,14 +110,14 @@ let L = class extends HTMLElement {
|
|
110
110
|
static _$Ei() {
|
111
111
|
if (this.hasOwnProperty(I("elementProperties")))
|
112
112
|
return;
|
113
|
-
const t =
|
113
|
+
const t = ge(this);
|
114
114
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
115
115
|
}
|
116
116
|
static finalize() {
|
117
117
|
if (this.hasOwnProperty(I("finalized")))
|
118
118
|
return;
|
119
119
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(I("properties"))) {
|
120
|
-
const e = this.properties, i = [...$e(e), ...
|
120
|
+
const e = this.properties, i = [...$e(e), ...fe(e)];
|
121
121
|
for (const s of i)
|
122
122
|
this.createProperty(s, e[s]);
|
123
123
|
}
|
@@ -140,9 +140,9 @@ let L = class extends HTMLElement {
|
|
140
140
|
if (Array.isArray(t)) {
|
141
141
|
const i = new Set(t.flat(1 / 0).reverse());
|
142
142
|
for (const s of i)
|
143
|
-
e.unshift(
|
143
|
+
e.unshift(yt(s));
|
144
144
|
} else
|
145
|
-
t !== void 0 && e.push(
|
145
|
+
t !== void 0 && e.push(yt(t));
|
146
146
|
return e;
|
147
147
|
}
|
148
148
|
static _$Eu(t, e) {
|
@@ -172,7 +172,7 @@ let L = class extends HTMLElement {
|
|
172
172
|
}
|
173
173
|
createRenderRoot() {
|
174
174
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
175
|
-
return
|
175
|
+
return pe(t, this.constructor.elementStyles), t;
|
176
176
|
}
|
177
177
|
connectedCallback() {
|
178
178
|
var t;
|
@@ -205,13 +205,13 @@ let L = class extends HTMLElement {
|
|
205
205
|
var n;
|
206
206
|
const i = this.constructor, s = i._$Eh.get(t);
|
207
207
|
if (s !== void 0 && this._$Em !== s) {
|
208
|
-
const o = i.getPropertyOptions(s),
|
209
|
-
this._$Em = s, this[s] =
|
208
|
+
const o = i.getPropertyOptions(s), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : dt;
|
209
|
+
this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
|
210
210
|
}
|
211
211
|
}
|
212
212
|
requestUpdate(t, e, i, s = !1, n) {
|
213
213
|
if (t !== void 0) {
|
214
|
-
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ??
|
214
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? Xt)(s ? n : this[t], e))
|
215
215
|
return;
|
216
216
|
this.C(t, e, i);
|
217
217
|
}
|
@@ -289,84 +289,84 @@ let L = class extends HTMLElement {
|
|
289
289
|
firstUpdated(t) {
|
290
290
|
}
|
291
291
|
};
|
292
|
-
|
292
|
+
N.elementStyles = [], N.shadowRootOptions = { mode: "open" }, N[I("elementProperties")] = /* @__PURE__ */ new Map(), N[I("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: N }), (b.reactiveElementVersions ?? (b.reactiveElementVersions = [])).push("2.0.2");
|
293
293
|
/**
|
294
294
|
* @license
|
295
295
|
* Copyright 2017 Google LLC
|
296
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
297
297
|
*/
|
298
|
-
const V = globalThis, Y = V.trustedTypes,
|
299
|
-
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
300
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), wt = /'/g, Pt = /"/g,
|
301
|
-
function
|
298
|
+
const V = globalThis, Y = V.trustedTypes, bt = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Jt = "$lit$", v = `lit$${(Math.random() + "").slice(9)}$`, Kt = "?" + v, ve = `<${Kt}>`, T = document, Q = () => T.createComment(""), B = (r) => r === null || typeof r != "object" && typeof r != "function", Ft = Array.isArray, Ae = (r) => Ft(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", nt = `[
|
299
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Et = /-->/g, St = />/g, S = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
|
300
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), wt = /'/g, Pt = /"/g, Gt = /^(?:script|style|textarea|title)$/i, W = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), C = T.createTreeWalker(T, 129);
|
301
|
+
function Zt(r, t) {
|
302
302
|
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
303
303
|
throw Error("invalid template strings array");
|
304
|
-
return
|
304
|
+
return bt !== void 0 ? bt.createHTML(t) : t;
|
305
305
|
}
|
306
|
-
const
|
306
|
+
const be = (r, t) => {
|
307
307
|
const e = r.length - 1, i = [];
|
308
308
|
let s, n = t === 2 ? "<svg>" : "", o = M;
|
309
|
-
for (let
|
310
|
-
const
|
309
|
+
for (let h = 0; h < e; h++) {
|
310
|
+
const a = r[h];
|
311
311
|
let c, d, l = -1, p = 0;
|
312
|
-
for (; p <
|
313
|
-
p = o.lastIndex, o === M ? d[1] === "!--" ? o =
|
314
|
-
const u = o ===
|
315
|
-
n += o === M ?
|
312
|
+
for (; p < a.length && (o.lastIndex = p, d = o.exec(a), d !== null); )
|
313
|
+
p = o.lastIndex, o === M ? d[1] === "!--" ? o = Et : d[1] !== void 0 ? o = St : d[2] !== void 0 ? (Gt.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = S) : d[3] !== void 0 && (o = S) : o === S ? d[0] === ">" ? (o = s ?? M, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? S : d[3] === '"' ? Pt : wt) : o === Pt || o === wt ? o = S : o === Et || o === St ? o = M : (o = S, s = void 0);
|
314
|
+
const u = o === S && r[h + 1].startsWith("/>") ? " " : "";
|
315
|
+
n += o === M ? a + ve : l >= 0 ? (i.push(c), a.slice(0, l) + Jt + a.slice(l) + v + u) : a + v + (l === -2 ? h : u);
|
316
316
|
}
|
317
|
-
return [
|
317
|
+
return [Zt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
318
318
|
};
|
319
|
-
let pt = class
|
319
|
+
let pt = class Yt {
|
320
320
|
constructor({ strings: t, _$litType$: e }, i) {
|
321
321
|
let s;
|
322
322
|
this.parts = [];
|
323
323
|
let n = 0, o = 0;
|
324
|
-
const
|
325
|
-
if (this.el =
|
324
|
+
const h = t.length - 1, a = this.parts, [c, d] = be(t, e);
|
325
|
+
if (this.el = Yt.createElement(c, i), C.currentNode = this.el.content, e === 2) {
|
326
326
|
const l = this.el.content.firstChild;
|
327
327
|
l.replaceWith(...l.childNodes);
|
328
328
|
}
|
329
|
-
for (; (s = C.nextNode()) !== null &&
|
329
|
+
for (; (s = C.nextNode()) !== null && a.length < h; ) {
|
330
330
|
if (s.nodeType === 1) {
|
331
331
|
if (s.hasAttributes())
|
332
332
|
for (const l of s.getAttributeNames())
|
333
|
-
if (l.endsWith(
|
334
|
-
const p = d[o++], u = s.getAttribute(l).split(
|
335
|
-
|
333
|
+
if (l.endsWith(Jt)) {
|
334
|
+
const p = d[o++], u = s.getAttribute(l).split(v), g = /([.?@])?(.*)/.exec(p);
|
335
|
+
a.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? Se : g[1] === "?" ? we : g[1] === "@" ? Pe : it }), s.removeAttribute(l);
|
336
336
|
} else
|
337
|
-
l.startsWith(
|
338
|
-
if (
|
339
|
-
const l = s.textContent.split(
|
337
|
+
l.startsWith(v) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
|
338
|
+
if (Gt.test(s.tagName)) {
|
339
|
+
const l = s.textContent.split(v), p = l.length - 1;
|
340
340
|
if (p > 0) {
|
341
341
|
s.textContent = Y ? Y.emptyScript : "";
|
342
342
|
for (let u = 0; u < p; u++)
|
343
|
-
s.append(l[u], Q()), C.nextNode(),
|
343
|
+
s.append(l[u], Q()), C.nextNode(), a.push({ type: 2, index: ++n });
|
344
344
|
s.append(l[p], Q());
|
345
345
|
}
|
346
346
|
}
|
347
347
|
} else if (s.nodeType === 8)
|
348
348
|
if (s.data === Kt)
|
349
|
-
|
349
|
+
a.push({ type: 2, index: n });
|
350
350
|
else {
|
351
351
|
let l = -1;
|
352
|
-
for (; (l = s.data.indexOf(
|
353
|
-
|
352
|
+
for (; (l = s.data.indexOf(v, l + 1)) !== -1; )
|
353
|
+
a.push({ type: 7, index: n }), l += v.length - 1;
|
354
354
|
}
|
355
355
|
n++;
|
356
356
|
}
|
357
357
|
}
|
358
358
|
static createElement(t, e) {
|
359
|
-
const i =
|
359
|
+
const i = T.createElement("template");
|
360
360
|
return i.innerHTML = t, i;
|
361
361
|
}
|
362
362
|
};
|
363
|
-
function
|
364
|
-
var o,
|
363
|
+
function k(r, t, e = r, i) {
|
364
|
+
var o, h;
|
365
365
|
if (t === W)
|
366
366
|
return t;
|
367
367
|
let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
368
368
|
const n = B(t) ? void 0 : t._$litDirective$;
|
369
|
-
return (s == null ? void 0 : s.constructor) !== n && ((
|
369
|
+
return (s == null ? void 0 : s.constructor) !== n && ((h = s == null ? void 0 : s._$AO) == null || h.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = k(r, s._$AS(r, t.values), s, i)), t;
|
370
370
|
}
|
371
371
|
let Ee = class {
|
372
372
|
constructor(t, e) {
|
@@ -379,24 +379,24 @@ let Ee = class {
|
|
379
379
|
return this._$AM._$AU;
|
380
380
|
}
|
381
381
|
u(t) {
|
382
|
-
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ??
|
382
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? T).importNode(e, !0);
|
383
383
|
C.currentNode = s;
|
384
|
-
let n = C.nextNode(), o = 0,
|
385
|
-
for (;
|
386
|
-
if (o ===
|
384
|
+
let n = C.nextNode(), o = 0, h = 0, a = i[0];
|
385
|
+
for (; a !== void 0; ) {
|
386
|
+
if (o === a.index) {
|
387
387
|
let c;
|
388
|
-
|
388
|
+
a.type === 2 ? c = new Qt(n, n.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (c = new Ce(n, this, t)), this._$AV.push(c), a = i[++h];
|
389
389
|
}
|
390
|
-
o !== (
|
390
|
+
o !== (a == null ? void 0 : a.index) && (n = C.nextNode(), o++);
|
391
391
|
}
|
392
|
-
return C.currentNode =
|
392
|
+
return C.currentNode = T, s;
|
393
393
|
}
|
394
394
|
p(t) {
|
395
395
|
let e = 0;
|
396
396
|
for (const i of this._$AV)
|
397
397
|
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
398
398
|
}
|
399
|
-
},
|
399
|
+
}, Qt = class te {
|
400
400
|
get _$AU() {
|
401
401
|
var t;
|
402
402
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
@@ -416,7 +416,7 @@ let Ee = class {
|
|
416
416
|
return this._$AB;
|
417
417
|
}
|
418
418
|
_$AI(t, e = this) {
|
419
|
-
t =
|
419
|
+
t = k(this, t, e), B(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== W && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Ae(t) ? this.T(t) : this._(t);
|
420
420
|
}
|
421
421
|
k(t) {
|
422
422
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -425,16 +425,16 @@ let Ee = class {
|
|
425
425
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
426
426
|
}
|
427
427
|
_(t) {
|
428
|
-
this._$AH !== _ && B(this._$AH) ? this._$AA.nextSibling.data = t : this.$(
|
428
|
+
this._$AH !== _ && B(this._$AH) ? this._$AA.nextSibling.data = t : this.$(T.createTextNode(t)), this._$AH = t;
|
429
429
|
}
|
430
430
|
g(t) {
|
431
431
|
var n;
|
432
|
-
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = pt.createElement(
|
432
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = pt.createElement(Zt(i.h, i.h[0]), this.options)), i);
|
433
433
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
|
434
434
|
this._$AH.p(e);
|
435
435
|
else {
|
436
|
-
const o = new Ee(s, this),
|
437
|
-
o.p(e), this.$(
|
436
|
+
const o = new Ee(s, this), h = o.u(this.options);
|
437
|
+
o.p(e), this.$(h), this._$AH = o;
|
438
438
|
}
|
439
439
|
}
|
440
440
|
_$AC(t) {
|
@@ -442,11 +442,11 @@ let Ee = class {
|
|
442
442
|
return e === void 0 && Ct.set(t.strings, e = new pt(t)), e;
|
443
443
|
}
|
444
444
|
T(t) {
|
445
|
-
|
445
|
+
Ft(this._$AH) || (this._$AH = [], this._$AR());
|
446
446
|
const e = this._$AH;
|
447
447
|
let i, s = 0;
|
448
448
|
for (const n of t)
|
449
|
-
s === e.length ? e.push(i = new
|
449
|
+
s === e.length ? e.push(i = new te(this.k(Q()), this.k(Q()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
450
450
|
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
451
451
|
}
|
452
452
|
_$AR(t = this._$AA.nextSibling, e) {
|
@@ -474,12 +474,12 @@ let Ee = class {
|
|
474
474
|
const n = this.strings;
|
475
475
|
let o = !1;
|
476
476
|
if (n === void 0)
|
477
|
-
t =
|
477
|
+
t = k(this, t, e, 0), o = !B(t) || t !== this._$AH && t !== W, o && (this._$AH = t);
|
478
478
|
else {
|
479
|
-
const
|
480
|
-
let
|
481
|
-
for (t = n[0],
|
482
|
-
c =
|
479
|
+
const h = t;
|
480
|
+
let a, c;
|
481
|
+
for (t = n[0], a = 0; a < n.length - 1; a++)
|
482
|
+
c = k(this, h[i + a], e, a), c === W && (c = this._$AH[a]), o || (o = !B(c) || c !== this._$AH[a]), c === _ ? t = _ : t !== _ && (t += (c ?? "") + n[a + 1]), this._$AH[a] = c;
|
483
483
|
}
|
484
484
|
o && !s && this.O(t);
|
485
485
|
}
|
@@ -493,19 +493,19 @@ let Ee = class {
|
|
493
493
|
O(t) {
|
494
494
|
this.element[this.name] = t === _ ? void 0 : t;
|
495
495
|
}
|
496
|
-
},
|
496
|
+
}, we = class extends it {
|
497
497
|
constructor() {
|
498
498
|
super(...arguments), this.type = 4;
|
499
499
|
}
|
500
500
|
O(t) {
|
501
501
|
this.element.toggleAttribute(this.name, !!t && t !== _);
|
502
502
|
}
|
503
|
-
},
|
503
|
+
}, Pe = class extends it {
|
504
504
|
constructor(t, e, i, s, n) {
|
505
505
|
super(t, e, i, s, n), this.type = 5;
|
506
506
|
}
|
507
507
|
_$AI(t, e = this) {
|
508
|
-
if ((t =
|
508
|
+
if ((t = k(this, t, e, 0) ?? _) === W)
|
509
509
|
return;
|
510
510
|
const i = this._$AH, s = t === _ && i !== _ || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== _ && (i === _ || s);
|
511
511
|
s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
@@ -514,7 +514,7 @@ let Ee = class {
|
|
514
514
|
var e;
|
515
515
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
516
516
|
}
|
517
|
-
},
|
517
|
+
}, Ce = class {
|
518
518
|
constructor(t, e, i) {
|
519
519
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
520
520
|
}
|
@@ -522,29 +522,29 @@ let Ee = class {
|
|
522
522
|
return this._$AM._$AU;
|
523
523
|
}
|
524
524
|
_$AI(t) {
|
525
|
-
|
525
|
+
k(this, t);
|
526
526
|
}
|
527
527
|
};
|
528
528
|
const ot = V.litHtmlPolyfillSupport;
|
529
|
-
ot == null || ot(pt,
|
529
|
+
ot == null || ot(pt, Qt), (V.litHtmlVersions ?? (V.litHtmlVersions = [])).push("3.1.0");
|
530
530
|
/**
|
531
531
|
* @license
|
532
532
|
* Copyright 2019 Google LLC
|
533
533
|
* SPDX-License-Identifier: BSD-3-Clause
|
534
534
|
*/
|
535
|
-
const Z = globalThis,
|
536
|
-
let
|
535
|
+
const Z = globalThis, mt = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ee = Symbol(), Ut = /* @__PURE__ */ new WeakMap();
|
536
|
+
let Ue = class {
|
537
537
|
constructor(t, e, i) {
|
538
|
-
if (this._$cssResult$ = !0, i !==
|
538
|
+
if (this._$cssResult$ = !0, i !== ee)
|
539
539
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
540
540
|
this.cssText = t, this.t = e;
|
541
541
|
}
|
542
542
|
get styleSheet() {
|
543
543
|
let t = this.o;
|
544
544
|
const e = this.t;
|
545
|
-
if (
|
545
|
+
if (mt && t === void 0) {
|
546
546
|
const i = e !== void 0 && e.length === 1;
|
547
|
-
i && (t =
|
547
|
+
i && (t = Ut.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Ut.set(e, t));
|
548
548
|
}
|
549
549
|
return t;
|
550
550
|
}
|
@@ -552,15 +552,15 @@ let Ce = class {
|
|
552
552
|
return this.cssText;
|
553
553
|
}
|
554
554
|
};
|
555
|
-
const Te = (r) => new
|
556
|
-
if (
|
555
|
+
const Te = (r) => new Ue(typeof r == "string" ? r : r + "", void 0, ee), xe = (r, t) => {
|
556
|
+
if (mt)
|
557
557
|
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
558
558
|
else
|
559
559
|
for (const e of t) {
|
560
560
|
const i = document.createElement("style"), s = Z.litNonce;
|
561
561
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
|
562
562
|
}
|
563
|
-
},
|
563
|
+
}, Tt = mt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
564
564
|
let e = "";
|
565
565
|
for (const i of t.cssRules)
|
566
566
|
e += i.cssText;
|
@@ -571,10 +571,10 @@ const Te = (r) => new Ce(typeof r == "string" ? r : r + "", void 0, te), Ue = (r
|
|
571
571
|
* Copyright 2017 Google LLC
|
572
572
|
* SPDX-License-Identifier: BSD-3-Clause
|
573
573
|
*/
|
574
|
-
const { is: Re, defineProperty:
|
574
|
+
const { is: Re, defineProperty: ke, getOwnPropertyDescriptor: He, getOwnPropertyNames: Oe, getOwnPropertySymbols: Ne, getPrototypeOf: Me } = Object, E = globalThis, xt = E.trustedTypes, Le = xt ? xt.emptyScript : "", at = E.reactiveElementPolyfillSupport, D = (r, t) => r, ut = { toAttribute(r, t) {
|
575
575
|
switch (t) {
|
576
576
|
case Boolean:
|
577
|
-
r = r ?
|
577
|
+
r = r ? Le : null;
|
578
578
|
break;
|
579
579
|
case Object:
|
580
580
|
case Array:
|
@@ -599,19 +599,19 @@ const { is: Re, defineProperty: xe, getOwnPropertyDescriptor: He, getOwnProperty
|
|
599
599
|
}
|
600
600
|
}
|
601
601
|
return e;
|
602
|
-
} },
|
603
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
604
|
-
class
|
602
|
+
} }, ie = (r, t) => !Re(r, t), Rt = { attribute: !0, type: String, converter: ut, reflect: !1, hasChanged: ie };
|
603
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), E.litPropertyMetadata ?? (E.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
604
|
+
class R extends HTMLElement {
|
605
605
|
static addInitializer(t) {
|
606
606
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
607
607
|
}
|
608
608
|
static get observedAttributes() {
|
609
609
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
610
610
|
}
|
611
|
-
static createProperty(t, e =
|
611
|
+
static createProperty(t, e = Rt) {
|
612
612
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
613
613
|
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
614
|
-
s !== void 0 &&
|
614
|
+
s !== void 0 && ke(this.prototype, t, s);
|
615
615
|
}
|
616
616
|
}
|
617
617
|
static getPropertyDescriptor(t, e, i) {
|
@@ -623,17 +623,17 @@ class x extends HTMLElement {
|
|
623
623
|
return { get() {
|
624
624
|
return s == null ? void 0 : s.call(this);
|
625
625
|
}, set(o) {
|
626
|
-
const
|
627
|
-
n.call(this, o), this.requestUpdate(t,
|
626
|
+
const h = s == null ? void 0 : s.call(this);
|
627
|
+
n.call(this, o), this.requestUpdate(t, h, i);
|
628
628
|
}, configurable: !0, enumerable: !0 };
|
629
629
|
}
|
630
630
|
static getPropertyOptions(t) {
|
631
|
-
return this.elementProperties.get(t) ??
|
631
|
+
return this.elementProperties.get(t) ?? Rt;
|
632
632
|
}
|
633
633
|
static _$Ei() {
|
634
634
|
if (this.hasOwnProperty(D("elementProperties")))
|
635
635
|
return;
|
636
|
-
const t =
|
636
|
+
const t = Me(this);
|
637
637
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
638
638
|
}
|
639
639
|
static finalize() {
|
@@ -663,9 +663,9 @@ class x extends HTMLElement {
|
|
663
663
|
if (Array.isArray(t)) {
|
664
664
|
const i = new Set(t.flat(1 / 0).reverse());
|
665
665
|
for (const s of i)
|
666
|
-
e.unshift(
|
666
|
+
e.unshift(Tt(s));
|
667
667
|
} else
|
668
|
-
t !== void 0 && e.push(
|
668
|
+
t !== void 0 && e.push(Tt(t));
|
669
669
|
return e;
|
670
670
|
}
|
671
671
|
static _$Eu(t, e) {
|
@@ -695,7 +695,7 @@ class x extends HTMLElement {
|
|
695
695
|
}
|
696
696
|
createRenderRoot() {
|
697
697
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
698
|
-
return
|
698
|
+
return xe(t, this.constructor.elementStyles), t;
|
699
699
|
}
|
700
700
|
connectedCallback() {
|
701
701
|
var t;
|
@@ -728,13 +728,13 @@ class x extends HTMLElement {
|
|
728
728
|
var n;
|
729
729
|
const i = this.constructor, s = i._$Eh.get(t);
|
730
730
|
if (s !== void 0 && this._$Em !== s) {
|
731
|
-
const o = i.getPropertyOptions(s),
|
732
|
-
this._$Em = s, this[s] =
|
731
|
+
const o = i.getPropertyOptions(s), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : ut;
|
732
|
+
this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
|
733
733
|
}
|
734
734
|
}
|
735
735
|
requestUpdate(t, e, i, s = !1, n) {
|
736
736
|
if (t !== void 0) {
|
737
|
-
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ??
|
737
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? ie)(s ? n : this[t], e))
|
738
738
|
return;
|
739
739
|
this.C(t, e, i);
|
740
740
|
}
|
@@ -812,86 +812,86 @@ class x extends HTMLElement {
|
|
812
812
|
firstUpdated(t) {
|
813
813
|
}
|
814
814
|
}
|
815
|
-
|
815
|
+
R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[D("elementProperties")] = /* @__PURE__ */ new Map(), R[D("finalized")] = /* @__PURE__ */ new Map(), at == null || at({ ReactiveElement: R }), (E.reactiveElementVersions ?? (E.reactiveElementVersions = [])).push("2.0.2");
|
816
816
|
/**
|
817
817
|
* @license
|
818
818
|
* Copyright 2017 Google LLC
|
819
819
|
* SPDX-License-Identifier: BSD-3-Clause
|
820
820
|
*/
|
821
|
-
const z = globalThis, tt = z.trustedTypes,
|
822
|
-
\f\r]`,
|
823
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
824
|
-
function
|
821
|
+
const z = globalThis, tt = z.trustedTypes, kt = tt ? tt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, se = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, re = "?" + A, Ie = `<${re}>`, x = document, q = () => x.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", ne = Array.isArray, Ve = (r) => ne(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", ht = `[
|
822
|
+
\f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ht = /-->/g, Ot = />/g, w = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
823
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Nt = /'/g, Mt = /"/g, oe = /^(?:script|style|textarea|title)$/i, De = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), ze = De(1), H = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Lt = /* @__PURE__ */ new WeakMap(), U = x.createTreeWalker(x, 129);
|
824
|
+
function ae(r, t) {
|
825
825
|
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
826
826
|
throw Error("invalid template strings array");
|
827
|
-
return
|
827
|
+
return kt !== void 0 ? kt.createHTML(t) : t;
|
828
828
|
}
|
829
|
-
const
|
829
|
+
const je = (r, t) => {
|
830
830
|
const e = r.length - 1, i = [];
|
831
|
-
let s, n = t === 2 ? "<svg>" : "", o =
|
832
|
-
for (let
|
833
|
-
const
|
831
|
+
let s, n = t === 2 ? "<svg>" : "", o = L;
|
832
|
+
for (let h = 0; h < e; h++) {
|
833
|
+
const a = r[h];
|
834
834
|
let c, d, l = -1, p = 0;
|
835
|
-
for (; p <
|
836
|
-
p = o.lastIndex, o ===
|
837
|
-
const u = o === w && r[
|
838
|
-
n += o ===
|
835
|
+
for (; p < a.length && (o.lastIndex = p, d = o.exec(a), d !== null); )
|
836
|
+
p = o.lastIndex, o === L ? d[1] === "!--" ? o = Ht : d[1] !== void 0 ? o = Ot : d[2] !== void 0 ? (oe.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = w) : d[3] !== void 0 && (o = w) : o === w ? d[0] === ">" ? (o = s ?? L, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? w : d[3] === '"' ? Mt : Nt) : o === Mt || o === Nt ? o = w : o === Ht || o === Ot ? o = L : (o = w, s = void 0);
|
837
|
+
const u = o === w && r[h + 1].startsWith("/>") ? " " : "";
|
838
|
+
n += o === L ? a + Ie : l >= 0 ? (i.push(c), a.slice(0, l) + se + a.slice(l) + A + u) : a + A + (l === -2 ? h : u);
|
839
839
|
}
|
840
|
-
return [
|
840
|
+
return [ae(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
841
841
|
};
|
842
|
-
class
|
842
|
+
class J {
|
843
843
|
constructor({ strings: t, _$litType$: e }, i) {
|
844
844
|
let s;
|
845
845
|
this.parts = [];
|
846
846
|
let n = 0, o = 0;
|
847
|
-
const
|
848
|
-
if (this.el =
|
847
|
+
const h = t.length - 1, a = this.parts, [c, d] = je(t, e);
|
848
|
+
if (this.el = J.createElement(c, i), U.currentNode = this.el.content, e === 2) {
|
849
849
|
const l = this.el.content.firstChild;
|
850
850
|
l.replaceWith(...l.childNodes);
|
851
851
|
}
|
852
|
-
for (; (s =
|
852
|
+
for (; (s = U.nextNode()) !== null && a.length < h; ) {
|
853
853
|
if (s.nodeType === 1) {
|
854
854
|
if (s.hasAttributes())
|
855
855
|
for (const l of s.getAttributeNames())
|
856
|
-
if (l.endsWith(
|
856
|
+
if (l.endsWith(se)) {
|
857
857
|
const p = d[o++], u = s.getAttribute(l).split(A), g = /([.?@])?(.*)/.exec(p);
|
858
|
-
|
858
|
+
a.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? We : g[1] === "?" ? qe : g[1] === "@" ? Xe : st }), s.removeAttribute(l);
|
859
859
|
} else
|
860
|
-
l.startsWith(A) && (
|
861
|
-
if (
|
860
|
+
l.startsWith(A) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
|
861
|
+
if (oe.test(s.tagName)) {
|
862
862
|
const l = s.textContent.split(A), p = l.length - 1;
|
863
863
|
if (p > 0) {
|
864
864
|
s.textContent = tt ? tt.emptyScript : "";
|
865
865
|
for (let u = 0; u < p; u++)
|
866
|
-
s.append(l[u], q()),
|
866
|
+
s.append(l[u], q()), U.nextNode(), a.push({ type: 2, index: ++n });
|
867
867
|
s.append(l[p], q());
|
868
868
|
}
|
869
869
|
}
|
870
870
|
} else if (s.nodeType === 8)
|
871
|
-
if (s.data ===
|
872
|
-
|
871
|
+
if (s.data === re)
|
872
|
+
a.push({ type: 2, index: n });
|
873
873
|
else {
|
874
874
|
let l = -1;
|
875
875
|
for (; (l = s.data.indexOf(A, l + 1)) !== -1; )
|
876
|
-
|
876
|
+
a.push({ type: 7, index: n }), l += A.length - 1;
|
877
877
|
}
|
878
878
|
n++;
|
879
879
|
}
|
880
880
|
}
|
881
881
|
static createElement(t, e) {
|
882
|
-
const i =
|
882
|
+
const i = x.createElement("template");
|
883
883
|
return i.innerHTML = t, i;
|
884
884
|
}
|
885
885
|
}
|
886
|
-
function
|
887
|
-
var o,
|
888
|
-
if (t ===
|
886
|
+
function O(r, t, e = r, i) {
|
887
|
+
var o, h;
|
888
|
+
if (t === H)
|
889
889
|
return t;
|
890
890
|
let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
891
891
|
const n = X(t) ? void 0 : t._$litDirective$;
|
892
|
-
return (s == null ? void 0 : s.constructor) !== n && ((
|
892
|
+
return (s == null ? void 0 : s.constructor) !== n && ((h = s == null ? void 0 : s._$AO) == null || h.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = O(r, s._$AS(r, t.values), s, i)), t;
|
893
893
|
}
|
894
|
-
class
|
894
|
+
class Be {
|
895
895
|
constructor(t, e) {
|
896
896
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
897
897
|
}
|
@@ -902,17 +902,17 @@ class je {
|
|
902
902
|
return this._$AM._$AU;
|
903
903
|
}
|
904
904
|
u(t) {
|
905
|
-
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ??
|
906
|
-
|
907
|
-
let n =
|
908
|
-
for (;
|
909
|
-
if (o ===
|
905
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? x).importNode(e, !0);
|
906
|
+
U.currentNode = s;
|
907
|
+
let n = U.nextNode(), o = 0, h = 0, a = i[0];
|
908
|
+
for (; a !== void 0; ) {
|
909
|
+
if (o === a.index) {
|
910
910
|
let c;
|
911
|
-
|
911
|
+
a.type === 2 ? c = new K(n, n.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (c = new Je(n, this, t)), this._$AV.push(c), a = i[++h];
|
912
912
|
}
|
913
|
-
o !== (
|
913
|
+
o !== (a == null ? void 0 : a.index) && (n = U.nextNode(), o++);
|
914
914
|
}
|
915
|
-
return
|
915
|
+
return U.currentNode = x, s;
|
916
916
|
}
|
917
917
|
p(t) {
|
918
918
|
let e = 0;
|
@@ -920,13 +920,13 @@ class je {
|
|
920
920
|
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
921
921
|
}
|
922
922
|
}
|
923
|
-
class
|
923
|
+
class K {
|
924
924
|
get _$AU() {
|
925
925
|
var t;
|
926
926
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
927
927
|
}
|
928
928
|
constructor(t, e, i, s) {
|
929
|
-
this.type = 2, this._$AH =
|
929
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
930
930
|
}
|
931
931
|
get parentNode() {
|
932
932
|
let t = this._$AA.parentNode;
|
@@ -940,7 +940,7 @@ class J {
|
|
940
940
|
return this._$AB;
|
941
941
|
}
|
942
942
|
_$AI(t, e = this) {
|
943
|
-
t =
|
943
|
+
t = O(this, t, e), X(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Ve(t) ? this.T(t) : this._(t);
|
944
944
|
}
|
945
945
|
k(t) {
|
946
946
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -949,28 +949,28 @@ class J {
|
|
949
949
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
950
950
|
}
|
951
951
|
_(t) {
|
952
|
-
this._$AH !==
|
952
|
+
this._$AH !== m && X(this._$AH) ? this._$AA.nextSibling.data = t : this.$(x.createTextNode(t)), this._$AH = t;
|
953
953
|
}
|
954
954
|
g(t) {
|
955
955
|
var n;
|
956
|
-
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
956
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = J.createElement(ae(i.h, i.h[0]), this.options)), i);
|
957
957
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
|
958
958
|
this._$AH.p(e);
|
959
959
|
else {
|
960
|
-
const o = new
|
961
|
-
o.p(e), this.$(
|
960
|
+
const o = new Be(s, this), h = o.u(this.options);
|
961
|
+
o.p(e), this.$(h), this._$AH = o;
|
962
962
|
}
|
963
963
|
}
|
964
964
|
_$AC(t) {
|
965
|
-
let e =
|
966
|
-
return e === void 0 &&
|
965
|
+
let e = Lt.get(t.strings);
|
966
|
+
return e === void 0 && Lt.set(t.strings, e = new J(t)), e;
|
967
967
|
}
|
968
968
|
T(t) {
|
969
|
-
|
969
|
+
ne(this._$AH) || (this._$AH = [], this._$AR());
|
970
970
|
const e = this._$AH;
|
971
971
|
let i, s = 0;
|
972
972
|
for (const n of t)
|
973
|
-
s === e.length ? e.push(i = new
|
973
|
+
s === e.length ? e.push(i = new K(this.k(q()), this.k(q()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
974
974
|
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
975
975
|
}
|
976
976
|
_$AR(t = this._$AA.nextSibling, e) {
|
@@ -993,49 +993,49 @@ class st {
|
|
993
993
|
return this._$AM._$AU;
|
994
994
|
}
|
995
995
|
constructor(t, e, i, s, n) {
|
996
|
-
this.type = 1, this._$AH =
|
996
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = m;
|
997
997
|
}
|
998
998
|
_$AI(t, e = this, i, s) {
|
999
999
|
const n = this.strings;
|
1000
1000
|
let o = !1;
|
1001
1001
|
if (n === void 0)
|
1002
|
-
t =
|
1002
|
+
t = O(this, t, e, 0), o = !X(t) || t !== this._$AH && t !== H, o && (this._$AH = t);
|
1003
1003
|
else {
|
1004
|
-
const
|
1005
|
-
let
|
1006
|
-
for (t = n[0],
|
1007
|
-
c =
|
1004
|
+
const h = t;
|
1005
|
+
let a, c;
|
1006
|
+
for (t = n[0], a = 0; a < n.length - 1; a++)
|
1007
|
+
c = O(this, h[i + a], e, a), c === H && (c = this._$AH[a]), o || (o = !X(c) || c !== this._$AH[a]), c === m ? t = m : t !== m && (t += (c ?? "") + n[a + 1]), this._$AH[a] = c;
|
1008
1008
|
}
|
1009
1009
|
o && !s && this.O(t);
|
1010
1010
|
}
|
1011
1011
|
O(t) {
|
1012
|
-
t ===
|
1012
|
+
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
1013
1013
|
}
|
1014
1014
|
}
|
1015
|
-
class
|
1015
|
+
class We extends st {
|
1016
1016
|
constructor() {
|
1017
1017
|
super(...arguments), this.type = 3;
|
1018
1018
|
}
|
1019
1019
|
O(t) {
|
1020
|
-
this.element[this.name] = t ===
|
1020
|
+
this.element[this.name] = t === m ? void 0 : t;
|
1021
1021
|
}
|
1022
1022
|
}
|
1023
|
-
class
|
1023
|
+
class qe extends st {
|
1024
1024
|
constructor() {
|
1025
1025
|
super(...arguments), this.type = 4;
|
1026
1026
|
}
|
1027
1027
|
O(t) {
|
1028
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
1028
|
+
this.element.toggleAttribute(this.name, !!t && t !== m);
|
1029
1029
|
}
|
1030
1030
|
}
|
1031
|
-
class
|
1031
|
+
class Xe extends st {
|
1032
1032
|
constructor(t, e, i, s, n) {
|
1033
1033
|
super(t, e, i, s, n), this.type = 5;
|
1034
1034
|
}
|
1035
1035
|
_$AI(t, e = this) {
|
1036
|
-
if ((t =
|
1036
|
+
if ((t = O(this, t, e, 0) ?? m) === H)
|
1037
1037
|
return;
|
1038
|
-
const i = this._$AH, s = t ===
|
1038
|
+
const i = this._$AH, s = t === m && i !== m || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== m && (i === m || s);
|
1039
1039
|
s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
1040
1040
|
}
|
1041
1041
|
handleEvent(t) {
|
@@ -1043,7 +1043,7 @@ class qe extends st {
|
|
1043
1043
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
1044
1044
|
}
|
1045
1045
|
}
|
1046
|
-
class
|
1046
|
+
class Je {
|
1047
1047
|
constructor(t, e, i) {
|
1048
1048
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
1049
1049
|
}
|
@@ -1051,17 +1051,17 @@ class Xe {
|
|
1051
1051
|
return this._$AM._$AU;
|
1052
1052
|
}
|
1053
1053
|
_$AI(t) {
|
1054
|
-
|
1054
|
+
O(this, t);
|
1055
1055
|
}
|
1056
1056
|
}
|
1057
1057
|
const lt = z.litHtmlPolyfillSupport;
|
1058
|
-
lt == null || lt(
|
1058
|
+
lt == null || lt(J, K), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.1.0");
|
1059
1059
|
const Ke = (r, t, e) => {
|
1060
1060
|
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
1061
1061
|
let s = i._$litPart$;
|
1062
1062
|
if (s === void 0) {
|
1063
1063
|
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
1064
|
-
i._$litPart$ = s = new
|
1064
|
+
i._$litPart$ = s = new K(t.insertBefore(q(), n), n, void 0, e ?? {});
|
1065
1065
|
}
|
1066
1066
|
return s._$AI(r), s;
|
1067
1067
|
};
|
@@ -1070,7 +1070,7 @@ const Ke = (r, t, e) => {
|
|
1070
1070
|
* Copyright 2017 Google LLC
|
1071
1071
|
* SPDX-License-Identifier: BSD-3-Clause
|
1072
1072
|
*/
|
1073
|
-
class j extends
|
1073
|
+
class j extends R {
|
1074
1074
|
constructor() {
|
1075
1075
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
1076
1076
|
}
|
@@ -1092,15 +1092,15 @@ class j extends x {
|
|
1092
1092
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
1093
1093
|
}
|
1094
1094
|
render() {
|
1095
|
-
return
|
1095
|
+
return H;
|
1096
1096
|
}
|
1097
1097
|
}
|
1098
|
-
var
|
1099
|
-
j._$litElement$ = !0, j.finalized = !0, (
|
1098
|
+
var zt;
|
1099
|
+
j._$litElement$ = !0, j.finalized = !0, (zt = globalThis.litElementHydrateSupport) == null || zt.call(globalThis, { LitElement: j });
|
1100
1100
|
const ct = globalThis.litElementPolyfillSupport;
|
1101
1101
|
ct == null || ct({ LitElement: j });
|
1102
1102
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.2");
|
1103
|
-
function
|
1103
|
+
function Fe(r, t, e) {
|
1104
1104
|
function i(s) {
|
1105
1105
|
e.dispatchEvent(new CustomEvent(s.type, s));
|
1106
1106
|
}
|
@@ -1108,17 +1108,17 @@ function Je(r, t, e) {
|
|
1108
1108
|
t.removeEventListener(r, i);
|
1109
1109
|
};
|
1110
1110
|
}
|
1111
|
-
class
|
1111
|
+
class Ge {
|
1112
1112
|
constructor(t, e) {
|
1113
|
-
this._events = [], this._cleanup = [], this._forwardElementRef =
|
1113
|
+
this._events = [], this._cleanup = [], this._forwardElementRef = Bt(), this.host = t, this._events = e, t.addController(this);
|
1114
1114
|
}
|
1115
1115
|
register() {
|
1116
|
-
return
|
1116
|
+
return Wt(this._forwardElementRef);
|
1117
1117
|
}
|
1118
1118
|
hostConnected() {
|
1119
1119
|
requestAnimationFrame(() => {
|
1120
1120
|
this._events.forEach((t) => {
|
1121
|
-
this._forwardElementRef.value && this._cleanup.push(
|
1121
|
+
this._forwardElementRef.value && this._cleanup.push(Fe(t, this._forwardElementRef.value, this.host));
|
1122
1122
|
});
|
1123
1123
|
});
|
1124
1124
|
}
|
@@ -1128,7 +1128,7 @@ class Fe {
|
|
1128
1128
|
}), this._cleanup = [];
|
1129
1129
|
}
|
1130
1130
|
}
|
1131
|
-
const It = "https://d2rxhdlm2q91uk.cloudfront.net",
|
1131
|
+
const It = "https://d2rxhdlm2q91uk.cloudfront.net", Ze = "https://d1ix11aj5kfygl.cloudfront.net", Ye = "https://d157jlwnudd93d.cloudfront.net", Vt = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", Qe = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", ti = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", ei = "http://localhost:6060/v2", ii = "https://embed-dev.vouchfor.com/v2", si = "https://embed-staging.vouchfor.com/v2", ri = "https://embed.vouchfor.com/v2";
|
1132
1132
|
function et(r) {
|
1133
1133
|
if (!["local", "dev", "staging", "prod"].includes(r))
|
1134
1134
|
throw new Error(`Unknown environment: ${r}`);
|
@@ -1136,71 +1136,69 @@ function et(r) {
|
|
1136
1136
|
return {
|
1137
1137
|
videoUrl: It,
|
1138
1138
|
publicApiUrl: Vt,
|
1139
|
-
embedApiUrl:
|
1139
|
+
embedApiUrl: ei
|
1140
1140
|
};
|
1141
1141
|
if (r === "dev")
|
1142
1142
|
return {
|
1143
1143
|
videoUrl: It,
|
1144
1144
|
publicApiUrl: Vt,
|
1145
|
-
embedApiUrl: ei
|
1146
|
-
};
|
1147
|
-
if (r === "staging")
|
1148
|
-
return {
|
1149
|
-
videoUrl: Ge,
|
1150
|
-
publicApiUrl: Ye,
|
1151
1145
|
embedApiUrl: ii
|
1152
1146
|
};
|
1153
|
-
if (r === "
|
1147
|
+
if (r === "staging")
|
1154
1148
|
return {
|
1155
1149
|
videoUrl: Ze,
|
1156
1150
|
publicApiUrl: Qe,
|
1157
1151
|
embedApiUrl: si
|
1158
1152
|
};
|
1153
|
+
if (r === "prod")
|
1154
|
+
return {
|
1155
|
+
videoUrl: Ye,
|
1156
|
+
publicApiUrl: ti,
|
1157
|
+
embedApiUrl: ri
|
1158
|
+
};
|
1159
1159
|
}
|
1160
|
-
class
|
1160
|
+
class ni {
|
1161
1161
|
constructor(t) {
|
1162
1162
|
this._fetching = !1, this.getVouch = async (e, i, s) => {
|
1163
1163
|
var d;
|
1164
|
-
const { embedApiUrl: n } = et(e), o = P(),
|
1164
|
+
const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/vouches/${s}`, {
|
1165
1165
|
method: "GET",
|
1166
1166
|
headers: [
|
1167
1167
|
["X-Api-Key", i],
|
1168
1168
|
["X-Cache-Check", o]
|
1169
1169
|
]
|
1170
|
-
}),
|
1171
|
-
this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail:
|
1172
|
-
const c = (d = a == null ? void 0 : a.headers) == null ? void 0 : d.get("X-Cache-Check");
|
1173
|
-
return c && c !== o && fetch(`${n}/vouches/${s}`, {
|
1170
|
+
}), a = await h.json();
|
1171
|
+
return this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail: a == null ? void 0 : a.id })), ((d = h == null ? void 0 : h.headers) == null ? void 0 : d.get("X-Cache-Check")) !== o && fetch(`${n}/vouches/${s}`, {
|
1174
1172
|
method: "GET",
|
1175
1173
|
headers: [
|
1176
1174
|
["X-Api-Key", i],
|
1177
1175
|
["Cache-Control", "max-age=0"]
|
1178
1176
|
]
|
1179
|
-
}),
|
1177
|
+
}), a;
|
1180
1178
|
}, this.getTemplate = async (e, i, s) => {
|
1181
1179
|
var d;
|
1182
|
-
const { embedApiUrl: n } = et(e), o = P(),
|
1180
|
+
const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/templates/${s}`, {
|
1183
1181
|
method: "GET",
|
1184
1182
|
headers: [
|
1185
1183
|
["X-Api-Key", i],
|
1186
1184
|
["X-Cache-Check", o]
|
1187
1185
|
]
|
1188
|
-
}),
|
1189
|
-
return
|
1186
|
+
}), a = await h.json();
|
1187
|
+
return ((d = h == null ? void 0 : h.headers) == null ? void 0 : d.get("X-Cache-Check")) !== o && fetch(`${n}/templates/${s}`, {
|
1190
1188
|
method: "GET",
|
1191
1189
|
headers: [
|
1192
1190
|
["X-Api-Key", i],
|
1193
1191
|
["Cache-Control", "max-age=0"]
|
1194
1192
|
]
|
1195
|
-
}),
|
1196
|
-
}, this.host = t, new
|
1193
|
+
}), a;
|
1194
|
+
}, this.host = t, new le(
|
1197
1195
|
this.host,
|
1198
1196
|
async ([e, i, s, n, o]) => {
|
1199
|
-
var
|
1197
|
+
var h, a, c, d;
|
1200
1198
|
try {
|
1201
1199
|
if (t.vouch = void 0, t.template = void 0, s) {
|
1202
1200
|
let l;
|
1203
|
-
o && (this.fetching = !0, l = await this.getTemplate(e, i, o)), t.vouch = s, t.template = l ?? ((
|
1201
|
+
o && (this.fetching = !0, l = await this.getTemplate(e, i, o)), t.vouch = s, t.template = l ?? ((a = (h = s == null ? void 0 : s.settings) == null ? void 0 : h.template) == null ? void 0 : a.instance);
|
1204
1202
|
} else if (n) {
|
1205
1203
|
this.fetching = !0;
|
1206
1204
|
const [l, p] = await Promise.all([
|
@@ -1223,8 +1221,85 @@ class ri {
|
|
1223
1221
|
return this._fetching;
|
1224
1222
|
}
|
1225
1223
|
}
|
1226
|
-
const
|
1227
|
-
|
1224
|
+
const oi = "@vouchfor/embeds", ai = "0.0.0-experiment.d892f46", hi = "MIT", li = "Aaron Williams", ci = "dist/es/embeds.js", di = "dist/es/embeds.js", pi = "module", ui = "dist/es/index.d.ts", _i = {
|
1225
|
+
".": "./dist/es/embeds.js"
|
1226
|
+
}, mi = [
|
1227
|
+
"dist",
|
1228
|
+
"src"
|
1229
|
+
], $i = {
|
1230
|
+
tag: "experiment",
|
1231
|
+
access: "public"
|
1232
|
+
}, fi = {
|
1233
|
+
build: "rm -rf dist && tsc && vite build --mode iife && vite build --mode es",
|
1234
|
+
"build:deps": "yarn --cwd ../media-player build",
|
1235
|
+
"build:package": "yarn build",
|
1236
|
+
"build:storybook": "yarn prebuild && storybook build",
|
1237
|
+
"generate:manifest": "wca src --outFile custom-elements.json",
|
1238
|
+
lint: "eslint . --quiet",
|
1239
|
+
"lint:fix": "eslint . --fix",
|
1240
|
+
"lint:staged": "lint-staged",
|
1241
|
+
prepublishOnly: "yarn build",
|
1242
|
+
size: "size-limit",
|
1243
|
+
storybook: "yarn prebuild && storybook dev -p 6007",
|
1244
|
+
prebuild: "yarn build:deps && yarn generate:manifest",
|
1245
|
+
test: "true"
|
1246
|
+
}, gi = {
|
1247
|
+
"@lit/task": "^1.0.0",
|
1248
|
+
"@vouchfor/media-player": "0.0.0-experiment.d892f46",
|
1249
|
+
uuid: "^9.0.1"
|
1250
|
+
}, yi = {
|
1251
|
+
lit: "^3.1.0"
|
1252
|
+
}, vi = {
|
1253
|
+
"@esm-bundle/chai": "^4.3.4-fix.0",
|
1254
|
+
"@open-wc/testing": "^3.2.0",
|
1255
|
+
"@storybook/addon-essentials": "^7.4.5",
|
1256
|
+
"@storybook/addon-links": "^7.4.5",
|
1257
|
+
"@storybook/blocks": "^7.4.5",
|
1258
|
+
"@storybook/web-components": "^7.4.5",
|
1259
|
+
"@storybook/web-components-vite": "^7.4.5",
|
1260
|
+
"@types/mocha": "^10.0.1",
|
1261
|
+
"@vouchfor/eslint-config": "^1.0.0",
|
1262
|
+
"@vouchfor/prettier-config": "^1.0.0",
|
1263
|
+
"@web/dev-server-esbuild": "^0.4.1",
|
1264
|
+
"@web/test-runner": "^0.17.1",
|
1265
|
+
"@web/test-runner-browserstack": "^0.6.1",
|
1266
|
+
"@web/test-runner-mocha": "^0.8.1",
|
1267
|
+
"@web/test-runner-playwright": "^0.10.1",
|
1268
|
+
dotenv: "^16.3.1",
|
1269
|
+
eslint: "^8.50.0",
|
1270
|
+
"eslint-plugin-import": "^2.28.1",
|
1271
|
+
"lint-staged": "^14.0.1",
|
1272
|
+
lit: "^3.1.0",
|
1273
|
+
prettier: "^3.0.3",
|
1274
|
+
react: "^18.2.0",
|
1275
|
+
"react-dom": "^18.2.0",
|
1276
|
+
storybook: "^7.4.5",
|
1277
|
+
typescript: "^5.1.3",
|
1278
|
+
vite: "^4.4.9",
|
1279
|
+
"vite-plugin-dts": "^3.6.0",
|
1280
|
+
"web-component-analyzer": "^1.1.7"
|
1281
|
+
}, Ai = {
|
1282
|
+
name: oi,
|
1283
|
+
version: ai,
|
1284
|
+
license: hi,
|
1285
|
+
author: li,
|
1286
|
+
main: ci,
|
1287
|
+
module: di,
|
1288
|
+
type: pi,
|
1289
|
+
types: ui,
|
1290
|
+
exports: _i,
|
1291
|
+
files: mi,
|
1292
|
+
publishConfig: $i,
|
1293
|
+
scripts: fi,
|
1294
|
+
"lint-staged": {
|
1295
|
+
"**/*.{ts,tsx,js}": "eslint --fix --quiet",
|
1296
|
+
"**/*.{md,json,yml}": "prettier --write"
|
1297
|
+
},
|
1298
|
+
dependencies: gi,
|
1299
|
+
peerDependencies: yi,
|
1300
|
+
devDependencies: vi
|
1301
|
+
}, Dt = 1;
|
1302
|
+
class bi {
|
1228
1303
|
constructor(t) {
|
1229
1304
|
this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this._streamStartTime = {}, this._streamLatestTime = {}, this._currentlyPlayingVideo = null, this._createVisitor = (e) => {
|
1230
1305
|
var s, n;
|
@@ -1233,10 +1308,10 @@ class oi {
|
|
1233
1308
|
}, this._getReportingMetadata = () => {
|
1234
1309
|
var n, o;
|
1235
1310
|
const [e, i] = ((o = (n = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : n.split) == null ? void 0 : o.call(n, "/")) ?? [], s = {};
|
1236
|
-
return [...new URLSearchParams(location.search).entries()].forEach(([
|
1237
|
-
if (/utm/.test(
|
1238
|
-
const c =
|
1239
|
-
s[c] =
|
1311
|
+
return [...new URLSearchParams(location.search).entries()].forEach(([h, a]) => {
|
1312
|
+
if (/utm/.test(h)) {
|
1313
|
+
const c = h.toLowerCase().replace(/[-_][a-z0-9]/g, (d) => d.slice(-1).toUpperCase());
|
1314
|
+
s[c] = a;
|
1240
1315
|
}
|
1241
1316
|
}), {
|
1242
1317
|
source: this.host.trackingSource,
|
@@ -1250,25 +1325,39 @@ class oi {
|
|
1250
1325
|
...s
|
1251
1326
|
};
|
1252
1327
|
}, this._sendTrackingEvent = (e, i) => {
|
1253
|
-
|
1328
|
+
const s = this._findVouchId(i);
|
1329
|
+
if (!s || this.host.disableTracking)
|
1254
1330
|
return;
|
1255
|
-
const { publicApiUrl: n } = et(this.host.env), { client: o, tab:
|
1331
|
+
const { publicApiUrl: n } = et(this.host.env), { client: o, tab: h, request: a, visitor: c } = this._getUids();
|
1256
1332
|
navigator.sendBeacon(
|
1257
1333
|
`${n}/api/events`,
|
1258
1334
|
JSON.stringify({
|
1259
1335
|
event: e,
|
1260
|
-
payload:
|
1336
|
+
payload: {
|
1337
|
+
...i,
|
1338
|
+
vouchId: s
|
1339
|
+
},
|
1261
1340
|
context: {
|
1262
1341
|
"x-uid-client": o,
|
1263
|
-
"x-uid-tab":
|
1264
|
-
"x-uid-request":
|
1342
|
+
"x-uid-tab": h,
|
1343
|
+
"x-uid-request": a,
|
1265
1344
|
"x-uid-visitor": c,
|
1266
|
-
"x-reporting-metadata": this._getReportingMetadata()
|
1345
|
+
"x-reporting-metadata": this._getReportingMetadata(),
|
1346
|
+
"x-embeds-version": Ai.version
|
1267
1347
|
}
|
1268
1348
|
})
|
1269
1349
|
);
|
1350
|
+
}, this._streamEnded = () => {
|
1351
|
+
if (this._currentlyPlayingVideo) {
|
1352
|
+
const { id: e, key: i } = this._currentlyPlayingVideo;
|
1353
|
+
this._streamLatestTime[i] > this._streamStartTime[i] + Dt && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1354
|
+
answerId: e,
|
1355
|
+
streamStart: this._streamStartTime[i],
|
1356
|
+
streamEnd: this._streamLatestTime[i]
|
1357
|
+
}), delete this._streamStartTime[i], delete this._streamLatestTime[i];
|
1358
|
+
}
|
1270
1359
|
}, this._handleVouchLoaded = ({ detail: e }) => {
|
1271
|
-
e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED"), this._hasLoaded[e] = !0));
|
1360
|
+
e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED", { vouchId: e }), this._hasLoaded[e] = !0));
|
1272
1361
|
}, this._handlePlay = () => {
|
1273
1362
|
this._hasPlayed || (this._sendTrackingEvent("VIDEO_PLAYED", {
|
1274
1363
|
streamStart: this.host.currentTime
|
@@ -1276,38 +1365,35 @@ class oi {
|
|
1276
1365
|
}, this._handleVideoPlay = ({ detail: { id: e, key: i, node: s } }) => {
|
1277
1366
|
this._answersViewed[i] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
|
1278
1367
|
answerId: e
|
1279
|
-
}), this._answersViewed[i] = !0), this._streamStartTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime;
|
1368
|
+
}), this._answersViewed[i] = !0), this._streamStartTime[i] || (this._streamStartTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime);
|
1280
1369
|
}, this._handleVideoTimeUpdate = ({ detail: { id: e, key: i, node: s } }) => {
|
1281
1370
|
var n, o;
|
1282
|
-
|
1283
|
-
|
1284
|
-
this.
|
1285
|
-
answerId: e,
|
1286
|
-
streamStart: this._streamStartTime[i],
|
1287
|
-
streamEnd: this._streamLatestTime[i]
|
1288
|
-
}), this._streamStartTime[i] = s.currentTime);
|
1371
|
+
// We only want to count any time that the video is actually playing
|
1372
|
+
!this.host.paused && // Only update the latest time if this event fires for the currently active video
|
1373
|
+
e === ((o = (n = this.host.scene) == null ? void 0 : n.video) == null ? void 0 : o.id) && (this._currentlyPlayingVideo = { id: e, key: i, node: s }, this._streamLatestTime[i] = s.currentTime);
|
1289
1374
|
}, this._handleVideoPause = ({ detail: { id: e, key: i } }) => {
|
1290
|
-
this._streamLatestTime[i] > this._streamStartTime[i] && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1375
|
+
this._streamLatestTime[i] > this._streamStartTime[i] + Dt && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1291
1376
|
answerId: e,
|
1292
1377
|
streamStart: this._streamStartTime[i],
|
1293
1378
|
streamEnd: this._streamLatestTime[i]
|
1294
|
-
}),
|
1379
|
+
}), delete this._streamStartTime[i], delete this._streamLatestTime[i];
|
1380
|
+
}, this._handleVisibilityChange = () => {
|
1381
|
+
document.visibilityState === "hidden" && (this.host.pause(), this._streamEnded());
|
1295
1382
|
}, this.host = t, t.addController(this);
|
1296
1383
|
}
|
1297
|
-
_findVouchId() {
|
1298
|
-
|
1299
|
-
return "uuid" in this.host.vouch ? this.host.vouch.uuid : this.host.vouch.id;
|
1384
|
+
_findVouchId(t) {
|
1385
|
+
return t && "vouchId" in t ? t.vouchId : this.host.vouch ? this.host.vouch.id : null;
|
1300
1386
|
}
|
1301
1387
|
_getUids() {
|
1302
|
-
var n, o,
|
1388
|
+
var n, o, h, a, c, d, l, p, u, g, F, $t;
|
1303
1389
|
if (typeof window > "u")
|
1304
1390
|
return {
|
1305
1391
|
client: null,
|
1306
1392
|
tab: null,
|
1307
1393
|
request: P()
|
1308
1394
|
};
|
1309
|
-
const t = this._visitorId || ((o = (n = window.localStorage) == null ? void 0 : n.getItem) == null ? void 0 : o.call(n, "vouch-uid-visitor")) || this._createVisitor(P()), e = this._clientId || ((
|
1310
|
-
return t !== this._visitorId && (this._visitorId = t, (p = (l = window.localStorage) == null ? void 0 : l.setItem) == null || p.call(l, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (g = (u = window.localStorage) == null ? void 0 : u.setItem) == null || g.call(u, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, (
|
1395
|
+
const t = this._visitorId || ((o = (n = window.localStorage) == null ? void 0 : n.getItem) == null ? void 0 : o.call(n, "vouch-uid-visitor")) || this._createVisitor(P()), e = this._clientId || ((a = (h = window.localStorage) == null ? void 0 : h.getItem) == null ? void 0 : a.call(h, "vouch-uid-client")) || P(), i = this._tabId || ((d = (c = window.sessionStorage) == null ? void 0 : c.getItem) == null ? void 0 : d.call(c, "vouch-uid-tab")) || P(), s = P();
|
1396
|
+
return t !== this._visitorId && (this._visitorId = t, (p = (l = window.localStorage) == null ? void 0 : l.setItem) == null || p.call(l, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (g = (u = window.localStorage) == null ? void 0 : u.setItem) == null || g.call(u, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, ($t = (F = window.sessionStorage) == null ? void 0 : F.setItem) == null || $t.call(F, "vouch-uid-tab", i)), {
|
1311
1397
|
client: e,
|
1312
1398
|
tab: i,
|
1313
1399
|
request: s,
|
@@ -1317,30 +1403,22 @@ class oi {
|
|
1317
1403
|
hostConnected() {
|
1318
1404
|
requestAnimationFrame(() => {
|
1319
1405
|
var t, e, i, s;
|
1320
|
-
this.host.addEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.addEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.addEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.addEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1406
|
+
document.addEventListener("visibilitychange", this._handleVisibilityChange), this.host.addEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.addEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.addEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.addEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1321
1407
|
});
|
1322
1408
|
}
|
1323
1409
|
hostDisconnected() {
|
1324
1410
|
var t, e, i, s;
|
1325
|
-
|
1326
|
-
const { id: n, key: o } = this._currentlyPlayingVideo;
|
1327
|
-
this._streamLatestTime[o] > this._streamStartTime[o] && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1328
|
-
answerId: n,
|
1329
|
-
streamStart: this._streamStartTime[o],
|
1330
|
-
streamEnd: this._streamLatestTime[o]
|
1331
|
-
});
|
1332
|
-
}
|
1333
|
-
this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.removeEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.removeEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.removeEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1411
|
+
this._streamEnded(), document.removeEventListener("visibilitychange", this._handleVisibilityChange), this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.removeEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.removeEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.removeEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
|
1334
1412
|
}
|
1335
1413
|
}
|
1336
|
-
var
|
1337
|
-
for (var s = i > 1 ? void 0 : i ?
|
1414
|
+
var Ei = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, f = (r, t, e, i) => {
|
1415
|
+
for (var s = i > 1 ? void 0 : i ? Si(t, e) : t, n = r.length - 1, o; n >= 0; n--)
|
1338
1416
|
(o = r[n]) && (s = (i ? o(t, e, s) : o(s)) || s);
|
1339
|
-
return i && s &&
|
1417
|
+
return i && s && Ei(t, e, s), s;
|
1340
1418
|
};
|
1341
|
-
let
|
1419
|
+
let $ = class extends j {
|
1342
1420
|
constructor() {
|
1343
|
-
super(...arguments), this._mediaPlayerRef =
|
1421
|
+
super(...arguments), this._mediaPlayerRef = Bt(), this.env = "prod", this.apiKey = "", this.disableTracking = !1, this.trackingSource = "embed", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Ge(this, [
|
1344
1422
|
"durationchange",
|
1345
1423
|
"ended",
|
1346
1424
|
"error",
|
@@ -1366,7 +1444,7 @@ let m = class extends j {
|
|
1366
1444
|
"video:timeupdate",
|
1367
1445
|
"video:ended",
|
1368
1446
|
"video:error"
|
1369
|
-
]), this._fetcherController = new
|
1447
|
+
]), this._fetcherController = new ni(this), this._trackingController = new bi(this);
|
1370
1448
|
}
|
1371
1449
|
get fetching() {
|
1372
1450
|
return this._fetcherController.fetching;
|
@@ -1451,9 +1529,9 @@ let m = class extends j {
|
|
1451
1529
|
(t = this._mediaPlayerRef.value) == null || t.setScene(r);
|
1452
1530
|
}
|
1453
1531
|
render() {
|
1454
|
-
return
|
1532
|
+
return ze`
|
1455
1533
|
<vmp-new-media-player
|
1456
|
-
${
|
1534
|
+
${Wt(this._mediaPlayerRef)}
|
1457
1535
|
${this.eventController.register()}
|
1458
1536
|
?autoplay=${this.autoplay}
|
1459
1537
|
?loading=${this.fetching}
|
@@ -1467,48 +1545,48 @@ let m = class extends j {
|
|
1467
1545
|
}
|
1468
1546
|
};
|
1469
1547
|
f([
|
1470
|
-
|
1471
|
-
],
|
1548
|
+
y({ type: Object, attribute: "data" })
|
1549
|
+
], $.prototype, "data", 2);
|
1472
1550
|
f([
|
1473
|
-
|
1474
|
-
],
|
1551
|
+
y({ type: String })
|
1552
|
+
], $.prototype, "vouchId", 2);
|
1475
1553
|
f([
|
1476
|
-
|
1477
|
-
],
|
1554
|
+
y({ type: String })
|
1555
|
+
], $.prototype, "templateId", 2);
|
1478
1556
|
f([
|
1479
|
-
|
1480
|
-
],
|
1557
|
+
y({ type: String })
|
1558
|
+
], $.prototype, "env", 2);
|
1481
1559
|
f([
|
1482
|
-
|
1483
|
-
],
|
1560
|
+
y({ type: String })
|
1561
|
+
], $.prototype, "apiKey", 2);
|
1484
1562
|
f([
|
1485
|
-
|
1486
|
-
],
|
1563
|
+
y({ type: Boolean })
|
1564
|
+
], $.prototype, "disableTracking", 2);
|
1487
1565
|
f([
|
1488
|
-
|
1489
|
-
],
|
1566
|
+
y({ type: String })
|
1567
|
+
], $.prototype, "trackingSource", 2);
|
1490
1568
|
f([
|
1491
|
-
|
1492
|
-
],
|
1569
|
+
y({ type: Array })
|
1570
|
+
], $.prototype, "controls", 2);
|
1493
1571
|
f([
|
1494
|
-
|
1495
|
-
],
|
1572
|
+
y({ type: String })
|
1573
|
+
], $.prototype, "preload", 2);
|
1496
1574
|
f([
|
1497
|
-
|
1498
|
-
],
|
1575
|
+
y({ type: Boolean })
|
1576
|
+
], $.prototype, "autoplay", 2);
|
1499
1577
|
f([
|
1500
|
-
|
1501
|
-
],
|
1578
|
+
y({ type: Number })
|
1579
|
+
], $.prototype, "aspectRatio", 2);
|
1502
1580
|
f([
|
1503
|
-
|
1504
|
-
],
|
1581
|
+
jt()
|
1582
|
+
], $.prototype, "vouch", 2);
|
1505
1583
|
f([
|
1506
|
-
|
1507
|
-
],
|
1508
|
-
|
1584
|
+
jt()
|
1585
|
+
], $.prototype, "template", 2);
|
1586
|
+
$ = f([
|
1509
1587
|
he("vouch-embed")
|
1510
|
-
],
|
1588
|
+
], $);
|
1511
1589
|
export {
|
1512
|
-
|
1590
|
+
$ as Embed
|
1513
1591
|
};
|
1514
1592
|
//# sourceMappingURL=embeds.js.map
|