@vouchfor/embeds 0.0.0-experiment.acfa1ff → 0.0.0-experiment.ae8c0d8

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/embeds.js CHANGED
@@ -1,26 +1,27 @@
1
- import { property as y, state as $t, customElement as Qt } from "lit/decorators.js";
2
- import { ifDefined as tt } from "lit/directives/if-defined.js";
3
- import { createRef as Lt, ref as Dt } from "lit/directives/ref.js";
4
- import { Task as te } from "@lit/task";
1
+ import { property as y, state as Wt, customElement as de } from "lit/decorators.js";
2
+ import { ifDefined as gt } from "lit/directives/if-defined.js";
3
+ import { createRef as qt, ref as Xt } from "lit/directives/ref.js";
4
+ import { Task as yt } from "@lit/task";
5
+ import { v4 as P } from "uuid";
5
6
  import "@vouchfor/media-player";
6
7
  /**
7
8
  * @license
8
9
  * Copyright 2019 Google LLC
9
10
  * SPDX-License-Identifier: BSD-3-Clause
10
11
  */
11
- const Z = window, mt = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, jt = Symbol(), ft = /* @__PURE__ */ new WeakMap();
12
- let ee = class {
12
+ const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Jt = Symbol(), vt = /* @__PURE__ */ new WeakMap();
13
+ let ce = class {
13
14
  constructor(t, e, i) {
14
- if (this._$cssResult$ = !0, i !== jt)
15
+ if (this._$cssResult$ = !0, i !== Jt)
15
16
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
16
17
  this.cssText = t, this.t = e;
17
18
  }
18
19
  get styleSheet() {
19
20
  let t = this.o;
20
21
  const e = this.t;
21
- if (mt && t === void 0) {
22
+ if (_t && t === void 0) {
22
23
  const i = e !== void 0 && e.length === 1;
23
- i && (t = ft.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && ft.set(e, t));
24
+ i && (t = vt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && vt.set(e, t));
24
25
  }
25
26
  return t;
26
27
  }
@@ -28,176 +29,201 @@ let ee = class {
28
29
  return this.cssText;
29
30
  }
30
31
  };
31
- const ie = (n) => new ee(typeof n == "string" ? n : n + "", void 0, jt), se = (n, t) => {
32
- mt ? n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
33
- const i = document.createElement("style"), s = Z.litNonce;
34
- s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
35
- });
36
- }, yt = mt ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
32
+ const pe = (r) => new ce(typeof r == "string" ? r : r + "", void 0, Jt), ue = (r, t) => {
33
+ if (_t)
34
+ r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
35
+ else
36
+ for (const e of t) {
37
+ const i = document.createElement("style"), s = G.litNonce;
38
+ s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
39
+ }
40
+ }, At = _t ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
37
41
  let e = "";
38
42
  for (const i of t.cssRules)
39
43
  e += i.cssText;
40
- return ie(e);
41
- })(n) : n;
44
+ return pe(e);
45
+ })(r) : r;
42
46
  /**
43
47
  * @license
44
48
  * Copyright 2017 Google LLC
45
49
  * SPDX-License-Identifier: BSD-3-Clause
46
50
  */
47
- var et;
48
- const F = window, At = F.trustedTypes, ne = At ? At.emptyScript : "", Et = F.reactiveElementPolyfillSupport, dt = { toAttribute(n, t) {
51
+ const { is: _e, defineProperty: me, getOwnPropertyDescriptor: $e, getOwnPropertyNames: fe, getOwnPropertySymbols: ge, getPrototypeOf: ye } = Object, b = globalThis, bt = b.trustedTypes, ve = bt ? bt.emptyScript : "", rt = b.reactiveElementPolyfillSupport, I = (r, t) => r, ct = { toAttribute(r, t) {
49
52
  switch (t) {
50
53
  case Boolean:
51
- n = n ? ne : null;
54
+ r = r ? ve : null;
52
55
  break;
53
56
  case Object:
54
57
  case Array:
55
- n = n == null ? n : JSON.stringify(n);
58
+ r = r == null ? r : JSON.stringify(r);
56
59
  }
57
- return n;
58
- }, fromAttribute(n, t) {
59
- let e = n;
60
+ return r;
61
+ }, fromAttribute(r, t) {
62
+ let e = r;
60
63
  switch (t) {
61
64
  case Boolean:
62
- e = n !== null;
65
+ e = r !== null;
63
66
  break;
64
67
  case Number:
65
- e = n === null ? null : Number(n);
68
+ e = r === null ? null : Number(r);
66
69
  break;
67
70
  case Object:
68
71
  case Array:
69
72
  try {
70
- e = JSON.parse(n);
73
+ e = JSON.parse(r);
71
74
  } catch {
72
75
  e = null;
73
76
  }
74
77
  }
75
78
  return e;
76
- } }, Bt = (n, t) => t !== n && (t == t || n == n), it = { attribute: !0, type: String, converter: dt, reflect: !1, hasChanged: Bt }, ct = "finalized";
77
- let T = class extends HTMLElement {
78
- constructor() {
79
- super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
80
- }
79
+ } }, Kt = (r, t) => !_e(r, t), Et = { attribute: !0, type: String, converter: ct, reflect: !1, hasChanged: Kt };
80
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
81
+ let N = class extends HTMLElement {
81
82
  static addInitializer(t) {
82
- var e;
83
- this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t);
83
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
84
84
  }
85
85
  static get observedAttributes() {
86
- this.finalize();
87
- const t = [];
88
- return this.elementProperties.forEach((e, i) => {
89
- const s = this._$Ep(i, e);
90
- s !== void 0 && (this._$Ev.set(s, i), t.push(s));
91
- }), t;
92
- }
93
- static createProperty(t, e = it) {
94
- if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
95
- const i = typeof t == "symbol" ? Symbol() : "__" + t, s = this.getPropertyDescriptor(t, i, e);
96
- s !== void 0 && Object.defineProperty(this.prototype, t, s);
86
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
87
+ }
88
+ static createProperty(t, e = Et) {
89
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
90
+ const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
91
+ s !== void 0 && me(this.prototype, t, s);
97
92
  }
98
93
  }
