@londondynamics/pericles-webcomponent 2.0.0 → 2.1.1
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/configurator.cjs +9 -9
- package/dist/configurator.d.cts +7 -4
- package/dist/configurator.d.ts +7 -4
- package/dist/configurator.js +248 -222
- package/package.json +1 -1
package/dist/configurator.js
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const H = globalThis,
|
|
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,
|
|
9
|
-
if (this._$cssResult$ = !0,
|
|
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 (
|
|
17
|
-
const
|
|
18
|
-
|
|
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 = (
|
|
27
|
-
const e =
|
|
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) +
|
|
34
|
-
return new ot(e,
|
|
35
|
-
}, ut = (
|
|
36
|
-
if (
|
|
37
|
-
|
|
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
|
|
41
|
-
r !== void 0 &&
|
|
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 =
|
|
43
|
+
}, G = J ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
|
44
44
|
let e = "";
|
|
45
|
-
for (const
|
|
46
|
-
e +=
|
|
45
|
+
for (const i of t.cssRules)
|
|
46
|
+
e += i.cssText;
|
|
47
47
|
return ct(e);
|
|
48
|
-
})(
|
|
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:
|
|
54
|
+
const { is: gt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: ft, getOwnPropertySymbols: mt, getPrototypeOf: $t } = Object, $ = globalThis, K = $.trustedTypes, wt = K ? K.emptyScript : "", D = $.reactiveElementPolyfillSupport, C = (s, t) => s, I = { toAttribute(s, t) {
|
|
55
55
|
switch (t) {
|
|
56
56
|
case Boolean:
|
|
57
|
-
|
|
57
|
+
s = s ? wt : null;
|
|
58
58
|
break;
|
|
59
59
|
case Object:
|
|
60
60
|
case Array:
|
|
61
|
-
|
|
61
|
+
s = s == null ? s : JSON.stringify(s);
|
|
62
62
|
}
|
|
63
|
-
return
|
|
64
|
-
}, fromAttribute(
|
|
65
|
-
let e =
|
|
63
|
+
return s;
|
|
64
|
+
}, fromAttribute(s, t) {
|
|
65
|
+
let e = s;
|
|
66
66
|
switch (t) {
|
|
67
67
|
case Boolean:
|
|
68
|
-
e =
|
|
68
|
+
e = s !== null;
|
|
69
69
|
break;
|
|
70
70
|
case Number:
|
|
71
|
-
e =
|
|
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(
|
|
76
|
+
e = JSON.parse(s);
|
|
77
77
|
} catch {
|
|
78
78
|
e = null;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
return e;
|
|
82
|
-
} },
|
|
83
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
84
|
-
class
|
|
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
|
|
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,
|
|
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,
|
|
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 =
|
|
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,
|
|
124
|
-
for (const r of
|
|
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 [
|
|
132
|
-
this.elementProperties.set(
|
|
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,
|
|
136
|
-
const r = this._$Eu(e,
|
|
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
|
|
145
|
-
for (const r of
|
|
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
|
|
153
|
-
return
|
|
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
|
|
173
|
-
this.hasOwnProperty(
|
|
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
|
|
184
|
-
return (
|
|
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
|
|
193
|
-
return (
|
|
192
|
+
var i;
|
|
193
|
+
return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
attributeChangedCallback(t, e,
|
|
197
|
-
this._$AK(t,
|
|
196
|
+
attributeChangedCallback(t, e, i) {
|
|
197
|
+
this._$AK(t, i);
|
|
198
198
|
}
|
|
199
199
|
_$EC(t, e) {
|
|
200
200
|
var n;
|
|
201
|
-
const
|
|
202
|
-
if (r !== void 0 &&
|
|
203
|
-
const o = (((n =
|
|
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
|
|
209
|
+
const i = this.constructor, r = i._$Eh.get(t);
|
|
210
210
|
if (r !== void 0 && this._$Em !== r) {
|
|
211
|
-
const o =
|
|
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,
|
|
215
|
+
requestUpdate(t, e, i) {
|
|
216
216
|
if (t !== void 0) {
|
|
217
|
-
if (
|
|
217
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? F)(this[t], e))
|
|
218
218
|
return;
|
|
219
|
-
this.P(t, e,
|
|
219
|
+
this.P(t, e, i);
|
|
220
220
|
}
|
|
221
221
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
222
222
|
}
|
|
223
|
-
P(t, e,
|
|
224
|
-
this._$AL.has(t) || this._$AL.set(t, e),
|
|
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
|
|
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), (
|
|
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((
|
|
270
|
+
(e = this._$EO) == null || e.forEach((i) => {
|
|
271
271
|
var r;
|
|
272
|
-
return (r =
|
|
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
|
-
|
|
295
|
+
A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[C("elementProperties")] = /* @__PURE__ */ new Map(), A[C("finalized")] = /* @__PURE__ */ new Map(), D == null || D({ 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: (
|
|
302
|
-
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, Y = />/g, w = RegExp(`>|${
|
|
303
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, lt = /^(?:script|style|textarea|title)$/i,
|
|
304
|
-
function pt(
|
|
305
|
-
if (!Array.isArray(
|
|
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 = (
|
|
310
|
-
const e =
|
|
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 =
|
|
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
|
|
318
|
-
n += o === P ? a + bt : u >= 0 ? (
|
|
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(
|
|
320
|
+
return [pt(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
|
321
321
|
};
|
|
322
322
|
class R {
|
|
323
|
-
constructor({ strings: t, _$litType$: e },
|
|
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,
|
|
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++],
|
|
338
|
-
a.push({ type: 1, index: n, name:
|
|
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 : j }), 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
|
|
346
|
-
r.append(u[
|
|
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
|
|
363
|
-
return
|
|
362
|
+
const i = S.createElement("template");
|
|
363
|
+
return i.innerHTML = t, i;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function E(
|
|
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 =
|
|
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(
|
|
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:
|
|
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 =
|
|
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 =
|
|
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 =
|
|
395
|
+
return b.currentNode = S, r;
|
|
396
396
|
}
|
|
397
397
|
p(t) {
|
|
398
398
|
let e = 0;
|
|
399
|
-
for (const
|
|
400
|
-
|
|
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,
|
|
409
|
-
this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM =
|
|
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) :
|
|
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(
|
|
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$:
|
|
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
|
|
451
|
+
let i, r = 0;
|
|
452
452
|
for (const n of t)
|
|
453
|
-
r === e.length ? e.push(
|
|
454
|
-
r < e.length && (this._$AR(
|
|
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
|
|
458
|
-
for ((
|
|
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
|
}
|
|
@@ -465,17 +465,17 @@ class N {
|
|
|
465
465
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
class
|
|
468
|
+
class j {
|
|
469
469
|
get tagName() {
|
|
470
470
|
return this.element.tagName;
|
|
471
471
|
}
|
|
472
472
|
get _$AU() {
|
|
473
473
|
return this._$AM._$AU;
|
|
474
474
|
}
|
|
475
|
-
constructor(t, e,
|
|
476
|
-
this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n,
|
|
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,
|
|
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[
|
|
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
|
}
|
|
@@ -492,7 +492,7 @@ class D {
|
|
|
492
492
|
t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
class Pt extends
|
|
495
|
+
class Pt extends j {
|
|
496
496
|
constructor() {
|
|
497
497
|
super(...arguments), this.type = 3;
|
|
498
498
|
}
|
|
@@ -500,7 +500,7 @@ class Pt extends D {
|
|
|
500
500
|
this.element[this.name] = t === y ? void 0 : t;
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
class Ct extends
|
|
503
|
+
class Ct extends j {
|
|
504
504
|
constructor() {
|
|
505
505
|
super(...arguments), this.type = 4;
|
|
506
506
|
}
|
|
@@ -508,15 +508,15 @@ class Ct extends D {
|
|
|
508
508
|
this.element.toggleAttribute(this.name, !!t && t !== y);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
class Mt extends
|
|
512
|
-
constructor(t, e,
|
|
513
|
-
super(t, e,
|
|
511
|
+
class Mt extends j {
|
|
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
|
|
519
|
-
r && this.element.removeEventListener(this.name, this,
|
|
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,
|
|
528
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
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 = (
|
|
540
|
-
const
|
|
541
|
-
let r =
|
|
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
|
-
|
|
544
|
+
i._$litPart$ = r = new N(t.insertBefore(x(), n), n, void 0, e ?? {});
|
|
545
545
|
}
|
|
546
|
-
return r._$AI(
|
|
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
|
|
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
|
|
581
|
-
|
|
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 = (
|
|
588
|
+
const Ot = (s) => (t, e) => {
|
|
589
589
|
e !== void 0 ? e.addInitializer(() => {
|
|
590
|
-
customElements.define(
|
|
591
|
-
}) : customElements.define(
|
|
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:
|
|
599
|
-
const { kind:
|
|
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,
|
|
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,
|
|
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,
|
|
607
|
+
return c !== void 0 && this.P(o, void 0, s), c;
|
|
608
608
|
} };
|
|
609
609
|
}
|
|
610
|
-
if (
|
|
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,
|
|
614
|
+
t.call(this, c), this.requestUpdate(o, a, s);
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
|
-
throw Error("Unsupported decorator location: " +
|
|
617
|
+
throw Error("Unsupported decorator location: " + i);
|
|
618
618
|
};
|
|
619
|
-
function p(
|
|
620
|
-
return (t, e) => typeof e == "object" ? Nt(
|
|
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 ? { ...
|
|
623
|
-
})(
|
|
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
|
|
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,86 @@ const Tt = [
|
|
|
654
656
|
"start-frame",
|
|
655
657
|
"tone-mapping",
|
|
656
658
|
"zoom-type"
|
|
657
|
-
],
|
|
659
|
+
], Tt = (s) => s.replace(/([-_]\w)/g, (t) => t[1].toUpperCase()), Ht = (s) => {
|
|
660
|
+
const t = Tt(s);
|
|
661
|
+
return t.includes("showAr") ? t.replace("showAr", "showAR") : t;
|
|
662
|
+
}, It = (s) => {
|
|
658
663
|
let t = new URLSearchParams();
|
|
659
|
-
return
|
|
660
|
-
if (
|
|
661
|
-
let
|
|
662
|
-
if (!
|
|
664
|
+
return kt.forEach((e) => {
|
|
665
|
+
if (s.hasAttribute(e)) {
|
|
666
|
+
let i = s.getAttribute(e);
|
|
667
|
+
if (!i)
|
|
663
668
|
return;
|
|
664
|
-
|
|
669
|
+
i === "yes" && (i = "true"), i === "no" && (i = "false"), t.append(Ht(e), i);
|
|
665
670
|
}
|
|
666
671
|
}), t;
|
|
667
672
|
};
|
|
668
|
-
var
|
|
669
|
-
for (var r =
|
|
670
|
-
(o =
|
|
671
|
-
return
|
|
673
|
+
var Lt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, l = (s, t, e, i) => {
|
|
674
|
+
for (var r = i > 1 ? void 0 : i ? jt(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
|
675
|
+
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
|
676
|
+
return i && r && Lt(t, e, r), r;
|
|
672
677
|
};
|
|
673
|
-
const Dt = "{host}{viewer}/by_scene_id/{scene_id}", zt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}",
|
|
674
|
-
function
|
|
678
|
+
const Dt = "{host}{viewer}/by_scene_id/{scene_id}", zt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}", Bt = "{host}{viewer}/by_product_id/{customer_id}/{sku}", qt = "{host}{viewer}/by_hash/{customer_id}/{hash}";
|
|
679
|
+
function T(s, t) {
|
|
675
680
|
var e = new RegExp(Object.keys(t).join("|"), "gi");
|
|
676
|
-
return
|
|
677
|
-
return t[
|
|
681
|
+
return s.replace(e, function(i) {
|
|
682
|
+
return t[i.toLowerCase()];
|
|
678
683
|
});
|
|
679
684
|
}
|
|
680
685
|
let h = class extends U {
|
|
681
686
|
constructor() {
|
|
682
|
-
super(...arguments), this.customerId = void 0, this.viewer = "realtime", this.host = "https://configurator.v2.londondynamics.com", this.getCurrentSelection = (
|
|
687
|
+
super(...arguments), this.customerId = void 0, this.viewer = "realtime", this.host = "https://configurator.v2.londondynamics.com", this.defaultSelection = {}, this.getCurrentSelection = (s) => this._pingpongPostMessage(
|
|
683
688
|
{
|
|
684
689
|
type: "currentValues"
|
|
685
690
|
},
|
|
686
|
-
|
|
687
|
-
), this._emit = (
|
|
691
|
+
s
|
|
692
|
+
), this._emit = (s, t) => {
|
|
688
693
|
this.dispatchEvent(
|
|
689
|
-
new CustomEvent(
|
|
694
|
+
new CustomEvent(s, {
|
|
690
695
|
detail: t,
|
|
691
696
|
bubbles: !0,
|
|
692
697
|
composed: !0
|
|
693
698
|
})
|
|
694
699
|
);
|
|
695
|
-
}, this._pingpongPostMessage = (
|
|
700
|
+
}, this._pingpongPostMessage = (s, t) => new Promise((e, i) => {
|
|
696
701
|
var c, a;
|
|
697
|
-
const r = { ...
|
|
702
|
+
const r = { ...s, messageId: Date.now() }, n = (d) => {
|
|
698
703
|
if (d.origin === this.host && d.data.messageId === r.messageId && d.data.type === r.type) {
|
|
699
704
|
try {
|
|
700
705
|
t ? t(JSON.parse(d.data.result)) : e(JSON.parse(d.data.result));
|
|
701
706
|
} catch (g) {
|
|
702
|
-
g instanceof Error ? t ? t({}, g.message) :
|
|
707
|
+
g instanceof Error ? t ? t({}, g.message) : i(g.message) : t ? t({}, "Unknown error") : i("Unknown error");
|
|
703
708
|
}
|
|
704
709
|
window.removeEventListener("message", n);
|
|
705
710
|
}
|
|
706
711
|
}, o = (c = this.shadowRoot) == null ? void 0 : c.querySelector("iframe");
|
|
707
712
|
o && (window.addEventListener("message", n), (a = o.contentWindow) == null || a.postMessage(r, "*"));
|
|
708
|
-
}), this._handleMessage = (
|
|
713
|
+
}), this._handleMessage = (s) => {
|
|
709
714
|
var t;
|
|
710
|
-
if (
|
|
711
|
-
switch (
|
|
715
|
+
if (s.origin === this.host && (t = s == null ? void 0 : s.data) != null && t.type)
|
|
716
|
+
switch (s.data.type) {
|
|
712
717
|
case "ready":
|
|
713
718
|
this._emit("ready", {
|
|
714
|
-
options: JSON.parse(
|
|
715
|
-
presets: JSON.parse(
|
|
716
|
-
scene: JSON.parse(
|
|
719
|
+
options: JSON.parse(s.data.options),
|
|
720
|
+
presets: JSON.parse(s.data.presets),
|
|
721
|
+
scene: JSON.parse(s.data.scene)
|
|
717
722
|
});
|
|
718
723
|
break;
|
|
719
724
|
case "load":
|
|
720
|
-
this._emit("load", JSON.parse(
|
|
725
|
+
this._emit("load", JSON.parse(s.data.values));
|
|
721
726
|
break;
|
|
722
727
|
case "error":
|
|
723
|
-
this._emit("error", JSON.parse(
|
|
728
|
+
this._emit("error", JSON.parse(s.data.values));
|
|
724
729
|
break;
|
|
725
730
|
case "change":
|
|
726
|
-
this._emit("change", JSON.parse(
|
|
731
|
+
this._emit("change", JSON.parse(s.data.values));
|
|
727
732
|
break;
|
|
728
733
|
case "cameraChange":
|
|
729
|
-
this._emit("camerachange", JSON.parse(
|
|
734
|
+
this._emit("camerachange", JSON.parse(s.data.values));
|
|
730
735
|
break;
|
|
731
736
|
case "log":
|
|
732
|
-
const { logType: e, logData:
|
|
733
|
-
this._emit(e, JSON.parse(
|
|
737
|
+
const { logType: e, logData: i } = s.data;
|
|
738
|
+
this._emit(e, JSON.parse(i));
|
|
734
739
|
break;
|
|
735
740
|
}
|
|
736
741
|
};
|
|
@@ -742,12 +747,12 @@ let h = class extends U {
|
|
|
742
747
|
* @example getCurrentConfiguration((values, err) => {})
|
|
743
748
|
* @returns {Promise<any>}
|
|
744
749
|
*/
|
|
745
|
-
getCurrentConfiguration(
|
|
750
|
+
getCurrentConfiguration(s) {
|
|
746
751
|
return this._pingpongPostMessage(
|
|
747
752
|
{
|
|
748
753
|
type: "currentConfig"
|
|
749
754
|
},
|
|
750
|
-
|
|
755
|
+
s
|
|
751
756
|
);
|
|
752
757
|
}
|
|
753
758
|
/**
|
|
@@ -757,12 +762,12 @@ let h = class extends U {
|
|
|
757
762
|
* @example getCurrentScene((values, err) => {})
|
|
758
763
|
* @returns {Promise<any>}
|
|
759
764
|
*/
|
|
760
|
-
getCurrentScene(
|
|
765
|
+
getCurrentScene(s) {
|
|
761
766
|
return this._pingpongPostMessage(
|
|
762
767
|
{
|
|
763
768
|
type: "currentScene"
|
|
764
769
|
},
|
|
765
|
-
|
|
770
|
+
s
|
|
766
771
|
);
|
|
767
772
|
}
|
|
768
773
|
/**
|
|
@@ -772,12 +777,12 @@ let h = class extends U {
|
|
|
772
777
|
* @example getCurrentHash((hash, err) => {})
|
|
773
778
|
* @returns {Promise<any>}
|
|
774
779
|
*/
|
|
775
|
-
getCurrentHash(
|
|
780
|
+
getCurrentHash(s) {
|
|
776
781
|
return this._pingpongPostMessage(
|
|
777
782
|
{
|
|
778
783
|
type: "currentHash"
|
|
779
784
|
},
|
|
780
|
-
|
|
785
|
+
s
|
|
781
786
|
);
|
|
782
787
|
}
|
|
783
788
|
/**
|
|
@@ -787,12 +792,12 @@ let h = class extends U {
|
|
|
787
792
|
* @example getCurrentSource((values, err) => {})
|
|
788
793
|
* @returns {Promise<any>}
|
|
789
794
|
*/
|
|
790
|
-
getCurrentSource(
|
|
795
|
+
getCurrentSource(s) {
|
|
791
796
|
return this._pingpongPostMessage(
|
|
792
797
|
{
|
|
793
798
|
type: "currentSource"
|
|
794
799
|
},
|
|
795
|
-
|
|
800
|
+
s
|
|
796
801
|
);
|
|
797
802
|
}
|
|
798
803
|
/**
|
|
@@ -802,12 +807,12 @@ let h = class extends U {
|
|
|
802
807
|
* @example getCurrentARSource((values, err) => {})
|
|
803
808
|
* @returns {Promise<any>}
|
|
804
809
|
*/
|
|
805
|
-
getCurrentARSource(
|
|
810
|
+
getCurrentARSource(s) {
|
|
806
811
|
return this._pingpongPostMessage(
|
|
807
812
|
{
|
|
808
813
|
type: "currentARSource"
|
|
809
814
|
},
|
|
810
|
-
|
|
815
|
+
s
|
|
811
816
|
);
|
|
812
817
|
}
|
|
813
818
|
/**
|
|
@@ -817,12 +822,12 @@ let h = class extends U {
|
|
|
817
822
|
* @example getDataURL((dataURL, err) => {})
|
|
818
823
|
* @returns {Promise<any>}
|
|
819
824
|
*/
|
|
820
|
-
getDataURL(
|
|
825
|
+
getDataURL(s) {
|
|
821
826
|
return this._pingpongPostMessage(
|
|
822
827
|
{
|
|
823
828
|
type: "dataURL"
|
|
824
829
|
},
|
|
825
|
-
|
|
830
|
+
s
|
|
826
831
|
);
|
|
827
832
|
}
|
|
828
833
|
/**
|
|
@@ -835,11 +840,11 @@ let h = class extends U {
|
|
|
835
840
|
* @example const { index, src } = await getFrame(0, { zoom: 2 })
|
|
836
841
|
* @returns {Promise<any>}
|
|
837
842
|
*/
|
|
838
|
-
getFrame(
|
|
843
|
+
getFrame(s, t, e) {
|
|
839
844
|
return this._pingpongPostMessage(
|
|
840
845
|
{
|
|
841
846
|
type: "getFrame",
|
|
842
|
-
index:
|
|
847
|
+
index: s,
|
|
843
848
|
options: t
|
|
844
849
|
},
|
|
845
850
|
e
|
|
@@ -852,10 +857,10 @@ let h = class extends U {
|
|
|
852
857
|
* @param {string} value
|
|
853
858
|
* @returns {void}
|
|
854
859
|
*/
|
|
855
|
-
setFeature(
|
|
860
|
+
setFeature(s, t) {
|
|
856
861
|
this._postMessage({
|
|
857
862
|
type: "setFeature",
|
|
858
|
-
featureId:
|
|
863
|
+
featureId: s,
|
|
859
864
|
variantId: t,
|
|
860
865
|
allowPartialMatch: this.allowPartialMatch
|
|
861
866
|
});
|
|
@@ -867,23 +872,23 @@ let h = class extends U {
|
|
|
867
872
|
* @param {boolean} resetBeforeUpdate (optional) - resets the configuration before updating
|
|
868
873
|
* @returns {void}
|
|
869
874
|
*/
|
|
870
|
-
setSelection(
|
|
875
|
+
setSelection(s, t) {
|
|
871
876
|
this._postMessage({
|
|
872
877
|
type: "setSelection",
|
|
873
|
-
selection:
|
|
878
|
+
selection: s,
|
|
874
879
|
resetBeforeUpdate: t,
|
|
875
880
|
allowPartialMatch: this.allowPartialMatch
|
|
876
881
|
});
|
|
877
882
|
}
|
|
878
883
|
/**
|
|
879
|
-
* Selects
|
|
880
|
-
* @param {string}
|
|
884
|
+
* Selects context by id
|
|
885
|
+
* @param {string} contextId
|
|
881
886
|
* @returns {void}
|
|
882
887
|
*/
|
|
883
|
-
|
|
888
|
+
setContext(s) {
|
|
884
889
|
this._postMessage({
|
|
885
890
|
type: "setPreset",
|
|
886
|
-
presetId:
|
|
891
|
+
presetId: s
|
|
887
892
|
});
|
|
888
893
|
}
|
|
889
894
|
/**
|
|
@@ -904,10 +909,10 @@ let h = class extends U {
|
|
|
904
909
|
* @param {boolean} state (optional)
|
|
905
910
|
* @returns {void}
|
|
906
911
|
*/
|
|
907
|
-
toggleLights(
|
|
912
|
+
toggleLights(s) {
|
|
908
913
|
this._postMessage({
|
|
909
914
|
type: "toggleLights",
|
|
910
|
-
value:
|
|
915
|
+
value: s
|
|
911
916
|
});
|
|
912
917
|
}
|
|
913
918
|
/**
|
|
@@ -917,10 +922,10 @@ let h = class extends U {
|
|
|
917
922
|
* @param {string} optionGroupId
|
|
918
923
|
* @returns {void}
|
|
919
924
|
*/
|
|
920
|
-
toggleGroup(
|
|
925
|
+
toggleGroup(s) {
|
|
921
926
|
this._postMessage({
|
|
922
927
|
type: "toggleGroup",
|
|
923
|
-
value:
|
|
928
|
+
value: s
|
|
924
929
|
});
|
|
925
930
|
}
|
|
926
931
|
/**
|
|
@@ -930,10 +935,10 @@ let h = class extends U {
|
|
|
930
935
|
* @param {string} optionGroupId
|
|
931
936
|
* @returns {void}
|
|
932
937
|
*/
|
|
933
|
-
toggleHotspot(
|
|
938
|
+
toggleHotspot(s) {
|
|
934
939
|
this._postMessage({
|
|
935
940
|
type: "toggleGroup",
|
|
936
|
-
groupId:
|
|
941
|
+
groupId: s
|
|
937
942
|
});
|
|
938
943
|
}
|
|
939
944
|
/**
|
|
@@ -944,10 +949,10 @@ let h = class extends U {
|
|
|
944
949
|
* @param {string} angularUnit "deg" or "rad"
|
|
945
950
|
* @returns {void}
|
|
946
951
|
*/
|
|
947
|
-
setRotation(
|
|
952
|
+
setRotation(s = [0, 0, 0], t = "deg") {
|
|
948
953
|
this._postMessage({
|
|
949
954
|
type: "setRotation",
|
|
950
|
-
rotation:
|
|
955
|
+
rotation: s,
|
|
951
956
|
angularUnit: t
|
|
952
957
|
});
|
|
953
958
|
}
|
|
@@ -958,47 +963,62 @@ let h = class extends U {
|
|
|
958
963
|
* @param {string} target
|
|
959
964
|
* @returns {void}
|
|
960
965
|
*/
|
|
961
|
-
setCamera(
|
|
966
|
+
setCamera(s = {}, t = {}) {
|
|
962
967
|
this._postMessage({
|
|
963
968
|
type: "setCamera",
|
|
964
|
-
...
|
|
969
|
+
...s,
|
|
965
970
|
...t
|
|
966
971
|
});
|
|
967
972
|
}
|
|
968
|
-
_postMessage(
|
|
969
|
-
var e,
|
|
973
|
+
_postMessage(s) {
|
|
974
|
+
var e, i;
|
|
970
975
|
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("iframe");
|
|
971
|
-
t && ((
|
|
976
|
+
t && ((i = t.contentWindow) == null || i.postMessage(s, "*"));
|
|
972
977
|
}
|
|
973
978
|
connectedCallback() {
|
|
974
|
-
super.connectedCallback()
|
|
979
|
+
super.connectedCallback();
|
|
980
|
+
const s = this.querySelector('script[type="application/json"]');
|
|
981
|
+
if (s && s.textContent)
|
|
982
|
+
try {
|
|
983
|
+
this.defaultSelection = JSON.parse(s.textContent);
|
|
984
|
+
} catch (t) {
|
|
985
|
+
typeof t == "object" && t instanceof Error ? console.warn(
|
|
986
|
+
`Error parsing selection: ${t.message}. Using default selection instead.`
|
|
987
|
+
) : console.warn(
|
|
988
|
+
"Error parsing selection. Using default selection instead."
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
window.addEventListener("message", this._handleMessage);
|
|
975
992
|
}
|
|
976
993
|
disconnectedCallback() {
|
|
977
994
|
window.removeEventListener("message", this._handleMessage), super.disconnectedCallback();
|
|
978
995
|
}
|
|
979
996
|
render() {
|
|
980
|
-
let
|
|
981
|
-
|
|
997
|
+
let s = null, t = null;
|
|
998
|
+
if (console.log("this.defaultSelection?", this.defaultSelection), this.host ? this.customerId ? this.hash ? t = T(qt, {
|
|
982
999
|
"{viewer}": "",
|
|
983
1000
|
"{host}": this.host,
|
|
984
1001
|
"{customer_id}": this.customerId,
|
|
985
1002
|
"{hash}": this.hash
|
|
986
|
-
}) : this.sceneId ? t =
|
|
1003
|
+
}) : this.sceneId ? t = T(Dt, {
|
|
987
1004
|
"{viewer}": this.viewer === "360" ? "/360" : "",
|
|
988
1005
|
"{host}": this.host,
|
|
989
1006
|
"{customer_id}": this.customerId,
|
|
990
1007
|
"{scene_id}": this.sceneId
|
|
991
|
-
}) : this.sku ? t =
|
|
1008
|
+
}) : this.sku ? t = T(Bt, {
|
|
992
1009
|
"{viewer}": this.viewer === "360" ? "/360" : "",
|
|
993
1010
|
"{host}": this.host,
|
|
994
1011
|
"{customer_id}": this.customerId,
|
|
995
1012
|
"{sku}": this.sku
|
|
996
|
-
}) : this.productId ? t =
|
|
1013
|
+
}) : this.productId ? t = T(zt, {
|
|
997
1014
|
"{viewer}": this.viewer === "360" ? "/360" : "",
|
|
998
1015
|
"{host}": this.host,
|
|
999
1016
|
"{customer_id}": this.customerId,
|
|
1000
1017
|
"{product_id}": this.productId
|
|
1001
|
-
}) :
|
|
1018
|
+
}) : s = "Missing property: sku, scene-id, or hash" : s = "Missing property: customer-id" : s = "Missing property: host", s)
|
|
1019
|
+
return st`<div>${s}</div>`;
|
|
1020
|
+
let e = "";
|
|
1021
|
+
return Object.keys(this.defaultSelection).length > 0 && (e += new URLSearchParams(this.defaultSelection).toString()), this.hasAttributes() && (Object.keys(this.defaultSelection).length > 0 && (e += "&"), e += It(this)), e.length && (t += "?" + e), st`<iframe
|
|
1002
1022
|
src="${t}"
|
|
1003
1023
|
width="100%"
|
|
1004
1024
|
height="100%"
|
|
@@ -1012,7 +1032,7 @@ let h = class extends U {
|
|
|
1012
1032
|
sandbox="allow-pointer-lock allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads"
|
|
1013
1033
|
>
|
|
1014
1034
|
Unfortunately, your browser does not support iFrames.
|
|
1015
|
-
</iframe
|
|
1035
|
+
</iframe>`;
|
|
1016
1036
|
}
|
|
1017
1037
|
};
|
|
1018
1038
|
h.styles = dt`
|
|
@@ -1053,17 +1073,23 @@ l([
|
|
|
1053
1073
|
p({ type: String, attribute: "background-color" })
|
|
1054
1074
|
], h.prototype, "backgroundColor", 2);
|
|
1055
1075
|
l([
|
|
1056
|
-
p({ type: String, attribute: "
|
|
1057
|
-
], h.prototype, "
|
|
1076
|
+
p({ type: String, attribute: "disable-retries" })
|
|
1077
|
+
], h.prototype, "disableRetries", 2);
|
|
1058
1078
|
l([
|
|
1059
1079
|
p({ type: String, attribute: "disable-scroll-wheel" })
|
|
1060
1080
|
], h.prototype, "disableScrollWheel", 2);
|
|
1081
|
+
l([
|
|
1082
|
+
p({ type: String, attribute: "enable-darkmode" })
|
|
1083
|
+
], h.prototype, "enableDarkMode", 2);
|
|
1061
1084
|
l([
|
|
1062
1085
|
p({ type: String, attribute: "interaction-prompt-style" })
|
|
1063
1086
|
], h.prototype, "interactionPromptStyle", 2);
|
|
1064
1087
|
l([
|
|
1065
1088
|
p({ type: String, attribute: "lights" })
|
|
1066
1089
|
], h.prototype, "lights", 2);
|
|
1090
|
+
l([
|
|
1091
|
+
p({ type: String, attribute: "qr-url-pattern" })
|
|
1092
|
+
], h.prototype, "qrUrlPattern", 2);
|
|
1067
1093
|
l([
|
|
1068
1094
|
p({ type: String, attribute: "rotation" })
|
|
1069
1095
|
], h.prototype, "rotation", 2);
|