@luzmo/embed 5.1.5 → 6.0.0-beta.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.
@@ -1,3062 +0,0 @@
1
- (function (g, f) {
2
- var hasExports = typeof exports === 'object';
3
- if (typeof define === "function" && define.amd) {
4
- define([], f);
5
- } else if (typeof module === "object" && module.exports) {
6
- module.exports = f();
7
- } else {
8
- var m = hasExports ? f() : f();
9
- var root = hasExports ? exports : g;
10
- for(var i in m) root[i] = m[i];
11
- }}(typeof self !== 'undefined' ? self : this, () => {
12
- var exports = {};
13
- var module = { exports };
14
- "use strict";
15
- var __defProp = Object.defineProperty;
16
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
17
- var __getOwnPropNames = Object.getOwnPropertyNames;
18
- var __hasOwnProp = Object.prototype.hasOwnProperty;
19
- var __export = (target, all) => {
20
- for (var name in all)
21
- __defProp(target, name, { get: all[name], enumerable: true });
22
- };
23
- var __copyProps = (to, from, except, desc) => {
24
- if (from && typeof from === "object" || typeof from === "function") {
25
- for (let key of __getOwnPropNames(from))
26
- if (!__hasOwnProp.call(to, key) && key !== except)
27
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
- }
29
- return to;
30
- };
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
- var __decorateClass = (decorators, target, key, kind) => {
33
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
34
- for (var i6 = decorators.length - 1, decorator; i6 >= 0; i6--)
35
- if (decorator = decorators[i6])
36
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
37
- if (kind && result)
38
- __defProp(target, key, result);
39
- return result;
40
- };
41
-
42
- // libs/embed-libs/embed/src/index.libs.ts
43
- var index_libs_exports = {};
44
- __export(index_libs_exports, {
45
- LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent
46
- });
47
- module.exports = __toCommonJS(index_libs_exports);
48
-
49
- // node_modules/@lit/reactive-element/decorators/custom-element.js
50
- var t = (t5) => (e7, o6) => {
51
- void 0 !== o6 ? o6.addInitializer(() => {
52
- customElements.define(t5, e7);
53
- }) : customElements.define(t5, e7);
54
- };
55
-
56
- // node_modules/@lit/reactive-element/css-tag.js
57
- var t2 = globalThis;
58
- var e = t2.ShadowRoot && (void 0 === t2.ShadyCSS || t2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
59
- var s = Symbol();
60
- var o = /* @__PURE__ */ new WeakMap();
61
- var n = class {
62
- constructor(t5, e7, o6) {
63
- if (this._$cssResult$ = true, o6 !== s)
64
- throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
65
- this.cssText = t5, this.t = e7;
66
- }
67
- get styleSheet() {
68
- let t5 = this.o;
69
- const s4 = this.t;
70
- if (e && void 0 === t5) {
71
- const e7 = void 0 !== s4 && 1 === s4.length;
72
- e7 && (t5 = o.get(s4)), void 0 === t5 && ((this.o = t5 = new CSSStyleSheet()).replaceSync(this.cssText), e7 && o.set(s4, t5));
73
- }
74
- return t5;
75
- }
76
- toString() {
77
- return this.cssText;
78
- }
79
- };
80
- var r = (t5) => new n("string" == typeof t5 ? t5 : t5 + "", void 0, s);
81
- var i = (t5, ...e7) => {
82
- const o6 = 1 === t5.length ? t5[0] : e7.reduce((e8, s4, o7) => e8 + ((t6) => {
83
- if (true === t6._$cssResult$)
84
- return t6.cssText;
85
- if ("number" == typeof t6)
86
- return t6;
87
- throw Error("Value passed to 'css' function must be a 'css' function result: " + t6 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
88
- })(s4) + t5[o7 + 1], t5[0]);
89
- return new n(o6, t5, s);
90
- };
91
- var S = (s4, o6) => {
92
- if (e)
93
- s4.adoptedStyleSheets = o6.map((t5) => t5 instanceof CSSStyleSheet ? t5 : t5.styleSheet);
94
- else
95
- for (const e7 of o6) {
96
- const o7 = document.createElement("style"), n6 = t2.litNonce;
97
- void 0 !== n6 && o7.setAttribute("nonce", n6), o7.textContent = e7.cssText, s4.appendChild(o7);
98
- }
99
- };
100
- var c = e ? (t5) => t5 : (t5) => t5 instanceof CSSStyleSheet ? ((t6) => {
101
- let e7 = "";
102
- for (const s4 of t6.cssRules)
103
- e7 += s4.cssText;
104
- return r(e7);
105
- })(t5) : t5;
106
-
107
- // node_modules/@lit/reactive-element/reactive-element.js
108
- var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object;
109
- var a = globalThis;
110
- var c2 = a.trustedTypes;
111
- var l = c2 ? c2.emptyScript : "";
112
- var p = a.reactiveElementPolyfillSupport;
113
- var d = (t5, s4) => t5;
114
- var u = { toAttribute(t5, s4) {
115
- switch (s4) {
116
- case Boolean:
117
- t5 = t5 ? l : null;
118
- break;
119
- case Object:
120
- case Array:
121
- t5 = null == t5 ? t5 : JSON.stringify(t5);
122
- }
123
- return t5;
124
- }, fromAttribute(t5, s4) {
125
- let i6 = t5;
126
- switch (s4) {
127
- case Boolean:
128
- i6 = null !== t5;
129
- break;
130
- case Number:
131
- i6 = null === t5 ? null : Number(t5);
132
- break;
133
- case Object:
134
- case Array:
135
- try {
136
- i6 = JSON.parse(t5);
137
- } catch (t6) {
138
- i6 = null;
139
- }
140
- }
141
- return i6;
142
- } };
143
- var f = (t5, s4) => !i2(t5, s4);
144
- var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
145
- Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
146
- var b = class extends HTMLElement {
147
- static addInitializer(t5) {
148
- this._$Ei(), (this.l ??= []).push(t5);
149
- }
150
- static get observedAttributes() {
151
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
152
- }
153
- static createProperty(t5, s4 = y) {
154
- if (s4.state && (s4.attribute = false), this._$Ei(), this.elementProperties.set(t5, s4), !s4.noAccessor) {
155
- const i6 = Symbol(), r7 = this.getPropertyDescriptor(t5, i6, s4);
156
- void 0 !== r7 && e2(this.prototype, t5, r7);
157
- }
158
- }
159
- static getPropertyDescriptor(t5, s4, i6) {
160
- const { get: e7, set: h3 } = r2(this.prototype, t5) ?? { get() {
161
- return this[s4];
162
- }, set(t6) {
163
- this[s4] = t6;
164
- } };
165
- return { get() {
166
- return e7?.call(this);
167
- }, set(s5) {
168
- const r7 = e7?.call(this);
169
- h3.call(this, s5), this.requestUpdate(t5, r7, i6);
170
- }, configurable: true, enumerable: true };
171
- }
172
- static getPropertyOptions(t5) {
173
- return this.elementProperties.get(t5) ?? y;
174
- }
175
- static _$Ei() {
176
- if (this.hasOwnProperty(d("elementProperties")))
177
- return;
178
- const t5 = n2(this);
179
- t5.finalize(), void 0 !== t5.l && (this.l = [...t5.l]), this.elementProperties = new Map(t5.elementProperties);
180
- }
181
- static finalize() {
182
- if (this.hasOwnProperty(d("finalized")))
183
- return;
184
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
185
- const t6 = this.properties, s4 = [...h(t6), ...o2(t6)];
186
- for (const i6 of s4)
187
- this.createProperty(i6, t6[i6]);
188
- }
189
- const t5 = this[Symbol.metadata];
190
- if (null !== t5) {
191
- const s4 = litPropertyMetadata.get(t5);
192
- if (void 0 !== s4)
193
- for (const [t6, i6] of s4)
194
- this.elementProperties.set(t6, i6);
195
- }
196
- this._$Eh = /* @__PURE__ */ new Map();
197
- for (const [t6, s4] of this.elementProperties) {
198
- const i6 = this._$Eu(t6, s4);
199
- void 0 !== i6 && this._$Eh.set(i6, t6);
200
- }
201
- this.elementStyles = this.finalizeStyles(this.styles);
202
- }
203
- static finalizeStyles(s4) {
204
- const i6 = [];
205
- if (Array.isArray(s4)) {
206
- const e7 = new Set(s4.flat(1 / 0).reverse());
207
- for (const s5 of e7)
208
- i6.unshift(c(s5));
209
- } else
210
- void 0 !== s4 && i6.push(c(s4));
211
- return i6;
212
- }
213
- static _$Eu(t5, s4) {
214
- const i6 = s4.attribute;
215
- return false === i6 ? void 0 : "string" == typeof i6 ? i6 : "string" == typeof t5 ? t5.toLowerCase() : void 0;
216
- }
217
- constructor() {
218
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
219
- }
220
- _$Ev() {
221
- this._$ES = new Promise((t5) => this.enableUpdating = t5), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t5) => t5(this));
222
- }
223
- addController(t5) {
224
- (this._$EO ??= /* @__PURE__ */ new Set()).add(t5), void 0 !== this.renderRoot && this.isConnected && t5.hostConnected?.();
225
- }
226
- removeController(t5) {
227
- this._$EO?.delete(t5);
228
- }
229
- _$E_() {
230
- const t5 = /* @__PURE__ */ new Map(), s4 = this.constructor.elementProperties;
231
- for (const i6 of s4.keys())
232
- this.hasOwnProperty(i6) && (t5.set(i6, this[i6]), delete this[i6]);
233
- t5.size > 0 && (this._$Ep = t5);
234
- }
235
- createRenderRoot() {
236
- const t5 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
237
- return S(t5, this.constructor.elementStyles), t5;
238
- }
239
- connectedCallback() {
240
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t5) => t5.hostConnected?.());
241
- }
242
- enableUpdating(t5) {
243
- }
244
- disconnectedCallback() {
245
- this._$EO?.forEach((t5) => t5.hostDisconnected?.());
246
- }
247
- attributeChangedCallback(t5, s4, i6) {
248
- this._$AK(t5, i6);
249
- }
250
- _$EC(t5, s4) {
251
- const i6 = this.constructor.elementProperties.get(t5), e7 = this.constructor._$Eu(t5, i6);
252
- if (void 0 !== e7 && true === i6.reflect) {
253
- const r7 = (void 0 !== i6.converter?.toAttribute ? i6.converter : u).toAttribute(s4, i6.type);
254
- this._$Em = t5, null == r7 ? this.removeAttribute(e7) : this.setAttribute(e7, r7), this._$Em = null;
255
- }
256
- }
257
- _$AK(t5, s4) {
258
- const i6 = this.constructor, e7 = i6._$Eh.get(t5);
259
- if (void 0 !== e7 && this._$Em !== e7) {
260
- const t6 = i6.getPropertyOptions(e7), r7 = "function" == typeof t6.converter ? { fromAttribute: t6.converter } : void 0 !== t6.converter?.fromAttribute ? t6.converter : u;
261
- this._$Em = e7, this[e7] = r7.fromAttribute(s4, t6.type), this._$Em = null;
262
- }
263
- }
264
- requestUpdate(t5, s4, i6) {
265
- if (void 0 !== t5) {
266
- if (i6 ??= this.constructor.getPropertyOptions(t5), !(i6.hasChanged ?? f)(this[t5], s4))
267
- return;
268
- this.P(t5, s4, i6);
269
- }
270
- false === this.isUpdatePending && (this._$ES = this._$ET());
271
- }
272
- P(t5, s4, i6) {
273
- this._$AL.has(t5) || this._$AL.set(t5, s4), true === i6.reflect && this._$Em !== t5 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t5);
274
- }
275
- async _$ET() {
276
- this.isUpdatePending = true;
277
- try {
278
- await this._$ES;
279
- } catch (t6) {
280
- Promise.reject(t6);
281
- }
282
- const t5 = this.scheduleUpdate();
283
- return null != t5 && await t5, !this.isUpdatePending;
284
- }
285
- scheduleUpdate() {
286
- return this.performUpdate();
287
- }
288
- performUpdate() {
289
- if (!this.isUpdatePending)
290
- return;
291
- if (!this.hasUpdated) {
292
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
293
- for (const [t7, s5] of this._$Ep)
294
- this[t7] = s5;
295
- this._$Ep = void 0;
296
- }
297
- const t6 = this.constructor.elementProperties;
298
- if (t6.size > 0)
299
- for (const [s5, i6] of t6)
300
- true !== i6.wrapped || this._$AL.has(s5) || void 0 === this[s5] || this.P(s5, this[s5], i6);
301
- }
302
- let t5 = false;
303
- const s4 = this._$AL;
304
- try {
305
- t5 = this.shouldUpdate(s4), t5 ? (this.willUpdate(s4), this._$EO?.forEach((t6) => t6.hostUpdate?.()), this.update(s4)) : this._$EU();
306
- } catch (s5) {
307
- throw t5 = false, this._$EU(), s5;
308
- }
309
- t5 && this._$AE(s4);
310
- }
311
- willUpdate(t5) {
312
- }
313
- _$AE(t5) {
314
- this._$EO?.forEach((t6) => t6.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t5)), this.updated(t5);
315
- }
316
- _$EU() {
317
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
318
- }
319
- get updateComplete() {
320
- return this.getUpdateComplete();
321
- }
322
- getUpdateComplete() {
323
- return this._$ES;
324
- }
325
- shouldUpdate(t5) {
326
- return true;
327
- }
328
- update(t5) {
329
- this._$Ej &&= this._$Ej.forEach((t6) => this._$EC(t6, this[t6])), this._$EU();
330
- }
331
- updated(t5) {
332
- }
333
- firstUpdated(t5) {
334
- }
335
- };
336
- b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4");
337
-
338
- // node_modules/@lit/reactive-element/decorators/property.js
339
- var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
340
- var r3 = (t5 = o3, e7, r7) => {
341
- const { kind: n6, metadata: i6 } = r7;
342
- let s4 = globalThis.litPropertyMetadata.get(i6);
343
- if (void 0 === s4 && globalThis.litPropertyMetadata.set(i6, s4 = /* @__PURE__ */ new Map()), s4.set(r7.name, t5), "accessor" === n6) {
344
- const { name: o6 } = r7;
345
- return { set(r8) {
346
- const n7 = e7.get.call(this);
347
- e7.set.call(this, r8), this.requestUpdate(o6, n7, t5);
348
- }, init(e8) {
349
- return void 0 !== e8 && this.P(o6, void 0, t5), e8;
350
- } };
351
- }
352
- if ("setter" === n6) {
353
- const { name: o6 } = r7;
354
- return function(r8) {
355
- const n7 = this[o6];
356
- e7.call(this, r8), this.requestUpdate(o6, n7, t5);
357
- };
358
- }
359
- throw Error("Unsupported decorator location: " + n6);
360
- };
361
- function n3(t5) {
362
- return (e7, o6) => "object" == typeof o6 ? r3(t5, e7, o6) : ((t6, e8, o7) => {
363
- const r7 = e8.hasOwnProperty(o7);
364
- return e8.constructor.createProperty(o7, r7 ? { ...t6, wrapped: true } : t6), r7 ? Object.getOwnPropertyDescriptor(e8, o7) : void 0;
365
- })(t5, e7, o6);
366
- }
367
-
368
- // node_modules/@lit/reactive-element/decorators/state.js
369
- function r4(r7) {
370
- return n3({ ...r7, state: true, attribute: false });
371
- }
372
-
373
- // node_modules/@lit/reactive-element/decorators/base.js
374
- var e3 = (e7, t5, c4) => (c4.configurable = true, c4.enumerable = true, Reflect.decorate && "object" != typeof t5 && Object.defineProperty(e7, t5, c4), c4);
375
-
376
- // node_modules/@lit/reactive-element/decorators/query.js
377
- function e4(e7, r7) {
378
- return (n6, s4, i6) => {
379
- const o6 = (t5) => t5.renderRoot?.querySelector(e7) ?? null;
380
- if (r7) {
381
- const { get: e8, set: r8 } = "object" == typeof s4 ? n6 : i6 ?? (() => {
382
- const t5 = Symbol();
383
- return { get() {
384
- return this[t5];
385
- }, set(e9) {
386
- this[t5] = e9;
387
- } };
388
- })();
389
- return e3(n6, s4, { get() {
390
- let t5 = e8.call(this);
391
- return void 0 === t5 && (t5 = o6(this), (null !== t5 || this.hasUpdated) && r8.call(this, t5)), t5;
392
- } });
393
- }
394
- return e3(n6, s4, { get() {
395
- return o6(this);
396
- } });
397
- };
398
- }
399
-
400
- // libs/embed-libs/shared-embed/src/lib/helpers/error.ts
401
- var _handleError = (errorMessage, parameters) => {
402
- let message = "The dashboard component encountered an error";
403
- if (typeof parameters?.dashboardId === "string") {
404
- message += ` for dashboard with id ${parameters.dashboardId}`;
405
- }
406
- if (typeof parameters?.dashboardSlug === "string") {
407
- message += ` for dashboard with slug ${parameters.dashboardSlug}`;
408
- }
409
- if (typeof parameters?.container === "string") {
410
- message += ` in container ${parameters.container}`;
411
- }
412
- if (errorMessage) {
413
- message += `:
414
- ${errorMessage}`;
415
- console.warn(message);
416
- }
417
- };
418
-
419
- // libs/embed-libs/shared-embed/src/lib/helpers/browser-check.ts
420
- var _browserCheck = (dashboardComponent) => {
421
- let hasError = false;
422
- let errorMessage = "";
423
- const document_ = document.body || document.documentElement;
424
- const style = document_.style;
425
- const browserCheck = {
426
- svg: !!("createElementNS" in document && document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect),
427
- flexbox: style.webkitFlexWrap === "" || style.flexWrap === "",
428
- postMessage: !!window.postMessage
429
- };
430
- const browserCheckKeys = ["svg", "flexbox", "postMessage"];
431
- for (const key of browserCheckKeys) {
432
- if (!browserCheck[key]) {
433
- hasError = true;
434
- dashboardComponent.browserNotSupported = dashboardComponent.browserNotSupported || [];
435
- dashboardComponent.browserNotSupported.push(key);
436
- errorMessage += `Your browser does not support: ${key}
437
- `;
438
- }
439
- }
440
- const ua = window.navigator.userAgent;
441
- const msie = ua.includes("MSIE");
442
- const trident = ua.includes("Trident/");
443
- if (msie || trident) {
444
- hasError = true;
445
- errorMessage = "IE is not supported.";
446
- }
447
- if (hasError) {
448
- _handleError(errorMessage);
449
- }
450
- };
451
-
452
- // libs/embed-libs/shared-embed/src/lib/helpers/default-parameters.ts
453
- var DEFAULT_PARAMETERS = {
454
- appServer: "https://app.luzmo.com/",
455
- apiHost: "https://api.luzmo.com/",
456
- dashboardId: null,
457
- dashboardSlug: null,
458
- container: null,
459
- key: null,
460
- token: null,
461
- language: "auto",
462
- qeVersion: null,
463
- editMode: null,
464
- screenMode: null,
465
- switchScreenModeOnResize: true,
466
- itemId: null,
467
- mainColor: "",
468
- accentColor: "",
469
- itemDimensions: {
470
- width: "auto",
471
- height: "auto"
472
- },
473
- loaderBackground: "#f9f9f9",
474
- loaderFontColor: "#5a5a5a",
475
- loaderSpinnerColor: "rgba(255, 165, 0, 0.7)",
476
- loaderSpinnerBackground: "rgba(169, 169, 169, 0.14)",
477
- timezoneId: null,
478
- contextId: null
479
- };
480
-
481
- // libs/embed-libs/shared-embed/src/lib/helpers/extents.ts
482
- var EXTENTS = [
483
- { mode: "mobile", width: [150, 767] },
484
- { mode: "tablet", width: [768, 1199] },
485
- { mode: "desktop", width: [1200, 1599] },
486
- { mode: "largeScreen", width: [1600, 9999] },
487
- { mode: "fixed", width: [] }
488
- ];
489
-
490
- // libs/embed-libs/shared-embed/src/lib/helpers/translations.ts
491
- var TRANSLATIONS = {
492
- initializing: { en: "Initializing...", nl: "Laden...", fr: "Chargement..." },
493
- errorDashboard: {
494
- en: "Oops, we could not load this dashboard!",
495
- nl: "Oeps, we konden het dashboard niet laden.",
496
- fr: "Le chargement a echou\xE9."
497
- },
498
- errorItem: {
499
- en: "Oops, we could not load this item!",
500
- nl: "Oeps, we konden de grafiek niet laden.",
501
- fr: "Le chargement a echou\xE9."
502
- }
503
- };
504
- var translations_default = TRANSLATIONS;
505
-
506
- // libs/embed-libs/shared-embed/src/lib/helpers/utils.ts
507
- var addTrailingSlash = (serverUrl) => {
508
- if (!serverUrl) {
509
- return "";
510
- }
511
- return serverUrl.endsWith("/") ? serverUrl : `${serverUrl}/`;
512
- };
513
- var removeTrailingSlash = (serverUrl) => {
514
- if (!serverUrl) {
515
- return "";
516
- }
517
- return serverUrl.endsWith("/") ? serverUrl.slice(0, -1) : serverUrl;
518
- };
519
- var formatDashboardList = (dashboards, integrationId, user, dashboardComponent) => {
520
- const combineRights = (securable, user2) => {
521
- const matchingUser = securable.users.find((u3) => u3.id === user2.id);
522
- const securableAccessRights = matchingUser && matchingUser.userAccessRight ? {
523
- flagRead: matchingUser.userAccessRight.flagRead,
524
- flagUse: matchingUser.userAccessRight.flagUse,
525
- flagModify: matchingUser.userAccessRight.flagModify,
526
- flagOwn: matchingUser.userAccessRight.flagOwn
527
- } : {
528
- flagRead: false,
529
- flagUse: false,
530
- flagModify: false,
531
- flagOwn: false
532
- };
533
- const groups = securable.groups.filter(
534
- (group) => user2.userGroups.includes(group.id) || group.public === true
535
- );
536
- const groupsAccess = groups.map((group) => {
537
- if (group.groupAccessRight) {
538
- return group.groupAccessRight;
539
- }
540
- });
541
- for (const groupAccess of groupsAccess) {
542
- if (!securableAccessRights.flagRead && groupAccess.flagRead) {
543
- securableAccessRights.flagRead = groupAccess.flagRead;
544
- }
545
- if (!securableAccessRights.flagUse && groupAccess.flagUse) {
546
- securableAccessRights.flagUse = groupAccess.flagUse;
547
- }
548
- if (!securableAccessRights.flagModify && groupAccess.flagModify) {
549
- securableAccessRights.flagModify = groupAccess.flagModify;
550
- }
551
- if (!securableAccessRights.flagOwn && groupAccess.flagOwn) {
552
- securableAccessRights.flagOwn = groupAccess.flagOwn;
553
- }
554
- }
555
- const integrationsAccess = securable.integrations?.length > 0 ? securable.integrations.map((integration) => {
556
- if (integration.integrationAccessRight) {
557
- return integration.integrationAccessRight;
558
- }
559
- }) : [];
560
- for (const integrationAccess of integrationsAccess) {
561
- if (!securableAccessRights.flagRead && integrationAccess.flagRead) {
562
- securableAccessRights.flagRead = integrationAccess.flagRead;
563
- }
564
- if (!securableAccessRights.flagUse && integrationAccess.flagUse) {
565
- securableAccessRights.flagUse = integrationAccess.flagUse;
566
- }
567
- if (!securableAccessRights.flagModify && integrationAccess.flagModify) {
568
- securableAccessRights.flagModify = integrationAccess.flagModify;
569
- }
570
- }
571
- return securableAccessRights;
572
- };
573
- const localize = (item, locale) => {
574
- if (item === null || item === void 0) {
575
- return "";
576
- }
577
- if (typeof item !== "object" || Object.keys(item).length === 0) {
578
- if (typeof item === "object" && Object.keys(item).length === 0) {
579
- return "";
580
- }
581
- return item;
582
- }
583
- let localizedItem;
584
- localizedItem = locale && item[locale] ? item[locale] : item[Object.keys(item)[0]];
585
- if (localizedItem === void 0 || localizedItem === null) {
586
- localizedItem = "";
587
- }
588
- return localizedItem;
589
- };
590
- const treatedDashboards = [];
591
- for (const dashboard of dashboards) {
592
- const treatedDashboard = {
593
- accessibleBy: [],
594
- accessRights: combineRights(dashboard, user),
595
- id: dashboard.id,
596
- modifiedAt: dashboard.modified_at,
597
- name: localize(dashboard.name, dashboardComponent.language),
598
- slug: null,
599
- tags: dashboard.tags.map((t5) => t5.tag).sort((t1, t22) => t1.localeCompare(t22))
600
- };
601
- const currentIntegration = dashboard.integrations.find(
602
- (i6) => i6.id === integrationId
603
- );
604
- if (currentIntegration?.integrationAccessRight?.slug) {
605
- treatedDashboard.slug = currentIntegration.integrationAccessRight.slug;
606
- }
607
- const users = dashboard.users.map((u3) => ({
608
- model: "User",
609
- id: u3.id,
610
- name: localize(u3.name, user.locale_id)
611
- }));
612
- const groups = dashboard.groups.map((g2) => ({
613
- model: "Group",
614
- id: g2.id,
615
- name: localize(g2.name, user.locale_id) || {}
616
- }));
617
- const integrations = dashboard.integrations.map((i6) => ({
618
- model: "Integration",
619
- id: i6.id,
620
- name: localize(i6.name, user.locale_id) || {}
621
- }));
622
- treatedDashboard.accessibleBy = [...users, ...groups, ...integrations];
623
- treatedDashboards.push(treatedDashboard);
624
- }
625
- return treatedDashboards;
626
- };
627
- var VERSION = "0.0.0-shared-luzmo";
628
- var sanitizeUrl = (url) => {
629
- const invalidPrototcolRegex = /^(%20|\s)*(javascript|data)/im;
630
- const ctrlCharactersRegex = /[^\u0020-\u007E]/gim;
631
- const urlSchemeRegex = /^([^:]+):/gm;
632
- const relativeFirstCharacters = /* @__PURE__ */ new Set([".", "/"]);
633
- const isRelativeUrlWithoutProtocol = (relativeUrl) => relativeFirstCharacters.has(relativeUrl[0]);
634
- if (!url) {
635
- return "about:blank";
636
- }
637
- const sanitizedUrl = url.replaceAll(ctrlCharactersRegex, "").trim();
638
- if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
639
- return sanitizedUrl;
640
- }
641
- const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);
642
- if (!urlSchemeParseResults) {
643
- return sanitizedUrl;
644
- }
645
- const urlScheme = urlSchemeParseResults[0];
646
- if (invalidPrototcolRegex.test(urlScheme)) {
647
- return "about:blank";
648
- }
649
- return sanitizedUrl;
650
- };
651
- var cloneDeep = (obj) => JSON.parse(JSON.stringify(obj));
652
- var isObject = (o6) => o6 && typeof o6 === "object";
653
- var defaultsDeep = (target, defaults) => {
654
- Object.entries(defaults).forEach(([k2, v2]) => {
655
- if (k2 in target) {
656
- if (target[k2] === void 0) {
657
- target[k2] = v2;
658
- } else {
659
- target[k2] = isObject(v2) ? defaultsDeep(
660
- target[k2],
661
- v2
662
- ) : target[k2];
663
- }
664
- } else {
665
- target[k2] = v2;
666
- }
667
- });
668
- return target;
669
- };
670
- var uuidv4 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g, function(c4) {
671
- const r7 = Math.random() * 16 | 0;
672
- const v2 = c4 == "x" ? r7 : r7 & 3 | 8;
673
- return v2.toString(16);
674
- });
675
-
676
- // libs/embed-libs/shared-embed/src/lib/helpers/iframe-url.ts
677
- var createIframeUrl = (dashboardContent) => {
678
- const searchString = [];
679
- const {
680
- appServer,
681
- language,
682
- qeVersion,
683
- loaderBackground,
684
- loaderSpinnerColor,
685
- loaderSpinnerBackground,
686
- loaderFontColor,
687
- screenMode,
688
- key,
689
- token,
690
- timezoneId,
691
- itemEmbedding,
692
- itemDimensions,
693
- dashboardId,
694
- dashboardSlug,
695
- itemId,
696
- mainColor,
697
- accentColor,
698
- editMode
699
- } = dashboardContent.params;
700
- if (language && language !== "auto") {
701
- searchString.push("language=" + language);
702
- }
703
- if (qeVersion) {
704
- searchString.push(`qe_version=${qeVersion}`);
705
- }
706
- if (loaderBackground) {
707
- searchString.push(`ldrbg=${loaderBackground}`);
708
- }
709
- if (loaderFontColor) {
710
- searchString.push(`ldrftclr=${loaderFontColor}`);
711
- }
712
- if (loaderSpinnerColor) {
713
- searchString.push(`ldrspclr=${loaderSpinnerColor}`);
714
- }
715
- if (loaderSpinnerBackground) {
716
- searchString.push(`ldrspbg=${loaderSpinnerBackground}`);
717
- }
718
- if (mainColor) {
719
- searchString.push(`mainColor=${mainColor}`);
720
- }
721
- if (accentColor) {
722
- searchString.push(`accentColor=${accentColor}`);
723
- }
724
- if (screenMode && screenMode !== "auto") {
725
- searchString.push("screenMode=" + screenMode);
726
- }
727
- if (timezoneId) {
728
- searchString.push("timezoneId=" + timezoneId);
729
- }
730
- if (itemEmbedding && itemDimensions && itemDimensions.width) {
731
- searchString.push("width=" + itemDimensions.width);
732
- }
733
- if (itemEmbedding && itemDimensions && itemDimensions.height) {
734
- searchString.push("height=" + itemDimensions.height);
735
- }
736
- if (editMode) {
737
- searchString.push("editMode=" + editMode);
738
- }
739
- const keyTokenUrlAnchor = key && token ? "#" + key + ":" + token : "";
740
- searchString.push("version=" + (dashboardContent.VERSION || VERSION));
741
- const iframeUrl = itemEmbedding ? `${appServer}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
742
- searchString.join("&")
743
- )}${keyTokenUrlAnchor}` : `${appServer}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
744
- searchString.join("&")
745
- )}${keyTokenUrlAnchor}`;
746
- return sanitizeUrl(iframeUrl);
747
- };
748
-
749
- // libs/embed-libs/shared-embed/src/lib/helpers/get-loader.ts
750
- var getLoader = (dashboardComponent) => {
751
- let errorMsg;
752
- if (dashboardComponent.params.error || dashboardComponent.browserNotSupported.length > 0) {
753
- dashboardComponent.params.error = true;
754
- if (dashboardComponent.browserNotSupported) {
755
- errorMsg = "Browser is not supported.";
756
- }
757
- }
758
- const loadingMsg = translations_default.initializing[dashboardComponent.params.language] || translations_default.initializing.en;
759
- return dashboardComponent.browserNotSupported || dashboardComponent.params.error ? { loadingMsg, errorMsg } : { loadingMsg, errorMsg: "" };
760
- };
761
-
762
- // libs/embed-libs/shared-embed/src/lib/helpers/promise-dispatch.ts
763
- function resolvePromise(dashboardComponent, requestId, data) {
764
- if (dashboardComponent.promises[requestId]) {
765
- dashboardComponent.promises[requestId].resolve(data);
766
- delete dashboardComponent.promises[requestId];
767
- }
768
- }
769
- function rejectPromise(dashboardComponent, requestId, data) {
770
- if (dashboardComponent.promises[requestId]) {
771
- dashboardComponent.promises[requestId].reject(data);
772
- delete dashboardComponent.promises[requestId];
773
- }
774
- }
775
-
776
- // libs/embed-libs/shared-embed/src/lib/helpers/styles.ts
777
- function containerStyles(dashboardComponent) {
778
- const styles = {};
779
- if (dashboardComponent.params.loaderBackground && !dashboardComponent.iframeLoaded) {
780
- styles.background = dashboardComponent.params.loaderBackground;
781
- }
782
- return styles;
783
- }
784
- function containerLoaderStyles(dashboardComponent) {
785
- const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
786
- const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
787
- const display = dashboardComponent.iframeLoaded ? "none" : "";
788
- return {
789
- display,
790
- height: `${chartHeightDefined ? height : dashboardComponent.minHeight}px`
791
- };
792
- }
793
- function loaderStyles(dashboardComponent) {
794
- const background = dashboardComponent.params.loaderBackground || DEFAULT_PARAMETERS.loaderBackground;
795
- if (dashboardComponent.params.itemEmbedding) {
796
- dashboardComponent.loaderSize = 24;
797
- dashboardComponent.borderWidth = 4;
798
- dashboardComponent.minHeight = 200;
799
- const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
800
- const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
801
- const chartWidthDefined = width !== "auto";
802
- const chartHeightDefined = height !== "auto";
803
- return {
804
- background,
805
- width: chartWidthDefined ? `${width}px` : "100%",
806
- height: `${chartHeightDefined ? height : "200"}px`,
807
- "min-height": chartHeightDefined ? "" : "200px"
808
- };
809
- }
810
- return {
811
- background
812
- };
813
- }
814
- function plStyles(dashboardComponent) {
815
- const {
816
- loaderSpinnerColor: defaultSpinnerColor,
817
- loaderSpinnerBackground: defaultSpinnerBackground
818
- } = DEFAULT_PARAMETERS;
819
- const spinnerColorBorder = generateBorderStyle(
820
- dashboardComponent.borderWidth,
821
- dashboardComponent.params.loaderSpinnerColor || defaultSpinnerColor
822
- );
823
- const spinnerBackgroundBorder = generateBorderStyle(
824
- dashboardComponent.borderWidth,
825
- dashboardComponent.params.loaderSpinnerBackground || defaultSpinnerBackground
826
- );
827
- const size = `${dashboardComponent.loaderSize}px`;
828
- return {
829
- "border-top": spinnerColorBorder,
830
- "border-right": spinnerColorBorder,
831
- "border-bottom": spinnerBackgroundBorder,
832
- "border-left": spinnerBackgroundBorder,
833
- width: size,
834
- height: size
835
- };
836
- }
837
- function lcStyles(dashboardComponent) {
838
- const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
839
- const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
840
- const getPaddingStr = (value) => `${(value - dashboardComponent.loaderSize - 32) / 2}px`;
841
- const verticalPadding = dashboardComponent.params.itemId ? chartHeightDefined ? getPaddingStr(Number.parseInt(`${height}`, 10)) : getPaddingStr(dashboardComponent.minHeight) : "128px";
842
- return {
843
- padding: `${verticalPadding} 16px`
844
- };
845
- }
846
- function calculateIframeStyles(dashboardComponent) {
847
- const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
848
- const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
849
- if (dashboardComponent.params.itemEmbedding && height !== "auto") {
850
- dashboardComponent.iframeHeight = `${height}px`;
851
- } else if (dashboardComponent.params.itemEmbedding) {
852
- dashboardComponent.iframeHeight = "200px";
853
- } else if (["editFull", "editLimited"].includes(dashboardComponent.params.editMode)) {
854
- dashboardComponent.iframeHeight = "100%";
855
- } else {
856
- dashboardComponent.iframeHeight = "400px";
857
- }
858
- dashboardComponent.iframeWidth = dashboardComponent.params.itemEmbedding && width !== "auto" ? `${width}px` : "100%";
859
- const styles = {
860
- height: dashboardComponent.iframeHeight,
861
- width: dashboardComponent.iframeWidth
862
- };
863
- if (dashboardComponent.iframeLoaded) {
864
- styles.opacity = 1;
865
- } else if (dashboardComponent.error) {
866
- styles.opacity = 1;
867
- styles.width = "100%";
868
- styles.height = "400px";
869
- } else {
870
- styles.opacity = 0;
871
- }
872
- return styles;
873
- }
874
- function generateBorderStyle(borderWidth, color) {
875
- return `${borderWidth}px solid ${color}`;
876
- }
877
-
878
- // libs/embed-libs/shared-embed/src/lib/helpers/update-iframe-url.ts
879
- var updateIframeUrl = (iframe, iframeUrl) => {
880
- if (iframe?.contentWindow) {
881
- iframe.contentWindow.location.replace(iframeUrl);
882
- }
883
- };
884
-
885
- // libs/embed-libs/shared-embed/src/lib/methods/export-dashboard.ts
886
- var exportDashboard = (dashboardComponent, iframe, format) => {
887
- const requestId = uuidv4();
888
- if (iframe?.contentWindow) {
889
- iframe.contentWindow.postMessage(
890
- {
891
- action: "exportDashboard",
892
- format: format || "png",
893
- _version: dashboardComponent.VERSION,
894
- requestId
895
- },
896
- "*"
897
- );
898
- return new Promise((resolve, reject) => {
899
- dashboardComponent.promises[requestId] = { resolve, reject };
900
- setTimeout(() => {
901
- if (dashboardComponent.promises[requestId]) {
902
- const errorMessage = "exportDashboard request timed out.";
903
- dashboardComponent.promises[requestId].reject(
904
- new Error(errorMessage)
905
- );
906
- delete dashboardComponent.promises[requestId];
907
- }
908
- }, 12e5);
909
- });
910
- }
911
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
912
- };
913
-
914
- // libs/embed-libs/shared-embed/src/lib/methods/get-accessible-dashboards.ts
915
- var getAccessibleDashboards = (dashboardComponent) => {
916
- if ((dashboardComponent.currentAuthKey ?? dashboardComponent.authKey) && (dashboardComponent.currentAuthToken ?? dashboardComponent.authToken)) {
917
- const fetchUser = new Promise((resolve, reject) => {
918
- void (() => {
919
- try {
920
- const responsePromise = window.fetch(
921
- // With experimental=true URLs remove the trailing slash, since the web component expects them to not have it.
922
- // Fixes incorrect url with experimental=true
923
- `${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/authorization`,
924
- {
925
- method: "POST",
926
- mode: "cors",
927
- cache: "no-cache",
928
- headers: { "Content-Type": "application/json" },
929
- redirect: "follow",
930
- body: JSON.stringify({
931
- action: "get",
932
- version: "0.1.0",
933
- key: dashboardComponent.currentAuthKey ?? dashboardComponent.authKey,
934
- token: dashboardComponent.currentAuthToken ?? dashboardComponent.authToken,
935
- find: {
936
- where: { id: dashboardComponent.authKey },
937
- attributes: ["id", "integration_id"],
938
- include: [
939
- {
940
- model: "User",
941
- attributes: ["id", "name", "locale_id"],
942
- include: [{ model: "Group" }]
943
- }
944
- ]
945
- }
946
- })
947
- }
948
- );
949
- responsePromise.then((response) => response.json()).then((data) => {
950
- if (!data || !data.rows || data.rows.length === 0 || !data.rows[0].user) {
951
- reject("Authorization failed, please check authKey and authToken. If the problem persists, please contact support@luzmo.com.");
952
- } else {
953
- data.rows[0].user.userGroups = data.rows[0].user.groups.map(
954
- (group) => group.id
955
- );
956
- delete data.rows[0].user.groups;
957
- resolve({
958
- integrationId: data.rows[0].integration_id,
959
- user: data.rows[0].user
960
- });
961
- }
962
- });
963
- } catch (error) {
964
- reject(error);
965
- }
966
- })();
967
- });
968
- return new Promise((resolve, reject) => void (() => {
969
- try {
970
- fetchUser.then((authorizationData) => {
971
- const responsePromise = window.fetch(
972
- // With experimental=true URLs remove the trailing slash, since the web component expects them to not have it.
973
- // Fixes incorrect url with experimental=true
974
- `${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/securable`,
975
- {
976
- method: "POST",
977
- mode: "cors",
978
- cache: "no-cache",
979
- headers: { "Content-Type": "application/json" },
980
- redirect: "follow",
981
- body: JSON.stringify({
982
- action: "get",
983
- version: "0.1.0",
984
- key: dashboardComponent.currentAuthKey ?? dashboardComponent.authKey,
985
- token: dashboardComponent.currentAuthToken ?? dashboardComponent.authToken,
986
- find: {
987
- where: { type: "dashboard", is_variant: false },
988
- attributes: ["id", "name", "modified_at"],
989
- order: [["modified_at", "desc"]],
990
- include: [
991
- { model: "Tag", attributes: ["tag"] },
992
- { model: "User", attributes: ["id", "name"] },
993
- {
994
- model: "Group",
995
- attributes: ["id", "name", "public"]
996
- },
997
- { model: "Integration", attributes: ["id", "name"] }
998
- ]
999
- }
1000
- })
1001
- }
1002
- );
1003
- responsePromise.then((response) => response.json()).then((data) => {
1004
- const dashboardList = data.rows.length > 0 ? formatDashboardList(
1005
- data.rows,
1006
- authorizationData.integrationId,
1007
- authorizationData.user,
1008
- dashboardComponent
1009
- ) : [];
1010
- resolve(dashboardList);
1011
- });
1012
- }).catch((error) => {
1013
- reject(error);
1014
- });
1015
- } catch (error) {
1016
- reject(error);
1017
- }
1018
- })());
1019
- }
1020
- throw new Error("No authKey or authToken found in the luzmo-dashboard component.");
1021
- };
1022
-
1023
- // libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
1024
- var getData = (dashboardComponent, iframe, itemId) => {
1025
- if (iframe?.contentWindow) {
1026
- const requestId = uuidv4();
1027
- iframe.contentWindow.postMessage(
1028
- {
1029
- action: "getData",
1030
- id: itemId,
1031
- _version: dashboardComponent.VERSION,
1032
- requestId
1033
- },
1034
- "*"
1035
- );
1036
- return new Promise((resolve, reject) => {
1037
- dashboardComponent.promises[requestId] = { resolve, reject };
1038
- setTimeout(() => {
1039
- if (dashboardComponent.promises[requestId]) {
1040
- const errorMessage = "getData request timed out.";
1041
- dashboardComponent.promises[requestId].reject(
1042
- new Error(errorMessage)
1043
- );
1044
- delete dashboardComponent.promises[requestId];
1045
- }
1046
- }, 2e3);
1047
- });
1048
- }
1049
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
1050
- };
1051
-
1052
- // libs/embed-libs/shared-embed/src/lib/methods/get-filters.ts
1053
- var getFilters = (dashboardComponent, iframe) => {
1054
- if (iframe?.contentWindow) {
1055
- const requestId = uuidv4();
1056
- iframe.contentWindow.postMessage(
1057
- { action: "getFilters", _version: dashboardComponent.VERSION, requestId },
1058
- "*"
1059
- );
1060
- return new Promise((resolve, reject) => {
1061
- dashboardComponent.promises[requestId] = { resolve, reject };
1062
- setTimeout(() => {
1063
- if (dashboardComponent.promises[requestId]) {
1064
- const errorMessage = "getFilters request timed out.";
1065
- dashboardComponent.promises[requestId].reject(
1066
- new Error(errorMessage)
1067
- );
1068
- delete dashboardComponent.promises[requestId];
1069
- }
1070
- }, 2e3);
1071
- });
1072
- }
1073
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
1074
- };
1075
-
1076
- // libs/embed-libs/shared-embed/src/lib/methods/refresh-data.ts
1077
- var refreshData = (dashboardComponent, iframe, itemId) => {
1078
- if (iframe) {
1079
- iframe.contentWindow.postMessage(
1080
- {
1081
- action: "refreshData",
1082
- id: itemId ?? null,
1083
- _version: dashboardComponent.VERSION
1084
- },
1085
- "*"
1086
- );
1087
- return Promise.resolve();
1088
- }
1089
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
1090
- };
1091
-
1092
- // libs/embed-libs/shared-embed/src/lib/methods/reload-dashboard.ts
1093
- var reloadDashboard = (dashboardComponent, iframe) => {
1094
- if (iframe) {
1095
- iframe.contentWindow.postMessage(
1096
- { action: "reloadDashboard", _version: dashboardComponent.VERSION },
1097
- "*"
1098
- );
1099
- return Promise.resolve();
1100
- }
1101
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
1102
- };
1103
-
1104
- // libs/embed-libs/shared-embed/src/lib/methods/set-authorization.ts
1105
- var setAuthorization = (dashboardComponent, iframe, key, token) => {
1106
- if (iframe) {
1107
- iframe.contentWindow.postMessage(
1108
- {
1109
- action: "setAuthorization",
1110
- key,
1111
- token,
1112
- _version: dashboardComponent.VERSION
1113
- },
1114
- "*"
1115
- );
1116
- return Promise.resolve();
1117
- }
1118
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
1119
- };
1120
-
1121
- // libs/embed-libs/shared-embed/src/lib/methods/set-edit-mode.ts
1122
- var setEditMode = (dashboardComponent, iframe, editMode) => {
1123
- if (iframe && iframe.contentWindow) {
1124
- const requestId = uuidv4();
1125
- if (dashboardComponent.params.editMode === editMode) {
1126
- return Promise.reject(
1127
- new Error("editMode parameter is currently already set to " + editMode)
1128
- );
1129
- } else if (editMode !== "editFull" && editMode !== "editLimited" && editMode !== "view") {
1130
- return Promise.reject(
1131
- new Error(
1132
- "The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'."
1133
- )
1134
- );
1135
- }
1136
- iframe.contentWindow.postMessage(
1137
- {
1138
- action: "setEditMode",
1139
- editMode,
1140
- _version: dashboardComponent.VERSION,
1141
- requestId
1142
- },
1143
- "*"
1144
- );
1145
- return new Promise((resolve, reject) => {
1146
- dashboardComponent.promises[requestId] = { resolve, reject };
1147
- });
1148
- }
1149
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
1150
- };
1151
-
1152
- // libs/embed-libs/shared-embed/src/lib/methods/set-filters.ts
1153
- var setFilters = (dashboardComponent, iframe, itemId, filters) => {
1154
- if (iframe) {
1155
- const requestId = uuidv4();
1156
- iframe.contentWindow.postMessage(
1157
- {
1158
- action: "setFilters",
1159
- itemId,
1160
- filters,
1161
- _version: dashboardComponent.VERSION,
1162
- requestId
1163
- },
1164
- "*"
1165
- );
1166
- return new Promise((resolve, reject) => {
1167
- dashboardComponent.promises[requestId] = { resolve, reject };
1168
- setTimeout(() => {
1169
- if (dashboardComponent.promises[requestId]) {
1170
- const errorMessage = "setFilters request timed out.";
1171
- dashboardComponent.promises[requestId].reject(
1172
- new Error(errorMessage)
1173
- );
1174
- delete dashboardComponent.promises[requestId];
1175
- }
1176
- }, 2e3);
1177
- });
1178
- }
1179
- return Promise.reject();
1180
- };
1181
-
1182
- // libs/embed-libs/shared-embed/src/lib/methods/set-preview.ts
1183
- var setPreview = (dashboardComponent, iframe, preview) => {
1184
- if (iframe) {
1185
- const requestId = uuidv4();
1186
- iframe.contentWindow.postMessage(
1187
- {
1188
- action: "setPreview",
1189
- preview,
1190
- requestId,
1191
- _version: dashboardComponent.VERSION
1192
- },
1193
- "*"
1194
- );
1195
- return new Promise((resolve, reject) => {
1196
- dashboardComponent.promises[requestId] = { resolve, reject };
1197
- setTimeout(() => {
1198
- if (dashboardComponent.promises[requestId]) {
1199
- const errorMessage = "setPreview request timed out.";
1200
- dashboardComponent.promises[requestId].reject(
1201
- new Error(errorMessage)
1202
- );
1203
- delete dashboardComponent.promises[requestId];
1204
- }
1205
- }, 2e3);
1206
- });
1207
- }
1208
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
1209
- };
1210
-
1211
- // libs/embed-libs/shared-embed/src/lib/service/calculate-dimensions.ts
1212
- var _setCalculatedDimensions = (dashboardComponent) => {
1213
- if (!dashboardComponent.dimensions) {
1214
- dashboardComponent.params.error = true;
1215
- _handleError("Got no valid dimensions.", dashboardComponent.params);
1216
- return;
1217
- }
1218
- const dashboardDimensionKeys = Object.keys(
1219
- dashboardComponent.dimensions
1220
- );
1221
- const availableScreenModeExtents = [];
1222
- let currentMode;
1223
- let currentWidth = 0;
1224
- let currentHeight = 0;
1225
- if (!dashboardComponent.params.switchScreenModeOnResize && dashboardComponent.currentScreenMode) {
1226
- dashboardComponent.params.screenMode = dashboardComponent.currentScreenMode;
1227
- }
1228
- if (dashboardComponent.dimensions && dashboardDimensionKeys?.[0] === "fixed") {
1229
- currentMode = "fixed";
1230
- currentWidth = dashboardComponent.dimensions.fixed[0];
1231
- currentHeight = dashboardComponent.dimensions.fixed[1];
1232
- } else {
1233
- const screenModes = [
1234
- "mobile",
1235
- "tablet",
1236
- "desktop",
1237
- "largeScreen"
1238
- ];
1239
- if (dashboardComponent.params.itemEmbedding) {
1240
- const [firstMatch] = dashboardDimensionKeys;
1241
- let match = cloneDeep(firstMatch);
1242
- for (const screenMode of screenModes) {
1243
- const found = dashboardDimensionKeys.find((key) => key === screenMode);
1244
- if (found) {
1245
- match = cloneDeep(found);
1246
- } else {
1247
- dashboardComponent.dimensions[screenMode] = dashboardComponent.dimensions[match];
1248
- }
1249
- }
1250
- }
1251
- for (const key of dashboardDimensionKeys) {
1252
- if (screenModes.includes(key)) {
1253
- const screenMode = EXTENTS.find((extent) => extent.mode === key);
1254
- availableScreenModeExtents.push({
1255
- ...screenMode,
1256
- height: dashboardComponent.dimensions[key][1] || 50
1257
- });
1258
- }
1259
- }
1260
- if (!availableScreenModeExtents.map((screenModeExtent) => screenModeExtent.mode).includes(dashboardComponent.params.screenMode)) {
1261
- dashboardComponent.params.screenMode = "auto";
1262
- }
1263
- if (dashboardComponent.params.screenMode === "auto") {
1264
- availableScreenModeExtents.sort(
1265
- (a3, b3) => screenModes.indexOf(a3.mode) - screenModes.indexOf(b3.mode)
1266
- );
1267
- for (const screenModeExtent of availableScreenModeExtents) {
1268
- const [screenModeExtentMinWidth, screenModeExtentMaxWidth] = screenModeExtent.width;
1269
- if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
1270
- if (screenModeExtentMinWidth < dashboardComponent.params.itemDimensions.width) {
1271
- currentMode = screenModeExtent.mode;
1272
- currentWidth = Number.parseInt(
1273
- dashboardComponent.params.itemDimensions.width,
1274
- 10
1275
- );
1276
- currentHeight = dashboardComponent.dimensions[currentMode][1];
1277
- }
1278
- } else {
1279
- if (screenModeExtentMinWidth < dashboardComponent.containerWidth) {
1280
- currentMode = screenModeExtent.mode;
1281
- if (dashboardComponent.params.itemEmbedding) {
1282
- currentWidth = dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto" ? Number.parseInt(
1283
- dashboardComponent.params.itemDimensions.width,
1284
- 10
1285
- ) : Math.min(
1286
- dashboardComponent.containerWidth,
1287
- screenModeExtentMaxWidth
1288
- );
1289
- currentHeight = dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto" ? Number.parseInt(
1290
- dashboardComponent.params.itemDimensions.height,
1291
- 10
1292
- ) : dashboardComponent.dimensions[currentMode][1];
1293
- if (dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
1294
- currentWidth = Number.parseInt(
1295
- dashboardComponent.params.itemDimensions.width,
1296
- 10
1297
- );
1298
- currentHeight = dashboardComponent.dimensions[currentMode][1];
1299
- }
1300
- } else {
1301
- currentWidth = Math.max(
1302
- Math.min(
1303
- screenModeExtentMaxWidth,
1304
- dashboardComponent.containerWidth
1305
- ),
1306
- screenModeExtentMinWidth
1307
- );
1308
- currentHeight = screenModeExtent.height;
1309
- }
1310
- }
1311
- }
1312
- }
1313
- } else {
1314
- const {
1315
- height: chosenModeHeight,
1316
- width: [chosenModeMinWidth, chosenModeMaxWidth]
1317
- } = availableScreenModeExtents.find(
1318
- (d3) => d3.mode === dashboardComponent.params.screenMode
1319
- );
1320
- currentMode = dashboardComponent.params.screenMode;
1321
- currentWidth = Math.max(
1322
- Math.min(chosenModeMaxWidth, dashboardComponent.containerWidth),
1323
- chosenModeMinWidth
1324
- );
1325
- currentHeight = chosenModeHeight;
1326
- if (dashboardComponent.params.itemEmbedding) {
1327
- if (dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto") {
1328
- currentWidth = Number.parseInt(
1329
- dashboardComponent.params.itemDimensions.width,
1330
- 10
1331
- );
1332
- }
1333
- if (dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto") {
1334
- currentHeight = Number.parseInt(
1335
- dashboardComponent.params.itemDimensions.height,
1336
- 10
1337
- );
1338
- }
1339
- }
1340
- }
1341
- if (!currentMode && availableScreenModeExtents.length > 0) {
1342
- const [lowestModeExtent] = availableScreenModeExtents;
1343
- currentMode = lowestModeExtent.mode;
1344
- currentWidth = lowestModeExtent.width[0];
1345
- currentHeight = lowestModeExtent.height;
1346
- }
1347
- }
1348
- dashboardComponent.currentScreenMode = currentMode;
1349
- const style = {
1350
- height: currentHeight === 0 ? "100%" : `${String(currentHeight)}px`,
1351
- width: currentWidth === 0 ? "100%" : `${String(currentWidth)}px`,
1352
- opacity: 1
1353
- };
1354
- const dashboardEditModes = ["editFull", "editLimited"];
1355
- if (dashboardEditModes.includes(dashboardComponent.params.editMode)) {
1356
- style.height = "100%";
1357
- style.width = "100%";
1358
- } else if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions) {
1359
- style.height = dashboardComponent.params.itemDimensions.height === "auto" ? style.height : `${String(dashboardComponent.params.itemDimensions.height).replace(
1360
- "px",
1361
- ""
1362
- )}px`;
1363
- style.width = dashboardComponent.params.itemDimensions.width === "auto" ? style.width : `${String(dashboardComponent.params.itemDimensions.width).replace(
1364
- "px",
1365
- ""
1366
- )}px`;
1367
- } else {
1368
- style.height = currentHeight === 0 ? "100%" : `${String(currentHeight)}px`;
1369
- style.width = currentWidth === 0 ? "100%" : `${String(currentWidth)}px`;
1370
- }
1371
- dashboardComponent.currentScreenMode = currentMode;
1372
- dashboardComponent.iframeStyle = style;
1373
- };
1374
-
1375
- // libs/embed-libs/shared-embed/src/lib/service/extend-and-validate.ts
1376
- var _extendAndValidate = (dashboardContent) => {
1377
- const defaultKeys = Object.keys(
1378
- DEFAULT_PARAMETERS
1379
- );
1380
- const errorMessages = [];
1381
- const requiredStringParams = [
1382
- "appServer",
1383
- "language",
1384
- "apiHost"
1385
- ];
1386
- const requiredStringOrEmptyParams = [
1387
- "key",
1388
- "token",
1389
- "screenMode",
1390
- "timezoneId",
1391
- "itemId",
1392
- "container",
1393
- "loaderBackground",
1394
- "loaderFontColor",
1395
- "loaderSpinnerColor",
1396
- "loaderSpinnerBackground"
1397
- ];
1398
- const objectParams = ["itemDimensions"];
1399
- const screenModes = [
1400
- "mobile",
1401
- "tablet",
1402
- "desktop",
1403
- "largeScreen",
1404
- "fixed",
1405
- "auto"
1406
- ];
1407
- for (const key of defaultKeys) {
1408
- if (dashboardContent.params[key] === null) {
1409
- delete dashboardContent.params[key];
1410
- }
1411
- }
1412
- dashboardContent.params = defaultsDeep(
1413
- dashboardContent.params,
1414
- DEFAULT_PARAMETERS
1415
- );
1416
- if ((!dashboardContent.params.dashboardId || typeof dashboardContent.params.dashboardId !== "string") && (!dashboardContent.params.dashboardSlug || typeof dashboardContent.params.dashboardSlug !== "string")) {
1417
- delete dashboardContent.params.dashboardId;
1418
- delete dashboardContent.params.dashboardSlug;
1419
- }
1420
- for (const key of requiredStringParams) {
1421
- if (typeof dashboardContent.params[key] !== "string") {
1422
- delete dashboardContent.params[key];
1423
- errorMessages.push(`${key} needs to be of type string.`);
1424
- }
1425
- }
1426
- for (const key of requiredStringOrEmptyParams) {
1427
- if (typeof dashboardContent.params[key] !== "string" && dashboardContent.params[key] !== null && dashboardContent.params[key] !== void 0) {
1428
- delete dashboardContent.params[key];
1429
- errorMessages.push(`${key} needs to be of type string or empty.`);
1430
- }
1431
- }
1432
- if (dashboardContent.params.screenMode && !screenModes.includes(dashboardContent.params.screenMode)) {
1433
- const validTypesString = screenModes.map((mode) => `"${mode}"`).join(", ");
1434
- errorMessages.push(
1435
- `"screenMode" needs should be one of these types: ${validTypesString}`
1436
- );
1437
- dashboardContent.params.screenMode = "auto";
1438
- }
1439
- if (dashboardContent.params.itemId) {
1440
- dashboardContent.params.itemEmbedding = true;
1441
- }
1442
- for (const key of objectParams) {
1443
- if (typeof dashboardContent.params[key] !== "object" && dashboardContent.params[key] !== null) {
1444
- delete dashboardContent.params[key];
1445
- errorMessages.push(`${key} needs to be of type object or empty.`);
1446
- }
1447
- }
1448
- if (typeof dashboardContent.params.switchScreenModeOnResize !== "boolean") {
1449
- errorMessages.push("switchScreenModeOnResize needs to be of type boolean.");
1450
- dashboardContent.params.switchScreenModeOnResize = true;
1451
- }
1452
- if (dashboardContent.params.itemDimensions) {
1453
- const itemDimensionsKeys = [
1454
- "width",
1455
- "height"
1456
- ];
1457
- for (const key of itemDimensionsKeys) {
1458
- if (!["string", "number"].includes(
1459
- typeof dashboardContent.params.itemDimensions[key]
1460
- ) && dashboardContent.params.itemDimensions[key] !== null) {
1461
- errorMessages.push(
1462
- `itemDimensions ${key} needs to be of type string, number or empty.`
1463
- );
1464
- }
1465
- }
1466
- }
1467
- dashboardContent.params = defaultsDeep(
1468
- dashboardContent.params,
1469
- DEFAULT_PARAMETERS
1470
- );
1471
- if (dashboardContent.params.screenMode && dashboardContent.params.screenMode !== "auto") {
1472
- dashboardContent.params.switchScreenModeOnResize = false;
1473
- }
1474
- if (dashboardContent.params.itemDimensions.width !== "auto") {
1475
- dashboardContent.params.itemDimensions.width = Number.parseInt(
1476
- `${dashboardContent.params.itemDimensions.width}`.replace("px", ""),
1477
- 10
1478
- ) || "auto";
1479
- }
1480
- if (dashboardContent.params.itemDimensions.height !== "auto") {
1481
- dashboardContent.params.itemDimensions.height = Number.parseInt(
1482
- `${dashboardContent.params.itemDimensions.height}`.replace("px", ""),
1483
- 10
1484
- ) || "auto";
1485
- }
1486
- dashboardContent.params.itemEmbedding = !!dashboardContent.params.itemId;
1487
- if (dashboardContent.params.error || errorMessages.length > 0) {
1488
- _handleError(errorMessages.join("\n"), dashboardContent.params);
1489
- }
1490
- };
1491
-
1492
- // libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
1493
- var luzmoEmbedContainerClass = "luzmo-embed-container";
1494
-
1495
- // libs/embed-libs/shared-embed/src/lib/helpers/remote-federation.ts
1496
- var remotesMap = {
1497
- // "remote_app": { url: "http://localhost:4201/remoteEntry.mjs", format: "esm", from: "vite" },
1498
- };
1499
- var loadJS = async (url, fn) => {
1500
- const resolvedUrl = typeof url === "function" ? await url() : url;
1501
- const script = document.createElement("script");
1502
- script.type = "text/javascript";
1503
- script.addEventListener("load", fn);
1504
- script.src = resolvedUrl;
1505
- document.querySelectorAll("head")[0].append(script);
1506
- };
1507
- var wrapShareModule = (remoteFrom) => ({});
1508
- async function __federationMethodEnsure(remoteId) {
1509
- const remote = remotesMap[remoteId];
1510
- if (remote.inited) {
1511
- return remote.lib;
1512
- }
1513
- if (remote.format === "var") {
1514
- return new Promise((resolve) => {
1515
- const callback = () => {
1516
- if (!remote.inited) {
1517
- remote.lib = window[remoteId];
1518
- remote.lib.init(wrapShareModule(remote.from));
1519
- remote.inited = true;
1520
- }
1521
- resolve(remote.lib);
1522
- };
1523
- return loadJS(remote.url, callback);
1524
- });
1525
- } else if (["esm", "systemjs"].includes(remote.format)) {
1526
- return new Promise((resolve, reject) => {
1527
- const getUrl = typeof remote.url === "function" ? remote.url : () => Promise.resolve(remote.url);
1528
- getUrl().then((url) => {
1529
- import(
1530
- /* @vite-ignore */
1531
- /* webpackIgnore: true */
1532
- url
1533
- ).then((lib) => {
1534
- if (!remote.inited) {
1535
- const shareScope = wrapShareModule(remote.from);
1536
- lib.init(shareScope);
1537
- remote.lib = lib;
1538
- remote.lib.init(shareScope);
1539
- remote.inited = true;
1540
- }
1541
- resolve(remote.lib);
1542
- }).catch(reject);
1543
- });
1544
- });
1545
- }
1546
- }
1547
- function __federationMethodWrapDefault(module2, need) {
1548
- if (!(module2 == null ? void 0 : module2.default) && need) {
1549
- const obj = /* @__PURE__ */ Object.create(null);
1550
- obj.default = module2;
1551
- obj.__esModule = true;
1552
- return obj;
1553
- }
1554
- return module2;
1555
- }
1556
- async function __federationMethodGetRemote(remoteName, componentName) {
1557
- return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
1558
- }
1559
-
1560
- // node_modules/lit-html/lit-html.js
1561
- var t3 = globalThis;
1562
- var i3 = t3.trustedTypes;
1563
- var s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t5) => t5 }) : void 0;
1564
- var e5 = "$lit$";
1565
- var h2 = `lit$${(Math.random() + "").slice(9)}$`;
1566
- var o4 = "?" + h2;
1567
- var n4 = `<${o4}>`;
1568
- var r5 = document;
1569
- var l2 = () => r5.createComment("");
1570
- var c3 = (t5) => null === t5 || "object" != typeof t5 && "function" != typeof t5;
1571
- var a2 = Array.isArray;
1572
- var u2 = (t5) => a2(t5) || "function" == typeof t5?.[Symbol.iterator];
1573
- var d2 = "[ \n\f\r]";
1574
- var f2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
1575
- var v = /-->/g;
1576
- var _ = />/g;
1577
- var m = RegExp(`>|${d2}(?:([^\\s"'>=/]+)(${d2}*=${d2}*(?:[^
1578
- \f\r"'\`<>=]|("|')|))|$)`, "g");
1579
- var p2 = /'/g;
1580
- var g = /"/g;
1581
- var $ = /^(?:script|style|textarea|title)$/i;
1582
- var y2 = (t5) => (i6, ...s4) => ({ _$litType$: t5, strings: i6, values: s4 });
1583
- var x = y2(1);
1584
- var b2 = y2(2);
1585
- var w = Symbol.for("lit-noChange");
1586
- var T = Symbol.for("lit-nothing");
1587
- var A = /* @__PURE__ */ new WeakMap();
1588
- var E = r5.createTreeWalker(r5, 129);
1589
- function C(t5, i6) {
1590
- if (!Array.isArray(t5) || !t5.hasOwnProperty("raw"))
1591
- throw Error("invalid template strings array");
1592
- return void 0 !== s2 ? s2.createHTML(i6) : i6;
1593
- }
1594
- var P = (t5, i6) => {
1595
- const s4 = t5.length - 1, o6 = [];
1596
- let r7, l3 = 2 === i6 ? "<svg>" : "", c4 = f2;
1597
- for (let i7 = 0; i7 < s4; i7++) {
1598
- const s5 = t5[i7];
1599
- let a3, u3, d3 = -1, y3 = 0;
1600
- for (; y3 < s5.length && (c4.lastIndex = y3, u3 = c4.exec(s5), null !== u3); )
1601
- y3 = c4.lastIndex, c4 === f2 ? "!--" === u3[1] ? c4 = v : void 0 !== u3[1] ? c4 = _ : void 0 !== u3[2] ? ($.test(u3[2]) && (r7 = RegExp("</" + u3[2], "g")), c4 = m) : void 0 !== u3[3] && (c4 = m) : c4 === m ? ">" === u3[0] ? (c4 = r7 ?? f2, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c4.lastIndex - u3[2].length, a3 = u3[1], c4 = void 0 === u3[3] ? m : '"' === u3[3] ? g : p2) : c4 === g || c4 === p2 ? c4 = m : c4 === v || c4 === _ ? c4 = f2 : (c4 = m, r7 = void 0);
1602
- const x2 = c4 === m && t5[i7 + 1].startsWith("/>") ? " " : "";
1603
- l3 += c4 === f2 ? s5 + n4 : d3 >= 0 ? (o6.push(a3), s5.slice(0, d3) + e5 + s5.slice(d3) + h2 + x2) : s5 + h2 + (-2 === d3 ? i7 : x2);
1604
- }
1605
- return [C(t5, l3 + (t5[s4] || "<?>") + (2 === i6 ? "</svg>" : "")), o6];
1606
- };
1607
- var V = class _V {
1608
- constructor({ strings: t5, _$litType$: s4 }, n6) {
1609
- let r7;
1610
- this.parts = [];
1611
- let c4 = 0, a3 = 0;
1612
- const u3 = t5.length - 1, d3 = this.parts, [f3, v2] = P(t5, s4);
1613
- if (this.el = _V.createElement(f3, n6), E.currentNode = this.el.content, 2 === s4) {
1614
- const t6 = this.el.content.firstChild;
1615
- t6.replaceWith(...t6.childNodes);
1616
- }
1617
- for (; null !== (r7 = E.nextNode()) && d3.length < u3; ) {
1618
- if (1 === r7.nodeType) {
1619
- if (r7.hasAttributes())
1620
- for (const t6 of r7.getAttributeNames())
1621
- if (t6.endsWith(e5)) {
1622
- const i6 = v2[a3++], s5 = r7.getAttribute(t6).split(h2), e7 = /([.?@])?(.*)/.exec(i6);
1623
- d3.push({ type: 1, index: c4, name: e7[2], strings: s5, ctor: "." === e7[1] ? k : "?" === e7[1] ? H : "@" === e7[1] ? I : R }), r7.removeAttribute(t6);
1624
- } else
1625
- t6.startsWith(h2) && (d3.push({ type: 6, index: c4 }), r7.removeAttribute(t6));
1626
- if ($.test(r7.tagName)) {
1627
- const t6 = r7.textContent.split(h2), s5 = t6.length - 1;
1628
- if (s5 > 0) {
1629
- r7.textContent = i3 ? i3.emptyScript : "";
1630
- for (let i6 = 0; i6 < s5; i6++)
1631
- r7.append(t6[i6], l2()), E.nextNode(), d3.push({ type: 2, index: ++c4 });
1632
- r7.append(t6[s5], l2());
1633
- }
1634
- }
1635
- } else if (8 === r7.nodeType)
1636
- if (r7.data === o4)
1637
- d3.push({ type: 2, index: c4 });
1638
- else {
1639
- let t6 = -1;
1640
- for (; -1 !== (t6 = r7.data.indexOf(h2, t6 + 1)); )
1641
- d3.push({ type: 7, index: c4 }), t6 += h2.length - 1;
1642
- }
1643
- c4++;
1644
- }
1645
- }
1646
- static createElement(t5, i6) {
1647
- const s4 = r5.createElement("template");
1648
- return s4.innerHTML = t5, s4;
1649
- }
1650
- };
1651
- function N(t5, i6, s4 = t5, e7) {
1652
- if (i6 === w)
1653
- return i6;
1654
- let h3 = void 0 !== e7 ? s4._$Co?.[e7] : s4._$Cl;
1655
- const o6 = c3(i6) ? void 0 : i6._$litDirective$;
1656
- return h3?.constructor !== o6 && (h3?._$AO?.(false), void 0 === o6 ? h3 = void 0 : (h3 = new o6(t5), h3._$AT(t5, s4, e7)), void 0 !== e7 ? (s4._$Co ??= [])[e7] = h3 : s4._$Cl = h3), void 0 !== h3 && (i6 = N(t5, h3._$AS(t5, i6.values), h3, e7)), i6;
1657
- }
1658
- var S2 = class {
1659
- constructor(t5, i6) {
1660
- this._$AV = [], this._$AN = void 0, this._$AD = t5, this._$AM = i6;
1661
- }
1662
- get parentNode() {
1663
- return this._$AM.parentNode;
1664
- }
1665
- get _$AU() {
1666
- return this._$AM._$AU;
1667
- }
1668
- u(t5) {
1669
- const { el: { content: i6 }, parts: s4 } = this._$AD, e7 = (t5?.creationScope ?? r5).importNode(i6, true);
1670
- E.currentNode = e7;
1671
- let h3 = E.nextNode(), o6 = 0, n6 = 0, l3 = s4[0];
1672
- for (; void 0 !== l3; ) {
1673
- if (o6 === l3.index) {
1674
- let i7;
1675
- 2 === l3.type ? i7 = new M(h3, h3.nextSibling, this, t5) : 1 === l3.type ? i7 = new l3.ctor(h3, l3.name, l3.strings, this, t5) : 6 === l3.type && (i7 = new L(h3, this, t5)), this._$AV.push(i7), l3 = s4[++n6];
1676
- }
1677
- o6 !== l3?.index && (h3 = E.nextNode(), o6++);
1678
- }
1679
- return E.currentNode = r5, e7;
1680
- }
1681
- p(t5) {
1682
- let i6 = 0;
1683
- for (const s4 of this._$AV)
1684
- void 0 !== s4 && (void 0 !== s4.strings ? (s4._$AI(t5, s4, i6), i6 += s4.strings.length - 2) : s4._$AI(t5[i6])), i6++;
1685
- }
1686
- };
1687
- var M = class _M {
1688
- get _$AU() {
1689
- return this._$AM?._$AU ?? this._$Cv;
1690
- }
1691
- constructor(t5, i6, s4, e7) {
1692
- this.type = 2, this._$AH = T, this._$AN = void 0, this._$AA = t5, this._$AB = i6, this._$AM = s4, this.options = e7, this._$Cv = e7?.isConnected ?? true;
1693
- }
1694
- get parentNode() {
1695
- let t5 = this._$AA.parentNode;
1696
- const i6 = this._$AM;
1697
- return void 0 !== i6 && 11 === t5?.nodeType && (t5 = i6.parentNode), t5;
1698
- }
1699
- get startNode() {
1700
- return this._$AA;
1701
- }
1702
- get endNode() {
1703
- return this._$AB;
1704
- }
1705
- _$AI(t5, i6 = this) {
1706
- t5 = N(this, t5, i6), c3(t5) ? t5 === T || null == t5 || "" === t5 ? (this._$AH !== T && this._$AR(), this._$AH = T) : t5 !== this._$AH && t5 !== w && this._(t5) : void 0 !== t5._$litType$ ? this.$(t5) : void 0 !== t5.nodeType ? this.T(t5) : u2(t5) ? this.k(t5) : this._(t5);
1707
- }
1708
- S(t5) {
1709
- return this._$AA.parentNode.insertBefore(t5, this._$AB);
1710
- }
1711
- T(t5) {
1712
- this._$AH !== t5 && (this._$AR(), this._$AH = this.S(t5));
1713
- }
1714
- _(t5) {
1715
- this._$AH !== T && c3(this._$AH) ? this._$AA.nextSibling.data = t5 : this.T(r5.createTextNode(t5)), this._$AH = t5;
1716
- }
1717
- $(t5) {
1718
- const { values: i6, _$litType$: s4 } = t5, e7 = "number" == typeof s4 ? this._$AC(t5) : (void 0 === s4.el && (s4.el = V.createElement(C(s4.h, s4.h[0]), this.options)), s4);
1719
- if (this._$AH?._$AD === e7)
1720
- this._$AH.p(i6);
1721
- else {
1722
- const t6 = new S2(e7, this), s5 = t6.u(this.options);
1723
- t6.p(i6), this.T(s5), this._$AH = t6;
1724
- }
1725
- }
1726
- _$AC(t5) {
1727
- let i6 = A.get(t5.strings);
1728
- return void 0 === i6 && A.set(t5.strings, i6 = new V(t5)), i6;
1729
- }
1730
- k(t5) {
1731
- a2(this._$AH) || (this._$AH = [], this._$AR());
1732
- const i6 = this._$AH;
1733
- let s4, e7 = 0;
1734
- for (const h3 of t5)
1735
- e7 === i6.length ? i6.push(s4 = new _M(this.S(l2()), this.S(l2()), this, this.options)) : s4 = i6[e7], s4._$AI(h3), e7++;
1736
- e7 < i6.length && (this._$AR(s4 && s4._$AB.nextSibling, e7), i6.length = e7);
1737
- }
1738
- _$AR(t5 = this._$AA.nextSibling, i6) {
1739
- for (this._$AP?.(false, true, i6); t5 && t5 !== this._$AB; ) {
1740
- const i7 = t5.nextSibling;
1741
- t5.remove(), t5 = i7;
1742
- }
1743
- }
1744
- setConnected(t5) {
1745
- void 0 === this._$AM && (this._$Cv = t5, this._$AP?.(t5));
1746
- }
1747
- };
1748
- var R = class {
1749
- get tagName() {
1750
- return this.element.tagName;
1751
- }
1752
- get _$AU() {
1753
- return this._$AM._$AU;
1754
- }
1755
- constructor(t5, i6, s4, e7, h3) {
1756
- this.type = 1, this._$AH = T, this._$AN = void 0, this.element = t5, this.name = i6, this._$AM = e7, this.options = h3, s4.length > 2 || "" !== s4[0] || "" !== s4[1] ? (this._$AH = Array(s4.length - 1).fill(new String()), this.strings = s4) : this._$AH = T;
1757
- }
1758
- _$AI(t5, i6 = this, s4, e7) {
1759
- const h3 = this.strings;
1760
- let o6 = false;
1761
- if (void 0 === h3)
1762
- t5 = N(this, t5, i6, 0), o6 = !c3(t5) || t5 !== this._$AH && t5 !== w, o6 && (this._$AH = t5);
1763
- else {
1764
- const e8 = t5;
1765
- let n6, r7;
1766
- for (t5 = h3[0], n6 = 0; n6 < h3.length - 1; n6++)
1767
- r7 = N(this, e8[s4 + n6], i6, n6), r7 === w && (r7 = this._$AH[n6]), o6 ||= !c3(r7) || r7 !== this._$AH[n6], r7 === T ? t5 = T : t5 !== T && (t5 += (r7 ?? "") + h3[n6 + 1]), this._$AH[n6] = r7;
1768
- }
1769
- o6 && !e7 && this.j(t5);
1770
- }
1771
- j(t5) {
1772
- t5 === T ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t5 ?? "");
1773
- }
1774
- };
1775
- var k = class extends R {
1776
- constructor() {
1777
- super(...arguments), this.type = 3;
1778
- }
1779
- j(t5) {
1780
- this.element[this.name] = t5 === T ? void 0 : t5;
1781
- }
1782
- };
1783
- var H = class extends R {
1784
- constructor() {
1785
- super(...arguments), this.type = 4;
1786
- }
1787
- j(t5) {
1788
- this.element.toggleAttribute(this.name, !!t5 && t5 !== T);
1789
- }
1790
- };
1791
- var I = class extends R {
1792
- constructor(t5, i6, s4, e7, h3) {
1793
- super(t5, i6, s4, e7, h3), this.type = 5;
1794
- }
1795
- _$AI(t5, i6 = this) {
1796
- if ((t5 = N(this, t5, i6, 0) ?? T) === w)
1797
- return;
1798
- const s4 = this._$AH, e7 = t5 === T && s4 !== T || t5.capture !== s4.capture || t5.once !== s4.once || t5.passive !== s4.passive, h3 = t5 !== T && (s4 === T || e7);
1799
- e7 && this.element.removeEventListener(this.name, this, s4), h3 && this.element.addEventListener(this.name, this, t5), this._$AH = t5;
1800
- }
1801
- handleEvent(t5) {
1802
- "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t5) : this._$AH.handleEvent(t5);
1803
- }
1804
- };
1805
- var L = class {
1806
- constructor(t5, i6, s4) {
1807
- this.element = t5, this.type = 6, this._$AN = void 0, this._$AM = i6, this.options = s4;
1808
- }
1809
- get _$AU() {
1810
- return this._$AM._$AU;
1811
- }
1812
- _$AI(t5) {
1813
- N(this, t5);
1814
- }
1815
- };
1816
- var Z = t3.litHtmlPolyfillSupport;
1817
- Z?.(V, M), (t3.litHtmlVersions ??= []).push("3.1.2");
1818
- var j = (t5, i6, s4) => {
1819
- const e7 = s4?.renderBefore ?? i6;
1820
- let h3 = e7._$litPart$;
1821
- if (void 0 === h3) {
1822
- const t6 = s4?.renderBefore ?? null;
1823
- e7._$litPart$ = h3 = new M(i6.insertBefore(l2(), t6), t6, void 0, s4 ?? {});
1824
- }
1825
- return h3._$AI(t5), h3;
1826
- };
1827
-
1828
- // node_modules/lit-element/lit-element.js
1829
- var s3 = class extends b {
1830
- constructor() {
1831
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1832
- }
1833
- createRenderRoot() {
1834
- const t5 = super.createRenderRoot();
1835
- return this.renderOptions.renderBefore ??= t5.firstChild, t5;
1836
- }
1837
- update(t5) {
1838
- const i6 = this.render();
1839
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t5), this._$Do = j(i6, this.renderRoot, this.renderOptions);
1840
- }
1841
- connectedCallback() {
1842
- super.connectedCallback(), this._$Do?.setConnected(true);
1843
- }
1844
- disconnectedCallback() {
1845
- super.disconnectedCallback(), this._$Do?.setConnected(false);
1846
- }
1847
- render() {
1848
- return w;
1849
- }
1850
- };
1851
- s3._$litElement$ = true, s3["finalized", "finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: s3 });
1852
- var r6 = globalThis.litElementPolyfillSupport;
1853
- r6?.({ LitElement: s3 });
1854
- (globalThis.litElementVersions ??= []).push("4.0.4");
1855
-
1856
- // node_modules/lit-html/directive.js
1857
- var t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
1858
- var e6 = (t5) => (...e7) => ({ _$litDirective$: t5, values: e7 });
1859
- var i4 = class {
1860
- constructor(t5) {
1861
- }
1862
- get _$AU() {
1863
- return this._$AM._$AU;
1864
- }
1865
- _$AT(t5, e7, i6) {
1866
- this._$Ct = t5, this._$AM = e7, this._$Ci = i6;
1867
- }
1868
- _$AS(t5, e7) {
1869
- return this.update(t5, e7);
1870
- }
1871
- update(t5, e7) {
1872
- return this.render(...e7);
1873
- }
1874
- };
1875
-
1876
- // node_modules/lit-html/directives/style-map.js
1877
- var n5 = "important";
1878
- var i5 = " !" + n5;
1879
- var o5 = e6(class extends i4 {
1880
- constructor(t5) {
1881
- if (super(t5), t5.type !== t4.ATTRIBUTE || "style" !== t5.name || t5.strings?.length > 2)
1882
- throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1883
- }
1884
- render(t5) {
1885
- return Object.keys(t5).reduce((e7, r7) => {
1886
- const s4 = t5[r7];
1887
- return null == s4 ? e7 : e7 + `${r7 = r7.includes("-") ? r7 : r7.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s4};`;
1888
- }, "");
1889
- }
1890
- update(e7, [r7]) {
1891
- const { style: s4 } = e7.element;
1892
- if (void 0 === this.ft)
1893
- return this.ft = new Set(Object.keys(r7)), this.render(r7);
1894
- for (const t5 of this.ft)
1895
- null == r7[t5] && (this.ft.delete(t5), t5.includes("-") ? s4.removeProperty(t5) : s4[t5] = null);
1896
- for (const t5 in r7) {
1897
- const e8 = r7[t5];
1898
- if (null != e8) {
1899
- this.ft.add(t5);
1900
- const r8 = "string" == typeof e8 && e8.endsWith(i5);
1901
- t5.includes("-") || r8 ? s4.setProperty(t5, r8 ? e8.slice(0, -11) : e8, r8 ? n5 : "") : s4[t5] = e8;
1902
- }
1903
- }
1904
- return w;
1905
- }
1906
- });
1907
-
1908
- // libs/embed-libs/embed/package.json
1909
- var version = "5.1.5";
1910
-
1911
- // libs/embed-libs/embed/src/lib/luzmo-service.ts
1912
- var LuzmoService = class {
1913
- constructor() {
1914
- this._components = [];
1915
- }
1916
- };
1917
- var luzmo_service_default = new LuzmoService();
1918
-
1919
- // libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
1920
- var _setEventHandler = () => {
1921
- if (typeof window.__luzmoMessageHandler === "function") {
1922
- return;
1923
- }
1924
- window.__luzmoMessageHandler = (event) => {
1925
- const dashboardComponent = luzmo_service_default._components.find(
1926
- (c4) => event.data.name === c4._iframeId
1927
- );
1928
- if (!dashboardComponent) {
1929
- return;
1930
- }
1931
- switch (event.data?.type) {
1932
- case "load": {
1933
- dashboardComponent.dispatchEvent(
1934
- new CustomEvent("load", { detail: { data: event.data } })
1935
- );
1936
- if (dashboardComponent._loadTimeoutHandle) {
1937
- clearTimeout(dashboardComponent._loadTimeoutHandle);
1938
- dashboardComponent._loadTimeoutHandle = void 0;
1939
- }
1940
- dashboardComponent.iframeLoaded = true;
1941
- dashboardComponent.dimensions = event.data.dimensions;
1942
- dashboardComponent._calculateDimAfterDashboardLoaded();
1943
- break;
1944
- }
1945
- case "error": {
1946
- dashboardComponent.dashboardError = true;
1947
- if (dashboardComponent._loadTimeoutHandle) {
1948
- clearTimeout(dashboardComponent._loadTimeoutHandle);
1949
- dashboardComponent._loadTimeoutHandle = void 0;
1950
- }
1951
- dashboardComponent.iframeLoaded = true;
1952
- dashboardComponent._displayError();
1953
- console.error("Dashboard error: ", event.data.errorMsg);
1954
- break;
1955
- }
1956
- case "data": {
1957
- resolvePromise(
1958
- dashboardComponent,
1959
- event.data.requestId,
1960
- event.data.data
1961
- );
1962
- break;
1963
- }
1964
- case "filters": {
1965
- resolvePromise(
1966
- dashboardComponent,
1967
- event.data.requestId,
1968
- event.data.filters
1969
- );
1970
- break;
1971
- }
1972
- case "getAccessibleDashboards": {
1973
- resolvePromise(
1974
- dashboardComponent,
1975
- event.data.requestId,
1976
- event.data.accessibleDashboards
1977
- );
1978
- break;
1979
- }
1980
- case "dashboardAction": {
1981
- dashboardComponent.dispatchEvent(
1982
- new CustomEvent("dashboardAction", { detail: { data: event.data } })
1983
- );
1984
- break;
1985
- }
1986
- case "export": {
1987
- if (event.data.error) {
1988
- rejectPromise(
1989
- dashboardComponent,
1990
- event.data.requestId,
1991
- event.data
1992
- );
1993
- } else {
1994
- dashboardComponent.dispatchEvent(
1995
- new CustomEvent("exported", { detail: { data: event.data } })
1996
- );
1997
- resolvePromise(
1998
- dashboardComponent,
1999
- event.data.requestId,
2000
- event.data
2001
- );
2002
- }
2003
- break;
2004
- }
2005
- case "changedFilters": {
2006
- dashboardComponent.dispatchEvent(
2007
- new CustomEvent("changedFilters", { detail: { data: event.data } })
2008
- );
2009
- break;
2010
- }
2011
- case "customEvent": {
2012
- dashboardComponent.dispatchEvent(
2013
- new CustomEvent("customEvent", { detail: { data: event.data } })
2014
- );
2015
- break;
2016
- }
2017
- case "chartsRendered":
2018
- case "itemsRendered": {
2019
- event.data.type = "itemsRendered";
2020
- dashboardComponent.dispatchEvent(
2021
- new CustomEvent("itemsRendered", { detail: { data: event.data } })
2022
- );
2023
- break;
2024
- }
2025
- case "setEditMode": {
2026
- if (event.data.error) {
2027
- rejectPromise(
2028
- dashboardComponent,
2029
- event.data.requestId,
2030
- event.data
2031
- );
2032
- } else {
2033
- resolvePromise(
2034
- dashboardComponent,
2035
- event.data.requestId,
2036
- event.data
2037
- );
2038
- dashboardComponent.params.editMode = event.data.editMode;
2039
- dashboardComponent._containerStyle = containerStyles(dashboardComponent);
2040
- if (dashboardComponent.dimensions) {
2041
- _setCalculatedDimensions(dashboardComponent);
2042
- }
2043
- }
2044
- break;
2045
- }
2046
- case "setFilters": {
2047
- event.data.error ? rejectPromise(
2048
- dashboardComponent,
2049
- event.data.requestId,
2050
- event.data
2051
- ) : resolvePromise(
2052
- dashboardComponent,
2053
- event.data.requestId,
2054
- event.data
2055
- );
2056
- break;
2057
- }
2058
- case "setPreview": {
2059
- event.data.error ? rejectPromise(
2060
- dashboardComponent,
2061
- event.data.requestId,
2062
- event.data
2063
- ) : resolvePromise(
2064
- dashboardComponent,
2065
- event.data.requestId,
2066
- event.data
2067
- );
2068
- break;
2069
- }
2070
- }
2071
- };
2072
- window.addEventListener("message", window.__luzmoMessageHandler, false);
2073
- };
2074
-
2075
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-styles.ts
2076
- var dashboardStyles = i`
2077
- :host {
2078
- display: block;
2079
- height: 100%;
2080
- }
2081
-
2082
- @-webkit-keyframes spin {
2083
- 0% {
2084
- -webkit-transform: rotate(0deg);
2085
- transform: rotate(0deg);
2086
- }
2087
- 100% {
2088
- -webkit-transform: rotate(360deg);
2089
- transform: rotate(360deg);
2090
- }
2091
- }
2092
-
2093
- @keyframes spin {
2094
- 0% {
2095
- -webkit-transform: rotate(0deg);
2096
- transform: rotate(0deg);
2097
- }
2098
- 100% {
2099
- -webkit-transform: rotate(360deg);
2100
- transform: rotate(360deg);
2101
- }
2102
- }
2103
- :host {
2104
- position: relative;
2105
- width: 100%;
2106
- }
2107
-
2108
- .luzmo-embed-dashboard {
2109
- background: transparent;
2110
- padding: 0;
2111
- border: 0;
2112
- }
2113
-
2114
- .luzmo-embed-dashboard-ede {
2115
- }
2116
-
2117
- .luzmo-embed-container-ede {
2118
- width: 100%;
2119
- height: 100%;
2120
- }
2121
-
2122
- .luzmo-container-loader {
2123
- width: 100%;
2124
- position: relative;
2125
- }
2126
-
2127
- .luzmo-lc {
2128
- margin: 0 auto;
2129
- }
2130
-
2131
- .luzmo-loading-message {
2132
- width: 100%;
2133
- height: 20px;
2134
- text-align: center;
2135
- margin-bottom: 16px;
2136
- font-family: Helvetica, Arial, sans-serif;
2137
- font-size: 14px;
2138
- }
2139
-
2140
- .luzmo-loading-circle {
2141
- box-sizing: border-box;
2142
- margin: 16px auto;
2143
- position: relative;
2144
- text-indent: -9999em;
2145
- animation: spin 0.6s infinite linear;
2146
- }
2147
-
2148
- .luzmo-loading-circle,
2149
- .luzmo-loading-circle:after {
2150
- border-radius: 50%;
2151
- width: 32px;
2152
- height: 32px;
2153
- }
2154
-
2155
- .itemEmbedding:after {
2156
- width: 24px;
2157
- height: 24px;
2158
- }
2159
-
2160
- .luzmo-error {
2161
- background: transparent;
2162
- padding: 48px 0;
2163
- margin: 0 auto;
2164
- width: 80%;
2165
- border: 0;
2166
- text-align: center;
2167
- min-height: 192px;
2168
- }
2169
-
2170
- .dashboard-error {
2171
- font-size: 30px;
2172
- background: transparent;
2173
- padding: 48px 0;
2174
- margin: 0 auto;
2175
- width: 80%;
2176
- border: 0;
2177
- text-align: center;
2178
- min-height: 192px;
2179
- }
2180
-
2181
- .luzmo-loader {
2182
- top: 0;
2183
- left: 0;
2184
- width: 100%;
2185
- min-height: 400px;
2186
- position: absolute;
2187
- transition-duration: 0.3s;
2188
- }
2189
- `;
2190
-
2191
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
2192
- var LuzmoDashboard = class extends s3 {
2193
- constructor() {
2194
- super();
2195
- this.language = "auto";
2196
- this.screenMode = "auto";
2197
- this.switchScreenModeOnResize = true;
2198
- this.editMode = "view";
2199
- this.experimental = false;
2200
- this.iframeStyle = {};
2201
- this._containerStyle = {};
2202
- this._loaderStyle = {};
2203
- this._lcStyle = {};
2204
- this._loadingCircleStyle = {};
2205
- this._containerLoaderStyle = {};
2206
- this._loaderMsg = "";
2207
- this._itemEmbedding = false;
2208
- this.browserError = false;
2209
- this.browserErrorMsg = "";
2210
- this.dashboardError = false;
2211
- this.browserNotSupported = [];
2212
- this.VERSION = version + "-wc-luzmo";
2213
- this.isLibraryLoaded = false;
2214
- this.currentAuthKey = null;
2215
- this.currentAuthToken = null;
2216
- this.isInitCalled = false;
2217
- this.attributesMap = {
2218
- dashboardId: "dashboard-id",
2219
- dashboardSlug: "dashboard-slug",
2220
- itemId: "item-id",
2221
- language: "language",
2222
- qeVersion: "qe-version",
2223
- screenMode: "screen-mode",
2224
- switchScreenModeOnResize: "switch-screen-mode-on-resize",
2225
- authKey: "auth-key",
2226
- authToken: "auth-token",
2227
- editMode: "edit-mode",
2228
- mainColor: "main-color",
2229
- accentColor: "accent-color",
2230
- loaderBackground: "loader-background",
2231
- loaderFontColor: "loader-font-color",
2232
- loaderSpinnerColor: "loader-spinner-color",
2233
- loaderSpinnerBackground: "loader-spinner-background",
2234
- appServer: "app-server",
2235
- apiHost: "api-host",
2236
- itemDimensions: "item-dimensions",
2237
- timezoneId: "timezone-id"
2238
- };
2239
- this.loaderSize = 32;
2240
- this.borderWidth = 3;
2241
- this.minHeight = 400;
2242
- this._containerId = uuidv4();
2243
- this._iframeId = `luzmo-dashboard-${this._containerId}`;
2244
- this.iframeLoaded = false;
2245
- this.promises = {};
2246
- this.params = this._setOptions();
2247
- this._onResize = () => {
2248
- if (this.shadowRoot?.querySelector(".dashboard-container")) {
2249
- this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
2250
- if (this.params.switchScreenModeOnResize && this.params.screenMode === "auto") {
2251
- for (const d3 of EXTENTS) {
2252
- if (d3.width[0] <= window.innerWidth && window.innerWidth <= d3.width[1]) {
2253
- this.currentScreenMode = d3.mode;
2254
- }
2255
- }
2256
- }
2257
- if (this.iframeLoaded) {
2258
- this._calculateDimAfterDashboardLoaded();
2259
- } else {
2260
- if (this.dimensions) {
2261
- this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
2262
- _setCalculatedDimensions(this);
2263
- }
2264
- }
2265
- }
2266
- };
2267
- this._resizeObserver = new ResizeObserver((entries) => {
2268
- window.requestAnimationFrame(() => {
2269
- if (!Array.isArray(entries) || entries.length === 0) {
2270
- return;
2271
- }
2272
- this._onResize();
2273
- });
2274
- });
2275
- }
2276
- loadLibrary(appServer) {
2277
- if (remotesMap[appServer]) {
2278
- return Promise.resolve(remotesMap[appServer].module);
2279
- }
2280
- remotesMap[appServer] = {
2281
- url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
2282
- format: "esm",
2283
- from: "vite",
2284
- module: void 0
2285
- };
2286
- return __federationMethodGetRemote(appServer, "./DashboardApp").then((module2) => {
2287
- const wrappedModule = __federationMethodWrapDefault(module2, true);
2288
- remotesMap[appServer].module = wrappedModule;
2289
- return wrappedModule;
2290
- });
2291
- }
2292
- // Set resize event listener
2293
- connectedCallback() {
2294
- super.connectedCallback();
2295
- }
2296
- // Set resize event listener
2297
- disconnectedCallback() {
2298
- super.disconnectedCallback();
2299
- this._resizeObserver.disconnect();
2300
- for (const promiseKey of Object.keys(this.promises)) {
2301
- this.promises[promiseKey].reject(
2302
- new Error("Dashboard component was removed")
2303
- );
2304
- }
2305
- }
2306
- firstUpdated() {
2307
- this._loaderMsg = getLoader(this)?.loadingMsg;
2308
- this._loaderStyles();
2309
- luzmo_service_default._components.push(this);
2310
- if (this.luzmoEmbedContainer) {
2311
- this._resizeObserver.observe(this.luzmoEmbedContainer);
2312
- }
2313
- }
2314
- initComponent() {
2315
- this.params = this._setOptions();
2316
- if (this.getIsViewMode()) {
2317
- this.loadLibrary(this.params.appServer).then(async () => {
2318
- this.isLibraryLoaded = true;
2319
- await this.updateComplete;
2320
- const oldReference = this.renderRoot.querySelector("dashboard-component");
2321
- this.dashboardReference = oldReference.cloneNode(true);
2322
- oldReference.replaceWith(this.dashboardReference);
2323
- this.dashboardReference.addEventListener("load", (payload) => {
2324
- this.containerWidth = this.dashboardReference.offsetWidth;
2325
- this.dimensions = payload.detail.dimensions;
2326
- _setCalculatedDimensions(this);
2327
- window.dispatchEvent(new Event("resize"));
2328
- this.dispatchEvent(new CustomEvent("load", payload));
2329
- });
2330
- this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
2331
- this.dashboardReference.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
2332
- this.dashboardReference.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
2333
- this.dashboardReference.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
2334
- this.dashboardReference.addEventListener("export", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
2335
- this.setAllAttributes();
2336
- });
2337
- } else {
2338
- this.containerWidth = this.container?.clientWidth;
2339
- _extendAndValidate(this);
2340
- _browserCheck(this);
2341
- this._setupLoader();
2342
- if (!this.params.error) {
2343
- this._loaderStyles();
2344
- _setEventHandler();
2345
- this._iframeUrl = createIframeUrl(this);
2346
- this.iframe?.setAttribute("src", this._iframeUrl);
2347
- this.iframeStyle = calculateIframeStyles(this);
2348
- }
2349
- }
2350
- }
2351
- setAllAttributes() {
2352
- if (this.dashboardReference) {
2353
- for (const key in this.attributesMap) {
2354
- if (!["authKey", "authToken", "apiHost", "itemDimensions"].includes(key) && this.params[key]) {
2355
- this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
2356
- }
2357
- if (this.params.itemDimensions) {
2358
- this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
2359
- }
2360
- if (this.params.apiHost) {
2361
- this.dashboardReference.setAttribute("api-host", removeTrailingSlash(this.params.apiHost));
2362
- }
2363
- if (this.params.key) {
2364
- this.dashboardReference.setAttribute("auth-key", this.params.key);
2365
- }
2366
- if (this.params.token) {
2367
- this.dashboardReference.setAttribute("auth-token", this.params.token);
2368
- }
2369
- }
2370
- }
2371
- }
2372
- // Reload dashboard when triggerproperty changes
2373
- updated(changedProperties) {
2374
- const triggerProperties = /* @__PURE__ */ new Set([
2375
- "dashboardId",
2376
- "dashboardSlug",
2377
- "itemId",
2378
- "language",
2379
- "qeVersion",
2380
- "editMode",
2381
- "screenMode",
2382
- "switchScreenModeOnResize",
2383
- "authToken",
2384
- "authKey",
2385
- "appServer",
2386
- "timezoneId",
2387
- "itemDimensions"
2388
- ]);
2389
- const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
2390
- let callInitComponent = false;
2391
- for (const condition of conditionsToCheck) {
2392
- callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition] !== void 0;
2393
- }
2394
- if (callInitComponent && !this.isInitCalled) {
2395
- this.initComponent();
2396
- this.isInitCalled = true;
2397
- return;
2398
- }
2399
- if (this.getIsViewMode()) {
2400
- if (this.dashboardReference) {
2401
- for (const [propertyName] of changedProperties.entries()) {
2402
- if (propertyName === "appSever") {
2403
- this.loadLibrary(changedProperties[propertyName]).then(async () => {
2404
- this.isLibraryLoaded = true;
2405
- await this.updateComplete;
2406
- this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
2407
- this.setAllAttributes();
2408
- });
2409
- } else if (this.attributesMap[propertyName]) {
2410
- const mappedAttributeName = this.attributesMap[propertyName] ?? propertyName;
2411
- const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() || this[propertyName];
2412
- this.dashboardReference.setAttribute(mappedAttributeName, attributeValue);
2413
- }
2414
- }
2415
- }
2416
- } else {
2417
- for (const [propertyName] of changedProperties.entries()) {
2418
- if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
2419
- this.iframeLoaded = false;
2420
- if (this._loadTimeoutHandle) {
2421
- clearTimeout(this._loadTimeoutHandle);
2422
- }
2423
- this._loadTimeoutHandle = setTimeout(() => {
2424
- console.warn(
2425
- "Failed to load dashboard, appServer is likely down or unreachable."
2426
- );
2427
- }, 15 * 1e3);
2428
- this.params = this._setOptions();
2429
- _extendAndValidate(this);
2430
- this._setupLoader();
2431
- this._loaderStyles();
2432
- this._iframeUrl = createIframeUrl(this);
2433
- if (this.iframe) {
2434
- this._updateIframeUrl();
2435
- }
2436
- this.iframeStyle = calculateIframeStyles(this);
2437
- } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
2438
- if (this.iframeLoaded) {
2439
- this.setEditMode(this.editMode);
2440
- }
2441
- this.params = this._setOptions();
2442
- }
2443
- }
2444
- }
2445
- }
2446
- // Set params
2447
- _setOptions() {
2448
- const defaultParameters = {
2449
- dashboardId: this.dashboardId,
2450
- dashboardSlug: this.dashboardSlug
2451
- };
2452
- if (this.itemId) {
2453
- defaultParameters.itemId = this.itemId;
2454
- this._itemEmbedding = true;
2455
- } else {
2456
- this._itemEmbedding = false;
2457
- }
2458
- if (this.language) {
2459
- defaultParameters.language = this.language;
2460
- }
2461
- if (this.qeVersion) {
2462
- defaultParameters.qeVersion = this.qeVersion;
2463
- }
2464
- if (this.screenMode) {
2465
- defaultParameters.screenMode = this.screenMode;
2466
- }
2467
- defaultParameters.switchScreenModeOnResize = this.switchScreenModeOnResize;
2468
- if (this.authToken) {
2469
- defaultParameters.token = this.authToken;
2470
- }
2471
- if (this.authKey) {
2472
- defaultParameters.key = this.authKey;
2473
- }
2474
- if (this.editMode) {
2475
- defaultParameters.editMode = this.editMode;
2476
- }
2477
- if (this.mainColor) {
2478
- defaultParameters.mainColor = this.mainColor;
2479
- }
2480
- if (this.accentColor) {
2481
- defaultParameters.accentColor = this.accentColor;
2482
- }
2483
- if (this.loaderBackground) {
2484
- defaultParameters.loaderBackground = this.loaderBackground;
2485
- }
2486
- if (this.loaderFontColor) {
2487
- defaultParameters.loaderFontColor = this.loaderFontColor;
2488
- }
2489
- if (this.loaderSpinnerColor) {
2490
- defaultParameters.loaderSpinnerColor = this.loaderSpinnerColor;
2491
- }
2492
- if (this.loaderSpinnerBackground) {
2493
- defaultParameters.loaderSpinnerBackground = this.loaderSpinnerBackground;
2494
- }
2495
- if (this.timezoneId) {
2496
- defaultParameters.timezoneId = this.timezoneId;
2497
- }
2498
- if (this.itemDimensions) {
2499
- defaultParameters.itemDimensions = this.itemDimensions;
2500
- }
2501
- if (this.appServer) {
2502
- this.appServer = this.getIsViewMode() ? removeTrailingSlash(this.appServer) : addTrailingSlash(this.appServer);
2503
- defaultParameters.appServer = this.appServer;
2504
- } else {
2505
- this.appServer = addTrailingSlash(
2506
- DEFAULT_PARAMETERS.appServer
2507
- );
2508
- defaultParameters.appServer = this.appServer;
2509
- }
2510
- if (this.apiHost) {
2511
- this.apiHost = this.getIsViewMode() ? removeTrailingSlash(this.apiHost) : addTrailingSlash(this.apiHost);
2512
- defaultParameters.apiHost = this.apiHost;
2513
- } else {
2514
- this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
2515
- defaultParameters.apiHost = this.apiHost;
2516
- }
2517
- this.currentAuthKey = this.authKey;
2518
- this.currentAuthToken = this.authToken;
2519
- return defaultParameters;
2520
- }
2521
- _updateIframeUrl() {
2522
- updateIframeUrl(this.iframe, this._iframeUrl);
2523
- }
2524
- // Setup loader / browser error
2525
- _setupLoader() {
2526
- const data = getLoader(this);
2527
- this._loaderMsg = data.loadingMsg;
2528
- if (data.errorMsg) {
2529
- this.browserError = true;
2530
- this.browserErrorMsg = data.errorMsg;
2531
- this._displayError();
2532
- }
2533
- }
2534
- _displayError() {
2535
- if (this.dashboardError) {
2536
- this._loaderStyles();
2537
- this.iframeStyle.opacity = 1;
2538
- }
2539
- if (this.browserError) {
2540
- this._containerStyle.display = "none";
2541
- }
2542
- }
2543
- _calculateDimAfterDashboardLoaded() {
2544
- this.dashboardError = false;
2545
- this._loaderStyles();
2546
- _setCalculatedDimensions(this);
2547
- }
2548
- // Set loader styles
2549
- _loaderStyles() {
2550
- this._containerStyle = containerStyles(this);
2551
- this._loaderStyle = loaderStyles(this);
2552
- this._loadingCircleStyle = plStyles(this);
2553
- this._containerLoaderStyle = containerLoaderStyles(this);
2554
- this._lcStyle = lcStyles(this);
2555
- }
2556
- static get styles() {
2557
- return [dashboardStyles];
2558
- }
2559
- render() {
2560
- let toBeRenderedHTML;
2561
- const loader = x`
2562
- <div
2563
- class="luzmo-container-loader"
2564
- id="luzmo-container-loader-${this._containerId}"
2565
- style=${o5(
2566
- this._containerLoaderStyle
2567
- )}
2568
- >
2569
- <div
2570
- class="luzmo-loader"
2571
- id="luzmo-loader-${this._containerId}"
2572
- style=${o5(this._loaderStyle)}
2573
- >
2574
- <div
2575
- class="luzmo-lc"
2576
- style=${o5(this._lcStyle)}
2577
- >
2578
- <div
2579
- class="luzmo-loading-circle"
2580
- style=${o5(
2581
- this._loadingCircleStyle
2582
- )}
2583
- ></div>
2584
- ${this._itemEmbedding ? "" : x`
2585
- <div
2586
- class="luzmo-loading-message"
2587
- style=${o5({ color: this.loaderFontColor })}
2588
- >
2589
- ${this._loaderMsg}
2590
- </div>
2591
- `}
2592
- </div>
2593
- </div>
2594
- </div>
2595
- `;
2596
- if (this.getIsViewMode()) {
2597
- toBeRenderedHTML = this.isLibraryLoaded ? x`
2598
- ${this.dashboardId || this.dashboardSlug ? x`
2599
- <dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
2600
- api-host="${this.params.apiHost}"></dashboard-component>` : x`
2601
- <div id="luzmo-error-${this._containerId}">
2602
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
2603
- </div>
2604
- `}
2605
- ` : x`${loader}`;
2606
- } else {
2607
- toBeRenderedHTML = x`
2608
- ${this.dashboardId || this.dashboardSlug ? x`
2609
- ${loader}
2610
- <iframe
2611
- class="luzmo-embed-dashboard ${!this.getIsViewMode() ? `luzmo-embed-dashboard-ede` : ""}"
2612
- id="${this._iframeId}"
2613
- name="${this._iframeId}"
2614
- style=${o5(this.iframeStyle)}
2615
- src="${this._iframeUrl}"
2616
- frameborder="0"
2617
- ></iframe>
2618
- ` : x`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
2619
- ${this.browserError ? x`
2620
- <div id="luzmo-error-${this._containerId}">
2621
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
2622
- </div>
2623
- ` : ""}
2624
- `;
2625
- }
2626
- return x`
2627
- <div class="${luzmoEmbedContainerClass} ${!this.getIsViewMode() ? `${luzmoEmbedContainerClass}-ede` : ""}">
2628
- <div
2629
- class="dashboard-container"
2630
- style=${o5(Object.assign({}, this._containerStyle, {
2631
- width: this.iframeStyle.width ?? "100%",
2632
- height: this.iframeStyle.height ?? "100%"
2633
- }))}
2634
- >
2635
- ${toBeRenderedHTML}
2636
- </div>
2637
- </div>
2638
-
2639
- `;
2640
- }
2641
- getDashboards() {
2642
- return new Promise(
2643
- (resolve) => resolve(luzmo_service_default._components)
2644
- );
2645
- }
2646
- // Public methods
2647
- getData(itemId) {
2648
- if (this.getIsViewMode() && this.dashboardReference) {
2649
- return this.dashboardReference.getData(itemId);
2650
- }
2651
- if (!this.getIsViewMode()) {
2652
- return getData(this, this.iframe, itemId);
2653
- }
2654
- return Promise.reject();
2655
- }
2656
- getFilters() {
2657
- if (this.getIsViewMode() && this.dashboardReference) {
2658
- return this.dashboardReference.getFilters();
2659
- }
2660
- if (!this.getIsViewMode()) {
2661
- return getFilters(this, this.iframe);
2662
- }
2663
- return Promise.reject();
2664
- }
2665
- setFilters(itemId, filters) {
2666
- if (this.getIsViewMode() && this.dashboardReference) {
2667
- return this.dashboardReference.setFilters(itemId, filters);
2668
- }
2669
- if (!this.getIsViewMode()) {
2670
- return setFilters(this, this.iframe, itemId, filters);
2671
- }
2672
- return Promise.reject();
2673
- }
2674
- setAuthorization(key, token) {
2675
- this.currentAuthKey = key;
2676
- this.currentAuthToken = token;
2677
- if (this.getIsViewMode() && this.dashboardReference) {
2678
- return this.dashboardReference.setAuthorization(key, token);
2679
- }
2680
- if (!this.getIsViewMode()) {
2681
- return setAuthorization(this, this.iframe, key, token);
2682
- }
2683
- return Promise.reject();
2684
- }
2685
- refreshData(itemId) {
2686
- if (this.getIsViewMode() && this.dashboardReference) {
2687
- return this.dashboardReference.refreshData(itemId);
2688
- }
2689
- if (!this.getIsViewMode()) {
2690
- return itemId ? refreshData(this, this.iframe, itemId) : refreshData(this, this.iframe);
2691
- }
2692
- return Promise.reject();
2693
- }
2694
- reloadDashboard() {
2695
- if (this.getIsViewMode() && this.dashboardReference) {
2696
- return this.dashboardReference.reloadDashboard();
2697
- }
2698
- if (!this.getIsViewMode()) {
2699
- return reloadDashboard(this, this.iframe);
2700
- }
2701
- return Promise.reject();
2702
- }
2703
- exportDashboard(format) {
2704
- if (this.getIsViewMode() && this.dashboardReference) {
2705
- return this.dashboardReference.exportDashboard(format);
2706
- }
2707
- if (!this.getIsViewMode()) {
2708
- return format ? exportDashboard(this, this.iframe, format) : exportDashboard(this, this.iframe);
2709
- }
2710
- return Promise.reject();
2711
- }
2712
- getAccessibleDashboards() {
2713
- return getAccessibleDashboards(this);
2714
- }
2715
- addFilters(itemId, filters) {
2716
- return this.dashboardReference.addFilters(itemId, filters);
2717
- }
2718
- setEditMode(editMode) {
2719
- if (this.dashboardReference && editMode === "view") {
2720
- this.editMode = "view";
2721
- this.params.editMode = "view";
2722
- this.initComponent();
2723
- return Promise.resolve({
2724
- type: "setEditMode",
2725
- editMode
2726
- });
2727
- }
2728
- if (this.dashboardReference && ["editFull", "editLimited"].includes(editMode)) {
2729
- this.editMode = editMode;
2730
- this.params.editMode = editMode;
2731
- this.initComponent();
2732
- return Promise.resolve({
2733
- type: "setEditMode",
2734
- editMode
2735
- });
2736
- }
2737
- if (this.getIsViewMode() && this.dashboardReference) {
2738
- return this.dashboardReference.setEditMode(editMode);
2739
- }
2740
- if (!this.getIsViewMode()) {
2741
- return setEditMode(this, this.iframe, editMode);
2742
- }
2743
- return Promise.reject();
2744
- }
2745
- setPreview(preview) {
2746
- if (this.getIsViewMode() && this.dashboardReference) {
2747
- return this.dashboardReference.setPreview(preview);
2748
- }
2749
- return setPreview(this, this.iframe, preview);
2750
- }
2751
- getIsViewMode() {
2752
- return this.experimental && this.params.editMode === "view" || this.params.editMode === void 0;
2753
- }
2754
- };
2755
- __decorateClass([
2756
- e4(".dashboard-container")
2757
- ], LuzmoDashboard.prototype, "container", 2);
2758
- __decorateClass([
2759
- e4(`.${luzmoEmbedContainerClass}`)
2760
- ], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
2761
- __decorateClass([
2762
- e4("iframe")
2763
- ], LuzmoDashboard.prototype, "iframe", 2);
2764
- __decorateClass([
2765
- n3()
2766
- ], LuzmoDashboard.prototype, "dashboardId", 2);
2767
- __decorateClass([
2768
- n3()
2769
- ], LuzmoDashboard.prototype, "dashboardSlug", 2);
2770
- __decorateClass([
2771
- n3()
2772
- ], LuzmoDashboard.prototype, "itemId", 2);
2773
- __decorateClass([
2774
- n3()
2775
- ], LuzmoDashboard.prototype, "language", 2);
2776
- __decorateClass([
2777
- n3()
2778
- ], LuzmoDashboard.prototype, "qeVersion", 2);
2779
- __decorateClass([
2780
- n3()
2781
- ], LuzmoDashboard.prototype, "screenMode", 2);
2782
- __decorateClass([
2783
- n3({
2784
- converter: {
2785
- fromAttribute: (value) => value === "true",
2786
- toAttribute: String
2787
- }
2788
- })
2789
- ], LuzmoDashboard.prototype, "switchScreenModeOnResize", 2);
2790
- __decorateClass([
2791
- n3()
2792
- ], LuzmoDashboard.prototype, "editMode", 2);
2793
- __decorateClass([
2794
- n3()
2795
- ], LuzmoDashboard.prototype, "mainColor", 2);
2796
- __decorateClass([
2797
- n3()
2798
- ], LuzmoDashboard.prototype, "accentColor", 2);
2799
- __decorateClass([
2800
- n3()
2801
- ], LuzmoDashboard.prototype, "authToken", 2);
2802
- __decorateClass([
2803
- n3()
2804
- ], LuzmoDashboard.prototype, "authKey", 2);
2805
- __decorateClass([
2806
- n3()
2807
- ], LuzmoDashboard.prototype, "loaderBackground", 2);
2808
- __decorateClass([
2809
- n3()
2810
- ], LuzmoDashboard.prototype, "loaderFontColor", 2);
2811
- __decorateClass([
2812
- n3()
2813
- ], LuzmoDashboard.prototype, "loaderSpinnerColor", 2);
2814
- __decorateClass([
2815
- n3()
2816
- ], LuzmoDashboard.prototype, "loaderSpinnerBackground", 2);
2817
- __decorateClass([
2818
- n3()
2819
- ], LuzmoDashboard.prototype, "appServer", 2);
2820
- __decorateClass([
2821
- n3()
2822
- ], LuzmoDashboard.prototype, "timezoneId", 2);
2823
- __decorateClass([
2824
- n3()
2825
- ], LuzmoDashboard.prototype, "apiHost", 2);
2826
- __decorateClass([
2827
- n3({ type: Object })
2828
- ], LuzmoDashboard.prototype, "itemDimensions", 2);
2829
- __decorateClass([
2830
- n3({
2831
- converter: {
2832
- fromAttribute: (value) => value === "true",
2833
- toAttribute: String
2834
- }
2835
- })
2836
- ], LuzmoDashboard.prototype, "experimental", 2);
2837
- __decorateClass([
2838
- n3({ attribute: false })
2839
- ], LuzmoDashboard.prototype, "_containerId", 2);
2840
- __decorateClass([
2841
- n3({ attribute: false })
2842
- ], LuzmoDashboard.prototype, "_iframeId", 2);
2843
- __decorateClass([
2844
- n3({ attribute: false })
2845
- ], LuzmoDashboard.prototype, "params", 2);
2846
- __decorateClass([
2847
- n3({ attribute: false })
2848
- ], LuzmoDashboard.prototype, "_iframeUrl", 2);
2849
- __decorateClass([
2850
- n3({ attribute: false })
2851
- ], LuzmoDashboard.prototype, "iframeLoaded", 2);
2852
- __decorateClass([
2853
- n3({ attribute: false })
2854
- ], LuzmoDashboard.prototype, "promises", 2);
2855
- __decorateClass([
2856
- n3({ attribute: false })
2857
- ], LuzmoDashboard.prototype, "iframeStyle", 2);
2858
- __decorateClass([
2859
- n3({ attribute: false })
2860
- ], LuzmoDashboard.prototype, "_containerStyle", 2);
2861
- __decorateClass([
2862
- n3({ attribute: false })
2863
- ], LuzmoDashboard.prototype, "_loaderStyle", 2);
2864
- __decorateClass([
2865
- n3({ attribute: false })
2866
- ], LuzmoDashboard.prototype, "_lcStyle", 2);
2867
- __decorateClass([
2868
- n3({ attribute: false })
2869
- ], LuzmoDashboard.prototype, "_loadingCircleStyle", 2);
2870
- __decorateClass([
2871
- n3({ attribute: false })
2872
- ], LuzmoDashboard.prototype, "_containerLoaderStyle", 2);
2873
- __decorateClass([
2874
- n3({ attribute: false })
2875
- ], LuzmoDashboard.prototype, "_loaderMsg", 2);
2876
- __decorateClass([
2877
- n3({ attribute: false })
2878
- ], LuzmoDashboard.prototype, "containerWidth", 2);
2879
- __decorateClass([
2880
- n3({ attribute: false })
2881
- ], LuzmoDashboard.prototype, "dimensions", 2);
2882
- __decorateClass([
2883
- n3({ attribute: false })
2884
- ], LuzmoDashboard.prototype, "currentScreenMode", 2);
2885
- __decorateClass([
2886
- n3({ attribute: false })
2887
- ], LuzmoDashboard.prototype, "_itemEmbedding", 2);
2888
- __decorateClass([
2889
- n3({ attribute: false })
2890
- ], LuzmoDashboard.prototype, "browserError", 2);
2891
- __decorateClass([
2892
- n3({ attribute: false })
2893
- ], LuzmoDashboard.prototype, "browserErrorMsg", 2);
2894
- __decorateClass([
2895
- n3({ attribute: false })
2896
- ], LuzmoDashboard.prototype, "dashboardError", 2);
2897
- __decorateClass([
2898
- n3({ attribute: false })
2899
- ], LuzmoDashboard.prototype, "browserNotSupported", 2);
2900
- __decorateClass([
2901
- n3()
2902
- ], LuzmoDashboard.prototype, "VERSION", 2);
2903
- __decorateClass([
2904
- r4()
2905
- ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
2906
- __decorateClass([
2907
- r4()
2908
- ], LuzmoDashboard.prototype, "dashboardReference", 2);
2909
- __decorateClass([
2910
- r4()
2911
- ], LuzmoDashboard.prototype, "currentAuthKey", 2);
2912
- __decorateClass([
2913
- r4()
2914
- ], LuzmoDashboard.prototype, "currentAuthToken", 2);
2915
- __decorateClass([
2916
- r4()
2917
- ], LuzmoDashboard.prototype, "isInitCalled", 2);
2918
-
2919
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-web-component.ts
2920
- var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
2921
- };
2922
- LuzmoDashboardWebComponent = __decorateClass([
2923
- t("luzmo-dashboard-web-component")
2924
- ], LuzmoDashboardWebComponent);
2925
- /*! Bundled license information:
2926
-
2927
- @lit/reactive-element/decorators/custom-element.js:
2928
- (**
2929
- * @license
2930
- * Copyright 2017 Google LLC
2931
- * SPDX-License-Identifier: BSD-3-Clause
2932
- *)
2933
-
2934
- @lit/reactive-element/css-tag.js:
2935
- (**
2936
- * @license
2937
- * Copyright 2019 Google LLC
2938
- * SPDX-License-Identifier: BSD-3-Clause
2939
- *)
2940
-
2941
- @lit/reactive-element/reactive-element.js:
2942
- (**
2943
- * @license
2944
- * Copyright 2017 Google LLC
2945
- * SPDX-License-Identifier: BSD-3-Clause
2946
- *)
2947
-
2948
- @lit/reactive-element/decorators/property.js:
2949
- (**
2950
- * @license
2951
- * Copyright 2017 Google LLC
2952
- * SPDX-License-Identifier: BSD-3-Clause
2953
- *)
2954
-
2955
- @lit/reactive-element/decorators/state.js:
2956
- (**
2957
- * @license
2958
- * Copyright 2017 Google LLC
2959
- * SPDX-License-Identifier: BSD-3-Clause
2960
- *)
2961
-
2962
- @lit/reactive-element/decorators/event-options.js:
2963
- (**
2964
- * @license
2965
- * Copyright 2017 Google LLC
2966
- * SPDX-License-Identifier: BSD-3-Clause
2967
- *)
2968
-
2969
- @lit/reactive-element/decorators/base.js:
2970
- (**
2971
- * @license
2972
- * Copyright 2017 Google LLC
2973
- * SPDX-License-Identifier: BSD-3-Clause
2974
- *)
2975
-
2976
- @lit/reactive-element/decorators/query.js:
2977
- (**
2978
- * @license
2979
- * Copyright 2017 Google LLC
2980
- * SPDX-License-Identifier: BSD-3-Clause
2981
- *)
2982
-
2983
- @lit/reactive-element/decorators/query-all.js:
2984
- (**
2985
- * @license
2986
- * Copyright 2017 Google LLC
2987
- * SPDX-License-Identifier: BSD-3-Clause
2988
- *)
2989
-
2990
- @lit/reactive-element/decorators/query-async.js:
2991
- (**
2992
- * @license
2993
- * Copyright 2017 Google LLC
2994
- * SPDX-License-Identifier: BSD-3-Clause
2995
- *)
2996
-
2997
- @lit/reactive-element/decorators/query-assigned-elements.js:
2998
- (**
2999
- * @license
3000
- * Copyright 2021 Google LLC
3001
- * SPDX-License-Identifier: BSD-3-Clause
3002
- *)
3003
-
3004
- @lit/reactive-element/decorators/query-assigned-nodes.js:
3005
- (**
3006
- * @license
3007
- * Copyright 2017 Google LLC
3008
- * SPDX-License-Identifier: BSD-3-Clause
3009
- *)
3010
-
3011
- lit-html/lit-html.js:
3012
- (**
3013
- * @license
3014
- * Copyright 2017 Google LLC
3015
- * SPDX-License-Identifier: BSD-3-Clause
3016
- *)
3017
-
3018
- lit-element/lit-element.js:
3019
- (**
3020
- * @license
3021
- * Copyright 2017 Google LLC
3022
- * SPDX-License-Identifier: BSD-3-Clause
3023
- *)
3024
-
3025
- lit-html/is-server.js:
3026
- (**
3027
- * @license
3028
- * Copyright 2022 Google LLC
3029
- * SPDX-License-Identifier: BSD-3-Clause
3030
- *)
3031
-
3032
- lit-html/directive.js:
3033
- (**
3034
- * @license
3035
- * Copyright 2017 Google LLC
3036
- * SPDX-License-Identifier: BSD-3-Clause
3037
- *)
3038
-
3039
- lit-html/directives/style-map.js:
3040
- (**
3041
- * @license
3042
- * Copyright 2018 Google LLC
3043
- * SPDX-License-Identifier: BSD-3-Clause
3044
- *)
3045
- */
3046
- if (typeof module.exports == "object" && typeof exports == "object") {
3047
- var __cp = (to, from, except, desc) => {
3048
- if ((from && typeof from === "object") || typeof from === "function") {
3049
- for (let key of Object.getOwnPropertyNames(from)) {
3050
- if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
3051
- Object.defineProperty(to, key, {
3052
- get: () => from[key],
3053
- enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
3054
- });
3055
- }
3056
- }
3057
- return to;
3058
- };
3059
- module.exports = __cp(module.exports, exports);
3060
- }
3061
- return module.exports;
3062
- }))