@londondynamics/pericles-webcomponent 2.0.0 → 2.1.0

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.
@@ -3,19 +3,19 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const H = globalThis, W = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, F = Symbol(), q = /* @__PURE__ */ new WeakMap();
6
+ const H = globalThis, J = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, W = Symbol(), V = /* @__PURE__ */ new WeakMap();
7
7
  let ot = class {
8
- constructor(t, e, s) {
9
- if (this._$cssResult$ = !0, s !== F)
8
+ constructor(t, e, i) {
9
+ if (this._$cssResult$ = !0, i !== W)
10
10
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
11
11
  this.cssText = t, this.t = e;
12
12
  }
13
13
  get styleSheet() {
14
14
  let t = this.o;
15
15
  const e = this.t;
16
- if (W && t === void 0) {
17
- const s = e !== void 0 && e.length === 1;
18
- s && (t = q.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && q.set(e, t));
16
+ if (J && t === void 0) {
17
+ const i = e !== void 0 && e.length === 1;
18
+ i && (t = V.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && V.set(e, t));
19
19
  }
20
20
  return t;
21
21
  }
@@ -23,65 +23,65 @@ let ot = class {
23
23
  return this.cssText;
24
24
  }
25
25
  };
26
- const ct = (i) => new ot(typeof i == "string" ? i : i + "", void 0, F), dt = (i, ...t) => {
27
- const e = i.length === 1 ? i[0] : t.reduce((s, r, n) => s + ((o) => {
26
+ const ct = (s) => new ot(typeof s == "string" ? s : s + "", void 0, W), dt = (s, ...t) => {
27
+ const e = s.length === 1 ? s[0] : t.reduce((i, r, n) => i + ((o) => {
28
28
  if (o._$cssResult$ === !0)
29
29
  return o.cssText;
30
30
  if (typeof o == "number")
31
31
  return o;
32
32
  throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
33
- })(r) + i[n + 1], i[0]);
34
- return new ot(e, i, F);
35
- }, ut = (i, t) => {
36
- if (W)
37
- i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
33
+ })(r) + s[n + 1], s[0]);
34
+ return new ot(e, s, W);
35
+ }, ut = (s, t) => {
36
+ if (J)
37
+ s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
38
38
  else
39
39
  for (const e of t) {
40
- const s = document.createElement("style"), r = H.litNonce;
41
- r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
40
+ const i = document.createElement("style"), r = H.litNonce;
41
+ r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
42
42
  }
43
- }, G = W ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
43
+ }, G = J ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
44
44
  let e = "";
45
- for (const s of t.cssRules)
46
- e += s.cssText;
45
+ for (const i of t.cssRules)
46
+ e += i.cssText;
47
47
  return ct(e);
48
- })(i) : i;
48
+ })(s) : s;
49
49
  /**
50
50
  * @license
51
51
  * Copyright 2017 Google LLC
52
52
  * SPDX-License-Identifier: BSD-3-Clause
53
53
  */
54
- const { is: gt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: $t, getOwnPropertySymbols: mt, getPrototypeOf: ft } = Object, f = globalThis, K = f.trustedTypes, wt = K ? K.emptyScript : "", z = f.reactiveElementPolyfillSupport, C = (i, t) => i, I = { toAttribute(i, t) {
54
+ const { is: gt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: ft, getOwnPropertySymbols: mt, getPrototypeOf: $t } = Object, $ = globalThis, K = $.trustedTypes, wt = K ? K.emptyScript : "", j = $.reactiveElementPolyfillSupport, C = (s, t) => s, I = { toAttribute(s, t) {
55
55
  switch (t) {
56
56
  case Boolean:
57
- i = i ? wt : null;
57
+ s = s ? wt : null;
58
58
  break;
59
59
  case Object:
60
60
  case Array:
61
- i = i == null ? i : JSON.stringify(i);
61
+ s = s == null ? s : JSON.stringify(s);
62
62
  }
63
- return i;
64
- }, fromAttribute(i, t) {
65
- let e = i;
63
+ return s;
64
+ }, fromAttribute(s, t) {
65
+ let e = s;
66
66
  switch (t) {
67
67
  case Boolean:
68
- e = i !== null;
68
+ e = s !== null;
69
69
  break;
70
70
  case Number:
71
- e = i === null ? null : Number(i);
71
+ e = s === null ? null : Number(s);
72
72
  break;
73
73
  case Object:
74
74
  case Array:
75
75
  try {
76
- e = JSON.parse(i);
76
+ e = JSON.parse(s);
77
77
  } catch {
78
78
  e = null;
79
79
  }
80
80
  }
81
81
  return e;
82
- } }, V = (i, t) => !gt(i, t), Q = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: V };
83
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
84
- class S extends HTMLElement {
82
+ } }, F = (s, t) => !gt(s, t), Q = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: F };
83
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
84
+ class A extends HTMLElement {
85
85
  static addInitializer(t) {
86
86
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
87
87
  }
@@ -90,11 +90,11 @@ class S extends HTMLElement {
90
90
  }
91
91
  static createProperty(t, e = Q) {
92
92
  if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
93
- const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
93
+ const i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
94
94
  r !== void 0 && yt(this.prototype, t, r);
95
95
  }
96
96
  }
