@roomle/embedding-lib 5.28.0-alpha.1 → 5.28.0-alpha.3
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/docs/md/web/embedding/CHANGELOG.md +2 -19
- package/package.json +1 -1
- package/packages/embedding-lib/src/embedding-lib.d.ts +7 -0
- package/packages/web-sdk/packages/homag-intelligence/src/callbacks.d.ts +1 -1
- package/packages/web-sdk/packages/homag-intelligence/src/emulator.d.ts +3 -3
- package/packages/web-sdk/packages/homag-intelligence/src/homag-intelligence.d.ts +4 -2
- package/packages/web-sdk/packages/homag-intelligence/src/loader.d.ts +2 -4
- package/packages/web-sdk/packages/planner-core/src/external-object-api-callbacks.d.ts +10 -9
- package/packages/web-sdk/packages/planner-core/src/roomle-planner-ui-callback.d.ts +2 -2
- package/packages/web-sdk/packages/planner-core/src/services/planner-kernel-access.d.ts +2 -2
- package/roomle-embedding-lib.es.js +508 -253
- package/roomle-embedding-lib.es.min.js +1 -1
- package/roomle-embedding-lib.umd.js +21 -17
- package/roomle-embedding-lib.umd.min.js +1 -1
|
@@ -1,125 +1,372 @@
|
|
|
1
|
-
class
|
|
1
|
+
class H {
|
|
2
2
|
_side;
|
|
3
3
|
// for better debugging (who handles message? iframe or website?)
|
|
4
4
|
_incomingMessageBus = null;
|
|
5
5
|
_outgoingMessageBus = null;
|
|
6
6
|
_execMessage = null;
|
|
7
|
-
constructor(
|
|
8
|
-
this._side =
|
|
7
|
+
constructor(t, s, r, n) {
|
|
8
|
+
this._side = t, this._incomingMessageBus = s, this._outgoingMessageBus = r, this._execMessage = n, this._incomingMessageBus && this._incomingMessageBus.addEventListener(
|
|
9
9
|
"message",
|
|
10
10
|
this._handleMessage.bind(this)
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
setOutgoingMessageBus(
|
|
14
|
-
this._outgoingMessageBus =
|
|
13
|
+
setOutgoingMessageBus(t) {
|
|
14
|
+
this._outgoingMessageBus = t;
|
|
15
15
|
}
|
|
16
|
-
setMessageExecution(
|
|
17
|
-
this._execMessage =
|
|
16
|
+
setMessageExecution(t) {
|
|
17
|
+
this._execMessage = t;
|
|
18
18
|
}
|
|
19
|
-
sendMessage(
|
|
20
|
-
return new Promise((r,
|
|
19
|
+
sendMessage(t, s = []) {
|
|
20
|
+
return new Promise((r, n) => {
|
|
21
21
|
if (this._incomingMessageBus === this._outgoingMessageBus)
|
|
22
22
|
return r(void 0);
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
if (!
|
|
26
|
-
return
|
|
23
|
+
const o = new MessageChannel();
|
|
24
|
+
o.port1.onmessage = (i) => {
|
|
25
|
+
if (!i || !i.data)
|
|
26
|
+
return o.port1.close(), o.port2.close(), n(
|
|
27
27
|
new Error(
|
|
28
28
|
this._side + " received message but response can not be interpreted"
|
|
29
29
|
)
|
|
30
30
|
);
|
|
31
|
-
let
|
|
31
|
+
let c;
|
|
32
32
|
try {
|
|
33
|
-
|
|
34
|
-
} catch (
|
|
35
|
-
return
|
|
33
|
+
c = JSON.parse(i.data);
|
|
34
|
+
} catch (l) {
|
|
35
|
+
return o.port1.close(), o.port2.close(), this._prepareError(l), n(l);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
c.error ? n(c.error) : c.result !== void 0 ? r(c.result) : r(void 0), o.port1.close(), o.port2.close();
|
|
38
38
|
};
|
|
39
39
|
let a = "";
|
|
40
40
|
try {
|
|
41
|
-
a = JSON.stringify({ message:
|
|
41
|
+
a = JSON.stringify({ message: t, args: s });
|
|
42
42
|
} catch {
|
|
43
|
-
return
|
|
43
|
+
return n(
|
|
44
44
|
new Error(
|
|
45
45
|
this._side + ": can not create command because it is not JSON.stringify able"
|
|
46
46
|
)
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
if (!this._outgoingMessageBus)
|
|
50
|
-
return
|
|
50
|
+
return n(new Error(this._side + ": outgoing bus not set yet"));
|
|
51
51
|
this._outgoingMessageBus.postMessage(a, "*", [
|
|
52
|
-
|
|
52
|
+
o.port2
|
|
53
53
|
]);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
_handleMessage(
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
56
|
+
_handleMessage(t) {
|
|
57
|
+
const s = t.ports && Array.isArray(t.ports) && t.ports.length > 0 ? t.ports[0] : null;
|
|
58
|
+
if (t.data && s)
|
|
59
59
|
try {
|
|
60
|
-
const r = JSON.parse(
|
|
60
|
+
const r = JSON.parse(t.data);
|
|
61
61
|
if (!this._execMessage)
|
|
62
|
-
return
|
|
62
|
+
return s.postMessage(
|
|
63
63
|
JSON.stringify({
|
|
64
64
|
error: this._side + " is not ready to handle messages"
|
|
65
65
|
})
|
|
66
66
|
);
|
|
67
67
|
Array.isArray(r.args) || (r.args = [r.args]);
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
68
|
+
const n = this._execMessage(r, t);
|
|
69
|
+
if (n === void 0)
|
|
70
70
|
return;
|
|
71
|
-
|
|
72
|
-
(
|
|
73
|
-
let a,
|
|
74
|
-
typeof
|
|
71
|
+
n.then(
|
|
72
|
+
(o = {}) => {
|
|
73
|
+
let a, i;
|
|
74
|
+
typeof o == "object" && o !== null && (a = o.error, i = o.result), a ? s.postMessage(
|
|
75
75
|
JSON.stringify({ error: a })
|
|
76
|
-
) :
|
|
77
|
-
JSON.stringify({ result: n })
|
|
78
|
-
) : t.postMessage(
|
|
76
|
+
) : i !== void 0 ? s.postMessage(
|
|
79
77
|
JSON.stringify({ result: i })
|
|
78
|
+
) : s.postMessage(
|
|
79
|
+
JSON.stringify({ result: o })
|
|
80
80
|
);
|
|
81
81
|
},
|
|
82
|
-
(
|
|
83
|
-
|
|
82
|
+
(o) => {
|
|
83
|
+
s.postMessage(
|
|
84
84
|
JSON.stringify({
|
|
85
|
-
error: this._prepareError(
|
|
85
|
+
error: this._prepareError(o)
|
|
86
86
|
})
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
);
|
|
90
90
|
} catch (r) {
|
|
91
|
-
|
|
91
|
+
s.postMessage(
|
|
92
92
|
JSON.stringify({
|
|
93
93
|
error: this._prepareError(r)
|
|
94
94
|
})
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
_prepareError(
|
|
99
|
-
if (typeof
|
|
100
|
-
const
|
|
101
|
-
return console.error(
|
|
98
|
+
_prepareError(t) {
|
|
99
|
+
if (typeof t == "string") {
|
|
100
|
+
const s = this._side + ": " + t;
|
|
101
|
+
return console.error(s), s;
|
|
102
102
|
}
|
|
103
|
-
return
|
|
103
|
+
return t.message = this._side + ": " + t.message, console.error(t), t.message;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
/**
|
|
107
|
+
* @license
|
|
108
|
+
* Copyright 2019 Google LLC
|
|
109
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
110
|
+
*/
|
|
111
|
+
const W = Symbol("Comlink.proxy"), X = Symbol("Comlink.endpoint"), j = Symbol("Comlink.releaseProxy"), M = Symbol("Comlink.finalizer"), w = Symbol("Comlink.thrown"), G = (e) => typeof e == "object" && e !== null || typeof e == "function", Z = {
|
|
112
|
+
canHandle: (e) => G(e) && e[W],
|
|
113
|
+
serialize(e) {
|
|
114
|
+
const { port1: t, port2: s } = new MessageChannel();
|
|
115
|
+
return L(e, t), [s, [s]];
|
|
116
|
+
},
|
|
117
|
+
deserialize(e) {
|
|
118
|
+
return e.start(), re(e);
|
|
119
|
+
}
|
|
120
|
+
}, ee = {
|
|
121
|
+
canHandle: (e) => G(e) && w in e,
|
|
122
|
+
serialize({ value: e }) {
|
|
123
|
+
let t;
|
|
124
|
+
return e instanceof Error ? t = {
|
|
125
|
+
isError: !0,
|
|
126
|
+
value: {
|
|
127
|
+
message: e.message,
|
|
128
|
+
name: e.name,
|
|
129
|
+
stack: e.stack
|
|
130
|
+
}
|
|
131
|
+
} : t = { isError: !1, value: e }, [t, []];
|
|
132
|
+
},
|
|
133
|
+
deserialize(e) {
|
|
134
|
+
throw e.isError ? Object.assign(new Error(e.value.message), e.value) : e.value;
|
|
135
|
+
}
|
|
136
|
+
}, z = /* @__PURE__ */ new Map([
|
|
137
|
+
["proxy", Z],
|
|
138
|
+
["throw", ee]
|
|
139
|
+
]);
|
|
140
|
+
function te(e, t) {
|
|
141
|
+
for (const s of e)
|
|
142
|
+
if (t === s || s === "*" || s instanceof RegExp && s.test(t))
|
|
143
|
+
return !0;
|
|
144
|
+
return !1;
|
|
145
|
+
}
|
|
146
|
+
function L(e, t = globalThis, s = ["*"]) {
|
|
147
|
+
t.addEventListener("message", function r(n) {
|
|
148
|
+
if (!n || !n.data)
|
|
149
|
+
return;
|
|
150
|
+
if (!te(s, n.origin)) {
|
|
151
|
+
console.warn(`Invalid origin '${n.origin}' for comlink proxy`);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const { id: o, type: a, path: i } = Object.assign({ path: [] }, n.data), c = (n.data.argumentList || []).map(m);
|
|
155
|
+
let l;
|
|
156
|
+
try {
|
|
157
|
+
const u = i.slice(0, -1).reduce((d, h) => d[h], e), g = i.reduce((d, h) => d[h], e);
|
|
158
|
+
switch (a) {
|
|
159
|
+
case "GET":
|
|
160
|
+
l = g;
|
|
161
|
+
break;
|
|
162
|
+
case "SET":
|
|
163
|
+
u[i.slice(-1)[0]] = m(n.data.value), l = !0;
|
|
164
|
+
break;
|
|
165
|
+
case "APPLY":
|
|
166
|
+
l = g.apply(u, c);
|
|
167
|
+
break;
|
|
168
|
+
case "CONSTRUCT":
|
|
169
|
+
{
|
|
170
|
+
const d = new g(...c);
|
|
171
|
+
l = ce(d);
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
case "ENDPOINT":
|
|
175
|
+
{
|
|
176
|
+
const { port1: d, port2: h } = new MessageChannel();
|
|
177
|
+
L(e, h), l = ae(d, [d]);
|
|
178
|
+
}
|
|
179
|
+
break;
|
|
180
|
+
case "RELEASE":
|
|
181
|
+
l = void 0;
|
|
182
|
+
break;
|
|
183
|
+
default:
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
} catch (u) {
|
|
187
|
+
l = { value: u, [w]: 0 };
|
|
188
|
+
}
|
|
189
|
+
Promise.resolve(l).catch((u) => ({ value: u, [w]: 0 })).then((u) => {
|
|
190
|
+
const [g, d] = S(u);
|
|
191
|
+
t.postMessage(Object.assign(Object.assign({}, g), { id: o }), d), a === "RELEASE" && (t.removeEventListener("message", r), V(t), M in e && typeof e[M] == "function" && e[M]());
|
|
192
|
+
}).catch((u) => {
|
|
193
|
+
const [g, d] = S({
|
|
194
|
+
value: new TypeError("Unserializable return value"),
|
|
195
|
+
[w]: 0
|
|
196
|
+
});
|
|
197
|
+
t.postMessage(Object.assign(Object.assign({}, g), { id: o }), d);
|
|
198
|
+
});
|
|
199
|
+
}), t.start && t.start();
|
|
200
|
+
}
|
|
201
|
+
function se(e) {
|
|
202
|
+
return e.constructor.name === "MessagePort";
|
|
203
|
+
}
|
|
204
|
+
function V(e) {
|
|
205
|
+
se(e) && e.close();
|
|
206
|
+
}
|
|
207
|
+
function re(e, t) {
|
|
208
|
+
const s = /* @__PURE__ */ new Map();
|
|
209
|
+
return e.addEventListener("message", function(n) {
|
|
210
|
+
const { data: o } = n;
|
|
211
|
+
if (!o || !o.id)
|
|
212
|
+
return;
|
|
213
|
+
const a = s.get(o.id);
|
|
214
|
+
if (a)
|
|
215
|
+
try {
|
|
216
|
+
a(o);
|
|
217
|
+
} finally {
|
|
218
|
+
s.delete(o.id);
|
|
219
|
+
}
|
|
220
|
+
}), b(e, s, [], t);
|
|
221
|
+
}
|
|
222
|
+
function _(e) {
|
|
223
|
+
if (e)
|
|
224
|
+
throw new Error("Proxy has been released and is not useable");
|
|
225
|
+
}
|
|
226
|
+
function J(e) {
|
|
227
|
+
return p(e, /* @__PURE__ */ new Map(), {
|
|
228
|
+
type: "RELEASE"
|
|
229
|
+
}).then(() => {
|
|
230
|
+
V(e);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
const y = /* @__PURE__ */ new WeakMap(), O = "FinalizationRegistry" in globalThis && new FinalizationRegistry((e) => {
|
|
234
|
+
const t = (y.get(e) || 0) - 1;
|
|
235
|
+
y.set(e, t), t === 0 && J(e);
|
|
236
|
+
});
|
|
237
|
+
function ne(e, t) {
|
|
238
|
+
const s = (y.get(t) || 0) + 1;
|
|
239
|
+
y.set(t, s), O && O.register(e, t, e);
|
|
240
|
+
}
|
|
241
|
+
function oe(e) {
|
|
242
|
+
O && O.unregister(e);
|
|
243
|
+
}
|
|
244
|
+
function b(e, t, s = [], r = function() {
|
|
245
|
+
}) {
|
|
246
|
+
let n = !1;
|
|
247
|
+
const o = new Proxy(r, {
|
|
248
|
+
get(a, i) {
|
|
249
|
+
if (_(n), i === j)
|
|
250
|
+
return () => {
|
|
251
|
+
oe(o), J(e), t.clear(), n = !0;
|
|
252
|
+
};
|
|
253
|
+
if (i === "then") {
|
|
254
|
+
if (s.length === 0)
|
|
255
|
+
return { then: () => o };
|
|
256
|
+
const c = p(e, t, {
|
|
257
|
+
type: "GET",
|
|
258
|
+
path: s.map((l) => l.toString())
|
|
259
|
+
}).then(m);
|
|
260
|
+
return c.then.bind(c);
|
|
261
|
+
}
|
|
262
|
+
return b(e, t, [...s, i]);
|
|
263
|
+
},
|
|
264
|
+
set(a, i, c) {
|
|
265
|
+
_(n);
|
|
266
|
+
const [l, u] = S(c);
|
|
267
|
+
return p(e, t, {
|
|
268
|
+
type: "SET",
|
|
269
|
+
path: [...s, i].map((g) => g.toString()),
|
|
270
|
+
value: l
|
|
271
|
+
}, u).then(m);
|
|
272
|
+
},
|
|
273
|
+
apply(a, i, c) {
|
|
274
|
+
_(n);
|
|
275
|
+
const l = s[s.length - 1];
|
|
276
|
+
if (l === X)
|
|
277
|
+
return p(e, t, {
|
|
278
|
+
type: "ENDPOINT"
|
|
279
|
+
}).then(m);
|
|
280
|
+
if (l === "bind")
|
|
281
|
+
return b(e, t, s.slice(0, -1));
|
|
282
|
+
const [u, g] = C(c);
|
|
283
|
+
return p(e, t, {
|
|
284
|
+
type: "APPLY",
|
|
285
|
+
path: s.map((d) => d.toString()),
|
|
286
|
+
argumentList: u
|
|
287
|
+
}, g).then(m);
|
|
288
|
+
},
|
|
289
|
+
construct(a, i) {
|
|
290
|
+
_(n);
|
|
291
|
+
const [c, l] = C(i);
|
|
292
|
+
return p(e, t, {
|
|
293
|
+
type: "CONSTRUCT",
|
|
294
|
+
path: s.map((u) => u.toString()),
|
|
295
|
+
argumentList: c
|
|
296
|
+
}, l).then(m);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
return ne(o, e), o;
|
|
300
|
+
}
|
|
301
|
+
function ie(e) {
|
|
302
|
+
return Array.prototype.concat.apply([], e);
|
|
303
|
+
}
|
|
304
|
+
function C(e) {
|
|
305
|
+
const t = e.map(S);
|
|
306
|
+
return [t.map((s) => s[0]), ie(t.map((s) => s[1]))];
|
|
307
|
+
}
|
|
308
|
+
const $ = /* @__PURE__ */ new WeakMap();
|
|
309
|
+
function ae(e, t) {
|
|
310
|
+
return $.set(e, t), e;
|
|
311
|
+
}
|
|
312
|
+
function ce(e) {
|
|
313
|
+
return Object.assign(e, { [W]: !0 });
|
|
314
|
+
}
|
|
315
|
+
function S(e) {
|
|
316
|
+
for (const [t, s] of z)
|
|
317
|
+
if (s.canHandle(e)) {
|
|
318
|
+
const [r, n] = s.serialize(e);
|
|
319
|
+
return [
|
|
320
|
+
{
|
|
321
|
+
type: "HANDLER",
|
|
322
|
+
name: t,
|
|
323
|
+
value: r
|
|
324
|
+
},
|
|
325
|
+
n
|
|
326
|
+
];
|
|
327
|
+
}
|
|
328
|
+
return [
|
|
329
|
+
{
|
|
330
|
+
type: "RAW",
|
|
331
|
+
value: e
|
|
332
|
+
},
|
|
333
|
+
$.get(e) || []
|
|
334
|
+
];
|
|
335
|
+
}
|
|
336
|
+
function m(e) {
|
|
337
|
+
switch (e.type) {
|
|
338
|
+
case "HANDLER":
|
|
339
|
+
return z.get(e.name).deserialize(e.value);
|
|
340
|
+
case "RAW":
|
|
341
|
+
return e.value;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
function p(e, t, s, r) {
|
|
345
|
+
return new Promise((n) => {
|
|
346
|
+
const o = le();
|
|
347
|
+
t.set(o, n), e.start && e.start(), e.postMessage(Object.assign({ id: o }, s), r);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function le() {
|
|
351
|
+
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
|
352
|
+
}
|
|
353
|
+
const T = ".", A = {
|
|
107
354
|
REQUEST_BOOT: "requestBoot",
|
|
108
355
|
SETUP: "setup",
|
|
109
356
|
WEBSITE_READY: "websiteReady"
|
|
110
|
-
},
|
|
357
|
+
}, E = {
|
|
111
358
|
GET_METHODS: "getMethods",
|
|
112
359
|
RETURN_METHODS: "returnMethods",
|
|
113
360
|
REGISTER_CUSTOM_VIEW: "registerCustomView",
|
|
114
361
|
REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
|
|
115
|
-
},
|
|
116
|
-
if (typeof
|
|
362
|
+
}, ue = async (e, t) => {
|
|
363
|
+
if (typeof e != "string")
|
|
117
364
|
throw new Error(
|
|
118
|
-
'Configurator ID is not a string type: "' + typeof
|
|
365
|
+
'Configurator ID is not a string type: "' + typeof e + '"'
|
|
119
366
|
);
|
|
120
|
-
const
|
|
367
|
+
const s = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, n = s + "/configurators/" + e, o = "roomle_portal_v2", a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;" + o), i = () => {
|
|
121
368
|
const g = {
|
|
122
|
-
apiKey:
|
|
369
|
+
apiKey: o,
|
|
123
370
|
currentTenant: r,
|
|
124
371
|
locale: "en",
|
|
125
372
|
language: "en",
|
|
@@ -128,60 +375,60 @@ const f = ".", _ = {
|
|
|
128
375
|
platform: "web"
|
|
129
376
|
};
|
|
130
377
|
return new Headers(g);
|
|
131
|
-
},
|
|
378
|
+
}, c = new Request(n, {
|
|
132
379
|
method: "GET",
|
|
133
|
-
headers:
|
|
380
|
+
headers: i(),
|
|
134
381
|
mode: "cors",
|
|
135
382
|
cache: "default"
|
|
136
|
-
}),
|
|
137
|
-
return
|
|
138
|
-
},
|
|
383
|
+
}), l = await fetch(c), { configurator: u } = await l.json();
|
|
384
|
+
return u;
|
|
385
|
+
}, ge = () => {
|
|
139
386
|
try {
|
|
140
387
|
return window.self !== window.top;
|
|
141
388
|
} catch {
|
|
142
389
|
return !0;
|
|
143
390
|
}
|
|
144
|
-
},
|
|
145
|
-
const
|
|
146
|
-
let
|
|
147
|
-
if (
|
|
391
|
+
}, de = ["127.0.0.1", "localhost", "0.0.0.0"], fe = () => {
|
|
392
|
+
const e = ge();
|
|
393
|
+
let t = window.location.href;
|
|
394
|
+
if (e) {
|
|
148
395
|
if (!document.referrer)
|
|
149
396
|
return null;
|
|
150
|
-
|
|
397
|
+
t = document.referrer;
|
|
151
398
|
}
|
|
152
|
-
const { hostname:
|
|
153
|
-
return
|
|
154
|
-
},
|
|
399
|
+
const { hostname: s } = new URL(t);
|
|
400
|
+
return s;
|
|
401
|
+
}, he = (e) => !!(de.includes(e) || e.endsWith("roomle.com") || e.endsWith("gitlab.io") || e.endsWith("gitlab.com")), v = [
|
|
155
402
|
"language",
|
|
156
403
|
"browserLanguage",
|
|
157
404
|
"userLanguage",
|
|
158
405
|
"systemLanguage"
|
|
159
|
-
],
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
return
|
|
163
|
-
if (Array.isArray(
|
|
164
|
-
return
|
|
165
|
-
for (let
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
return
|
|
406
|
+
], me = (e = null) => {
|
|
407
|
+
const t = window.navigator;
|
|
408
|
+
if (e)
|
|
409
|
+
return e.substr(0, 2);
|
|
410
|
+
if (Array.isArray(t.languages) && t.languages.length > 0)
|
|
411
|
+
return t.languages[0].substr(0, 2);
|
|
412
|
+
for (let s = 0, r = v.length; s < r; s++) {
|
|
413
|
+
const n = t[v[s]];
|
|
414
|
+
if (n)
|
|
415
|
+
return n.substr(0, 2);
|
|
169
416
|
}
|
|
170
417
|
return "en";
|
|
171
|
-
},
|
|
172
|
-
const
|
|
173
|
-
return
|
|
174
|
-
},
|
|
175
|
-
for (const
|
|
418
|
+
}, pe = (e, t) => {
|
|
419
|
+
const s = JSON.parse(JSON.stringify(e));
|
|
420
|
+
return P(s, t);
|
|
421
|
+
}, P = (e, t) => {
|
|
422
|
+
for (const s in t)
|
|
176
423
|
try {
|
|
177
|
-
|
|
424
|
+
t[s].constructor === Object ? e[s] = P(e[s], t[s]) : e[s] = t[s];
|
|
178
425
|
} catch {
|
|
179
|
-
s
|
|
426
|
+
e[s] = t[s];
|
|
180
427
|
}
|
|
181
|
-
return
|
|
428
|
+
return e;
|
|
182
429
|
};
|
|
183
|
-
var
|
|
184
|
-
const
|
|
430
|
+
var Y = /* @__PURE__ */ ((e) => (e.BOTTOM_BAR = "bottom_bar", e.PARTLIST_BOUNDS = "partlist_bounds", e.INTERACTION_NOTES = "interaction_notes", e.PARAMETER_GROUPS = "parameter_groups", e))(Y || {});
|
|
431
|
+
const _e = (e) => JSON.parse(JSON.stringify(e)), Ee = {
|
|
185
432
|
mobileLandscape: !0,
|
|
186
433
|
floorMaterialRootTag: "materials_root",
|
|
187
434
|
buttons: {
|
|
@@ -192,7 +439,7 @@ const k = (s) => JSON.parse(JSON.stringify(s)), G = {
|
|
|
192
439
|
partlist_print: !0
|
|
193
440
|
},
|
|
194
441
|
elements: {
|
|
195
|
-
[
|
|
442
|
+
[Y.INTERACTION_NOTES]: !0
|
|
196
443
|
},
|
|
197
444
|
helpcenter: {
|
|
198
445
|
roomdesigner: !0,
|
|
@@ -209,33 +456,33 @@ const k = (s) => JSON.parse(JSON.stringify(s)), G = {
|
|
|
209
456
|
},
|
|
210
457
|
rotationSnapDegrees: 10,
|
|
211
458
|
interactionsCollapsed: !1
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
)),
|
|
216
|
-
if (!
|
|
459
|
+
}, we = "(idle)", ye = (e) => (I(e), e?.customApiUrl && (e.customApiUrl = decodeURIComponent(e.customApiUrl)), e.shareUrl && (e.deeplink = e.shareUrl.replace(
|
|
460
|
+
Me,
|
|
461
|
+
Te
|
|
462
|
+
)), e), I = (e) => {
|
|
463
|
+
if (!e)
|
|
217
464
|
return;
|
|
218
|
-
const
|
|
219
|
-
for (const
|
|
220
|
-
const r = s
|
|
221
|
-
if (!Array.isArray(r) && typeof r == "object" && r !== null &&
|
|
222
|
-
for (const
|
|
223
|
-
|
|
224
|
-
(r === "true" || r === "false") && (s
|
|
465
|
+
const t = Object.keys(e);
|
|
466
|
+
for (const s of t) {
|
|
467
|
+
const r = e[s];
|
|
468
|
+
if (!Array.isArray(r) && typeof r == "object" && r !== null && I(r), Array.isArray(r))
|
|
469
|
+
for (const n of r)
|
|
470
|
+
I(n);
|
|
471
|
+
(r === "true" || r === "false") && (e[s] = r === "true");
|
|
225
472
|
}
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
return !
|
|
230
|
-
},
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
return
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
class
|
|
473
|
+
}, Oe = (e, t) => {
|
|
474
|
+
t.configuratorId = e.id;
|
|
475
|
+
const s = e.settings || {};
|
|
476
|
+
return !t.overrideTenant && e.tenant && (t.overrideTenant = e.tenant), pe(s, t);
|
|
477
|
+
}, Se = () => {
|
|
478
|
+
const e = _e(Ee);
|
|
479
|
+
e.locale || (e.locale = me()), e.id === we && delete e.id;
|
|
480
|
+
const t = fe();
|
|
481
|
+
return t && he(t) && (e.configuratorId = "demoConfigurator"), e.customApiUrl = void 0, e.emails = !1, e;
|
|
482
|
+
}, Me = "<CONF_ID>", Te = "#CONFIGURATIONID#", Ae = (e) => {
|
|
483
|
+
e.featureFlags || (e.featureFlags = {}), typeof e.featureFlags.realPartList != "boolean" && (e.featureFlags.realPartList = !0), typeof e.featureFlags.globalCallbacks != "boolean" && (e.featureFlags.globalCallbacks = !0), typeof e.featureFlags.mocAr != "boolean" && (e.featureFlags.mocAr = !1);
|
|
484
|
+
}, D = () => /(android)/i.test(navigator.userAgent);
|
|
485
|
+
class x {
|
|
239
486
|
_messageHandler = null;
|
|
240
487
|
isSetupDone = !1;
|
|
241
488
|
viewName = "main";
|
|
@@ -259,149 +506,149 @@ class A {
|
|
|
259
506
|
global = {
|
|
260
507
|
callbacks: {}
|
|
261
508
|
};
|
|
262
|
-
setMessageHandler(
|
|
263
|
-
this._messageHandler =
|
|
509
|
+
setMessageHandler(t) {
|
|
510
|
+
this._messageHandler = t;
|
|
264
511
|
}
|
|
265
|
-
handleSetup(
|
|
266
|
-
const { methods:
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
this[a] || (this[a] = {}), this[a][
|
|
512
|
+
handleSetup(t) {
|
|
513
|
+
const { methods: s, callbacks: r } = t;
|
|
514
|
+
s.forEach((n) => {
|
|
515
|
+
const o = n.split(T), a = o[0], i = o[1];
|
|
516
|
+
this[a] || (this[a] = {}), this[a][i] = (function() {
|
|
270
517
|
if (!this._messageHandler) {
|
|
271
518
|
console.error("MessageHandler not set");
|
|
272
519
|
return;
|
|
273
520
|
}
|
|
274
|
-
return this._messageHandler.sendMessage(
|
|
521
|
+
return this._messageHandler.sendMessage(n, [...arguments]);
|
|
275
522
|
}).bind(this);
|
|
276
|
-
}), r.forEach((
|
|
277
|
-
const
|
|
278
|
-
this[a] || (this[a] = {}), this[a][
|
|
523
|
+
}), r.forEach((n) => {
|
|
524
|
+
const o = n.split(T), a = o[0], i = o[1], c = o[2];
|
|
525
|
+
this[a] || (this[a] = {}), this[a][i] || (this[a][i] = {}), this[a][i][c] = () => {
|
|
279
526
|
};
|
|
280
527
|
}), this.isSetupDone = !0;
|
|
281
528
|
}
|
|
282
|
-
executeMessage({ message:
|
|
283
|
-
const r =
|
|
284
|
-
if (a && this[
|
|
285
|
-
const
|
|
286
|
-
...
|
|
529
|
+
executeMessage({ message: t, args: s }) {
|
|
530
|
+
const r = t.split(T), n = r[0], o = r[1], a = r.length === 3 ? r[2] : null;
|
|
531
|
+
if (a && this[n][o][a]) {
|
|
532
|
+
const i = this[n][o][a](
|
|
533
|
+
...s
|
|
287
534
|
);
|
|
288
|
-
return
|
|
535
|
+
return i instanceof Promise ? i.then((c) => ({ result: c })) : i !== void 0 ? Promise.resolve({ result: i }) : Promise.resolve({ result: null });
|
|
289
536
|
}
|
|
290
|
-
return Promise.reject('Message "' +
|
|
537
|
+
return Promise.reject('Message "' + t + '" is unkown');
|
|
291
538
|
}
|
|
292
|
-
setupPlugins(
|
|
293
|
-
for (const
|
|
294
|
-
typeof
|
|
295
|
-
new Promise((
|
|
539
|
+
setupPlugins(t, s, r = "website") {
|
|
540
|
+
for (const n of t)
|
|
541
|
+
typeof n == "string" && n === "dragIn" ? this.pluginsLoaded.push(
|
|
542
|
+
new Promise((o, a) => {
|
|
296
543
|
try {
|
|
297
|
-
import("./drag-in-BEjBh6zz.mjs").then((
|
|
298
|
-
({ DragIn:
|
|
299
|
-
const
|
|
544
|
+
import("./drag-in-BEjBh6zz.mjs").then((i) => i.l).then(
|
|
545
|
+
({ DragIn: i }) => {
|
|
546
|
+
const c = new i(
|
|
300
547
|
this.ui,
|
|
301
|
-
|
|
548
|
+
s,
|
|
302
549
|
r,
|
|
303
550
|
this.viewName
|
|
304
551
|
);
|
|
305
|
-
|
|
306
|
-
this.plugins.dragIn =
|
|
552
|
+
c.init().then(() => {
|
|
553
|
+
this.plugins.dragIn = c, o();
|
|
307
554
|
}, a);
|
|
308
555
|
}
|
|
309
556
|
);
|
|
310
|
-
} catch (
|
|
311
|
-
a(
|
|
557
|
+
} catch (i) {
|
|
558
|
+
a(i);
|
|
312
559
|
}
|
|
313
560
|
})
|
|
314
|
-
) :
|
|
315
|
-
new Promise((
|
|
561
|
+
) : n.name && n.loader && this.pluginsLoaded.push(
|
|
562
|
+
new Promise((o, a) => {
|
|
316
563
|
try {
|
|
317
|
-
|
|
318
|
-
const
|
|
564
|
+
n.loader().then((i) => {
|
|
565
|
+
const c = new i(
|
|
319
566
|
this.ui,
|
|
320
|
-
|
|
567
|
+
s,
|
|
321
568
|
r,
|
|
322
569
|
this.viewName
|
|
323
570
|
);
|
|
324
|
-
|
|
325
|
-
this.plugins[
|
|
571
|
+
c.init().then(() => {
|
|
572
|
+
this.plugins[n.name] = c, o();
|
|
326
573
|
}, a);
|
|
327
574
|
});
|
|
328
|
-
} catch (
|
|
329
|
-
a(
|
|
575
|
+
} catch (i) {
|
|
576
|
+
a(i);
|
|
330
577
|
}
|
|
331
578
|
})
|
|
332
579
|
);
|
|
333
580
|
}
|
|
334
581
|
}
|
|
335
|
-
const
|
|
336
|
-
let
|
|
337
|
-
return { promise: new Promise((r,
|
|
338
|
-
|
|
339
|
-
}), resolve:
|
|
340
|
-
},
|
|
582
|
+
const k = () => {
|
|
583
|
+
let e, t;
|
|
584
|
+
return { promise: new Promise((r, n) => {
|
|
585
|
+
e = r, t = n;
|
|
586
|
+
}), resolve: e, reject: t };
|
|
587
|
+
}, F = (e, t, s) => {
|
|
341
588
|
let r = null;
|
|
342
|
-
Object.defineProperty(
|
|
589
|
+
Object.defineProperty(e, t, {
|
|
343
590
|
get() {
|
|
344
|
-
return r ||
|
|
591
|
+
return r || s;
|
|
345
592
|
},
|
|
346
|
-
set(
|
|
347
|
-
|
|
593
|
+
set(n) {
|
|
594
|
+
n?.mute ? r = n.value : (console.warn(
|
|
348
595
|
"You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"
|
|
349
|
-
), console.warn("{ mute: true, value: () => void }"), r =
|
|
596
|
+
), console.warn("{ mute: true, value: () => void }"), r = n);
|
|
350
597
|
}
|
|
351
598
|
});
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
() =>
|
|
599
|
+
}, q = () => window.innerHeight * 0.01 + "px", U = (e) => {
|
|
600
|
+
e && setTimeout(
|
|
601
|
+
() => e.style.setProperty(N, q()),
|
|
355
602
|
0
|
|
356
603
|
);
|
|
357
|
-
},
|
|
604
|
+
}, B = "rml-styles", Re = 450, N = "--rml-full-height", f = {
|
|
358
605
|
CONTAINER: "rml-container",
|
|
359
606
|
FILL: "rml-fill",
|
|
360
607
|
POSITION: "rml-pos",
|
|
361
608
|
TRANSITION: "rml-transition",
|
|
362
609
|
ANDROID_HEIGHT: "rml-android-height",
|
|
363
610
|
OVERFLOW_HIDDEN: "rml-overflow-hidden"
|
|
364
|
-
},
|
|
365
|
-
class
|
|
366
|
-
static createPlanner(
|
|
611
|
+
}, R = /* @__PURE__ */ new Map();
|
|
612
|
+
class be extends x {
|
|
613
|
+
static createPlanner(t, s, r, n = []) {
|
|
367
614
|
return this._create(
|
|
368
|
-
e,
|
|
369
615
|
t,
|
|
616
|
+
s,
|
|
370
617
|
r,
|
|
371
|
-
|
|
618
|
+
n
|
|
372
619
|
);
|
|
373
620
|
}
|
|
374
|
-
static async connect(
|
|
375
|
-
const r = new
|
|
376
|
-
r.viewName =
|
|
377
|
-
const { resolve:
|
|
621
|
+
static async connect(t, s = []) {
|
|
622
|
+
const r = new x();
|
|
623
|
+
r.viewName = t;
|
|
624
|
+
const { resolve: n, promise: o } = k(), { resolve: a, promise: i } = k(), c = ({
|
|
378
625
|
message: g,
|
|
379
|
-
args:
|
|
626
|
+
args: d
|
|
380
627
|
}) => {
|
|
381
628
|
switch (g) {
|
|
382
|
-
case
|
|
383
|
-
|
|
629
|
+
case E.REGISTER_CUSTOM_VIEW_DONE:
|
|
630
|
+
n();
|
|
384
631
|
break;
|
|
385
|
-
case
|
|
386
|
-
r.handleSetup(
|
|
632
|
+
case E.RETURN_METHODS:
|
|
633
|
+
r.handleSetup(d[0]), a();
|
|
387
634
|
break;
|
|
388
635
|
default:
|
|
389
636
|
if (r.isSetupDone)
|
|
390
|
-
return r.executeMessage({ message: g, args:
|
|
637
|
+
return r.executeMessage({ message: g, args: d });
|
|
391
638
|
}
|
|
392
|
-
},
|
|
393
|
-
"custom-view-" +
|
|
639
|
+
}, l = new H(
|
|
640
|
+
"custom-view-" + t,
|
|
394
641
|
window,
|
|
395
642
|
window.parent,
|
|
396
|
-
|
|
643
|
+
c
|
|
397
644
|
);
|
|
398
|
-
r.setMessageHandler(
|
|
399
|
-
const
|
|
400
|
-
return
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
), await
|
|
404
|
-
|
|
645
|
+
r.setMessageHandler(l);
|
|
646
|
+
const u = [t];
|
|
647
|
+
return l.sendMessage(
|
|
648
|
+
E.REGISTER_CUSTOM_VIEW,
|
|
649
|
+
u
|
|
650
|
+
), await o, l.sendMessage(E.GET_METHODS, u), await i, r.setupPlugins(
|
|
651
|
+
s,
|
|
405
652
|
document.body,
|
|
406
653
|
"custom-view"
|
|
407
654
|
), await Promise.allSettled(r.pluginsLoaded), r;
|
|
@@ -412,12 +659,12 @@ class X extends A {
|
|
|
412
659
|
* @param container DOM container in which the configurator should be placed
|
|
413
660
|
* @param initData settings with which the configurator should be started
|
|
414
661
|
*/
|
|
415
|
-
static createConfigurator(
|
|
662
|
+
static createConfigurator(t, s, r, n = []) {
|
|
416
663
|
return this._create(
|
|
417
|
-
e,
|
|
418
664
|
t,
|
|
665
|
+
s,
|
|
419
666
|
r,
|
|
420
|
-
|
|
667
|
+
n
|
|
421
668
|
);
|
|
422
669
|
}
|
|
423
670
|
/**
|
|
@@ -427,12 +674,12 @@ class X extends A {
|
|
|
427
674
|
* @param container DOM container in which the configurator should be placed
|
|
428
675
|
* @param initData settings with which the configurator should be started
|
|
429
676
|
*/
|
|
430
|
-
static create(
|
|
677
|
+
static create(t, s, r, n) {
|
|
431
678
|
return this._create(
|
|
432
|
-
e,
|
|
433
679
|
t,
|
|
680
|
+
s,
|
|
434
681
|
r,
|
|
435
|
-
|
|
682
|
+
n
|
|
436
683
|
);
|
|
437
684
|
}
|
|
438
685
|
/**
|
|
@@ -441,37 +688,45 @@ class X extends A {
|
|
|
441
688
|
* @param container DOM container in which the configurator should be placed
|
|
442
689
|
* @param initData settings with which the configurator should be started
|
|
443
690
|
*/
|
|
444
|
-
static createViewer(
|
|
691
|
+
static createViewer(t, s, r, n = []) {
|
|
445
692
|
return this._create(
|
|
446
|
-
e,
|
|
447
693
|
t,
|
|
694
|
+
s,
|
|
448
695
|
r,
|
|
449
|
-
|
|
696
|
+
n
|
|
450
697
|
);
|
|
451
698
|
}
|
|
452
|
-
static
|
|
453
|
-
|
|
699
|
+
static setupHi(t) {
|
|
700
|
+
window.addEventListener("message", (s) => {
|
|
701
|
+
if (s.data.type === "connect" && s.data.port) {
|
|
702
|
+
const r = s.data.port;
|
|
703
|
+
r.start?.(), L(t, r);
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
static async _create(t, s, r, n) {
|
|
708
|
+
return new Promise(async (o, a) => {
|
|
454
709
|
try {
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
);
|
|
459
|
-
K(n);
|
|
460
|
-
const l = await C(
|
|
461
|
-
e,
|
|
462
|
-
n
|
|
710
|
+
const i = P(
|
|
711
|
+
Se(),
|
|
712
|
+
ye(r)
|
|
463
713
|
);
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
l,
|
|
714
|
+
Ae(i);
|
|
715
|
+
const c = await ue(
|
|
467
716
|
t,
|
|
468
|
-
r,
|
|
469
|
-
o,
|
|
470
717
|
i
|
|
471
718
|
);
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
719
|
+
r = Oe(c, i);
|
|
720
|
+
const l = new this(
|
|
721
|
+
c,
|
|
722
|
+
s,
|
|
723
|
+
r,
|
|
724
|
+
n,
|
|
725
|
+
o
|
|
726
|
+
);
|
|
727
|
+
return await Promise.allSettled(l.pluginsLoaded), l;
|
|
728
|
+
} catch (i) {
|
|
729
|
+
return a(i);
|
|
475
730
|
}
|
|
476
731
|
});
|
|
477
732
|
}
|
|
@@ -480,66 +735,66 @@ class X extends A {
|
|
|
480
735
|
_configuratorSettings;
|
|
481
736
|
_initData = {};
|
|
482
737
|
_iframe;
|
|
483
|
-
constructor(
|
|
484
|
-
if (super(), !
|
|
738
|
+
constructor(t, s, r, n, o) {
|
|
739
|
+
if (super(), !t || typeof t.id != "string")
|
|
485
740
|
throw new Error(
|
|
486
741
|
"Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person"
|
|
487
742
|
);
|
|
488
|
-
if (
|
|
743
|
+
if (R.has(s))
|
|
489
744
|
throw new Error("There is already an instance on this DOM element");
|
|
490
|
-
if (!!!document.getElementById(
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
const g = "transition:all ease-in-out " +
|
|
494
|
-
(
|
|
745
|
+
if (!!!document.getElementById(B)) {
|
|
746
|
+
const l = r.zIndex || 9999999, u = document.createElement("style");
|
|
747
|
+
u.type = "text/css", u.id = B;
|
|
748
|
+
const g = "transition:all ease-in-out " + Re + "ms;", d = ["-webkit-", "-o-"].reduce(
|
|
749
|
+
(K, Q) => K += Q + g,
|
|
495
750
|
""
|
|
496
|
-
) + g,
|
|
497
|
-
|
|
498
|
-
.${
|
|
499
|
-
.${
|
|
500
|
-
.${
|
|
501
|
-
.${
|
|
502
|
-
.${
|
|
503
|
-
.${
|
|
504
|
-
`, document.head.appendChild(
|
|
751
|
+
) + g, h = q();
|
|
752
|
+
u.innerHTML = `
|
|
753
|
+
.${f.CONTAINER}{${N}:${h};}
|
|
754
|
+
.${f.POSITION}{position:fixed;top:0;left:0;z-index:${l};opacity:0}
|
|
755
|
+
.${f.TRANSITION}{${d}}
|
|
756
|
+
.${f.FILL}{width:100%;height:100%;opacity:1}
|
|
757
|
+
.${f.ANDROID_HEIGHT}{height:calc(var(${N},1vh)*100)}
|
|
758
|
+
.${f.OVERFLOW_HIDDEN}{overflow:hidden}
|
|
759
|
+
`, document.head.appendChild(u);
|
|
505
760
|
}
|
|
506
761
|
this._executeMessage = this._executeMessage.bind(this);
|
|
507
|
-
const
|
|
762
|
+
const i = new H(
|
|
508
763
|
"website",
|
|
509
764
|
window,
|
|
510
765
|
null,
|
|
511
766
|
this._executeMessage
|
|
512
767
|
);
|
|
513
|
-
this.setMessageHandler(
|
|
514
|
-
const
|
|
515
|
-
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe =
|
|
768
|
+
this.setMessageHandler(i), this._onResize = this._onResize.bind(this), D() && window.addEventListener("resize", this._onResize), this._container = s, this._initData = r, this._configuratorSettings = t;
|
|
769
|
+
const c = this._createIframe();
|
|
770
|
+
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = o, this._container.appendChild(c), this._iframe = c, this.setupPlugins(n, this._iframe), R.set(s, !0);
|
|
516
771
|
}
|
|
517
772
|
teardown() {
|
|
518
|
-
this._container &&
|
|
519
|
-
const
|
|
520
|
-
|
|
773
|
+
this._container && R.delete(this._container);
|
|
774
|
+
const t = this._container.querySelector("iframe");
|
|
775
|
+
t && this._container.removeChild(t), window.removeEventListener("resize", this._onResize);
|
|
521
776
|
}
|
|
522
777
|
_createIframe() {
|
|
523
|
-
const
|
|
524
|
-
let
|
|
525
|
-
return this._initData.useLocalRoomle && (
|
|
778
|
+
const t = document.createElement("iframe");
|
|
779
|
+
let s = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
|
|
780
|
+
return this._initData.useLocalRoomle && (s = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (s = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (s = this._initData.overrideServerUrl), t.src = s, t.classList.add(f.CONTAINER), t.classList.add(f.FILL), t;
|
|
526
781
|
}
|
|
527
782
|
_onResize() {
|
|
528
|
-
|
|
783
|
+
U(this._iframe);
|
|
529
784
|
}
|
|
530
785
|
_onUseFullPage() {
|
|
531
|
-
this._iframe.classList.add(
|
|
786
|
+
this._iframe.classList.add(f.POSITION), document.documentElement.classList.add(f.OVERFLOW_HIDDEN), window.document.body.classList.add(f.OVERFLOW_HIDDEN), D() && (U(this._iframe), this._iframe.classList.add(f.ANDROID_HEIGHT));
|
|
532
787
|
}
|
|
533
788
|
_onBackToWebsite() {
|
|
534
|
-
this._iframe.classList.remove(
|
|
789
|
+
this._iframe.classList.remove(f.POSITION), this._iframe.classList.remove(f.ANDROID_HEIGHT), document.documentElement.classList.remove(f.OVERFLOW_HIDDEN), window.document.body.classList.remove(f.OVERFLOW_HIDDEN);
|
|
535
790
|
}
|
|
536
|
-
_executeMessage({ message:
|
|
791
|
+
_executeMessage({ message: t, args: s }, r) {
|
|
537
792
|
if (r.source && r.source === this._iframe?.contentWindow)
|
|
538
|
-
return
|
|
793
|
+
return t === A.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(r.source), Promise.resolve({ result: this._initData })) : (console.error("MessageHandler not set"), Promise.resolve({ error: "MessageHandler not set" })) : t === A.SETUP ? (this.handleSetup(s[0]), F(
|
|
539
794
|
this.ui.callbacks,
|
|
540
795
|
"onUseFullPage",
|
|
541
796
|
this._onUseFullPage
|
|
542
|
-
),
|
|
797
|
+
), F(
|
|
543
798
|
this.ui.callbacks,
|
|
544
799
|
"onBackToWebsite",
|
|
545
800
|
this._onBackToWebsite
|
|
@@ -548,10 +803,10 @@ class X extends A {
|
|
|
548
803
|
console.error("MessageHandler not set");
|
|
549
804
|
return;
|
|
550
805
|
}
|
|
551
|
-
this._messageHandler.sendMessage(
|
|
552
|
-
}, 0), Promise.resolve({ result: null })) : this.executeMessage({ message:
|
|
806
|
+
this._messageHandler.sendMessage(A.WEBSITE_READY);
|
|
807
|
+
}, 0), Promise.resolve({ result: null })) : this.executeMessage({ message: t, args: s });
|
|
553
808
|
}
|
|
554
809
|
}
|
|
555
810
|
export {
|
|
556
|
-
|
|
811
|
+
be as default
|
|
557
812
|
};
|