@vouchfor/embeds 0.0.0-experiment.f4df018 → 0.0.0-experiment.f726309

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