97
- static getPropertyDescriptor(t, e, s) {
97
+ static getPropertyDescriptor(t, e, i) {
98
98
  const { get: r, set: n } = _t(this.prototype, t) ?? { get() {
99
99
  return this[e];
100
100
  }, set(o) {
@@ -104,7 +104,7 @@ class S extends HTMLElement {
104
104
  return r == null ? void 0 : r.call(this);
105
105
  }, set(o) {
106
106
  const c = r == null ? void 0 : r.call(this);
107
- n.call(this, o), this.requestUpdate(t, c, s);
107
+ n.call(this, o), this.requestUpdate(t, c, i);
108
108
  }, configurable: !0, enumerable: !0 };
109
109
  }
110
110
  static getPropertyOptions(t) {
@@ -113,27 +113,27 @@ class S extends HTMLElement {
113
113
  static _$Ei() {
114
114
  if (this.hasOwnProperty(C("elementProperties")))
115
115
  return;
116
- const t = ft(this);
116
+ const t = $t(this);
117
117
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
118
118
  }
119
119
  static finalize() {
120
120
  if (this.hasOwnProperty(C("finalized")))
121
121
  return;
122
122
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
123
- const e = this.properties, s = [...$t(e), ...mt(e)];
124
- for (const r of s)
123
+ const e = this.properties, i = [...ft(e), ...mt(e)];
124
+ for (const r of i)
125
125
  this.createProperty(r, e[r]);
126
126
  }
127
127
  const t = this[Symbol.metadata];
128
128
  if (t !== null) {
129
129
  const e = litPropertyMetadata.get(t);
130
130
  if (e !== void 0)
131
- for (const [s, r] of e)
132
- this.elementProperties.set(s, r);
131
+ for (const [i, r] of e)
132
+ this.elementProperties.set(i, r);
133
133
  }
134
134
  this._$Eh = /* @__PURE__ */ new Map();
135
- for (const [e, s] of this.elementProperties) {
136
- const r = this._$Eu(e, s);
135
+ for (const [e, i] of this.elementProperties) {
136
+ const r = this._$Eu(e, i);
137
137
  r !== void 0 && this._$Eh.set(r, e);
138
138
  }
139
139
  this.elementStyles = this.finalizeStyles(this.styles);
@@ -141,16 +141,16 @@ class S extends HTMLElement {
141
141
  static finalizeStyles(t) {
142
142
  const e = [];
143
143
  if (Array.isArray(t)) {
144
- const s = new Set(t.flat(1 / 0).reverse());
145
- for (const r of s)
144
+ const i = new Set(t.flat(1 / 0).reverse());
145
+ for (const r of i)
146
146
  e.unshift(G(r));
147
147
  } else
148
148
  t !== void 0 && e.push(G(t));
149
149
  return e;
150
150
  }
151
151
  static _$Eu(t, e) {
152
- const s = e.attribute;
153
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
152
+ const i = e.attribute;
153
+ return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
154
154
  }
155
155
  constructor() {
156
156
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
@@ -169,8 +169,8 @@ class S extends HTMLElement {
169
169
  }
170
170
  _$E_() {
171
171
  const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
172
- for (const s of e.keys())
173
- this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
172
+ for (const i of e.keys())
173
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
174
174
  t.size > 0 && (this._$Ep = t);
175
175
  }
176
176
  createRenderRoot() {
@@ -180,8 +180,8 @@ class S extends HTMLElement {
180
180
  connectedCallback() {
181
181
  var t;
182
182
  this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
183
- var s;
184
- return (s = e.hostConnected) == null ? void 0 : s.call(e);
183
+ var i;
184
+ return (i = e.hostConnected) == null ? void 0 : i.call(e);
185
185
  });
186
186
  }
187
187
  enableUpdating(t) {
@@ -189,39 +189,39 @@ class S extends HTMLElement {
189
189
  disconnectedCallback() {
190
190
  var t;
191
191
  (t = this._$EO) == null || t.forEach((e) => {
192
- var s;
193
- return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
192
+ var i;
193
+ return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
194
194
  });
195
195
  }
196
- attributeChangedCallback(t, e, s) {
197
- this._$AK(t, s);
196
+ attributeChangedCallback(t, e, i) {
197
+ this._$AK(t, i);
198
198
  }
199
199
  _$EC(t, e) {
200
200
  var n;
201
- const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
202
- if (r !== void 0 && s.reflect === !0) {
203
- const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : I).toAttribute(e, s.type);
201
+ const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
202
+ if (r !== void 0 && i.reflect === !0) {
203
+ const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : I).toAttribute(e, i.type);
204
204
  this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
205
205
  }
206
206
  }
207
207
  _$AK(t, e) {
208
208
  var n;
209
- const s = this.constructor, r = s._$Eh.get(t);
209
+ const i = this.constructor, r = i._$Eh.get(t);
210
210
  if (r !== void 0 && this._$Em !== r) {
211
- const o = s.getPropertyOptions(r), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : I;
211
+ const o = i.getPropertyOptions(r), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : I;
212
212
  this._$Em = r, this[r] = c.fromAttribute(e, o.type), this._$Em = null;
213
213
  }
214
214
  }
215
- requestUpdate(t, e, s) {
215
+ requestUpdate(t, e, i) {
216
216
  if (t !== void 0) {
217
- if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? V)(this[t], e))
217
+ if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? F)(this[t], e))
218
218
  return;
219
- this.P(t, e, s);
219
+ this.P(t, e, i);
220
220
  }
221
221
  this.isUpdatePending === !1 && (this._$ES = this._$ET());
222
222
  }
223
- P(t, e, s) {
224
- this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
223
+ P(t, e, i) {
224
+ this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
225
225
  }
226
226
  async _$ET() {
227
227
  this.isUpdatePending = !0;
@@ -237,7 +237,7 @@ class S extends HTMLElement {
237
237
  return this.performUpdate();
238
238
  }
239
239
  performUpdate() {
240
- var s;
240
+ var i;
241
241
  if (!this.isUpdatePending)
242
242
  return;
243
243
  if (!this.hasUpdated) {
@@ -254,7 +254,7 @@ class S extends HTMLElement {
254
254
  let t = !1;
255
255
  const e = this._$AL;
256
256
  try {
257
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((r) => {
257
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach((r) => {
258
258
  var n;
259
259
  return (n = r.hostUpdate) == null ? void 0 : n.call(r);
260
260
  }), this.update(e)) : this._$EU();
@@ -267,9 +267,9 @@ class S extends HTMLElement {
267
267
  }
268
268
  _$AE(t) {
269
269
  var e;
270
- (e = this._$EO) == null || e.forEach((s) => {
270
+ (e = this._$EO) == null || e.forEach((i) => {
271
271
  var r;
272
- return (r = s.hostUpdated) == null ? void 0 : r.call(s);
272
+ return (r = i.hostUpdated) == null ? void 0 : r.call(i);
273
273
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
274
274
  }
275
275
  _$EU() {
@@ -292,40 +292,40 @@ class S extends HTMLElement {
292
292
  firstUpdated(t) {
293
293
  }
294
294
  }
295
- S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[C("elementProperties")] = /* @__PURE__ */ new Map(), S[C("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: S }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.4");
295
+ A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[C("elementProperties")] = /* @__PURE__ */ new Map(), A[C("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: A }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
296
296
  /**
297
297
  * @license
298
298
  * Copyright 2017 Google LLC
299
299
  * SPDX-License-Identifier: BSD-3-Clause
300
300
  */
301
- const M = globalThis, L = M.trustedTypes, Z = L ? L.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, nt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + m, bt = `<${at}>`, A = document, x = () => A.createComment(""), O = (i) => i === null || typeof i != "object" && typeof i != "function", ht = Array.isArray, At = (i) => ht(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", j = `[
302
- \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, Y = />/g, w = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
303
- \f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, lt = /^(?:script|style|textarea|title)$/i, St = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), st = St(1), v = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), b = A.createTreeWalker(A, 129);
304
- function pt(i, t) {
305
- if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
301
+ const M = globalThis, L = M.trustedTypes, Z = L ? L.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, nt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + m, bt = `<${at}>`, S = document, x = () => S.createComment(""), O = (s) => s === null || typeof s != "object" && typeof s != "function", ht = Array.isArray, St = (s) => ht(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", z = `[
302
+ \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, Y = />/g, w = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
303
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, lt = /^(?:script|style|textarea|title)$/i, At = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), st = At(1), v = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), b = S.createTreeWalker(S, 129);
304
+ function pt(s, t) {
305
+ if (!Array.isArray(s) || !s.hasOwnProperty("raw"))
306
306
  throw Error("invalid template strings array");
307
307
  return Z !== void 0 ? Z.createHTML(t) : t;
308
308
  }
309
- const vt = (i, t) => {
310
- const e = i.length - 1, s = [];
309
+ const vt = (s, t) => {
310
+ const e = s.length - 1, i = [];
311
311
  let r, n = t === 2 ? "<svg>" : "", o = P;
312
312
  for (let c = 0; c < e; c++) {
313
- const a = i[c];
313
+ const a = s[c];
314
314
  let d, g, u = -1, _ = 0;
315
315
  for (; _ < a.length && (o.lastIndex = _, g = o.exec(a), g !== null); )
316
316
  _ = o.lastIndex, o === P ? g[1] === "!--" ? o = X : g[1] !== void 0 ? o = Y : g[2] !== void 0 ? (lt.test(g[2]) && (r = RegExp("</" + g[2], "g")), o = w) : g[3] !== void 0 && (o = w) : o === w ? g[0] === ">" ? (o = r ?? P, u = -1) : g[1] === void 0 ? u = -2 : (u = o.lastIndex - g[2].length, d = g[1], o = g[3] === void 0 ? w : g[3] === '"' ? et : tt) : o === et || o === tt ? o = w : o === X || o === Y ? o = P : (o = w, r = void 0);
317
- const $ = o === w && i[c + 1].startsWith("/>") ? " " : "";
318
- n += o === P ? a + bt : u >= 0 ? (s.push(d), a.slice(0, u) + nt + a.slice(u) + m + $) : a + m + (u === -2 ? c : $);
317
+ const f = o === w && s[c + 1].startsWith("/>") ? " " : "";
318
+ n += o === P ? a + bt : u >= 0 ? (i.push(d), a.slice(0, u) + nt + a.slice(u) + m + f) : a + m + (u === -2 ? c : f);
319
319
  }
320
- return [pt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
320
+ return [pt(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
321
321
  };
322
322
  class R {
323
- constructor({ strings: t, _$litType$: e }, s) {
323
+ constructor({ strings: t, _$litType$: e }, i) {
324
324
  let r;
325
325
  this.parts = [];
326
326
  let n = 0, o = 0;
327
327
  const c = t.length - 1, a = this.parts, [d, g] = vt(t, e);
328
- if (this.el = R.createElement(d, s), b.currentNode = this.el.content, e === 2) {
328
+ if (this.el = R.createElement(d, i), b.currentNode = this.el.content, e === 2) {
329
329
  const u = this.el.content.firstChild;
330
330
  u.replaceWith(...u.childNodes);
331
331
  }
@@ -334,16 +334,16 @@ class R {
334
334
  if (r.hasAttributes())
335
335
  for (const u of r.getAttributeNames())
336
336
  if (u.endsWith(nt)) {
337
- const _ = g[o++], $ = r.getAttribute(u).split(m), T = /([.?@])?(.*)/.exec(_);
338
- a.push({ type: 1, index: n, name: T[2], strings: $, ctor: T[1] === "." ? Pt : T[1] === "?" ? Ct : T[1] === "@" ? Mt : D }), r.removeAttribute(u);
337
+ const _ = g[o++], f = r.getAttribute(u).split(m), k = /([.?@])?(.*)/.exec(_);
338
+ a.push({ type: 1, index: n, name: k[2], strings: f, ctor: k[1] === "." ? Pt : k[1] === "?" ? Ct : k[1] === "@" ? Mt : D }), r.removeAttribute(u);
339
339
  } else
340
340
  u.startsWith(m) && (a.push({ type: 6, index: n }), r.removeAttribute(u));
341
341
  if (lt.test(r.tagName)) {
342
342
  const u = r.textContent.split(m), _ = u.length - 1;
343
343
  if (_ > 0) {
344
344
  r.textContent = L ? L.emptyScript : "";
345
- for (let $ = 0; $ < _; $++)
346
- r.append(u[$], x()), b.nextNode(), a.push({ type: 2, index: ++n });
345
+ for (let f = 0; f < _; f++)
346
+ r.append(u[f], x()), b.nextNode(), a.push({ type: 2, index: ++n });
347
347
  r.append(u[_], x());
348
348
  }
349
349
  }
@@ -359,17 +359,17 @@ class R {
359
359
  }
360
360
  }
361
361
  static createElement(t, e) {
362
- const s = A.createElement("template");
363
- return s.innerHTML = t, s;
362
+ const i = S.createElement("template");
363
+ return i.innerHTML = t, i;
364
364
  }
365
365
  }
366
- function E(i, t, e = i, s) {
366
+ function E(s, t, e = s, i) {
367
367
  var o, c;
368
368
  if (t === v)
369
369
  return t;
370
- let r = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
370
+ let r = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
371
371
  const n = O(t) ? void 0 : t._$litDirective$;
372
- return (r == null ? void 0 : r.constructor) !== n && ((c = r == null ? void 0 : r._$AO) == null || c.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = E(i, r._$AS(i, t.values), r, s)), t;
372
+ return (r == null ? void 0 : r.constructor) !== n && ((c = r == null ? void 0 : r._$AO) == null || c.call(r, !1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = r : e._$Cl = r), r !== void 0 && (t = E(s, r._$AS(s, t.values), r, i)), t;
373
373
  }
374
374
  class Et {
375
375
  constructor(t, e) {
@@ -382,22 +382,22 @@ class Et {
382
382
  return this._$AM._$AU;
383
383
  }
384
384
  u(t) {
385
- const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
385
+ const { el: { content: e }, parts: i } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? S).importNode(e, !0);
386
386
  b.currentNode = r;
387
- let n = b.nextNode(), o = 0, c = 0, a = s[0];
387
+ let n = b.nextNode(), o = 0, c = 0, a = i[0];
388
388
  for (; a !== void 0; ) {
389
389
  if (o === a.index) {
390
390
  let d;
391
- a.type === 2 ? d = new N(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(n, this, t)), this._$AV.push(d), a = s[++c];
391
+ a.type === 2 ? d = new N(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(n, this, t)), this._$AV.push(d), a = i[++c];
392
392
  }
393
393
  o !== (a == null ? void 0 : a.index) && (n = b.nextNode(), o++);
394
394
  }
395
- return b.currentNode = A, r;
395
+ return b.currentNode = S, r;
396
396
  }
397
397
  p(t) {
398
398
  let e = 0;
399
- for (const s of this._$AV)
400
- s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
399
+ for (const i of this._$AV)
400
+ i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
401
401
  }
402
402
  }
403
403
  class N {
@@ -405,8 +405,8 @@ class N {
405
405
  var t;
406
406
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
407
407
  }
408
- constructor(t, e, s, r) {
409
- this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
408
+ constructor(t, e, i, r) {
409
+ this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
410
410
  }
411
411
  get parentNode() {
412
412
  let t = this._$AA.parentNode;
@@ -420,7 +420,7 @@ class N {
420
420
  return this._$AB;
421
421
  }
422
422
  _$AI(t, e = this) {
423
- t = E(this, t, e), O(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : At(t) ? this.k(t) : this._(t);
423
+ t = E(this, t, e), O(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : St(t) ? this.k(t) : this._(t);
424
424
  }
425
425
  S(t) {
426
426
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -429,11 +429,11 @@ class N {
429
429
  this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
430
430
  }
431
431
  _(t) {
432
- this._$AH !== y && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
432
+ this._$AH !== y && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
433
433
  }
434
434
  $(t) {
435
435
  var n;
436
- const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = R.createElement(pt(s.h, s.h[0]), this.options)), s);
436
+ const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = R.createElement(pt(i.h, i.h[0]), this.options)), i);
437
437
  if (((n = this._$AH) == null ? void 0 : n._$AD) === r)
438
438
  this._$AH.p(e);
439
439
  else {
@@ -448,14 +448,14 @@ class N {
448
448
  k(t) {
449
449
  ht(this._$AH) || (this._$AH = [], this._$AR());
450
450
  const e = this._$AH;
451
- let s, r = 0;
451
+ let i, r = 0;
452
452
  for (const n of t)
453
- r === e.length ? e.push(s = new N(this.S(x()), this.S(x()), this, this.options)) : s = e[r], s._$AI(n), r++;
454
- r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
453
+ r === e.length ? e.push(i = new N(this.S(x()), this.S(x()), this, this.options)) : i = e[r], i._$AI(n), r++;
454
+ r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
455
455
  }
456
456
  _$AR(t = this._$AA.nextSibling, e) {
457
- var s;
458
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
457
+ var i;
458
+ for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
459
459
  const r = t.nextSibling;
460
460
  t.remove(), t = r;
461
461
  }
@@ -472,10 +472,10 @@ class D {
472
472
  get _$AU() {
473
473
  return this._$AM._$AU;
474
474
  }
475
- constructor(t, e, s, r, n) {
476
- this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = y;
475
+ constructor(t, e, i, r, n) {
476
+ this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = y;
477
477
  }
478
- _$AI(t, e = this, s, r) {
478
+ _$AI(t, e = this, i, r) {
479
479
  const n = this.strings;
480
480
  let o = !1;
481
481
  if (n === void 0)
@@ -484,7 +484,7 @@ class D {
484
484
  const c = t;
485
485
  let a, d;
486
486
  for (t = n[0], a = 0; a < n.length - 1; a++)
487
- d = E(this, c[s + a], e, a), d === v && (d = this._$AH[a]), o || (o = !O(d) || d !== this._$AH[a]), d === y ? t = y : t !== y && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
487
+ d = E(this, c[i + a], e, a), d === v && (d = this._$AH[a]), o || (o = !O(d) || d !== this._$AH[a]), d === y ? t = y : t !== y && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
488
488
  }
489
489
  o && !r && this.j(t);
490
490
  }
@@ -509,14 +509,14 @@ class Ct extends D {
509
509
  }
510
510
  }
511
511
  class Mt extends D {
512
- constructor(t, e, s, r, n) {
513
- super(t, e, s, r, n), this.type = 5;
512
+ constructor(t, e, i, r, n) {
513
+ super(t, e, i, r, n), this.type = 5;
514
514
  }
515
515
  _$AI(t, e = this) {
516
516
  if ((t = E(this, t, e, 0) ?? y) === v)
517
517
  return;
518
- const s = this._$AH, r = t === y && s !== y || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== y && (s === y || r);
519
- r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
518
+ const i = this._$AH, r = t === y && i !== y || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== y && (i === y || r);
519
+ r && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
520
520
  }
521
521
  handleEvent(t) {
522
522
  var e;
@@ -524,8 +524,8 @@ class Mt extends D {
524
524
  }
525
525
  }
526
526
  class Ut {
527
- constructor(t, e, s) {
528
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
527
+ constructor(t, e, i) {
528
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
529
529
  }
530
530
  get _$AU() {
531
531
  return this._$AM._$AU;
@@ -536,21 +536,21 @@ class Ut {
536
536
  }
537
537
  const B = M.litHtmlPolyfillSupport;
538
538
  B == null || B(R, N), (M.litHtmlVersions ?? (M.litHtmlVersions = [])).push("3.1.3");
539
- const xt = (i, t, e) => {
540
- const s = (e == null ? void 0 : e.renderBefore) ?? t;
541
- let r = s._$litPart$;
539
+ const xt = (s, t, e) => {
540
+ const i = (e == null ? void 0 : e.renderBefore) ?? t;
541
+ let r = i._$litPart$;
542
542
  if (r === void 0) {
543
543
  const n = (e == null ? void 0 : e.renderBefore) ?? null;
544
- s._$litPart$ = r = new N(t.insertBefore(x(), n), n, void 0, e ?? {});
544
+ i._$litPart$ = r = new N(t.insertBefore(x(), n), n, void 0, e ?? {});
545
545
  }
546
- return r._$AI(i), r;
546
+ return r._$AI(s), r;
547
547
  };
548
548
  /**
549
549
  * @license
550
550
  * Copyright 2017 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
552
  */
553
- class U extends S {
553
+ class U extends A {
554
554
  constructor() {
555
555
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
556
556
  }
@@ -577,57 +577,58 @@ class U extends S {
577
577
  }
578
578
  var rt;
579
579
  U._$litElement$ = !0, U.finalized = !0, (rt = globalThis.litElementHydrateSupport) == null || rt.call(globalThis, { LitElement: U });
580
- const J = globalThis.litElementPolyfillSupport;
581
- J == null || J({ LitElement: U });
580
+ const q = globalThis.litElementPolyfillSupport;
581
+ q == null || q({ LitElement: U });
582
582
  (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5");
583
583
  /**
584
584
  * @license
585
585
  * Copyright 2017 Google LLC
586
586
  * SPDX-License-Identifier: BSD-3-Clause
587
587
  */
588
- const Ot = (i) => (t, e) => {
588
+ const Ot = (s) => (t, e) => {
589
589
  e !== void 0 ? e.addInitializer(() => {
590
- customElements.define(i, t);
591
- }) : customElements.define(i, t);
590
+ customElements.define(s, t);
591
+ }) : customElements.define(s, t);
592
592
  };
593
593
  /**
594
594
  * @license
595
595
  * Copyright 2017 Google LLC
596
596
  * SPDX-License-Identifier: BSD-3-Clause
597
597
  */
598
- const Rt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: V }, Nt = (i = Rt, t, e) => {
599
- const { kind: s, metadata: r } = e;
598
+ const Rt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: F }, Nt = (s = Rt, t, e) => {
599
+ const { kind: i, metadata: r } = e;
600
600
  let n = globalThis.litPropertyMetadata.get(r);
601
- if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), n.set(e.name, i), s === "accessor") {
601
+ if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), n.set(e.name, s), i === "accessor") {
602
602
  const { name: o } = e;
603
603
  return { set(c) {
604
604
  const a = t.get.call(this);
605
- t.set.call(this, c), this.requestUpdate(o, a, i);
605
+ t.set.call(this, c), this.requestUpdate(o, a, s);
606
606
  }, init(c) {
607
- return c !== void 0 && this.P(o, void 0, i), c;
607
+ return c !== void 0 && this.P(o, void 0, s), c;
608
608
  } };
609
609
  }
610
- if (s === "setter") {
610
+ if (i === "setter") {
611
611
  const { name: o } = e;
612
612
  return function(c) {
613
613
  const a = this[o];
614
- t.call(this, c), this.requestUpdate(o, a, i);
614
+ t.call(this, c), this.requestUpdate(o, a, s);
615
615
  };
616
616
  }
617
- throw Error("Unsupported decorator location: " + s);
617
+ throw Error("Unsupported decorator location: " + i);
618
618
  };
619
- function p(i) {
620
- return (t, e) => typeof e == "object" ? Nt(i, t, e) : ((s, r, n) => {
619
+ function p(s) {
620
+ return (t, e) => typeof e == "object" ? Nt(s, t, e) : ((i, r, n) => {
621
621
  const o = r.hasOwnProperty(n);
622
- return r.constructor.createProperty(n, o ? { ...s, wrapped: !0 } : s), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
623
- })(i, t, e);
622
+ return r.constructor.createProperty(n, o ? { ...i, wrapped: !0 } : i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
623
+ })(s, t, e);
624
624
  }
625
- const Tt = [
625
+ const kt = [
626
626
  "allow-partial-match",
627
627
  "ar-placement",
628
628
  "background-color",
629
629
  "camera-orbit-sensitivity",
630
630
  "camera-transition-duration",
631
+ "disable-retries",
631
632
  "disable-scroll-wheel",
632
633
  "enable-dark-mode",
633
634
  "highlight-color",
@@ -636,6 +637,7 @@ const Tt = [
636
637
  "list-bullet-alignment",
637
638
  "list-bullet-leading-zeros",
638
639
  "list-bullet-style",
640
+ "qr-url-pattern",
639
641
  "rotation",
640
642
  "ruler-unit",
641
643
  "shadow-intensity",
@@ -654,83 +656,83 @@ const Tt = [
654
656
  "start-frame",
655
657
  "tone-mapping",
656
658
  "zoom-type"
657
- ], kt = (i) => i.replace(/([-_]\w)/g, (t) => t[1].toUpperCase()), Ht = (i) => {
659
+ ], Tt = (s) => s.replace(/([-_]\w)/g, (t) => t[1].toUpperCase()), Ht = (s) => {
658
660
  let t = new URLSearchParams();
659
- return Tt.forEach((e) => {
660
- if (i.hasAttribute(e)) {
661
- let s = i.getAttribute(e);
662
- if (!s)
661
+ return kt.forEach((e) => {
662
+ if (s.hasAttribute(e)) {
663
+ let i = s.getAttribute(e);
664
+ if (!i)
663
665
  return;
664
- s === "yes" && (s = "true"), s === "no" && (s = "false"), t.append(kt(e), s);
666
+ i === "yes" && (i = "true"), i === "no" && (i = "false"), t.append(Tt(e), i);
665
667
  }
666
668
  }), t;
667
669
  };
668
- var It = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, l = (i, t, e, s) => {
669
- for (var r = s > 1 ? void 0 : s ? Lt(t, e) : t, n = i.length - 1, o; n >= 0; n--)
670
- (o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
671
- return s && r && It(t, e, r), r;
670
+ var It = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, l = (s, t, e, i) => {
671
+ for (var r = i > 1 ? void 0 : i ? Lt(t, e) : t, n = s.length - 1, o; n >= 0; n--)
672
+ (o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
673
+ return i && r && It(t, e, r), r;
672
674
  };
673
- const Dt = "{host}{viewer}/by_scene_id/{scene_id}", zt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}", jt = "{host}{viewer}/by_product_id/{customer_id}/{sku}", Bt = "{host}{viewer}/by_hash/{customer_id}/{hash}";
674
- function k(i, t) {
675
+ const Dt = "{host}{viewer}/by_scene_id/{scene_id}", jt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}", zt = "{host}{viewer}/by_product_id/{customer_id}/{sku}", Bt = "{host}{viewer}/by_hash/{customer_id}/{hash}";
676
+ function T(s, t) {
675
677
  var e = new RegExp(Object.keys(t).join("|"), "gi");
676
- return i.replace(e, function(s) {
677
- return t[s.toLowerCase()];
678
+ return s.replace(e, function(i) {
679
+ return t[i.toLowerCase()];
678
680
  });
679
681
  }
680
682
  let h = class extends U {
681
683
  constructor() {
682
- super(...arguments), this.customerId = void 0, this.viewer = "realtime", this.host = "https://configurator.v2.londondynamics.com", this.getCurrentSelection = (i) => this._pingpongPostMessage(
684
+ super(...arguments), this.customerId = void 0, this.viewer = "realtime", this.host = "https://configurator.v2.londondynamics.com", this.defaultSelection = {}, this.getCurrentSelection = (s) => this._pingpongPostMessage(
683
685
  {
684
686
  type: "currentValues"
685
687
  },
686
- i
687
- ), this._emit = (i, t) => {
688
+ s
689
+ ), this._emit = (s, t) => {
688
690
  this.dispatchEvent(
689
- new CustomEvent(i, {
691
+ new CustomEvent(s, {
690
692
  detail: t,
691
693
  bubbles: !0,
692
694
  composed: !0
693
695
  })
694
696
  );
695
- }, this._pingpongPostMessage = (i, t) => new Promise((e, s) => {
697
+ }, this._pingpongPostMessage = (s, t) => new Promise((e, i) => {
696
698
  var c, a;
697
- const r = { ...i, messageId: Date.now() }, n = (d) => {
699
+ const r = { ...s, messageId: Date.now() }, n = (d) => {
698
700
  if (d.origin === this.host && d.data.messageId === r.messageId && d.data.type === r.type) {
699
701
  try {
700
702
  t ? t(JSON.parse(d.data.result)) : e(JSON.parse(d.data.result));
701
703
  } catch (g) {
702
- g instanceof Error ? t ? t({}, g.message) : s(g.message) : t ? t({}, "Unknown error") : s("Unknown error");
704
+ g instanceof Error ? t ? t({}, g.message) : i(g.message) : t ? t({}, "Unknown error") : i("Unknown error");
703
705
  }
704
706
  window.removeEventListener("message", n);
705
707
  }
706
708
  }, o = (c = this.shadowRoot) == null ? void 0 : c.querySelector("iframe");
707
709
  o && (window.addEventListener("message", n), (a = o.contentWindow) == null || a.postMessage(r, "*"));
708
- }), this._handleMessage = (i) => {
710
+ }), this._handleMessage = (s) => {
709
711
  var t;
710
- if (i.origin === this.host && (t = i == null ? void 0 : i.data) != null && t.type)
711
- switch (i.data.type) {
712
+ if (s.origin === this.host && (t = s == null ? void 0 : s.data) != null && t.type)
713
+ switch (s.data.type) {
712
714
  case "ready":
713
715
  this._emit("ready", {
714
- options: JSON.parse(i.data.options),
715
- presets: JSON.parse(i.data.presets),
716
- scene: JSON.parse(i.data.scene)
716
+ options: JSON.parse(s.data.options),
717
+ presets: JSON.parse(s.data.presets),
718
+ scene: JSON.parse(s.data.scene)
717
719
  });
718
720
  break;
719
721
  case "load":
720
- this._emit("load", JSON.parse(i.data.values));
722
+ this._emit("load", JSON.parse(s.data.values));
721
723
  break;
722
724
  case "error":
723
- this._emit("error", JSON.parse(i.data.values));
725
+ this._emit("error", JSON.parse(s.data.values));
724
726
  break;
725
727
  case "change":
726
- this._emit("change", JSON.parse(i.data.values));
728
+ this._emit("change", JSON.parse(s.data.values));
727
729
  break;
728
730
  case "cameraChange":
729
- this._emit("camerachange", JSON.parse(i.data.values));
731
+ this._emit("camerachange", JSON.parse(s.data.values));
730
732
  break;
731
733
  case "log":
732
- const { logType: e, logData: s } = i.data;
733
- this._emit(e, JSON.parse(s));
734
+ const { logType: e, logData: i } = s.data;
735
+ this._emit(e, JSON.parse(i));
734
736
  break;
735
737
  }
736
738
  };
@@ -742,12 +744,12 @@ let h = class extends U {
742
744
  * @example getCurrentConfiguration((values, err) => {})
743
745
  * @returns {Promise<any>}
744
746
  */
745
- getCurrentConfiguration(i) {
747
+ getCurrentConfiguration(s) {
746
748
  return this._pingpongPostMessage(
747
749
  {
748
750
  type: "currentConfig"
749
751
  },
750
- i
752
+ s
751
753
  );
752
754
  }
753
755
  /**
@@ -757,12 +759,12 @@ let h = class extends U {
757
759
  * @example getCurrentScene((values, err) => {})
758
760
  * @returns {Promise<any>}
759
761
  */
760
- getCurrentScene(i) {
762
+ getCurrentScene(s) {
761
763
  return this._pingpongPostMessage(
762
764
  {
763
765
  type: "currentScene"
764
766
  },
765
- i
767
+ s
766
768
  );
767
769
  }
768
770
  /**
@@ -772,12 +774,12 @@ let h = class extends U {
772
774
  * @example getCurrentHash((hash, err) => {})
773
775
  * @returns {Promise<any>}
774
776
  */
775
- getCurrentHash(i) {
777
+ getCurrentHash(s) {
776
778
  return this._pingpongPostMessage(
777
779
  {
778
780
  type: "currentHash"
779
781
  },
780
- i
782
+ s
781
783
  );
782
784
  }
783
785
  /**
@@ -787,12 +789,12 @@ let h = class extends U {
787
789
  * @example getCurrentSource((values, err) => {})
788
790
  * @returns {Promise<any>}
789
791
  */
790
- getCurrentSource(i) {
792
+ getCurrentSource(s) {
791
793
  return this._pingpongPostMessage(
792
794
  {
793
795
  type: "currentSource"
794
796
  },
795
- i
797
+ s
796
798
  );
797
799
  }
798
800
  /**
@@ -802,12 +804,12 @@ let h = class extends U {
802
804
  * @example getCurrentARSource((values, err) => {})
803
805
  * @returns {Promise<any>}
804
806
  */
805
- getCurrentARSource(i) {
807
+ getCurrentARSource(s) {
806
808
  return this._pingpongPostMessage(
807
809
  {
808
810
  type: "currentARSource"
809
811
  },
810
- i
812
+ s
811
813
  );
812
814
  }
813
815
  /**
@@ -817,12 +819,12 @@ let h = class extends U {
817
819
  * @example getDataURL((dataURL, err) => {})
818
820
  * @returns {Promise<any>}
819
821
  */
820
- getDataURL(i) {
822
+ getDataURL(s) {
821
823
  return this._pingpongPostMessage(
822
824
  {
823
825
  type: "dataURL"
824
826
  },
825
- i
827
+ s
826
828
  );
827
829
  }
828
830
  /**
@@ -835,11 +837,11 @@ let h = class extends U {
835
837
  * @example const { index, src } = await getFrame(0, { zoom: 2 })
836
838
  * @returns {Promise<any>}
837
839
  */
838
- getFrame(i, t, e) {
840
+ getFrame(s, t, e) {
839
841
  return this._pingpongPostMessage(
840
842
  {
841
843
  type: "getFrame",
842
- index: i,
844
+ index: s,
843
845
  options: t
844
846
  },
845
847
  e
@@ -852,10 +854,10 @@ let h = class extends U {
852
854
  * @param {string} value
853
855
  * @returns {void}
854
856
  */
855
- setFeature(i, t) {
857
+ setFeature(s, t) {
856
858
  this._postMessage({
857
859
  type: "setFeature",
858
- featureId: i,
860
+ featureId: s,
859
861
  variantId: t,
860
862
  allowPartialMatch: this.allowPartialMatch
861
863
  });
@@ -867,23 +869,23 @@ let h = class extends U {
867
869
  * @param {boolean} resetBeforeUpdate (optional) - resets the configuration before updating
868
870
  * @returns {void}
869
871
  */
870
- setSelection(i, t) {
872
+ setSelection(s, t) {
871
873
  this._postMessage({
872
874
  type: "setSelection",
873
- selection: i,
875
+ selection: s,
874
876
  resetBeforeUpdate: t,
875
877
  allowPartialMatch: this.allowPartialMatch
876
878
  });
877
879
  }
878
880
  /**
879
- * Selects preset by id
880
- * @param {string} presetId
881
+ * Selects context by id
882
+ * @param {string} contextId
881
883
  * @returns {void}
882
884
  */
883
- setPreset(i) {
885
+ setContext(s) {
884
886
  this._postMessage({
885
887
  type: "setPreset",
886
- presetId: i
888
+ presetId: s
887
889
  });
888
890
  }
889
891
  /**
@@ -904,10 +906,10 @@ let h = class extends U {
904
906
  * @param {boolean} state (optional)
905
907
  * @returns {void}
906
908
  */
907
- toggleLights(i) {
909
+ toggleLights(s) {
908
910
  this._postMessage({
909
911
  type: "toggleLights",
910
- value: i
912
+ value: s
911
913
  });
912
914
  }
913
915
  /**
@@ -917,10 +919,10 @@ let h = class extends U {
917
919
  * @param {string} optionGroupId
918
920
  * @returns {void}
919
921
  */
920
- toggleGroup(i) {
922
+ toggleGroup(s) {
921
923
  this._postMessage({
922
924
  type: "toggleGroup",
923
- value: i
925
+ value: s
924
926
  });
925
927
  }
926
928
  /**
@@ -930,10 +932,10 @@ let h = class extends U {
930
932
  * @param {string} optionGroupId
931
933
  * @returns {void}
932
934
  */
933
- toggleHotspot(i) {
935
+ toggleHotspot(s) {
934
936
  this._postMessage({
935
937
  type: "toggleGroup",
936
- groupId: i
938
+ groupId: s
937
939
  });
938
940
  }
939
941
  /**
@@ -944,10 +946,10 @@ let h = class extends U {
944
946
  * @param {string} angularUnit "deg" or "rad"
945
947
  * @returns {void}
946
948
  */
947
- setRotation(i = [0, 0, 0], t = "deg") {
949
+ setRotation(s = [0, 0, 0], t = "deg") {
948
950
  this._postMessage({
949
951
  type: "setRotation",
950
- rotation: i,
952
+ rotation: s,
951
953
  angularUnit: t
952
954
  });
953
955
  }
@@ -958,47 +960,62 @@ let h = class extends U {
958
960
  * @param {string} target
959
961
  * @returns {void}
960
962
  */
961
- setCamera(i = {}, t = {}) {
963
+ setCamera(s = {}, t = {}) {
962
964
  this._postMessage({
963
965
  type: "setCamera",
964
- ...i,
966
+ ...s,
965
967
  ...t
966
968
  });
967
969
  }
968
- _postMessage(i) {
969
- var e, s;
970
+ _postMessage(s) {
971
+ var e, i;
970
972
  const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("iframe");
971
- t && ((s = t.contentWindow) == null || s.postMessage(i, "*"));
973
+ t && ((i = t.contentWindow) == null || i.postMessage(s, "*"));
972
974
  }
973
975
  connectedCallback() {
974
- super.connectedCallback(), window.addEventListener("message", this._handleMessage);
976
+ super.connectedCallback();
977
+ const s = this.querySelector('script[type="application/json"]');
978
+ if (s && s.textContent)
979
+ try {
980
+ this.defaultSelection = JSON.parse(s.textContent);
981
+ } catch (t) {
982
+ typeof t == "object" && t instanceof Error ? console.warn(
983
+ `Error parsing selection: ${t.message}. Using default selection instead.`
984
+ ) : console.warn(
985
+ "Error parsing selection. Using default selection instead."
986
+ );
987
+ }
988
+ window.addEventListener("message", this._handleMessage);
975
989
  }
976
990
  disconnectedCallback() {
977
991
  window.removeEventListener("message", this._handleMessage), super.disconnectedCallback();
978
992
  }
979
993
  render() {
980
- let i = null, t = null;
981
- return this.host ? this.customerId ? this.hash ? t = k(Bt, {
994
+ let s = null, t = null;
995
+ if (console.log("this.defaultSelection?", this.defaultSelection), this.host ? this.customerId ? this.hash ? t = T(Bt, {
982
996
  "{viewer}": "",
983
997
  "{host}": this.host,
984
998
  "{customer_id}": this.customerId,
985
999
  "{hash}": this.hash
986
- }) : this.sceneId ? t = k(Dt, {
1000
+ }) : this.sceneId ? t = T(Dt, {
987
1001
  "{viewer}": this.viewer === "360" ? "/360" : "",
988
1002
  "{host}": this.host,
989
1003
  "{customer_id}": this.customerId,
990
1004
  "{scene_id}": this.sceneId
991
- }) : this.sku ? t = k(jt, {
1005
+ }) : this.sku ? t = T(zt, {
992
1006
  "{viewer}": this.viewer === "360" ? "/360" : "",
993
1007
  "{host}": this.host,
994
1008
  "{customer_id}": this.customerId,
995
1009
  "{sku}": this.sku
996
- }) : this.productId ? t = k(zt, {
1010
+ }) : this.productId ? t = T(jt, {
997
1011
  "{viewer}": this.viewer === "360" ? "/360" : "",
998
1012
  "{host}": this.host,
999
1013
  "{customer_id}": this.customerId,
1000
1014
  "{product_id}": this.productId
1001
- }) : i = "Missing property: sku, scene-id, or hash" : i = "Missing property: customer-id" : i = "Missing property: host", i ? st`<div>${i}</div>` : (this.hasAttributes() && (t += "?" + Ht(this)), st`<iframe
1015
+ }) : s = "Missing property: sku, scene-id, or hash" : s = "Missing property: customer-id" : s = "Missing property: host", s)
1016
+ return st`<div>${s}</div>`;
1017
+ let e = "";
1018
+ return this.hasAttributes() && (e += Ht(this)), Object.keys(this.defaultSelection).length > 0 && (e += new URLSearchParams(this.defaultSelection).toString()), e.length && (t += "?" + e), st`<iframe
1002
1019
  src="${t}"
1003
1020
  width="100%"
1004
1021
  height="100%"
@@ -1012,7 +1029,7 @@ let h = class extends U {
1012
1029
  sandbox="allow-pointer-lock allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads"
1013
1030
  >
1014
1031
  Unfortunately, your browser does not support iFrames.
1015
- </iframe>`);
1032
+ </iframe>`;
1016
1033
  }
1017
1034
  };
1018
1035
  h.styles = dt`
@@ -1053,17 +1070,23 @@ l([
1053
1070
  p({ type: String, attribute: "background-color" })
1054
1071
  ], h.prototype, "backgroundColor", 2);
1055
1072
  l([
1056
- p({ type: String, attribute: "enable-darkmode" })
1057
- ], h.prototype, "enableDarkMode", 2);
1073
+ p({ type: String, attribute: "disable-retries" })
1074
+ ], h.prototype, "disableRetries", 2);
1058
1075
  l([
1059
1076
  p({ type: String, attribute: "disable-scroll-wheel" })
1060
1077
  ], h.prototype, "disableScrollWheel", 2);
1078
+ l([
1079
+ p({ type: String, attribute: "enable-darkmode" })
1080
+ ], h.prototype, "enableDarkMode", 2);
1061
1081
  l([
1062
1082
  p({ type: String, attribute: "interaction-prompt-style" })
1063
1083
  ], h.prototype, "interactionPromptStyle", 2);
1064
1084
  l([
1065
1085
  p({ type: String, attribute: "lights" })
1066
1086
  ], h.prototype, "lights", 2);
1087
+ l([
1088
+ p({ type: String, attribute: "qr-url-pattern" })
1089
+ ], h.prototype, "qrUrlPattern", 2);
1067
1090
  l([
1068
1091
  p({ type: String, attribute: "rotation" })
1069
1092
  ], h.prototype, "rotation", 2);