99
94
  static getPropertyDescriptor(t, e, i) {
100
- return { get() {
95
+ const { get: s, set: n } = $e(this.prototype, t) ?? { get() {
101
96
  return this[e];
102
- }, set(s) {
103
- const o = this[t];
104
- this[e] = s, this.requestUpdate(t, o, i);
97
+ }, set(o) {
98
+ this[e] = o;
99
+ } };
100
+ return { get() {
101
+ return s == null ? void 0 : s.call(this);
102
+ }, set(o) {
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) {
108
- return this.elementProperties.get(t) || it;
108
+ return this.elementProperties.get(t) ?? Et;
109
+ }
110
+ static _$Ei() {
111
+ if (this.hasOwnProperty(I("elementProperties")))
112
+ return;
113
+ const t = ye(this);
114
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
109
115
  }
110
116
  static finalize() {
111
- if (this.hasOwnProperty(ct))
112
- return !1;
113
- this[ct] = !0;
114
- const t = Object.getPrototypeOf(this);
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
- const e = this.properties, i = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
117
+ if (this.hasOwnProperty(I("finalized")))
118
+ return;
119
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(I("properties"))) {
120
+ const e = this.properties, i = [...fe(e), ...ge(e)];
117
121
  for (const s of i)
118
122
  this.createProperty(s, e[s]);
119
123
  }
120
- return this.elementStyles = this.finalizeStyles(this.styles), !0;
124
+ const t = this[Symbol.metadata];
125
+ if (t !== null) {
126
+ const e = litPropertyMetadata.get(t);
127
+ if (e !== void 0)
128
+ for (const [i, s] of e)
129
+ this.elementProperties.set(i, s);
130
+ }
131
+ this._$Eh = /* @__PURE__ */ new Map();
132
+ for (const [e, i] of this.elementProperties) {
133
+ const s = this._$Eu(e, i);
134
+ s !== void 0 && this._$Eh.set(s, e);
135
+ }
136
+ this.elementStyles = this.finalizeStyles(this.styles);
121
137
  }
122
138
  static finalizeStyles(t) {
123
139
  const e = [];
124
140
  if (Array.isArray(t)) {
125
141
  const i = new Set(t.flat(1 / 0).reverse());
126
142
  for (const s of i)
127
- e.unshift(yt(s));
143
+ e.unshift(At(s));
128
144
  } else
129
- t !== void 0 && e.push(yt(t));
145
+ t !== void 0 && e.push(At(t));
130
146
  return e;
131
147
  }
132
- static _$Ep(t, e) {
148
+ static _$Eu(t, e) {
133
149
  const i = e.attribute;
134
150
  return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
135
151
  }
136
- u() {
152
+ constructor() {
153
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
154
+ }
155
+ _$Ev() {
137
156
  var t;
138
- this._$E_ = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (t = this.constructor.h) === null || t === void 0 || t.forEach((e) => e(this));
157
+ this._$Eg = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$ES(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
139
158
  }
140
159
  addController(t) {
141
- var e, i;
142
- ((e = this._$ES) !== null && e !== void 0 ? e : this._$ES = []).push(t), this.renderRoot !== void 0 && this.isConnected && ((i = t.hostConnected) === null || i === void 0 || i.call(t));
160
+ var e;
161
+ (this._$E_ ?? (this._$E_ = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
143
162
  }
144
163
  removeController(t) {
145
164
  var e;
146
- (e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(t) >>> 0, 1);
165
+ (e = this._$E_) == null || e.delete(t);
147
166
  }
148
- _$Eg() {
149
- this.constructor.elementProperties.forEach((t, e) => {
150
- this.hasOwnProperty(e) && (this._$Ei.set(e, this[e]), delete this[e]);
151
- });
167
+ _$ES() {
168
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
169
+ for (const i of e.keys())
170
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
171
+ t.size > 0 && (this._$Ep = t);
152
172
  }
153
173
  createRenderRoot() {
154
- var t;
155
- const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions);
156
- return se(e, this.constructor.elementStyles), e;
174
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
175
+ return ue(t, this.constructor.elementStyles), t;
157
176
  }
158
177
  connectedCallback() {
159
178
  var t;
160
- this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
179
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$E_) == null || t.forEach((e) => {
161
180
  var i;
162
- return (i = e.hostConnected) === null || i === void 0 ? void 0 : i.call(e);
181
+ return (i = e.hostConnected) == null ? void 0 : i.call(e);
163
182
  });
164
183
  }
165
184
  enableUpdating(t) {
166
185
  }
167
186
  disconnectedCallback() {
168
187
  var t;
169
- (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
188
+ (t = this._$E_) == null || t.forEach((e) => {
170
189
  var i;
171
- return (i = e.hostDisconnected) === null || i === void 0 ? void 0 : i.call(e);
190
+ return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
172
191
  });
173
192
  }
174
193
  attributeChangedCallback(t, e, i) {
175
194
  this._$AK(t, i);
176
195
  }
177
- _$EO(t, e, i = it) {
178
- var s;
179
- const o = this.constructor._$Ep(t, i);
180
- if (o !== void 0 && i.reflect === !0) {
181
- const r = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : dt).toAttribute(e, i.type);
182
- this._$El = t, r == null ? this.removeAttribute(o) : this.setAttribute(o, r), this._$El = null;
196
+ _$EO(t, e) {
197
+ var n;
198
+ const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
199
+ if (s !== void 0 && i.reflect === !0) {
200
+ const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : ct).toAttribute(e, i.type);
201
+ this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
183
202
  }
184
203
  }
185
204
  _$AK(t, e) {
186
- var i;
187
- const s = this.constructor, o = s._$Ev.get(t);
188
- if (o !== void 0 && this._$El !== o) {
189
- const r = s.getPropertyOptions(o), d = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((i = r.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? r.converter : dt;
190
- this._$El = o, this[o] = d.fromAttribute(e, r.type), this._$El = null;
205
+ var n;
206
+ const i = this.constructor, s = i._$Eh.get(t);
207
+ if (s !== void 0 && this._$Em !== 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 : ct;
209
+ this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
191
210
  }
192
211
  }
193
- requestUpdate(t, e, i) {
194
- let s = !0;
195
- t !== void 0 && (((i = i || this.constructor.getPropertyOptions(t)).hasChanged || Bt)(this[t], e) ? (this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$El !== t && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t, i))) : s = !1), !this.isUpdatePending && s && (this._$E_ = this._$Ej());
212
+ requestUpdate(t, e, i, s = !1, n) {
213
+ if (t !== void 0) {
214
+ if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? Kt)(s ? n : this[t], e))
215
+ return;
216
+ this.C(t, e, i);
217
+ }
218
+ this.isUpdatePending === !1 && (this._$Eg = this._$EP());
196
219
  }
197
- async _$Ej() {
220
+ C(t, e, i) {
221
+ this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
222
+ }
223
+ async _$EP() {
198
224
  this.isUpdatePending = !0;
199
225
  try {
200
- await this._$E_;
226
+ await this._$Eg;
201
227
  } catch (e) {
202
228
  Promise.reject(e);
203
229
  }
@@ -208,139 +234,141 @@ let T = class extends HTMLElement {
208
234
  return this.performUpdate();
209
235
  }
210
236
  performUpdate() {
211
- var t;
237
+ var i;
212
238
  if (!this.isUpdatePending)
213
239
  return;
214
- this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, o) => this[o] = s), this._$Ei = void 0);
215
- let e = !1;
216
- const i = this._$AL;
240
+ if (!this.hasUpdated) {
241
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
242
+ for (const [n, o] of this._$Ep)
243
+ this[n] = o;
244
+ this._$Ep = void 0;
245
+ }
246
+ const s = this.constructor.elementProperties;
247
+ if (s.size > 0)
248
+ for (const [n, o] of s)
249
+ o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
250
+ }
251
+ let t = !1;
252
+ const e = this._$AL;
217
253
  try {
218
- e = this.shouldUpdate(i), e ? (this.willUpdate(i), (t = this._$ES) === null || t === void 0 || t.forEach((s) => {
219
- var o;
220
- return (o = s.hostUpdate) === null || o === void 0 ? void 0 : o.call(s);
221
- }), this.update(i)) : this._$Ek();
254
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$E_) == null || i.forEach((s) => {
255
+ var n;
256
+ return (n = s.hostUpdate) == null ? void 0 : n.call(s);
257
+ }), this.update(e)) : this._$ET();
222
258
  } catch (s) {
223
- throw e = !1, this._$Ek(), s;
259
+ throw t = !1, this._$ET(), s;
224
260
  }
225
- e && this._$AE(i);
261
+ t && this._$AE(e);
226
262
  }
227
263
  willUpdate(t) {
228
264
  }
229
265
  _$AE(t) {
230
266
  var e;
231
- (e = this._$ES) === null || e === void 0 || e.forEach((i) => {
267
+ (e = this._$E_) == null || e.forEach((i) => {
232
268
  var s;
233
- return (s = i.hostUpdated) === null || s === void 0 ? void 0 : s.call(i);
269
+ return (s = i.hostUpdated) == null ? void 0 : s.call(i);
234
270
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
235
271
  }
236
- _$Ek() {
272
+ _$ET() {
237
273
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
238
274
  }
239
275
  get updateComplete() {
240
276
  return this.getUpdateComplete();
241
277
  }
242
278
  getUpdateComplete() {
243
- return this._$E_;
279
+ return this._$Eg;
244
280
  }
245
281
  shouldUpdate(t) {
246
282
  return !0;
247
283
  }
248
284
  update(t) {
249
- this._$EC !== void 0 && (this._$EC.forEach((e, i) => this._$EO(i, this[i], e)), this._$EC = void 0), this._$Ek();
285
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
250
286
  }
251
287
  updated(t) {
252
288
  }
253
289
  firstUpdated(t) {
254
290
  }
255
291
  };
256
- T[ct] = !0, T.elementProperties = /* @__PURE__ */ new Map(), T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, Et == null || Et({ ReactiveElement: T }), ((et = F.reactiveElementVersions) !== null && et !== void 0 ? et : F.reactiveElementVersions = []).push("1.6.2");
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");
257
293
  /**
258
294
  * @license
259
295
  * Copyright 2017 Google LLC
260
296
  * SPDX-License-Identifier: BSD-3-Clause
261
297
  */
262
- var st;
263
- const J = window, x = J.trustedTypes, bt = x ? x.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ut = "$lit$", E = `lit$${(Math.random() + "").slice(9)}$`, zt = "?" + E, re = `<${zt}>`, C = document, G = () => C.createComment(""), D = (n) => n === null || typeof n != "object" && typeof n != "function", Wt = Array.isArray, oe = (n) => Wt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", nt = `[
264
- \f\r]`, V = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, St = />/g, w = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
265
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Pt = /'/g, Ut = /"/g, qt = /^(?:script|style|textarea|title)$/i, j = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), P = C.createTreeWalker(C, 129, null, !1);
266
- function Kt(n, t) {
267
- if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
298
+ const V = globalThis, Y = V.trustedTypes, St = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Ft = "$lit$", v = `lit$${(Math.random() + "").slice(9)}$`, Gt = "?" + v, Ae = `<${Gt}>`, T = document, Q = () => T.createComment(""), B = (r) => r === null || typeof r != "object" && typeof r != "function", Zt = Array.isArray, be = (r) => Zt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", nt = `[
299
+ \f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, Pt = />/g, S = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
300
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Ut = /"/g, Yt = /^(?:script|style|textarea|title)$/i, W = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Tt = /* @__PURE__ */ new WeakMap(), C = T.createTreeWalker(T, 129);
301
+ function Qt(r, t) {
302
+ if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
268
303
  throw Error("invalid template strings array");
269
- return bt !== void 0 ? bt.createHTML(t) : t;
304
+ return St !== void 0 ? St.createHTML(t) : t;
270
305
  }
271
- const le = (n, t) => {
272
- const e = n.length - 1, i = [];
273
- let s, o = t === 2 ? "<svg>" : "", r = V;
274
- for (let d = 0; d < e; d++) {
275
- const l = n[d];
276
- let a, u, h = -1, c = 0;
277
- for (; c < l.length && (r.lastIndex = c, u = r.exec(l), u !== null); )
278
- c = r.lastIndex, r === V ? u[1] === "!--" ? r = wt : u[1] !== void 0 ? r = St : u[2] !== void 0 ? (qt.test(u[2]) && (s = RegExp("</" + u[2], "g")), r = w) : u[3] !== void 0 && (r = w) : r === w ? u[0] === ">" ? (r = s ?? V, h = -1) : u[1] === void 0 ? h = -2 : (h = r.lastIndex - u[2].length, a = u[1], r = u[3] === void 0 ? w : u[3] === '"' ? Ut : Pt) : r === Ut || r === Pt ? r = w : r === wt || r === St ? r = V : (r = w, s = void 0);
279
- const p = r === w && n[d + 1].startsWith("/>") ? " " : "";
280
- o += r === V ? l + re : h >= 0 ? (i.push(a), l.slice(0, h) + ut + l.slice(h) + E + p) : l + E + (h === -2 ? (i.push(void 0), d) : p);
281
- }
282
- return [Kt(n, o + (n[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
306
+ const Ee = (r, t) => {
307
+ const e = r.length - 1, i = [];
308
+ let s, n = t === 2 ? "<svg>" : "", o = L;
309
+ for (let h = 0; h < e; h++) {
310
+ const a = r[h];
311
+ let d, c, l = -1, p = 0;
312
+ for (; p < a.length && (o.lastIndex = p, c = o.exec(a), c !== null); )
313
+ p = o.lastIndex, o === L ? c[1] === "!--" ? o = wt : c[1] !== void 0 ? o = Pt : c[2] !== void 0 ? (Yt.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = S) : c[3] !== void 0 && (o = S) : o === S ? c[0] === ">" ? (o = s ?? L, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, d = c[1], o = c[3] === void 0 ? S : c[3] === '"' ? Ut : Ct) : o === Ut || o === Ct ? o = S : o === wt || o === Pt ? o = L : (o = S, s = void 0);
314
+ const u = o === S && r[h + 1].startsWith("/>") ? " " : "";
315
+ n += o === L ? a + Ae : l >= 0 ? (i.push(d), a.slice(0, l) + Ft + a.slice(l) + v + u) : a + v + (l === -2 ? h : u);
316
+ }
317
+ return [Qt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
283
318
  };
284
- let pt = class Zt {
319
+ let pt = class te {
285
320
  constructor({ strings: t, _$litType$: e }, i) {
286
321
  let s;
287
322
  this.parts = [];
288
- let o = 0, r = 0;
289
- const d = t.length - 1, l = this.parts, [a, u] = le(t, e);
290
- if (this.el = Zt.createElement(a, i), P.currentNode = this.el.content, e === 2) {
291
- const h = this.el.content, c = h.firstChild;
292
- c.remove(), h.append(...c.childNodes);
323
+ let n = 0, o = 0;
324
+ const h = t.length - 1, a = this.parts, [d, c] = Ee(t, e);
325
+ if (this.el = te.createElement(d, i), C.currentNode = this.el.content, e === 2) {
326
+ const l = this.el.content.firstChild;
327
+ l.replaceWith(...l.childNodes);
293
328
  }
294
- for (; (s = P.nextNode()) !== null && l.length < d; ) {
329
+ for (; (s = C.nextNode()) !== null && a.length < h; ) {
295
330
  if (s.nodeType === 1) {
296
- if (s.hasAttributes()) {
297
- const h = [];
298
- for (const c of s.getAttributeNames())
299
- if (c.endsWith(ut) || c.startsWith(E)) {
300
- const p = u[r++];
301
- if (h.push(c), p !== void 0) {
302
- const A = s.getAttribute(p.toLowerCase() + ut).split(E), f = /([.?@])?(.*)/.exec(p);
303
- l.push({ type: 1, index: o, name: f[2], strings: A, ctor: f[1] === "." ? he : f[1] === "?" ? ce : f[1] === "@" ? ue : Y });
304
- } else
305
- l.push({ type: 6, index: o });
306
- }
307
- for (const c of h)
308
- s.removeAttribute(c);
309
- }
310
- if (qt.test(s.tagName)) {
311
- const h = s.textContent.split(E), c = h.length - 1;
312
- if (c > 0) {
313
- s.textContent = x ? x.emptyScript : "";
314
- for (let p = 0; p < c; p++)
315
- s.append(h[p], G()), P.nextNode(), l.push({ type: 2, index: ++o });
316
- s.append(h[c], G());
331
+ if (s.hasAttributes())
332
+ for (const l of s.getAttributeNames())
333
+ if (l.endsWith(Ft)) {
334
+ const p = c[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] === "." ? we : g[1] === "?" ? Pe : g[1] === "@" ? Ce : it }), s.removeAttribute(l);
336
+ } else
337
+ l.startsWith(v) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
338
+ if (Yt.test(s.tagName)) {
339
+ const l = s.textContent.split(v), p = l.length - 1;
340
+ if (p > 0) {
341
+ s.textContent = Y ? Y.emptyScript : "";
342
+ for (let u = 0; u < p; u++)
343
+ s.append(l[u], Q()), C.nextNode(), a.push({ type: 2, index: ++n });
344
+ s.append(l[p], Q());
317
345
  }
318
346
  }
319
347
  } else if (s.nodeType === 8)
320
- if (s.data === zt)
321
- l.push({ type: 2, index: o });
348
+ if (s.data === Gt)
349
+ a.push({ type: 2, index: n });
322
350
  else {
323
- let h = -1;
324
- for (; (h = s.data.indexOf(E, h + 1)) !== -1; )
325
- l.push({ type: 7, index: o }), h += E.length - 1;
351
+ let l = -1;
352
+ for (; (l = s.data.indexOf(v, l + 1)) !== -1; )
353
+ a.push({ type: 7, index: n }), l += v.length - 1;
326
354
  }
327
- o++;
355
+ n++;
328
356
  }
329
357
  }
330
358
  static createElement(t, e) {
331
- const i = C.createElement("template");
359
+ const i = T.createElement("template");
332
360
  return i.innerHTML = t, i;
333
361
  }
334
362
  };
335
- function H(n, t, e = n, i) {
336
- var s, o, r, d;
337
- if (t === j)
363
+ function H(r, t, e = r, i) {
364
+ var o, h;
365
+ if (t === W)
338
366
  return t;
339
- let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl;
340
- const a = D(t) ? void 0 : t._$litDirective$;
341
- return (l == null ? void 0 : l.constructor) !== a && ((o = l == null ? void 0 : l._$AO) === null || o === void 0 || o.call(l, !1), a === void 0 ? l = void 0 : (l = new a(n), l._$AT(n, e, i)), i !== void 0 ? ((r = (d = e)._$Co) !== null && r !== void 0 ? r : d._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = H(n, l._$AS(n, t.values), l, i)), t;
367
+ let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
368
+ const n = B(t) ? void 0 : t._$litDirective$;
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 = H(r, s._$AS(r, t.values), s, i)), t;
342
370
  }
343
- let ae = class {
371
+ let Se = class {
344
372
  constructor(t, e) {
345
373
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
346
374
  }
@@ -351,32 +379,30 @@ let ae = class {
351
379
  return this._$AM._$AU;
352
380
  }
353
381
  u(t) {
354
- var e;
355
- const { el: { content: i }, parts: s } = this._$AD, o = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : C).importNode(i, !0);
356
- P.currentNode = o;
357
- let r = P.nextNode(), d = 0, l = 0, a = s[0];
382
+ const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? T).importNode(e, !0);
383
+ C.currentNode = s;
384
+ let n = C.nextNode(), o = 0, h = 0, a = i[0];
358
385
  for (; a !== void 0; ) {
359
- if (d === a.index) {
360
- let u;
361
- a.type === 2 ? u = new Ft(r, r.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (u = new pe(r, this, t)), this._$AV.push(u), a = s[++l];
386
+ if (o === a.index) {
387
+ let d;
388
+ a.type === 2 ? d = new ee(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ue(n, this, t)), this._$AV.push(d), a = i[++h];
362
389
  }
363
- d !== (a == null ? void 0 : a.index) && (r = P.nextNode(), d++);
390
+ o !== (a == null ? void 0 : a.index) && (n = C.nextNode(), o++);
364
391
  }
365
- return P.currentNode = C, o;
392
+ return C.currentNode = T, s;
366
393
  }
367
- v(t) {
394
+ p(t) {
368
395
  let e = 0;
369
396
  for (const i of this._$AV)
370
397
  i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
371
398
  }
372
- }, Ft = class Jt {
373
- constructor(t, e, i, s) {
374
- var o;
375
- this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (o = s == null ? void 0 : s.isConnected) === null || o === void 0 || o;
376
- }
399
+ }, ee = class ie {
377
400
  get _$AU() {
378
- var t, e;
379
- return (e = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && e !== void 0 ? e : this._$Cp;
401
+ var t;
402
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
403
+ }
404
+ constructor(t, e, i, s) {
405
+ this.type = 2, this._$AH = _, 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;
380
406
  }
381
407
  get parentNode() {
382
408
  let t = this._$AA.parentNode;
@@ -390,7 +416,7 @@ let ae = class {
390
416
  return this._$AB;
391
417
  }
392
418
  _$AI(t, e = this) {
393
- t = H(this, t, e), D(t) ? t === v || t == null || t === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : t !== this._$AH && t !== j && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : oe(t) ? this.T(t) : this._(t);
419
+ t = H(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) : be(t) ? this.T(t) : this._(t);
394
420
  }
395
421
  k(t) {
396
422
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -399,100 +425,96 @@ let ae = class {
399
425
  this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
400
426
  }
401
427
  _(t) {
402
- this._$AH !== v && D(this._$AH) ? this._$AA.nextSibling.data = t : this.$(C.createTextNode(t)), this._$AH = t;
428
+ this._$AH !== _ && B(this._$AH) ? this._$AA.nextSibling.data = t : this.$(T.createTextNode(t)), this._$AH = t;
403
429
  }
404
430
  g(t) {
405
- var e;
406
- const { values: i, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = pt.createElement(Kt(s.h, s.h[0]), this.options)), s);
407
- if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === o)
408
- this._$AH.v(i);
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(Qt(i.h, i.h[0]), this.options)), i);
433
+ if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
434
+ this._$AH.p(e);
409
435
  else {
410
- const r = new ae(o, this), d = r.u(this.options);
411
- r.v(i), this.$(d), this._$AH = r;
436
+ const o = new Se(s, this), h = o.u(this.options);
437
+ o.p(e), this.$(h), this._$AH = o;
412
438
  }
413
439
  }
414
440
  _$AC(t) {
415
- let e = Ct.get(t.strings);
416
- return e === void 0 && Ct.set(t.strings, e = new pt(t)), e;
441
+ let e = Tt.get(t.strings);
442
+ return e === void 0 && Tt.set(t.strings, e = new pt(t)), e;
417
443
  }
418
444
  T(t) {
419
- Wt(this._$AH) || (this._$AH = [], this._$AR());
445
+ Zt(this._$AH) || (this._$AH = [], this._$AR());
420
446
  const e = this._$AH;
421
447
  let i, s = 0;
422
- for (const o of t)
423
- s === e.length ? e.push(i = new Jt(this.k(G()), this.k(G()), this, this.options)) : i = e[s], i._$AI(o), s++;
448
+ for (const n of t)
449
+ s === e.length ? e.push(i = new ie(this.k(Q()), this.k(Q()), this, this.options)) : i = e[s], i._$AI(n), s++;
424
450
  s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
425
451
  }
426
452
  _$AR(t = this._$AA.nextSibling, e) {
427
453
  var i;
428
- for ((i = this._$AP) === null || i === void 0 || i.call(this, !1, !0, e); t && t !== this._$AB; ) {
454
+ for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
429
455
  const s = t.nextSibling;
430
456
  t.remove(), t = s;
431
457
  }
432
458
  }
433
459
  setConnected(t) {
434
460
  var e;
435
- this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
436
- }
437
- }, Y = class {
438
- constructor(t, e, i, s, o) {
439
- this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v;
461
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
440
462
  }
463
+ }, it = class {
441
464
  get tagName() {
442
465
  return this.element.tagName;
443
466
  }
444
467
  get _$AU() {
445
468
  return this._$AM._$AU;
446
469
  }
470
+ constructor(t, e, i, s, n) {
471
+ this.type = 1, this._$AH = _, 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 = _;
472
+ }
447
473
  _$AI(t, e = this, i, s) {
448
- const o = this.strings;
449
- let r = !1;
450
- if (o === void 0)
451
- t = H(this, t, e, 0), r = !D(t) || t !== this._$AH && t !== j, r && (this._$AH = t);
474
+ const n = this.strings;
475
+ let o = !1;
476
+ if (n === void 0)
477
+ t = H(this, t, e, 0), o = !B(t) || t !== this._$AH && t !== W, o && (this._$AH = t);
452
478
  else {
453
- const d = t;
454
- let l, a;
455
- for (t = o[0], l = 0; l < o.length - 1; l++)
456
- a = H(this, d[i + l], e, l), a === j && (a = this._$AH[l]), r || (r = !D(a) || a !== this._$AH[l]), a === v ? t = v : t !== v && (t += (a ?? "") + o[l + 1]), this._$AH[l] = a;
479
+ const h = t;
480
+ let a, d;
481
+ for (t = n[0], a = 0; a < n.length - 1; a++)
482
+ d = H(this, h[i + a], e, a), d === W && (d = this._$AH[a]), o || (o = !B(d) || d !== this._$AH[a]), d === _ ? t = _ : t !== _ && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
457
483
  }
458
- r && !s && this.j(t);
484
+ o && !s && this.O(t);
459
485
  }
460
- j(t) {
461
- t === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
486
+ O(t) {
487
+ t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
462
488
  }
463
- }, he = class extends Y {
489
+ }, we = class extends it {
464
490
  constructor() {
465
491
  super(...arguments), this.type = 3;
466
492
  }
467
- j(t) {
468
- this.element[this.name] = t === v ? void 0 : t;
493
+ O(t) {
494
+ this.element[this.name] = t === _ ? void 0 : t;
469
495
  }
470
- };
471
- const de = x ? x.emptyScript : "";
472
- let ce = class extends Y {
496
+ }, Pe = class extends it {
473
497
  constructor() {
474
498
  super(...arguments), this.type = 4;
475
499
  }
476
- j(t) {
477
- t && t !== v ? this.element.setAttribute(this.name, de) : this.element.removeAttribute(this.name);
500
+ O(t) {
501
+ this.element.toggleAttribute(this.name, !!t && t !== _);
478
502
  }
479
- }, ue = class extends Y {
480
- constructor(t, e, i, s, o) {
481
- super(t, e, i, s, o), this.type = 5;
503
+ }, Ce = class extends it {
504
+ constructor(t, e, i, s, n) {
505
+ super(t, e, i, s, n), this.type = 5;
482
506
  }
483
507
  _$AI(t, e = this) {
484
- var i;
485
- if ((t = (i = H(this, t, e, 0)) !== null && i !== void 0 ? i : v) === j)
508
+ if ((t = H(this, t, e, 0) ?? _) === W)
486
509
  return;
487
- const s = this._$AH, o = t === v && s !== v || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== v && (s === v || o);
488
- o && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
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
+ s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
489
512
  }
490
513
  handleEvent(t) {
491
- var e, i;
492
- typeof this._$AH == "function" ? this._$AH.call((i = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && i !== void 0 ? i : this.element, t) : this._$AH.handleEvent(t);
514
+ var e;
515
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
493
516
  }
494
- };
495
- class pe {
517
+ }, Ue = class {
496
518
  constructor(t, e, i) {
497
519
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
498
520
  }
@@ -502,93 +524,383 @@ class pe {
502
524
  _$AI(t) {
503
525
  H(this, t);
504
526
  }
527
+ };
528
+ const ot = V.litHtmlPolyfillSupport;
529
+ ot == null || ot(pt, ee), (V.litHtmlVersions ?? (V.litHtmlVersions = [])).push("3.1.0");
530
+ /**
531
+ * @license
532
+ * Copyright 2019 Google LLC
533
+ * SPDX-License-Identifier: BSD-3-Clause
534
+ */
535
+ const Z = globalThis, mt = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, $t = Symbol(), xt = /* @__PURE__ */ new WeakMap();
536
+ let se = class {
537
+ constructor(t, e, i) {
538
+ if (this._$cssResult$ = !0, i !== $t)
539
+ throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
540
+ this.cssText = t, this.t = e;
541
+ }
542
+ get styleSheet() {
543
+ let t = this.o;
544
+ const e = this.t;
545
+ if (mt && t === void 0) {
546
+ const i = e !== void 0 && e.length === 1;
547
+ i && (t = xt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && xt.set(e, t));
548
+ }
549
+ return t;
550
+ }
551
+ toString() {
552
+ return this.cssText;
553
+ }
554
+ };
555
+ const Te = (r) => new se(typeof r == "string" ? r : r + "", void 0, $t), xe = (r, ...t) => {
556
+ const e = r.length === 1 ? r[0] : t.reduce((i, s, n) => i + ((o) => {
557
+ if (o._$cssResult$ === !0)
558
+ return o.cssText;
559
+ if (typeof o == "number")
560
+ return o;
561
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
562
+ })(s) + r[n + 1], r[0]);
563
+ return new se(e, r, $t);
564
+ }, Re = (r, t) => {
565
+ if (mt)
566
+ r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
567
+ else
568
+ for (const e of t) {
569
+ const i = document.createElement("style"), s = Z.litNonce;
570
+ s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
571
+ }
572
+ }, Rt = mt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
573
+ let e = "";
574
+ for (const i of t.cssRules)
575
+ e += i.cssText;
576
+ return Te(e);
577
+ })(r) : r;
578
+ /**
579
+ * @license
580
+ * Copyright 2017 Google LLC
581
+ * SPDX-License-Identifier: BSD-3-Clause
582
+ */
583
+ const { is: He, defineProperty: ke, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Ne, getOwnPropertySymbols: Le, getPrototypeOf: Me } = Object, E = globalThis, Ht = E.trustedTypes, Ie = Ht ? Ht.emptyScript : "", at = E.reactiveElementPolyfillSupport, D = (r, t) => r, ut = { toAttribute(r, t) {
584
+ switch (t) {
585
+ case Boolean:
586
+ r = r ? Ie : null;
587
+ break;
588
+ case Object:
589
+ case Array:
590
+ r = r == null ? r : JSON.stringify(r);
591
+ }
592
+ return r;
593
+ }, fromAttribute(r, t) {
594
+ let e = r;
595
+ switch (t) {
596
+ case Boolean:
597
+ e = r !== null;
598
+ break;
599
+ case Number:
600
+ e = r === null ? null : Number(r);
601
+ break;
602
+ case Object:
603
+ case Array:
604
+ try {
605
+ e = JSON.parse(r);
606
+ } catch {
607
+ e = null;
608
+ }
609
+ }
610
+ return e;
611
+ } }, re = (r, t) => !He(r, t), kt = { attribute: !0, type: String, converter: ut, reflect: !1, hasChanged: re };
612
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), E.litPropertyMetadata ?? (E.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
613
+ class R extends HTMLElement {
614
+ static addInitializer(t) {
615
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
616
+ }
617
+ static get observedAttributes() {
618
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
619
+ }
620
+ static createProperty(t, e = kt) {
621
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
622
+ const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
623
+ s !== void 0 && ke(this.prototype, t, s);
624
+ }
625
+ }
626
+ static getPropertyDescriptor(t, e, i) {
627
+ const { get: s, set: n } = Oe(this.prototype, t) ?? { get() {
628
+ return this[e];
629
+ }, set(o) {
630
+ this[e] = o;
631
+ } };
632
+ return { get() {
633
+ return s == null ? void 0 : s.call(this);
634
+ }, set(o) {
635
+ const h = s == null ? void 0 : s.call(this);
636
+ n.call(this, o), this.requestUpdate(t, h, i);
637
+ }, configurable: !0, enumerable: !0 };
638
+ }
639
+ static getPropertyOptions(t) {
640
+ return this.elementProperties.get(t) ?? kt;
641
+ }
642
+ static _$Ei() {
643
+ if (this.hasOwnProperty(D("elementProperties")))
644
+ return;
645
+ const t = Me(this);
646
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
647
+ }
648
+ static finalize() {
649
+ if (this.hasOwnProperty(D("finalized")))
650
+ return;
651
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(D("properties"))) {
652
+ const e = this.properties, i = [...Ne(e), ...Le(e)];
653
+ for (const s of i)
654
+ this.createProperty(s, e[s]);
655
+ }
656
+ const t = this[Symbol.metadata];
657
+ if (t !== null) {
658
+ const e = litPropertyMetadata.get(t);
659
+ if (e !== void 0)
660
+ for (const [i, s] of e)
661
+ this.elementProperties.set(i, s);
662
+ }
663
+ this._$Eh = /* @__PURE__ */ new Map();
664
+ for (const [e, i] of this.elementProperties) {
665
+ const s = this._$Eu(e, i);
666
+ s !== void 0 && this._$Eh.set(s, e);
667
+ }
668
+ this.elementStyles = this.finalizeStyles(this.styles);
669
+ }
670
+ static finalizeStyles(t) {
671
+ const e = [];
672
+ if (Array.isArray(t)) {
673
+ const i = new Set(t.flat(1 / 0).reverse());
674
+ for (const s of i)
675
+ e.unshift(Rt(s));
676
+ } else
677
+ t !== void 0 && e.push(Rt(t));
678
+ return e;
679
+ }
680
+ static _$Eu(t, e) {
681
+ const i = e.attribute;
682
+ return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
683
+ }
684
+ constructor() {
685
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
686
+ }
687
+ _$Ev() {
688
+ var t;
689
+ this._$Eg = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$ES(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
690
+ }
691
+ addController(t) {
692
+ var e;
693
+ (this._$E_ ?? (this._$E_ = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
694
+ }
695
+ removeController(t) {
696
+ var e;
697
+ (e = this._$E_) == null || e.delete(t);
698
+ }
699
+ _$ES() {
700
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
701
+ for (const i of e.keys())
702
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
703
+ t.size > 0 && (this._$Ep = t);
704
+ }
705
+ createRenderRoot() {
706
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
707
+ return Re(t, this.constructor.elementStyles), t;
708
+ }
709
+ connectedCallback() {
710
+ var t;
711
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$E_) == null || t.forEach((e) => {
712
+ var i;
713
+ return (i = e.hostConnected) == null ? void 0 : i.call(e);
714
+ });
715
+ }
716
+ enableUpdating(t) {
717
+ }
718
+ disconnectedCallback() {
719
+ var t;
720
+ (t = this._$E_) == null || t.forEach((e) => {
721
+ var i;
722
+ return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
723
+ });
724
+ }
725
+ attributeChangedCallback(t, e, i) {
726
+ this._$AK(t, i);
727
+ }
728
+ _$EO(t, e) {
729
+ var n;
730
+ const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
731
+ if (s !== void 0 && i.reflect === !0) {
732
+ const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : ut).toAttribute(e, i.type);
733
+ this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
734
+ }
735
+ }
736
+ _$AK(t, e) {
737
+ var n;
738
+ const i = this.constructor, s = i._$Eh.get(t);
739
+ if (s !== void 0 && this._$Em !== s) {
740
+ 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;
741
+ this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
742
+ }
743
+ }
744
+ requestUpdate(t, e, i, s = !1, n) {
745
+ if (t !== void 0) {
746
+ if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? re)(s ? n : this[t], e))
747
+ return;
748
+ this.C(t, e, i);
749
+ }
750
+ this.isUpdatePending === !1 && (this._$Eg = this._$EP());
751
+ }
752
+ C(t, e, i) {
753
+ this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
754
+ }
755
+ async _$EP() {
756
+ this.isUpdatePending = !0;
757
+ try {
758
+ await this._$Eg;
759
+ } catch (e) {
760
+ Promise.reject(e);
761
+ }
762
+ const t = this.scheduleUpdate();
763
+ return t != null && await t, !this.isUpdatePending;
764
+ }
765
+ scheduleUpdate() {
766
+ return this.performUpdate();
767
+ }
768
+ performUpdate() {
769
+ var i;
770
+ if (!this.isUpdatePending)
771
+ return;
772
+ if (!this.hasUpdated) {
773
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
774
+ for (const [n, o] of this._$Ep)
775
+ this[n] = o;
776
+ this._$Ep = void 0;
777
+ }
778
+ const s = this.constructor.elementProperties;
779
+ if (s.size > 0)
780
+ for (const [n, o] of s)
781
+ o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
782
+ }
783
+ let t = !1;
784
+ const e = this._$AL;
785
+ try {
786
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$E_) == null || i.forEach((s) => {
787
+ var n;
788
+ return (n = s.hostUpdate) == null ? void 0 : n.call(s);
789
+ }), this.update(e)) : this._$ET();
790
+ } catch (s) {
791
+ throw t = !1, this._$ET(), s;
792
+ }
793
+ t && this._$AE(e);
794
+ }
795
+ willUpdate(t) {
796
+ }
797
+ _$AE(t) {
798
+ var e;
799
+ (e = this._$E_) == null || e.forEach((i) => {
800
+ var s;
801
+ return (s = i.hostUpdated) == null ? void 0 : s.call(i);
802
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
803
+ }
804
+ _$ET() {
805
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
806
+ }
807
+ get updateComplete() {
808
+ return this.getUpdateComplete();
809
+ }
810
+ getUpdateComplete() {
811
+ return this._$Eg;
812
+ }
813
+ shouldUpdate(t) {
814
+ return !0;
815
+ }
816
+ update(t) {
817
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
818
+ }
819
+ updated(t) {
820
+ }
821
+ firstUpdated(t) {
822
+ }
505
823
  }
506
- const Rt = J.litHtmlPolyfillSupport;
507
- Rt == null || Rt(pt, Ft), ((st = J.litHtmlVersions) !== null && st !== void 0 ? st : J.litHtmlVersions = []).push("2.8.0");
824
+ 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");
508
825
  /**
509
826
  * @license
510
827
  * Copyright 2017 Google LLC
511
828
  * SPDX-License-Identifier: BSD-3-Clause
512
829
  */
513
- var rt;
514
- const X = window, N = X.trustedTypes, Tt = N ? N.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, vt = "$lit$", b = `lit$${(Math.random() + "").slice(9)}$`, Gt = "?" + b, ve = `<${Gt}>`, R = document, B = () => R.createComment(""), z = (n) => n === null || typeof n != "object" && typeof n != "function", Xt = Array.isArray, _e = (n) => Xt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", ot = `[
515
- \f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, xt = /-->/g, Ht = />/g, S = RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
516
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Nt = /'/g, It = /"/g, Yt = /^(?:script|style|textarea|title)$/i, $e = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), me = $e(1), I = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), kt = /* @__PURE__ */ new WeakMap(), U = R.createTreeWalker(R, 129, null, !1), ge = (n, t) => {
517
- const e = n.length - 1, i = [];
518
- let s, o = t === 2 ? "<svg>" : "", r = O;
519
- for (let l = 0; l < e; l++) {
520
- const a = n[l];
521
- let u, h, c = -1, p = 0;
522
- for (; p < a.length && (r.lastIndex = p, h = r.exec(a), h !== null); )
523
- p = r.lastIndex, r === O ? h[1] === "!--" ? r = xt : h[1] !== void 0 ? r = Ht : h[2] !== void 0 ? (Yt.test(h[2]) && (s = RegExp("</" + h[2], "g")), r = S) : h[3] !== void 0 && (r = S) : r === S ? h[0] === ">" ? (r = s ?? O, c = -1) : h[1] === void 0 ? c = -2 : (c = r.lastIndex - h[2].length, u = h[1], r = h[3] === void 0 ? S : h[3] === '"' ? It : Nt) : r === It || r === Nt ? r = S : r === xt || r === Ht ? r = O : (r = S, s = void 0);
524
- const A = r === S && n[l + 1].startsWith("/>") ? " " : "";
525
- o += r === O ? a + ve : c >= 0 ? (i.push(u), a.slice(0, c) + vt + a.slice(c) + b + A) : a + b + (c === -2 ? (i.push(void 0), l) : A);
526
- }
527
- const d = o + (n[e] || "<?>") + (t === 2 ? "</svg>" : "");
528
- if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
830
+ const z = globalThis, tt = z.trustedTypes, Ot = tt ? tt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ne = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, oe = "?" + A, Ve = `<${oe}>`, x = document, q = () => x.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", ae = Array.isArray, De = (r) => ae(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", ht = `[
831
+ \f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Nt = /-->/g, Lt = />/g, w = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
832
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Mt = /'/g, It = /"/g, he = /^(?:script|style|textarea|title)$/i, ze = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), je = ze(1), k = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Vt = /* @__PURE__ */ new WeakMap(), U = x.createTreeWalker(x, 129);
833
+ function le(r, t) {
834
+ if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
529
835
  throw Error("invalid template strings array");
530
- return [Tt !== void 0 ? Tt.createHTML(d) : d, i];
836
+ return Ot !== void 0 ? Ot.createHTML(t) : t;
837
+ }
838
+ const Be = (r, t) => {
839
+ const e = r.length - 1, i = [];
840
+ let s, n = t === 2 ? "<svg>" : "", o = M;
841
+ for (let h = 0; h < e; h++) {
842
+ const a = r[h];
843
+ let d, c, l = -1, p = 0;
844
+ for (; p < a.length && (o.lastIndex = p, c = o.exec(a), c !== null); )
845
+ p = o.lastIndex, o === M ? c[1] === "!--" ? o = Nt : c[1] !== void 0 ? o = Lt : c[2] !== void 0 ? (he.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = w) : c[3] !== void 0 && (o = w) : o === w ? c[0] === ">" ? (o = s ?? M, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, d = c[1], o = c[3] === void 0 ? w : c[3] === '"' ? It : Mt) : o === It || o === Mt ? o = w : o === Nt || o === Lt ? o = M : (o = w, s = void 0);
846
+ const u = o === w && r[h + 1].startsWith("/>") ? " " : "";
847
+ n += o === M ? a + Ve : l >= 0 ? (i.push(d), a.slice(0, l) + ne + a.slice(l) + A + u) : a + A + (l === -2 ? h : u);
848
+ }
849
+ return [le(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
531
850
  };
532
- class W {
851
+ class J {
533
852
  constructor({ strings: t, _$litType$: e }, i) {
534
853
  let s;
535
854
  this.parts = [];
536
- let o = 0, r = 0;
537
- const d = t.length - 1, l = this.parts, [a, u] = ge(t, e);
538
- if (this.el = W.createElement(a, i), U.currentNode = this.el.content, e === 2) {
539
- const h = this.el.content, c = h.firstChild;
540
- c.remove(), h.append(...c.childNodes);
855
+ let n = 0, o = 0;
856
+ const h = t.length - 1, a = this.parts, [d, c] = Be(t, e);
857
+ if (this.el = J.createElement(d, i), U.currentNode = this.el.content, e === 2) {
858
+ const l = this.el.content.firstChild;
859
+ l.replaceWith(...l.childNodes);
541
860
  }
542
- for (; (s = U.nextNode()) !== null && l.length < d; ) {
861
+ for (; (s = U.nextNode()) !== null && a.length < h; ) {
543
862
  if (s.nodeType === 1) {
544
- if (s.hasAttributes()) {
545
- const h = [];
546
- for (const c of s.getAttributeNames())
547
- if (c.endsWith(vt) || c.startsWith(b)) {
548
- const p = u[r++];
549
- if (h.push(c), p !== void 0) {
550
- const A = s.getAttribute(p.toLowerCase() + vt).split(b), f = /([.?@])?(.*)/.exec(p);
551
- l.push({ type: 1, index: o, name: f[2], strings: A, ctor: f[1] === "." ? ye : f[1] === "?" ? Ee : f[1] === "@" ? be : Q });
552
- } else
553
- l.push({ type: 6, index: o });
554
- }
555
- for (const c of h)
556
- s.removeAttribute(c);
557
- }
558
- if (Yt.test(s.tagName)) {
559
- const h = s.textContent.split(b), c = h.length - 1;
560
- if (c > 0) {
561
- s.textContent = N ? N.emptyScript : "";
562
- for (let p = 0; p < c; p++)
563
- s.append(h[p], B()), U.nextNode(), l.push({ type: 2, index: ++o });
564
- s.append(h[c], B());
863
+ if (s.hasAttributes())
864
+ for (const l of s.getAttributeNames())
865
+ if (l.endsWith(ne)) {
866
+ const p = c[o++], u = s.getAttribute(l).split(A), g = /([.?@])?(.*)/.exec(p);
867
+ a.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? qe : g[1] === "?" ? Xe : g[1] === "@" ? Je : st }), s.removeAttribute(l);
868
+ } else
869
+ l.startsWith(A) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
870
+ if (he.test(s.tagName)) {
871
+ const l = s.textContent.split(A), p = l.length - 1;
872
+ if (p > 0) {
873
+ s.textContent = tt ? tt.emptyScript : "";
874
+ for (let u = 0; u < p; u++)
875
+ s.append(l[u], q()), U.nextNode(), a.push({ type: 2, index: ++n });
876
+ s.append(l[p], q());
565
877
  }
566
878
  }
567
879
  } else if (s.nodeType === 8)
568
- if (s.data === Gt)
569
- l.push({ type: 2, index: o });
880
+ if (s.data === oe)
881
+ a.push({ type: 2, index: n });
570
882
  else {
571
- let h = -1;
572
- for (; (h = s.data.indexOf(b, h + 1)) !== -1; )
573
- l.push({ type: 7, index: o }), h += b.length - 1;
883
+ let l = -1;
884
+ for (; (l = s.data.indexOf(A, l + 1)) !== -1; )
885
+ a.push({ type: 7, index: n }), l += A.length - 1;
574
886
  }
575
- o++;
887
+ n++;
576
888
  }
577
889
  }
578
890
  static createElement(t, e) {
579
- const i = R.createElement("template");
891
+ const i = x.createElement("template");
580
892
  return i.innerHTML = t, i;
581
893
  }
582
894
  }
583
- function k(n, t, e = n, i) {
584
- var s, o, r, d;
585
- if (t === I)
895
+ function O(r, t, e = r, i) {
896
+ var o, h;
897
+ if (t === k)
586
898
  return t;
587
- let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl;
588
- const a = z(t) ? void 0 : t._$litDirective$;
589
- return (l == null ? void 0 : l.constructor) !== a && ((o = l == null ? void 0 : l._$AO) === null || o === void 0 || o.call(l, !1), a === void 0 ? l = void 0 : (l = new a(n), l._$AT(n, e, i)), i !== void 0 ? ((r = (d = e)._$Co) !== null && r !== void 0 ? r : d._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = k(n, l._$AS(n, t.values), l, i)), t;
899
+ let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
900
+ const n = X(t) ? void 0 : t._$litDirective$;
901
+ 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;
590
902
  }
591
- class fe {
903
+ class We {
592
904
  constructor(t, e) {
593
905
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
594
906
  }
@@ -599,33 +911,31 @@ class fe {
599
911
  return this._$AM._$AU;
600
912
  }
601
913
  u(t) {
602
- var e;
603
- const { el: { content: i }, parts: s } = this._$AD, o = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : R).importNode(i, !0);
604
- U.currentNode = o;
605
- let r = U.nextNode(), d = 0, l = 0, a = s[0];
914
+ const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? x).importNode(e, !0);
915
+ U.currentNode = s;
916
+ let n = U.nextNode(), o = 0, h = 0, a = i[0];
606
917
  for (; a !== void 0; ) {
607
- if (d === a.index) {
608
- let u;
609
- a.type === 2 ? u = new q(r, r.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (u = new we(r, this, t)), this._$AV.push(u), a = s[++l];
918
+ if (o === a.index) {
919
+ let d;
920
+ a.type === 2 ? d = new K(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ke(n, this, t)), this._$AV.push(d), a = i[++h];
610
921
  }
611
- d !== (a == null ? void 0 : a.index) && (r = U.nextNode(), d++);
922
+ o !== (a == null ? void 0 : a.index) && (n = U.nextNode(), o++);
612
923
  }
613
- return U.currentNode = R, o;
924
+ return U.currentNode = x, s;
614
925
  }
615
- v(t) {
926
+ p(t) {
616
927
  let e = 0;
617
928
  for (const i of this._$AV)
618
929
  i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
619
930
  }
620
931
  }
621
- class q {
622
- constructor(t, e, i, s) {
623
- var o;
624
- this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (o = s == null ? void 0 : s.isConnected) === null || o === void 0 || o;
625
- }
932
+ class K {
626
933
  get _$AU() {
627
- var t, e;
628
- return (e = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && e !== void 0 ? e : this._$Cp;
934
+ var t;
935
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
936
+ }
937
+ constructor(t, e, i, s) {
938
+ 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;
629
939
  }
630
940
  get parentNode() {
631
941
  let t = this._$AA.parentNode;
@@ -639,7 +949,7 @@ class q {
639
949
  return this._$AB;
640
950
  }
641
951
  _$AI(t, e = this) {
642
- t = k(this, t, e), z(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== I && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : _e(t) ? this.T(t) : this._(t);
952
+ t = O(this, t, e), X(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== k && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : De(t) ? this.T(t) : this._(t);
643
953
  }
644
954
  k(t) {
645
955
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -648,103 +958,101 @@ class q {
648
958
  this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
649
959
  }
650
960
  _(t) {
651
- this._$AH !== _ && z(this._$AH) ? this._$AA.nextSibling.data = t : this.$(R.createTextNode(t)), this._$AH = t;
961
+ this._$AH !== m && X(this._$AH) ? this._$AA.nextSibling.data = t : this.$(x.createTextNode(t)), this._$AH = t;
652
962
  }
653
963
  g(t) {
654
- var e;
655
- const { values: i, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = W.createElement(s.h, this.options)), s);
656
- if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === o)
657
- this._$AH.v(i);
964
+ var n;
965
+ const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = J.createElement(le(i.h, i.h[0]), this.options)), i);
966
+ if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
967
+ this._$AH.p(e);
658
968
  else {
659
- const r = new fe(o, this), d = r.u(this.options);
660
- r.v(i), this.$(d), this._$AH = r;
969
+ const o = new We(s, this), h = o.u(this.options);
970
+ o.p(e), this.$(h), this._$AH = o;
661
971
  }
662
972
  }
663
973
  _$AC(t) {
664
- let e = kt.get(t.strings);
665
- return e === void 0 && kt.set(t.strings, e = new W(t)), e;
974
+ let e = Vt.get(t.strings);
975
+ return e === void 0 && Vt.set(t.strings, e = new J(t)), e;
666
976
  }
667
977
  T(t) {
668
- Xt(this._$AH) || (this._$AH = [], this._$AR());
978
+ ae(this._$AH) || (this._$AH = [], this._$AR());
669
979
  const e = this._$AH;
670
980
  let i, s = 0;
671
- for (const o of t)
672
- s === e.length ? e.push(i = new q(this.k(B()), this.k(B()), this, this.options)) : i = e[s], i._$AI(o), s++;
981
+ for (const n of t)
982
+ s === e.length ? e.push(i = new K(this.k(q()), this.k(q()), this, this.options)) : i = e[s], i._$AI(n), s++;
673
983
  s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
674
984
  }
675
985
  _$AR(t = this._$AA.nextSibling, e) {
676
986
  var i;
677
- for ((i = this._$AP) === null || i === void 0 || i.call(this, !1, !0, e); t && t !== this._$AB; ) {
987
+ for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
678
988
  const s = t.nextSibling;
679
989
  t.remove(), t = s;
680
990
  }
681
991
  }
682
992
  setConnected(t) {
683
993
  var e;
684
- this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
994
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
685
995
  }
686
996
  }
687
- class Q {
688
- constructor(t, e, i, s, o) {
689
- this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = _;
690
- }
997
+ class st {
691
998
  get tagName() {
692
999
  return this.element.tagName;
693
1000
  }
694
1001
  get _$AU() {
695
1002
  return this._$AM._$AU;
696
1003
  }
1004
+ constructor(t, e, i, s, n) {
1005
+ 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;
1006
+ }
697
1007
  _$AI(t, e = this, i, s) {
698
- const o = this.strings;
699
- let r = !1;
700
- if (o === void 0)
701
- t = k(this, t, e, 0), r = !z(t) || t !== this._$AH && t !== I, r && (this._$AH = t);
1008
+ const n = this.strings;
1009
+ let o = !1;
1010
+ if (n === void 0)
1011
+ t = O(this, t, e, 0), o = !X(t) || t !== this._$AH && t !== k, o && (this._$AH = t);
702
1012
  else {
703
- const d = t;
704
- let l, a;
705
- for (t = o[0], l = 0; l < o.length - 1; l++)
706
- a = k(this, d[i + l], e, l), a === I && (a = this._$AH[l]), r || (r = !z(a) || a !== this._$AH[l]), a === _ ? t = _ : t !== _ && (t += (a ?? "") + o[l + 1]), this._$AH[l] = a;
1013
+ const h = t;
1014
+ let a, d;
1015
+ for (t = n[0], a = 0; a < n.length - 1; a++)
1016
+ d = O(this, h[i + a], e, a), d === k && (d = this._$AH[a]), o || (o = !X(d) || d !== this._$AH[a]), d === m ? t = m : t !== m && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
707
1017
  }
708
- r && !s && this.j(t);
1018
+ o && !s && this.O(t);
709
1019
  }
710
- j(t) {
711
- t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
1020
+ O(t) {
1021
+ t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
712
1022
  }
713
1023
  }
714
- class ye extends Q {
1024
+ class qe extends st {
715
1025
  constructor() {
716
1026
  super(...arguments), this.type = 3;
717
1027
  }
718
- j(t) {
719
- this.element[this.name] = t === _ ? void 0 : t;
1028
+ O(t) {
1029
+ this.element[this.name] = t === m ? void 0 : t;
720
1030
  }
721
1031
  }
722
- const Ae = N ? N.emptyScript : "";
723
- class Ee extends Q {
1032
+ class Xe extends st {
724
1033
  constructor() {
725
1034
  super(...arguments), this.type = 4;
726
1035
  }
727
- j(t) {
728
- t && t !== _ ? this.element.setAttribute(this.name, Ae) : this.element.removeAttribute(this.name);
1036
+ O(t) {
1037
+ this.element.toggleAttribute(this.name, !!t && t !== m);
729
1038
  }
730
1039
  }
731
- class be extends Q {
732
- constructor(t, e, i, s, o) {
733
- super(t, e, i, s, o), this.type = 5;
1040
+ class Je extends st {
1041
+ constructor(t, e, i, s, n) {
1042
+ super(t, e, i, s, n), this.type = 5;
734
1043
  }
735
1044
  _$AI(t, e = this) {
736
- var i;
737
- if ((t = (i = k(this, t, e, 0)) !== null && i !== void 0 ? i : _) === I)
1045
+ if ((t = O(this, t, e, 0) ?? m) === k)
738
1046
  return;
739
- const s = this._$AH, o = t === _ && s !== _ || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== _ && (s === _ || o);
740
- o && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
1047
+ 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);
1048
+ s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
741
1049
  }
742
1050
  handleEvent(t) {
743
- var e, i;
744
- typeof this._$AH == "function" ? this._$AH.call((i = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && i !== void 0 ? i : this.element, t) : this._$AH.handleEvent(t);
1051
+ var e;
1052
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
745
1053
  }
746
1054
  }
747
- class we {
1055
+ class Ke {
748
1056
  constructor(t, e, i) {
749
1057
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
750
1058
  }
@@ -752,75 +1060,74 @@ class we {
752
1060
  return this._$AM._$AU;
753
1061
  }
754
1062
  _$AI(t) {
755
- k(this, t);
1063
+ O(this, t);
756
1064
  }
757
1065
  }
758
- const Vt = X.litHtmlPolyfillSupport;
759
- Vt == null || Vt(W, q), ((rt = X.litHtmlVersions) !== null && rt !== void 0 ? rt : X.litHtmlVersions = []).push("2.7.4");
760
- const Se = (n, t, e) => {
761
- var i, s;
762
- const o = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
763
- let r = o._$litPart$;
764
- if (r === void 0) {
765
- const d = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null;
766
- o._$litPart$ = r = new q(t.insertBefore(B(), d), d, void 0, e ?? {});
767
- }
768
- return r._$AI(n), r;
1066
+ const lt = z.litHtmlPolyfillSupport;
1067
+ lt == null || lt(J, K), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.1.0");
1068
+ const Fe = (r, t, e) => {
1069
+ const i = (e == null ? void 0 : e.renderBefore) ?? t;
1070
+ let s = i._$litPart$;
1071
+ if (s === void 0) {
1072
+ const n = (e == null ? void 0 : e.renderBefore) ?? null;
1073
+ i._$litPart$ = s = new K(t.insertBefore(q(), n), n, void 0, e ?? {});
1074
+ }
1075
+ return s._$AI(r), s;
769
1076
  };
770
1077
  /**
771
1078
  * @license
772
1079
  * Copyright 2017 Google LLC
773
1080
  * SPDX-License-Identifier: BSD-3-Clause
774
1081
  */
775
- var lt, at;
776
- class L extends T {
1082
+ class j extends R {
777
1083
  constructor() {
778
1084
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
779
1085
  }
780
1086
  createRenderRoot() {
781
- var t, e;
782
- const i = super.createRenderRoot();
783
- return (t = (e = this.renderOptions).renderBefore) !== null && t !== void 0 || (e.renderBefore = i.firstChild), i;
1087
+ var e;
1088
+ const t = super.createRenderRoot();
1089
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
784
1090
  }
785
1091
  update(t) {
786
1092
  const e = this.render();
787
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Se(e, this.renderRoot, this.renderOptions);
1093
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Fe(e, this.renderRoot, this.renderOptions);
788
1094
  }
789
1095
  connectedCallback() {
790
1096
  var t;
791
- super.connectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!0);
1097
+ super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
792
1098
  }
793
1099
  disconnectedCallback() {
794
1100
  var t;
795
- super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1);
1101
+ super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
796
1102
  }
797
1103
  render() {
798
- return I;
1104
+ return k;
799
1105
  }
800
1106
  }
801
- L.finalized = !0, L._$litElement$ = !0, (lt = globalThis.litElementHydrateSupport) === null || lt === void 0 || lt.call(globalThis, { LitElement: L });
802
- const Ot = globalThis.litElementPolyfillSupport;
803
- Ot == null || Ot({ LitElement: L });
804
- ((at = globalThis.litElementVersions) !== null && at !== void 0 ? at : globalThis.litElementVersions = []).push("3.3.2");
805
- function Pe(n, t, e) {
1107
+ var Bt;
1108
+ j._$litElement$ = !0, j.finalized = !0, (Bt = globalThis.litElementHydrateSupport) == null || Bt.call(globalThis, { LitElement: j });
1109
+ const dt = globalThis.litElementPolyfillSupport;
1110
+ dt == null || dt({ LitElement: j });
1111
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.2");
1112
+ function Ge(r, t, e) {
806
1113
  function i(s) {
807
1114
  e.dispatchEvent(new CustomEvent(s.type, s));
808
1115
  }
809
- return t.addEventListener(n, i), () => {
810
- t.removeEventListener(n, i);
1116
+ return t.addEventListener(r, i), () => {
1117
+ t.removeEventListener(r, i);
811
1118
  };
812
1119
  }
813
- class Ue {
1120
+ class Ze {
814
1121
  constructor(t, e) {
815
- this._events = [], this._cleanup = [], this._forwardElementRef = Lt(), this.host = t, this._events = e, t.addController(this);
1122
+ this._events = [], this._cleanup = [], this._forwardElementRef = qt(), this.host = t, this._events = e, t.addController(this);
816
1123
  }
817
1124
  register() {
818
- return Dt(this._forwardElementRef);
1125
+ return Xt(this._forwardElementRef);
819
1126
  }
820
1127
  hostConnected() {
821
1128
  requestAnimationFrame(() => {
822
1129
  this._events.forEach((t) => {
823
- this._forwardElementRef.value && this._cleanup.push(Pe(t, this._forwardElementRef.value, this.host));
1130
+ this._forwardElementRef.value && this._cleanup.push(Ge(t, this._forwardElementRef.value, this.host));
824
1131
  });
825
1132
  });
826
1133
  }
@@ -830,104 +1137,203 @@ class Ue {
830
1137
  }), this._cleanup = [];
831
1138
  }
832
1139
  }
833
- const ht = "https://vouchfor.com", Ce = "https://d2rxhdlm2q91uk.cloudfront.net", Re = "https://d1ix11aj5kfygl.cloudfront.net", Te = "https://d157jlwnudd93d.cloudfront.net", xe = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", He = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", Ne = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", Ie = "http://localhost:6060/v1", ke = "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
- function _t(n) {
835
- if (!["dev", "staging", "prod"].includes(n))
836
- throw new Error(`Unknown environment: ${n}`);
837
- if (n === "dev")
1140
+ const Dt = "https://d2rxhdlm2q91uk.cloudfront.net", Ye = "https://d1ix11aj5kfygl.cloudfront.net", Qe = "https://d157jlwnudd93d.cloudfront.net", zt = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", ti = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", ei = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", ii = "http://localhost:6060/v2", si = "https://embed-dev.vouchfor.com/v2", ri = "https://embed-staging.vouchfor.com/v2", ni = "https://embed.vouchfor.com/v2";
1141
+ function et(r) {
1142
+ if (!["local", "dev", "staging", "prod"].includes(r))
1143
+ throw new Error(`Unknown environment: ${r}`);
1144
+ if (r === "local")
838
1145
  return {
839
- marketingUrl: ht,
840
- videoUrl: Ce,
841
- publicApiUrl: xe,
842
- embedApiUrl: Ie,
843
- publicRecorderUrl: Oe
1146
+ videoUrl: Dt,
1147
+ publicApiUrl: zt,
1148
+ embedApiUrl: ii
844
1149
  };
845
- if (n === "staging")
1150
+ if (r === "dev")
846
1151
  return {
847
- marketingUrl: ht,
848
- videoUrl: Re,
849
- publicApiUrl: He,
850
- embedApiUrl: ke,
851
- publicRecorderUrl: Me
1152
+ videoUrl: Dt,
1153
+ publicApiUrl: zt,
1154
+ embedApiUrl: si
852
1155
  };
853
- if (n === "prod")
1156
+ if (r === "staging")
854
1157
  return {
855
- marketingUrl: ht,
856
- videoUrl: Te,
857
- publicApiUrl: Ne,
858
- embedApiUrl: Ve,
859
- publicRecorderUrl: Le
1158
+ videoUrl: Ye,
1159
+ publicApiUrl: ti,
1160
+ embedApiUrl: ri
1161
+ };
1162
+ if (r === "prod")
1163
+ return {
1164
+ videoUrl: Qe,
1165
+ publicApiUrl: ei,
1166
+ embedApiUrl: ni
860
1167
  };
861
1168
  }
862
- class De {
1169
+ class oi {
863
1170
  constructor(t) {
864
- this.host = t, new te(
1171
+ this._fetching = !1, this.getVouch = async (e, i, s) => {
1172
+ var c;
1173
+ const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/vouches/${s}`, {
1174
+ method: "GET",
1175
+ headers: [
1176
+ ["X-Api-Key", i],
1177
+ ["X-Cache-Check", o]
1178
+ ]
1179
+ }), a = await h.json();
1180
+ return this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail: a == null ? void 0 : a.id })), ((c = h == null ? void 0 : h.headers) == null ? void 0 : c.get("X-Cache-Check")) !== o && fetch(`${n}/vouches/${s}`, {
1181
+ method: "GET",
1182
+ headers: [
1183
+ ["X-Api-Key", i],
1184
+ ["Cache-Control", "max-age=0"]
1185
+ ]
1186
+ }), a;
1187
+ }, this.getTemplate = async (e, i, s) => {
1188
+ var c;
1189
+ const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/templates/${s}`, {
1190
+ method: "GET",
1191
+ headers: [
1192
+ ["X-Api-Key", i],
1193
+ ["X-Cache-Check", o]
1194
+ ]
1195
+ }), a = await h.json();
1196
+ return ((c = h == null ? void 0 : h.headers) == null ? void 0 : c.get("X-Cache-Check")) !== o && fetch(`${n}/templates/${s}`, {
1197
+ method: "GET",
1198
+ headers: [
1199
+ ["X-Api-Key", i],
1200
+ ["Cache-Control", "max-age=0"]
1201
+ ]
1202
+ }), a;
1203
+ }, this.host = t, new yt(
865
1204
  this.host,
866
- async ([e, i, s]) => {
867
- var o, r;
1205
+ async ([e, i, s, n, o]) => {
1206
+ var h, a, d, c;
868
1207
  try {
869
- if (s) {
870
- t.fetching = !0;
871
- const { embedApiUrl: d } = _t(e), l = await fetch(`${d}/v1/vouches/${s}`, {
872
- method: "GET",
873
- headers: [["X-Api-Key", i]]
874
- }).then((a) => a.json());
875
- t.data = l, t.instance = (r = (o = l == null ? void 0 : l.settings) == null ? void 0 : o.template) == null ? void 0 : r.instance;
1208
+ if (t.vouch = void 0, t.template = void 0, s) {
1209
+ let l;
1210
+ o && (this.fetching = !0, l = await this.getTemplate(e, i, o)), this._vouch = s, t.template = l ?? ((a = (h = s == null ? void 0 : s.settings) == null ? void 0 : h.template) == null ? void 0 : a.instance);
1211
+ } else if (n) {
1212
+ this.fetching = !0;
1213
+ const [l, p] = await Promise.all([
1214
+ this.getVouch(e, i, n),
1215
+ o ? this.getTemplate(e, i, o) : null
1216
+ ]);
1217
+ this._vouch = l, t.template = p ?? ((c = (d = l == null ? void 0 : l.settings) == null ? void 0 : d.template) == null ? void 0 : c.instance);
876
1218
  }
877
1219
  } finally {
878
- t.fetching = !1;
1220
+ this.fetching = !1;
879
1221
  }
880
1222
  },
881
- () => [t.env, t.apiKey, t.vouchHashId]
1223
+ () => [t.env, t.apiKey, t.data, t.vouchId, t.templateId]
1224
+ ), new yt(
1225
+ this.host,
1226
+ ([e, i]) => {
1227
+ t.vouch = e ? {
1228
+ ...e,
1229
+ questions: {
1230
+ items: e == null ? void 0 : e.questions.items.filter((s, n) => !(i != null && i.length) || (i == null ? void 0 : i.includes(n + 1)))
1231
+ }
1232
+ } : void 0;
1233
+ },
1234
+ () => [this._vouch, t.questions]
882
1235
  );
883
1236
  }
884
- }
885
- let K;
886
- const je = new Uint8Array(16);
887
- function Be() {
888
- if (!K && (K = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !K))
889
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
890
- return K(je);
891
- }
892
- const $ = [];
893
- for (let n = 0; n < 256; ++n)
894
- $.push((n + 256).toString(16).slice(1));
895
- function ze(n, t = 0) {
896
- return $[n[t + 0]] + $[n[t + 1]] + $[n[t + 2]] + $[n[t + 3]] + "-" + $[n[t + 4]] + $[n[t + 5]] + "-" + $[n[t + 6]] + $[n[t + 7]] + "-" + $[n[t + 8]] + $[n[t + 9]] + "-" + $[n[t + 10]] + $[n[t + 11]] + $[n[t + 12]] + $[n[t + 13]] + $[n[t + 14]] + $[n[t + 15]];
897
- }
898
- const We = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Mt = {
899
- randomUUID: We
900
- };
901
- function M(n, t, e) {
902
- if (Mt.randomUUID && !t && !n)
903
- return Mt.randomUUID();
904
- n = n || {};
905
- const i = n.random || (n.rng || Be)();
906
- if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
907
- e = e || 0;
908
- for (let s = 0; s < 16; ++s)
909
- t[e + s] = i[s];
910
- return t;
1237
+ set fetching(t) {
1238
+ this._fetching !== t && (this._fetching = t, this.host.requestUpdate());
1239
+ }
1240
+ get fetching() {
1241
+ return this._fetching;
911
1242
  }
912
- return ze(i);
913
1243
  }
914
- const qe = 2e3;
915
- class Ke {
1244
+ const ai = "@vouchfor/embeds", hi = "0.0.0-experiment.ae8c0d8", li = "MIT", di = "Aaron Williams", ci = "dist/es/embeds.js", pi = "dist/es/embeds.js", ui = "module", _i = "dist/es/index.d.ts", mi = {
1245
+ ".": "./dist/es/embeds.js"
1246
+ }, $i = [
1247
+ "dist",
1248
+ "src"
1249
+ ], fi = {
1250
+ tag: "experiment",
1251
+ access: "public"
1252
+ }, gi = {
1253
+ build: "rm -rf dist && tsc && vite build --mode iife && vite build --mode es",
1254
+ "build:deps": "yarn --cwd ../media-player build",
1255
+ "build:package": "yarn build",
1256
+ "build:storybook": "yarn prebuild && storybook build",
1257
+ "generate:manifest": "wca src --outFile custom-elements.json",
1258
+ lint: "eslint . --quiet",
1259
+ "lint:fix": "eslint . --fix",
1260
+ "lint:staged": "lint-staged",
1261
+ prepublishOnly: "yarn build",
1262
+ size: "size-limit",
1263
+ storybook: "yarn prebuild && storybook dev -p 6007",
1264
+ prebuild: "yarn build:deps && yarn generate:manifest",
1265
+ test: "true"
1266
+ }, yi = {
1267
+ "@lit/task": "^1.0.0",
1268
+ "@vouchfor/media-player": "0.0.0-experiment.ae8c0d8",
1269
+ uuid: "^9.0.1"
1270
+ }, vi = {
1271
+ lit: "^3.1.0"
1272
+ }, Ai = {
1273
+ "@esm-bundle/chai": "^4.3.4-fix.0",
1274
+ "@open-wc/testing": "^3.2.0",
1275
+ "@storybook/addon-essentials": "^7.4.5",
1276
+ "@storybook/addon-links": "^7.4.5",
1277
+ "@storybook/blocks": "^7.4.5",
1278
+ "@storybook/web-components": "^7.4.5",
1279
+ "@storybook/web-components-vite": "^7.4.5",
1280
+ "@types/mocha": "^10.0.1",
1281
+ "@vouchfor/eslint-config": "^1.0.0",
1282
+ "@vouchfor/prettier-config": "^1.0.0",
1283
+ "@web/dev-server-esbuild": "^0.4.1",
1284
+ "@web/test-runner": "^0.17.1",
1285
+ "@web/test-runner-browserstack": "^0.6.1",
1286
+ "@web/test-runner-mocha": "^0.8.1",
1287
+ "@web/test-runner-playwright": "^0.10.1",
1288
+ dotenv: "^16.3.1",
1289
+ eslint: "^8.50.0",
1290
+ "eslint-plugin-import": "^2.28.1",
1291
+ "lint-staged": "^14.0.1",
1292
+ lit: "^3.1.0",
1293
+ prettier: "^3.0.3",
1294
+ react: "^18.2.0",
1295
+ "react-dom": "^18.2.0",
1296
+ storybook: "^7.4.5",
1297
+ typescript: "^5.1.3",
1298
+ vite: "^4.4.9",
1299
+ "vite-plugin-dts": "^3.6.0",
1300
+ "web-component-analyzer": "^1.1.7"
1301
+ }, bi = {
1302
+ name: ai,
1303
+ version: hi,
1304
+ license: li,
1305
+ author: di,
1306
+ main: ci,
1307
+ module: pi,
1308
+ type: ui,
1309
+ types: _i,
1310
+ exports: mi,
1311
+ files: $i,
1312
+ publishConfig: fi,
1313
+ scripts: gi,
1314
+ "lint-staged": {
1315
+ "**/*.{ts,tsx,js}": "eslint --fix --quiet",
1316
+ "**/*.{md,json,yml}": "prettier --write"
1317
+ },
1318
+ dependencies: yi,
1319
+ peerDependencies: vi,
1320
+ devDependencies: Ai
1321
+ }, jt = 1;
1322
+ class Ei {
916
1323
  constructor(t) {
917
- this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this._streamedTime = {}, this._streamedPrevTimestamp = {}, this._createVisitor = (e) => {
918
- var s, o;
919
- const { publicApiUrl: i } = _t(this.host.env);
920
- return (o = (s = window.localStorage) == null ? void 0 : s.setItem) == null || o.call(s, "vouch-uid-visitor", e), navigator.sendBeacon(`${i}/api/visitor`, JSON.stringify({ visitorId: e })), e;
1324
+ 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) => {
1325
+ var s, n;
1326
+ const { publicApiUrl: i } = et(this.host.env);
1327
+ return (n = (s = window.localStorage) == null ? void 0 : s.setItem) == null || n.call(s, "vouch-uid-visitor", e), navigator.sendBeacon(`${i}/api/visitor`, JSON.stringify({ visitorId: e })), e;
921
1328
  }, this._getReportingMetadata = () => {
922
- var o, r;
923
- const [e, i] = ((r = (o = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : o.split) == null ? void 0 : r.call(o, "/")) ?? [], s = {};
924
- return [...new URLSearchParams(location.search).entries()].forEach(([d, l]) => {
925
- if (/utm/.test(d)) {
926
- const a = d.toLowerCase().replace(/[-_][a-z0-9]/g, (u) => u.slice(-1).toUpperCase());
927
- s[a] = l;
1329
+ var n, o;
1330
+ const [e, i] = ((o = (n = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : n.split) == null ? void 0 : o.call(n, "/")) ?? [], s = {};
1331
+ return [...new URLSearchParams(location.search).entries()].forEach(([h, a]) => {
1332
+ if (/utm/.test(h)) {
1333
+ const d = h.toLowerCase().replace(/[-_][a-z0-9]/g, (c) => c.slice(-1).toUpperCase());
1334
+ s[d] = a;
928
1335
  }
929
1336
  }), {
930
- // Source might be embeds, could be playlink etc.
931
1337
  source: this.host.trackingSource,
932
1338
  time: /* @__PURE__ */ new Date(),
933
1339
  region: i,
@@ -939,75 +1345,79 @@ class Ke {
939
1345
  ...s
940
1346
  };
941
1347
  }, this._sendTrackingEvent = (e, i) => {
942
- const { publicApiUrl: s } = _t(this.host.env), { client: o, tab: r, request: d, visitor: l } = this._getUids();
943
- this.host.enableTracking && this.host.trackingSource && navigator.sendBeacon(
944
- `${s}/api/events`,
1348
+ const s = this._findVouchId(i);
1349
+ if (!s || this.host.disableTracking)
1350
+ return;
1351
+ const { publicApiUrl: n } = et(this.host.env), { client: o, tab: h, request: a, visitor: d } = this._getUids();
1352
+ navigator.sendBeacon(
1353
+ `${n}/api/v2/events`,
945
1354
  JSON.stringify({
946
1355
  event: e,
947
- payload: i,
1356
+ payload: {
1357
+ ...i,
1358
+ vouchId: s
1359
+ },
948
1360
  context: {
949
1361
  "x-uid-client": o,
950
- "x-uid-tab": r,
951
- "x-uid-request": d,
952
- "x-uid-visitor": l,
953
- "x-reporting-metadata": this._getReportingMetadata()
1362
+ "x-uid-tab": h,
1363
+ "x-uid-request": a,
1364
+ "x-uid-visitor": d,
1365
+ "x-reporting-metadata": this._getReportingMetadata(),
1366
+ "x-embeds-version": bi.version
954
1367
  }
955
1368
  })
956
1369
  );
1370
+ }, this._streamEnded = () => {
1371
+ if (this._currentlyPlayingVideo) {
1372
+ const { id: e, key: i } = this._currentlyPlayingVideo;
1373
+ this._streamLatestTime[i] > this._streamStartTime[i] + jt && this._sendTrackingEvent("VIDEO_STREAMED", {
1374
+ answerId: e,
1375
+ streamStart: this._streamStartTime[i],
1376
+ streamEnd: this._streamLatestTime[i]
1377
+ }), delete this._streamStartTime[i], delete this._streamLatestTime[i];
1378
+ }
957
1379
  }, this._handleVouchLoaded = ({ detail: e }) => {
958
- e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED", {
959
- vouchId: e
960
- }), this._hasLoaded[e] = !0));
1380
+ e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED", { vouchId: e }), this._hasLoaded[e] = !0));
961
1381
  }, this._handlePlay = () => {
962
- const e = this._findVouchId();
963
- e && (this._hasPlayed || (this._sendTrackingEvent("VIDEO_PLAYED", {
964
- vouchId: e,
1382
+ this._hasPlayed || (this._sendTrackingEvent("VIDEO_PLAYED", {
965
1383
  streamStart: this.host.currentTime
966
- }), this._hasPlayed = !0));
967
- }, this._handleVideoPlay = ({ detail: { id: e, node: i } }) => {
968
- const s = this._findVouchId();
969
- s && (this._answersViewed[e] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
970
- vouchId: s,
1384
+ }), this._hasPlayed = !0);
1385
+ }, this._handleVideoPlay = ({ detail: { id: e, key: i, node: s } }) => {
1386
+ this._answersViewed[i] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
971
1387
  answerId: e
972
- }), this._answersViewed[e] = !0), this._streamedTime[e] = i.currentTime, this._streamedPrevTimestamp[e] = Date.now());
973
- }, this._handleVideoTimeUpdate = ({ detail: { id: e, node: i } }) => {
974
- var r, d;
975
- const s = this._findVouchId();
976
- if (!s)
977
- return;
978
- const o = Date.now();
979
- !this.host.paused && // Only fire the video seeked event when this video is the active one
980
- e === ((d = (r = this.host.scene) == null ? void 0 : r.video) == null ? void 0 : d.id) && // Throttle the frequency that we send streamed events while playing
981
- o - this._streamedPrevTimestamp[e] > qe && (this._sendTrackingEvent("VIDEO_STREAMED", {
982
- vouchId: s,
1388
+ }), this._answersViewed[i] = !0), this._streamStartTime[i] || (this._streamStartTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime);
1389
+ }, this._handleVideoTimeUpdate = ({ detail: { id: e, key: i, node: s } }) => {
1390
+ var n, o;
1391
+ // We only want to count any time that the video is actually playing
1392
+ !this.host.paused && // Only update the latest time if this event fires for the currently active video
1393
+ 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);
1394
+ }, this._handleVideoPause = ({ detail: { id: e, key: i } }) => {
1395
+ this._streamLatestTime[i] > this._streamStartTime[i] + jt && this._sendTrackingEvent("VIDEO_STREAMED", {
983
1396
  answerId: e,
984
- streamStart: this._streamedTime[e],
985
- streamEnd: i.currentTime
986
- }), this._streamedTime[e] = i.currentTime, this._streamedPrevTimestamp[e] = o);
987
- }, this._handleVideoPause = ({ detail: { id: e, node: i } }) => {
988
- const s = this._findVouchId();
989
- s && (this._sendTrackingEvent("VIDEO_STREAMED", {
990
- vouchId: s,
991
- answerId: e,
992
- streamStart: this._streamedTime[e],
993
- streamEnd: i.currentTime
994
- }), delete this._streamedTime[e], delete this._streamedPrevTimestamp[e]);
1397
+ streamStart: this._streamStartTime[i],
1398
+ streamEnd: this._streamLatestTime[i]
1399
+ }), delete this._streamStartTime[i], delete this._streamLatestTime[i];
1400
+ }, this._pageUnloading = () => {
1401
+ this._streamEnded(), this.host.pause();
1402
+ }, this._handleVisibilityChange = () => {
1403
+ document.visibilityState === "hidden" && this._pageUnloading();
1404
+ }, this._handlePageHide = () => {
1405
+ this._pageUnloading();
995
1406
  }, this.host = t, t.addController(this);
996
1407
  }
997
- _findVouchId() {
998
- if (this.host.data)
999
- return "uuid" in this.host.data ? this.host.data.uuid : this.host.data.id;
1408
+ _findVouchId(t) {
1409
+ return t && "vouchId" in t ? t.vouchId : this.host.vouch ? this.host.vouch.id : null;
1000
1410
  }
1001
1411
  _getUids() {
1002
- var o, r, d, l, a, u, h, c, p, A, f, gt;
1412
+ var n, o, h, a, d, c, l, p, u, g, F, ft;
1003
1413
  if (typeof window > "u")
1004
1414
  return {
1005
1415
  client: null,
1006
1416
  tab: null,
1007
- request: M()
1417
+ request: P()
1008
1418
  };
1009
- const t = this._visitorId || ((r = (o = window.localStorage) == null ? void 0 : o.getItem) == null ? void 0 : r.call(o, "vouch-uid-visitor")) || this._createVisitor(M()), e = this._clientId || ((l = (d = window.localStorage) == null ? void 0 : d.getItem) == null ? void 0 : l.call(d, "vouch-uid-client")) || M(), i = this._tabId || ((u = (a = window.sessionStorage) == null ? void 0 : a.getItem) == null ? void 0 : u.call(a, "vouch-uid-tab")) || M(), s = M();
1010
- return t !== this._visitorId && (this._visitorId = t, (c = (h = window.localStorage) == null ? void 0 : h.setItem) == null || c.call(h, "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, (gt = (f = window.sessionStorage) == null ? void 0 : f.setItem) == null || gt.call(f, "vouch-uid-tab", i)), {
1419
+ 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 || ((c = (d = window.sessionStorage) == null ? void 0 : d.getItem) == null ? void 0 : c.call(d, "vouch-uid-tab")) || P(), s = P();
1420
+ 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, (ft = (F = window.sessionStorage) == null ? void 0 : F.setItem) == null || ft.call(F, "vouch-uid-tab", i)), {
1011
1421
  client: e,
1012
1422
  tab: i,
1013
1423
  request: s,
@@ -1015,24 +1425,24 @@ class Ke {
1015
1425
  };
1016
1426
  }
1017
1427
  hostConnected() {
1018
- this.host.enableTracking && this.host.trackingSource && requestAnimationFrame(() => {
1428
+ requestAnimationFrame(() => {
1019
1429
  var t, e, i, s;
1020
- 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);
1430
+ "onvisibilitychange" in document ? document.addEventListener("visibilitychange", this._handleVisibilityChange) : window.addEventListener("pagehide", this._handlePageHide), 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);
1021
1431
  });
1022
1432
  }
1023
1433
  hostDisconnected() {
1024
1434
  var t, e, i, s;
1025
- this.host.enableTracking && this.host.trackingSource && (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));
1435
+ this._streamEnded(), "onvisibilitychange" in document ? document.removeEventListener("visibilitychange", this._handleVisibilityChange) : window.removeEventListener("pagehide", this._handlePageHide), 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);
1026
1436
  }
1027
1437
  }
1028
- var Ze = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, g = (n, t, e, i) => {
1029
- for (var s = i > 1 ? void 0 : i ? Fe(t, e) : t, o = n.length - 1, r; o >= 0; o--)
1030
- (r = n[o]) && (s = (i ? r(t, e, s) : r(s)) || s);
1031
- return i && s && Ze(t, e, s), s;
1438
+ var Si = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, f = (r, t, e, i) => {
1439
+ for (var s = i > 1 ? void 0 : i ? wi(t, e) : t, n = r.length - 1, o; n >= 0; n--)
1440
+ (o = r[n]) && (s = (i ? o(t, e, s) : o(s)) || s);
1441
+ return i && s && Si(t, e, s), s;
1032
1442
  };
1033
- let m = class extends L {
1443
+ let $ = class extends j {
1034
1444
  constructor() {
1035
- super(...arguments), this._mediaPlayerRef = Lt(), this.env = "prod", this.apiKey = "", this.preload = "auto", this.autoplay = !1, this.enableTracking = !1, this.trackingSource = "media_player", this.resolution = 1080, this.aspectRatio = 0, this.fetching = !1, this.eventController = new Ue(this, [
1445
+ super(...arguments), this._mediaPlayerRef = qt(), this.env = "prod", this.apiKey = "", this.disableTracking = !1, this.trackingSource = "embed", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Ze(this, [
1036
1446
  "durationchange",
1037
1447
  "ended",
1038
1448
  "error",
@@ -1049,6 +1459,7 @@ let m = class extends L {
1049
1459
  "volumechange",
1050
1460
  "waiting",
1051
1461
  "video:loadeddata",
1462
+ "video:seeking",
1052
1463
  "video:seeked",
1053
1464
  "video:play",
1054
1465
  "video:playing",
@@ -1057,150 +1468,163 @@ let m = class extends L {
1057
1468
  "video:timeupdate",
1058
1469
  "video:ended",
1059
1470
  "video:error"
1060
- ]), this.trackingController = new Ke(this), this.fetcherController = new De(this);
1471
+ ]), this._fetcherController = new oi(this), this._trackingController = new Ei(this);
1472
+ }
1473
+ get fetching() {
1474
+ return this._fetcherController.fetching;
1061
1475
  }
1062
1476
  get waiting() {
1063
- var n;
1064
- return (n = this._mediaPlayerRef.value) == null ? void 0 : n.waiting;
1477
+ var r;
1478
+ return (r = this._mediaPlayerRef.value) == null ? void 0 : r.waiting;
1065
1479
  }
1066
1480
  get seeking() {
1067
- var n;
1068
- return (n = this._mediaPlayerRef.value) == null ? void 0 : n.seeking;
1481
+ var r;
1482
+ return (r = this._mediaPlayerRef.value) == null ? void 0 : r.seeking;
1069
1483
  }
1070
1484
  get paused() {
1071
- var n;
1072
- return (n = this._mediaPlayerRef.value) == null ? void 0 : n.paused;
1485
+ var r;
1486
+ return (r = this._mediaPlayerRef.value) == null ? void 0 : r.paused;
1073
1487
  }
1074
1488
  get captions() {
1075
- var n;
1076
- return (n = this._mediaPlayerRef.value) == null ? void 0 : n.captions;
1489
+ var r;
1490
+ return (r = this._mediaPlayerRef.value) == null ? void 0 : r.captions;
1077
1491
  }
1078
1492
  get fullscreen() {
1079
- var n;
1080
- return (n = this._mediaPlayerRef.value) == null ? void 0 : n.fullscreen;
1493
+ var r;
1494
+ return (r = this._mediaPlayerRef.value) == null ? void 0 : r.fullscreen;
1081
1495
  }
1082
1496
  get duration() {
1083
- var n;
1084
- return (n = this._mediaPlayerRef.value) == null ? void 0 : n.duration;
1497
+ var r;
1498
+ return (r = this._mediaPlayerRef.value) == null ? void 0 : r.duration;
1085
1499
  }
1086
- set currentTime(n) {
1087
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.currentTime = n);
1500
+ set currentTime(r) {
1501
+ this._mediaPlayerRef.value && (this._mediaPlayerRef.value.currentTime = r);
1088
1502
  }
1089
1503
  get currentTime() {
1090
- var n;
1091
- return ((n = this._mediaPlayerRef.value) == null ? void 0 : n.currentTime) ?? 0;
1504
+ var r;
1505
+ return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.currentTime) ?? 0;
1092
1506
  }
1093
- set playbackRate(n) {
1094
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.playbackRate = n);
1507
+ set playbackRate(r) {
1508
+ this._mediaPlayerRef.value && (this._mediaPlayerRef.value.playbackRate = r);
1095
1509
  }
1096
1510
  get playbackRate() {
1097
- var n;
1098
- return ((n = this._mediaPlayerRef.value) == null ? void 0 : n.playbackRate) ?? 1;
1511
+ var r;
1512
+ return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.playbackRate) ?? 1;
1099
1513
  }
1100
- set volume(n) {
1101
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.volume = n);
1514
+ set volume(r) {
1515
+ this._mediaPlayerRef.value && (this._mediaPlayerRef.value.volume = r);
1102
1516
  }
1103
1517
  get volume() {
1104
- var n;
1105
- return ((n = this._mediaPlayerRef.value) == null ? void 0 : n.volume) ?? 1;
1518
+ var r;
1519
+ return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.volume) ?? 1;
1106
1520
  }
1107
- set muted(n) {
1108
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.muted = n);
1521
+ set muted(r) {
1522
+ this._mediaPlayerRef.value && (this._mediaPlayerRef.value.muted = r);
1109
1523
  }
1110
1524
  get muted() {
1111
- var n;
1112
- return ((n = this._mediaPlayerRef.value) == null ? void 0 : n.muted) ?? !1;
1525
+ var r;
1526
+ return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.muted) ?? !1;
1113
1527
  }
1114
1528
  get scene() {
1115
- var n;
1116
- return ((n = this._mediaPlayerRef.value) == null ? void 0 : n.scene) ?? null;
1529
+ var r;
1530
+ return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.scene) ?? null;
1117
1531
  }
1118
1532
  get scenes() {
1119
- var n;
1120
- return ((n = this._mediaPlayerRef.value) == null ? void 0 : n.scenes) ?? [];
1533
+ var r;
1534
+ return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.scenes) ?? [];
1535
+ }
1536
+ get sceneConfig() {
1537
+ var r;
1538
+ return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.sceneConfig) ?? null;
1121
1539
  }
1122
1540
  get videoState() {
1123
- var n;
1124
- return (n = this._mediaPlayerRef.value) == null ? void 0 : n.videoState;
1541
+ var r;
1542
+ return (r = this._mediaPlayerRef.value) == null ? void 0 : r.videoState;
1125
1543
  }
1126
1544
  get mediaPlayer() {
1127
1545
  return this._mediaPlayerRef.value;
1128
1546
  }
1129
1547
  play() {
1130
- var n;
1131
- (n = this._mediaPlayerRef.value) == null || n.play();
1548
+ var r;
1549
+ (r = this._mediaPlayerRef.value) == null || r.play();
1132
1550
  }
1133
1551
  pause() {
1134
- var n;
1135
- (n = this._mediaPlayerRef.value) == null || n.pause();
1552
+ var r;
1553
+ (r = this._mediaPlayerRef.value) == null || r.pause();
1136
1554
  }
1137
- setScene(n) {
1555
+ setScene(r) {
1138
1556
  var t;
1139
- (t = this._mediaPlayerRef.value) == null || t.setScene(n);
1557
+ (t = this._mediaPlayerRef.value) == null || t.setScene(r);
1140
1558
  }
1141
1559
  render() {
1142
- return me`
1560
+ return je`
1143
1561
  <vmp-media-player
1144
- ${Dt(this._mediaPlayerRef)}
1562
+ ${Xt(this._mediaPlayerRef)}
1145
1563
  ${this.eventController.register()}
1146
1564
  ?autoplay=${this.autoplay}
1147
1565
  ?loading=${this.fetching}
1148
- .data=${this.data}
1149
- .instance=${this.instance}
1150
- resolution=${tt(this.resolution)}
1151
- aspectRatio=${tt(this.aspectRatio)}
1152
- preload=${tt(this.preload)}
1566
+ .data=${this.vouch}
1567
+ .template=${this.template}
1568
+ aspectRatio=${gt(this.aspectRatio)}
1569
+ preload=${gt(this.preload)}
1153
1570
  .controls=${this.controls}
1154
1571
  ></vmp-media-player>
1155
1572
  `;
1156
1573
  }
1157
1574
  };
1158
- g([
1159
- y({ type: Object, attribute: "data" })
1160
- ], m.prototype, "propData", 2);
1161
- g([
1575
+ $.styles = [
1576
+ xe`
1577
+ :host {
1578
+ display: flex;
1579
+ }
1580
+ `
1581
+ ];
1582
+ f([
1583
+ y({ type: Object })
1584
+ ], $.prototype, "data", 2);
1585
+ f([
1162
1586
  y({ type: String })
1163
- ], m.prototype, "vouchHashId", 2);
1164
- g([
1587
+ ], $.prototype, "vouchId", 2);
1588
+ f([
1165
1589
  y({ type: String })
1166
- ], m.prototype, "env", 2);
1167
- g([
1590
+ ], $.prototype, "templateId", 2);
1591
+ f([
1592
+ y({ type: Array })
1593
+ ], $.prototype, "questions", 2);
1594
+ f([
1168
1595
  y({ type: String })
1169
- ], m.prototype, "apiKey", 2);
1170
- g([
1596
+ ], $.prototype, "env", 2);
1597
+ f([
1171
1598
  y({ type: String })
1172
- ], m.prototype, "preload", 2);
1173
- g([
1599
+ ], $.prototype, "apiKey", 2);
1600
+ f([
1174
1601
  y({ type: Boolean })
1175
- ], m.prototype, "autoplay", 2);
1176
- g([
1177
- y({ type: Boolean })
1178
- ], m.prototype, "enableTracking", 2);
1179
- g([
1602
+ ], $.prototype, "disableTracking", 2);
1603
+ f([
1180
1604
  y({ type: String })
1181
- ], m.prototype, "trackingSource", 2);
1182
- g([
1183
- y({ type: Number })
1184
- ], m.prototype, "resolution", 2);
1185
- g([
1186
- y({ type: Number })
1187
- ], m.prototype, "aspectRatio", 2);
1188
- g([
1605
+ ], $.prototype, "trackingSource", 2);
1606
+ f([
1189
1607
  y({ type: Array })
1190
- ], m.prototype, "controls", 2);
1191
- g([
1192
- $t()
1193
- ], m.prototype, "data", 2);
1194
- g([
1195
- $t()
1196
- ], m.prototype, "instance", 2);
1197
- g([
1198
- $t()
1199
- ], m.prototype, "fetching", 2);
1200
- m = g([
1201
- Qt("vouch-embed")
1202
- ], m);
1608
+ ], $.prototype, "controls", 2);
1609
+ f([
1610
+ y({ type: String })
1611
+ ], $.prototype, "preload", 2);
1612
+ f([
1613
+ y({ type: Boolean })
1614
+ ], $.prototype, "autoplay", 2);
1615
+ f([
1616
+ y({ type: Number })
1617
+ ], $.prototype, "aspectRatio", 2);
1618
+ f([
1619
+ Wt()
1620
+ ], $.prototype, "vouch", 2);
1621
+ f([
1622
+ Wt()
1623
+ ], $.prototype, "template", 2);
1624
+ $ = f([
1625
+ de("vouch-embed")
1626
+ ], $);
1203
1627
  export {
1204
- m as Embed
1628
+ $ as Embed
1205
1629
  };
1206
1630
  //# sourceMappingURL=embeds.js.map