@vouchfor/embeds 0.0.0-experiment.1b80037 → 0.0.0-experiment.254513d
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/es/components/Embed/controllers/fetcher.d.ts +6 -6
- package/dist/es/components/Embed/index.d.ts +4 -5
- package/dist/es/embeds.js +62 -66
- package/dist/es/embeds.js.map +1 -1
- package/dist/iife/embeds.iife.js +153 -154
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Embed/Embed.stories.ts +4 -17
- package/src/components/Embed/controllers/fetcher.ts +4 -4
- package/src/components/Embed/index.ts +3 -9
@@ -5,14 +5,14 @@ type EmbedHost = ReactiveControllerHost & Embed;
|
|
5
5
|
declare class FetcherController {
|
6
6
|
host: EmbedHost;
|
7
7
|
private _fetching;
|
8
|
-
private _vouch
|
9
|
-
private _template
|
8
|
+
private _vouch?;
|
9
|
+
private _template?;
|
10
10
|
set fetching(value: boolean);
|
11
11
|
get fetching(): boolean;
|
12
|
-
set vouch(value: import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch |
|
13
|
-
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch |
|
14
|
-
set template(value: TemplateInstance |
|
15
|
-
get template(): TemplateInstance |
|
12
|
+
set vouch(value: import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | undefined);
|
13
|
+
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | undefined;
|
14
|
+
set template(value: TemplateInstance | undefined);
|
15
|
+
get template(): TemplateInstance | undefined;
|
16
16
|
private getVouch;
|
17
17
|
private getTemplate;
|
18
18
|
constructor(host: EmbedHost);
|
@@ -2,7 +2,7 @@ import { LitElement } from 'lit';
|
|
2
2
|
import type { Scene, TemplateInstance } from '@vouchfor/canvas-video';
|
3
3
|
import type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';
|
4
4
|
import type { Environment } from '../../utils/env';
|
5
|
-
type EmbedProps = Pick<MediaPlayerProps, 'data' | '
|
5
|
+
type EmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
|
6
6
|
env: Environment;
|
7
7
|
apiKey: string;
|
8
8
|
vouchId?: string;
|
@@ -15,16 +15,15 @@ declare class Embed extends LitElement {
|
|
15
15
|
templateId: EmbedProps['templateId'];
|
16
16
|
env: EmbedProps['env'];
|
17
17
|
apiKey: EmbedProps['apiKey'];
|
18
|
+
controls: EmbedProps['controls'];
|
18
19
|
preload: EmbedProps['preload'];
|
19
20
|
autoplay: EmbedProps['autoplay'];
|
20
|
-
resolution: EmbedProps['resolution'];
|
21
21
|
aspectRatio: EmbedProps['aspectRatio'];
|
22
|
-
controls: EmbedProps['controls'];
|
23
22
|
private eventController;
|
24
23
|
private _fetcherController;
|
25
24
|
private _trackingController;
|
26
|
-
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch |
|
27
|
-
get template(): TemplateInstance |
|
25
|
+
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | undefined;
|
26
|
+
get template(): TemplateInstance | undefined;
|
28
27
|
get fetching(): boolean;
|
29
28
|
get waiting(): boolean | undefined;
|
30
29
|
get seeking(): boolean | undefined;
|
package/dist/es/embeds.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { property as
|
2
|
-
import { ifDefined as
|
1
|
+
import { property as y, customElement as Yt } from "lit/decorators.js";
|
2
|
+
import { ifDefined as mt } from "lit/directives/if-defined.js";
|
3
3
|
import { createRef as Lt, ref as kt } from "lit/directives/ref.js";
|
4
4
|
import { Task as Qt } from "@lit/task";
|
5
5
|
import "@vouchfor/media-player";
|
@@ -8,7 +8,7 @@ import "@vouchfor/media-player";
|
|
8
8
|
* Copyright 2019 Google LLC
|
9
9
|
* SPDX-License-Identifier: BSD-3-Clause
|
10
10
|
*/
|
11
|
-
const F = window,
|
11
|
+
const F = window, _t = F.ShadowRoot && (F.ShadyCSS === void 0 || F.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Dt = Symbol(), gt = /* @__PURE__ */ new WeakMap();
|
12
12
|
let te = class {
|
13
13
|
constructor(t, e, i) {
|
14
14
|
if (this._$cssResult$ = !0, i !== Dt)
|
@@ -18,7 +18,7 @@ let te = class {
|
|
18
18
|
get styleSheet() {
|
19
19
|
let t = this.o;
|
20
20
|
const e = this.t;
|
21
|
-
if (
|
21
|
+
if (_t && t === void 0) {
|
22
22
|
const i = e !== void 0 && e.length === 1;
|
23
23
|
i && (t = gt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && gt.set(e, t));
|
24
24
|
}
|
@@ -29,11 +29,11 @@ let te = class {
|
|
29
29
|
}
|
30
30
|
};
|
31
31
|
const ee = (n) => new te(typeof n == "string" ? n : n + "", void 0, Dt), ie = (n, t) => {
|
32
|
-
|
32
|
+
_t ? n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
|
33
33
|
const i = document.createElement("style"), s = F.litNonce;
|
34
34
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
|
35
35
|
});
|
36
|
-
}, ft =
|
36
|
+
}, ft = _t ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
|
37
37
|
let e = "";
|
38
38
|
for (const i of t.cssRules)
|
39
39
|
e += i.cssText;
|
@@ -44,8 +44,8 @@ const ee = (n) => new te(typeof n == "string" ? n : n + "", void 0, Dt), ie = (n
|
|
44
44
|
* Copyright 2017 Google LLC
|
45
45
|
* SPDX-License-Identifier: BSD-3-Clause
|
46
46
|
*/
|
47
|
-
var
|
48
|
-
const K = window, At = K.trustedTypes, se = At ? At.emptyScript : "", yt = K.reactiveElementPolyfillSupport,
|
47
|
+
var et;
|
48
|
+
const K = window, At = K.trustedTypes, se = At ? At.emptyScript : "", yt = K.reactiveElementPolyfillSupport, dt = { toAttribute(n, t) {
|
49
49
|
switch (t) {
|
50
50
|
case Boolean:
|
51
51
|
n = n ? se : null;
|
@@ -73,7 +73,7 @@ const K = window, At = K.trustedTypes, se = At ? At.emptyScript : "", yt = K.rea
|
|
73
73
|
}
|
74
74
|
}
|
75
75
|
return e;
|
76
|
-
} }, jt = (n, t) => t !== n && (t == t || n == n),
|
76
|
+
} }, jt = (n, t) => t !== n && (t == t || n == n), it = { attribute: !0, type: String, converter: dt, reflect: !1, hasChanged: jt }, ct = "finalized";
|
77
77
|
let T = class extends HTMLElement {
|
78
78
|
constructor() {
|
79
79
|
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
|
@@ -90,7 +90,7 @@ let T = class extends HTMLElement {
|
|
90
90
|
s !== void 0 && (this._$Ev.set(s, i), t.push(s));
|
91
91
|
}), t;
|
92
92
|
}
|
93
|
-
static createProperty(t, e =
|
93
|
+
static createProperty(t, e = it) {
|
94
94
|
if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
|
95
95
|
const i = typeof t == "symbol" ? Symbol() : "__" + t, s = this.getPropertyDescriptor(t, i, e);
|
96
96
|
s !== void 0 && Object.defineProperty(this.prototype, t, s);
|
@@ -105,12 +105,12 @@ let T = class extends HTMLElement {
|
|
105
105
|
}, configurable: !0, enumerable: !0 };
|
106
106
|
}
|
107
107
|
static getPropertyOptions(t) {
|
108
|
-
return this.elementProperties.get(t) ||
|
108
|
+
return this.elementProperties.get(t) || it;
|
109
109
|
}
|
110
110
|
static finalize() {
|
111
|
-
if (this.hasOwnProperty(
|
111
|
+
if (this.hasOwnProperty(ct))
|
112
112
|
return !1;
|
113
|
-
this[
|
113
|
+
this[ct] = !0;
|
114
114
|
const t = Object.getPrototypeOf(this);
|
115
115
|
if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
|
116
116
|
const e = this.properties, i = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
|
@@ -174,11 +174,11 @@ let T = class extends HTMLElement {
|
|
174
174
|
attributeChangedCallback(t, e, i) {
|
175
175
|
this._$AK(t, i);
|
176
176
|
}
|
177
|
-
_$EO(t, e, i =
|
177
|
+
_$EO(t, e, i = it) {
|
178
178
|
var s;
|
179
179
|
const r = this.constructor._$Ep(t, i);
|
180
180
|
if (r !== void 0 && i.reflect === !0) {
|
181
|
-
const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter :
|
181
|
+
const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : dt).toAttribute(e, i.type);
|
182
182
|
this._$El = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$El = null;
|
183
183
|
}
|
184
184
|
}
|
@@ -186,7 +186,7 @@ let T = class extends HTMLElement {
|
|
186
186
|
var i;
|
187
187
|
const s = this.constructor, r = s._$Ev.get(t);
|
188
188
|
if (r !== void 0 && this._$El !== r) {
|
189
|
-
const o = s.getPropertyOptions(r), d = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((i = o.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? o.converter :
|
189
|
+
const o = s.getPropertyOptions(r), d = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((i = o.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? o.converter : dt;
|
190
190
|
this._$El = r, this[r] = d.fromAttribute(e, o.type), this._$El = null;
|
191
191
|
}
|
192
192
|
}
|
@@ -253,15 +253,15 @@ let T = class extends HTMLElement {
|
|
253
253
|
firstUpdated(t) {
|
254
254
|
}
|
255
255
|
};
|
256
|
-
T[
|
256
|
+
T[ct] = !0, T.elementProperties = /* @__PURE__ */ new Map(), T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, yt == null || yt({ ReactiveElement: T }), ((et = K.reactiveElementVersions) !== null && et !== void 0 ? et : K.reactiveElementVersions = []).push("1.6.2");
|
257
257
|
/**
|
258
258
|
* @license
|
259
259
|
* Copyright 2017 Google LLC
|
260
260
|
* SPDX-License-Identifier: BSD-3-Clause
|
261
261
|
*/
|
262
|
-
var
|
263
|
-
const J = window, x = J.trustedTypes, Et = x ? x.createPolicy("lit-html", { createHTML: (n) => n }) : void 0,
|
264
|
-
\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, bt = />/g, b = RegExp(`>|${
|
262
|
+
var st;
|
263
|
+
const J = window, x = J.trustedTypes, Et = x ? x.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ut = "$lit$", E = `lit$${(Math.random() + "").slice(9)}$`, Bt = "?" + E, ne = `<${Bt}>`, C = document, G = () => C.createComment(""), D = (n) => n === null || typeof n != "object" && typeof n != "function", zt = Array.isArray, re = (n) => zt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", nt = `[
|
264
|
+
\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, bt = />/g, b = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
|
265
265
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, Pt = /"/g, qt = /^(?:script|style|textarea|title)$/i, j = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ut = /* @__PURE__ */ new WeakMap(), P = C.createTreeWalker(C, 129, null, !1);
|
266
266
|
function Wt(n, t) {
|
267
267
|
if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
|
@@ -277,11 +277,11 @@ const oe = (n, t) => {
|
|
277
277
|
for (; c < l.length && (o.lastIndex = c, u = o.exec(l), u !== null); )
|
278
278
|
c = o.lastIndex, o === O ? u[1] === "!--" ? o = wt : u[1] !== void 0 ? o = bt : u[2] !== void 0 ? (qt.test(u[2]) && (s = RegExp("</" + u[2], "g")), o = b) : u[3] !== void 0 && (o = b) : o === b ? u[0] === ">" ? (o = s ?? O, a = -1) : u[1] === void 0 ? a = -2 : (a = o.lastIndex - u[2].length, h = u[1], o = u[3] === void 0 ? b : u[3] === '"' ? Pt : St) : o === Pt || o === St ? o = b : o === wt || o === bt ? o = O : (o = b, s = void 0);
|
279
279
|
const p = o === b && n[d + 1].startsWith("/>") ? " " : "";
|
280
|
-
r += o === O ? l + ne : a >= 0 ? (i.push(h), l.slice(0, a) +
|
280
|
+
r += o === O ? l + ne : a >= 0 ? (i.push(h), l.slice(0, a) + ut + l.slice(a) + E + p) : l + E + (a === -2 ? (i.push(void 0), d) : p);
|
281
281
|
}
|
282
282
|
return [Wt(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
283
283
|
};
|
284
|
-
let
|
284
|
+
let pt = class Zt {
|
285
285
|
constructor({ strings: t, _$litType$: e }, i) {
|
286
286
|
let s;
|
287
287
|
this.parts = [];
|
@@ -296,11 +296,11 @@ let vt = class Zt {
|
|
296
296
|
if (s.hasAttributes()) {
|
297
297
|
const a = [];
|
298
298
|
for (const c of s.getAttributeNames())
|
299
|
-
if (c.endsWith(
|
299
|
+
if (c.endsWith(ut) || c.startsWith(E)) {
|
300
300
|
const p = u[o++];
|
301
301
|
if (a.push(c), p !== void 0) {
|
302
|
-
const
|
303
|
-
l.push({ type: 1, index: r, name: m[2], strings:
|
302
|
+
const A = s.getAttribute(p.toLowerCase() + ut).split(E), m = /([.?@])?(.*)/.exec(p);
|
303
|
+
l.push({ type: 1, index: r, name: m[2], strings: A, ctor: m[1] === "." ? he : m[1] === "?" ? de : m[1] === "@" ? ce : Q });
|
304
304
|
} else
|
305
305
|
l.push({ type: 6, index: r });
|
306
306
|
}
|
@@ -403,7 +403,7 @@ let le = class {
|
|
403
403
|
}
|
404
404
|
g(t) {
|
405
405
|
var e;
|
406
|
-
const { values: i, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el =
|
406
|
+
const { values: i, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = pt.createElement(Wt(s.h, s.h[0]), this.options)), s);
|
407
407
|
if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === r)
|
408
408
|
this._$AH.v(i);
|
409
409
|
else {
|
@@ -413,7 +413,7 @@ let le = class {
|
|
413
413
|
}
|
414
414
|
_$AC(t) {
|
415
415
|
let e = Ut.get(t.strings);
|
416
|
-
return e === void 0 && Ut.set(t.strings, e = new
|
416
|
+
return e === void 0 && Ut.set(t.strings, e = new pt(t)), e;
|
417
417
|
}
|
418
418
|
T(t) {
|
419
419
|
zt(this._$AH) || (this._$AH = [], this._$AR());
|
@@ -504,15 +504,15 @@ class ue {
|
|
504
504
|
}
|
505
505
|
}
|
506
506
|
const Ct = J.litHtmlPolyfillSupport;
|
507
|
-
Ct == null || Ct(
|
507
|
+
Ct == null || Ct(pt, Ft), ((st = J.litHtmlVersions) !== null && st !== void 0 ? st : J.litHtmlVersions = []).push("2.8.0");
|
508
508
|
/**
|
509
509
|
* @license
|
510
510
|
* Copyright 2017 Google LLC
|
511
511
|
* SPDX-License-Identifier: BSD-3-Clause
|
512
512
|
*/
|
513
|
-
var
|
514
|
-
const X = window, N = X.trustedTypes, Rt = N ? N.createPolicy("lit-html", { createHTML: (n) => n }) : void 0,
|
515
|
-
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, xt = />/g, S = RegExp(`>|${
|
513
|
+
var rt;
|
514
|
+
const X = window, N = X.trustedTypes, Rt = N ? N.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, vt = "$lit$", w = `lit$${(Math.random() + "").slice(9)}$`, Jt = "?" + w, pe = `<${Jt}>`, R = document, B = () => R.createComment(""), z = (n) => n === null || typeof n != "object" && typeof n != "function", Gt = Array.isArray, ve = (n) => Gt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", ot = `[
|
515
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, xt = />/g, S = RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
|
516
516
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, Nt = /"/g, Xt = /^(?:script|style|textarea|title)$/i, _e = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), $e = _e(1), I = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), It = /* @__PURE__ */ new WeakMap(), U = R.createTreeWalker(R, 129, null, !1), me = (n, t) => {
|
517
517
|
const e = n.length - 1, i = [];
|
518
518
|
let s, r = t === 2 ? "<svg>" : "", o = M;
|
@@ -521,8 +521,8 @@ const X = window, N = X.trustedTypes, Rt = N ? N.createPolicy("lit-html", { crea
|
|
521
521
|
let u, a, c = -1, p = 0;
|
522
522
|
for (; p < h.length && (o.lastIndex = p, a = o.exec(h), a !== null); )
|
523
523
|
p = o.lastIndex, o === M ? a[1] === "!--" ? o = Tt : a[1] !== void 0 ? o = xt : a[2] !== void 0 ? (Xt.test(a[2]) && (s = RegExp("</" + a[2], "g")), o = S) : a[3] !== void 0 && (o = S) : o === S ? a[0] === ">" ? (o = s ?? M, c = -1) : a[1] === void 0 ? c = -2 : (c = o.lastIndex - a[2].length, u = a[1], o = a[3] === void 0 ? S : a[3] === '"' ? Nt : Ht) : o === Nt || o === Ht ? o = S : o === Tt || o === xt ? o = M : (o = S, s = void 0);
|
524
|
-
const
|
525
|
-
r += o === M ? h + pe : c >= 0 ? (i.push(u), h.slice(0, c) +
|
524
|
+
const A = o === S && n[l + 1].startsWith("/>") ? " " : "";
|
525
|
+
r += o === M ? h + pe : c >= 0 ? (i.push(u), h.slice(0, c) + vt + h.slice(c) + w + A) : h + w + (c === -2 ? (i.push(void 0), l) : A);
|
526
526
|
}
|
527
527
|
const d = r + (n[e] || "<?>") + (t === 2 ? "</svg>" : "");
|
528
528
|
if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
|
@@ -544,11 +544,11 @@ class q {
|
|
544
544
|
if (s.hasAttributes()) {
|
545
545
|
const a = [];
|
546
546
|
for (const c of s.getAttributeNames())
|
547
|
-
if (c.endsWith(
|
547
|
+
if (c.endsWith(vt) || c.startsWith(w)) {
|
548
548
|
const p = u[o++];
|
549
549
|
if (a.push(c), p !== void 0) {
|
550
|
-
const
|
551
|
-
l.push({ type: 1, index: r, name: m[2], strings:
|
550
|
+
const A = s.getAttribute(p.toLowerCase() + vt).split(w), m = /([.?@])?(.*)/.exec(p);
|
551
|
+
l.push({ type: 1, index: r, name: m[2], strings: A, ctor: m[1] === "." ? fe : m[1] === "?" ? ye : m[1] === "@" ? Ee : tt });
|
552
552
|
} else
|
553
553
|
l.push({ type: 6, index: r });
|
554
554
|
}
|
@@ -756,7 +756,7 @@ class we {
|
|
756
756
|
}
|
757
757
|
}
|
758
758
|
const Vt = X.litHtmlPolyfillSupport;
|
759
|
-
Vt == null || Vt(q, W), ((
|
759
|
+
Vt == null || Vt(q, W), ((rt = X.litHtmlVersions) !== null && rt !== void 0 ? rt : X.litHtmlVersions = []).push("2.7.4");
|
760
760
|
const be = (n, t, e) => {
|
761
761
|
var i, s;
|
762
762
|
const r = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
|
@@ -772,7 +772,7 @@ const be = (n, t, e) => {
|
|
772
772
|
* Copyright 2017 Google LLC
|
773
773
|
* SPDX-License-Identifier: BSD-3-Clause
|
774
774
|
*/
|
775
|
-
var
|
775
|
+
var lt, ht;
|
776
776
|
class k extends T {
|
777
777
|
constructor() {
|
778
778
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
@@ -798,10 +798,10 @@ class k extends T {
|
|
798
798
|
return I;
|
799
799
|
}
|
800
800
|
}
|
801
|
-
k.finalized = !0, k._$litElement$ = !0, (
|
801
|
+
k.finalized = !0, k._$litElement$ = !0, (lt = globalThis.litElementHydrateSupport) === null || lt === void 0 || lt.call(globalThis, { LitElement: k });
|
802
802
|
const Ot = globalThis.litElementPolyfillSupport;
|
803
803
|
Ot == null || Ot({ LitElement: k });
|
804
|
-
((
|
804
|
+
((ht = globalThis.litElementVersions) !== null && ht !== void 0 ? ht : globalThis.litElementVersions = []).push("3.3.2");
|
805
805
|
function Se(n, t, e) {
|
806
806
|
function i(s) {
|
807
807
|
e.dispatchEvent(new CustomEvent(s.type, s));
|
@@ -830,13 +830,13 @@ class Pe {
|
|
830
830
|
}), this._cleanup = [];
|
831
831
|
}
|
832
832
|
}
|
833
|
-
const
|
833
|
+
const at = "https://vouchfor.com", Ue = "https://d2rxhdlm2q91uk.cloudfront.net", Ce = "https://d1ix11aj5kfygl.cloudfront.net", Re = "https://d157jlwnudd93d.cloudfront.net", Te = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", xe = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", He = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", Ne = "http://localhost:6060/v1", Ie = "https://embed-staging.vouchfor.com/v1", Ve = "https://embed.vouchfor.com/v1", Oe = "https://dev.vouchfor.com", Me = "https://staging.vouchfor.com", Le = "https://app.vouchfor.com";
|
834
834
|
function Y(n) {
|
835
835
|
if (!["dev", "staging", "prod"].includes(n))
|
836
836
|
throw new Error(`Unknown environment: ${n}`);
|
837
837
|
if (n === "dev")
|
838
838
|
return {
|
839
|
-
marketingUrl:
|
839
|
+
marketingUrl: at,
|
840
840
|
videoUrl: Ue,
|
841
841
|
publicApiUrl: Te,
|
842
842
|
embedApiUrl: Ne,
|
@@ -844,7 +844,7 @@ function Y(n) {
|
|
844
844
|
};
|
845
845
|
if (n === "staging")
|
846
846
|
return {
|
847
|
-
marketingUrl:
|
847
|
+
marketingUrl: at,
|
848
848
|
videoUrl: Ce,
|
849
849
|
publicApiUrl: xe,
|
850
850
|
embedApiUrl: Ie,
|
@@ -852,7 +852,7 @@ function Y(n) {
|
|
852
852
|
};
|
853
853
|
if (n === "prod")
|
854
854
|
return {
|
855
|
-
marketingUrl:
|
855
|
+
marketingUrl: at,
|
856
856
|
videoUrl: Re,
|
857
857
|
publicApiUrl: He,
|
858
858
|
embedApiUrl: Ve,
|
@@ -861,12 +861,12 @@ function Y(n) {
|
|
861
861
|
}
|
862
862
|
class ke {
|
863
863
|
constructor(t) {
|
864
|
-
this._fetching = !1, this.
|
864
|
+
this._fetching = !1, this.host = t, new Qt(
|
865
865
|
this.host,
|
866
866
|
async ([e, i, s, r, o]) => {
|
867
867
|
var d, l, h, u;
|
868
868
|
try {
|
869
|
-
if (this.vouch =
|
869
|
+
if (this.vouch = void 0, this.template = void 0, s) {
|
870
870
|
const a = await this.getTemplate(e, i, o);
|
871
871
|
this.vouch = s, this.template = ((l = (d = s == null ? void 0 : s.settings) == null ? void 0 : d.template) == null ? void 0 : l.instance) ?? a;
|
872
872
|
} else if (r) {
|
@@ -1033,7 +1033,7 @@ class We {
|
|
1033
1033
|
return "uuid" in this.host.data ? this.host.data.uuid : this.host.data.id;
|
1034
1034
|
}
|
1035
1035
|
_getUids() {
|
1036
|
-
var r, o, d, l, h, u, a, c, p,
|
1036
|
+
var r, o, d, l, h, u, a, c, p, A, m, $t;
|
1037
1037
|
if (typeof window > "u")
|
1038
1038
|
return {
|
1039
1039
|
client: null,
|
@@ -1041,7 +1041,7 @@ class We {
|
|
1041
1041
|
request: L()
|
1042
1042
|
};
|
1043
1043
|
const t = this._visitorId || ((o = (r = window.localStorage) == null ? void 0 : r.getItem) == null ? void 0 : o.call(r, "vouch-uid-visitor")) || this._createVisitor(L()), e = this._clientId || ((l = (d = window.localStorage) == null ? void 0 : d.getItem) == null ? void 0 : l.call(d, "vouch-uid-client")) || L(), i = this._tabId || ((u = (h = window.sessionStorage) == null ? void 0 : h.getItem) == null ? void 0 : u.call(h, "vouch-uid-tab")) || L(), s = L();
|
1044
|
-
return t !== this._visitorId && (this._visitorId = t, (c = (a = window.localStorage) == null ? void 0 : a.setItem) == null || c.call(a, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (
|
1044
|
+
return t !== this._visitorId && (this._visitorId = t, (c = (a = window.localStorage) == null ? void 0 : a.setItem) == null || c.call(a, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (A = (p = window.localStorage) == null ? void 0 : p.setItem) == null || A.call(p, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, ($t = (m = window.sessionStorage) == null ? void 0 : m.setItem) == null || $t.call(m, "vouch-uid-tab", i)), {
|
1045
1045
|
client: e,
|
1046
1046
|
tab: i,
|
1047
1047
|
request: s,
|
@@ -1066,7 +1066,7 @@ var Ze = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, f = (n, t,
|
|
1066
1066
|
};
|
1067
1067
|
let g = class extends k {
|
1068
1068
|
constructor() {
|
1069
|
-
super(...arguments), this._mediaPlayerRef = Lt(), this.env = "prod", this.apiKey = "", this.preload = "auto", this.autoplay = !1, this.
|
1069
|
+
super(...arguments), this._mediaPlayerRef = Lt(), this.env = "prod", this.apiKey = "", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Pe(this, [
|
1070
1070
|
"durationchange",
|
1071
1071
|
"ended",
|
1072
1072
|
"error",
|
@@ -1190,44 +1190,40 @@ let g = class extends k {
|
|
1190
1190
|
?loading=${this.fetching}
|
1191
1191
|
.data=${this.vouch}
|
1192
1192
|
.template=${this.template}
|
1193
|
-
|
1194
|
-
|
1195
|
-
preload=${et(this.preload)}
|
1193
|
+
aspectRatio=${mt(this.aspectRatio)}
|
1194
|
+
preload=${mt(this.preload)}
|
1196
1195
|
.controls=${this.controls}
|
1197
1196
|
></vmp-media-player>
|
1198
1197
|
`;
|
1199
1198
|
}
|
1200
1199
|
};
|
1201
1200
|
f([
|
1202
|
-
|
1201
|
+
y({ type: Object, attribute: "data" })
|
1203
1202
|
], g.prototype, "data", 2);
|
1204
1203
|
f([
|
1205
|
-
|
1204
|
+
y({ type: String })
|
1206
1205
|
], g.prototype, "vouchId", 2);
|
1207
1206
|
f([
|
1208
|
-
|
1207
|
+
y({ type: String })
|
1209
1208
|
], g.prototype, "templateId", 2);
|
1210
1209
|
f([
|
1211
|
-
|
1210
|
+
y({ type: String })
|
1212
1211
|
], g.prototype, "env", 2);
|
1213
1212
|
f([
|
1214
|
-
|
1213
|
+
y({ type: String })
|
1215
1214
|
], g.prototype, "apiKey", 2);
|
1216
1215
|
f([
|
1217
|
-
|
1216
|
+
y({ type: Array })
|
1217
|
+
], g.prototype, "controls", 2);
|
1218
|
+
f([
|
1219
|
+
y({ type: String })
|
1218
1220
|
], g.prototype, "preload", 2);
|
1219
1221
|
f([
|
1220
|
-
|
1222
|
+
y({ type: Boolean })
|
1221
1223
|
], g.prototype, "autoplay", 2);
|
1222
1224
|
f([
|
1223
|
-
|
1224
|
-
], g.prototype, "resolution", 2);
|
1225
|
-
f([
|
1226
|
-
A({ type: Number })
|
1225
|
+
y({ type: Number })
|
1227
1226
|
], g.prototype, "aspectRatio", 2);
|
1228
|
-
f([
|
1229
|
-
A({ type: Array })
|
1230
|
-
], g.prototype, "controls", 2);
|
1231
1227
|
g = f([
|
1232
1228
|
Yt("vouch-embed")
|
1233
1229
|
], g);
|