@revealbi/ui
Version:
1,399 lines (1,373 loc) • 54.1 kB
JavaScript
const re = class re {
static set serverUrl(e) {
this._serverUrl = e, $.ig.RevealSdkSettings.setBaseUrl(this._serverUrl);
}
static get serverUrl() {
return this._serverUrl;
}
};
re._serverUrl = "";
let se = re;
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const F = globalThis, Q = F.ShadowRoot && (F.ShadyCSS === void 0 || F.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, K = Symbol(), oe = /* @__PURE__ */ new WeakMap();
let _e = class {
constructor(e, i, r) {
if (this._$cssResult$ = !0, r !== K) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = e, this.t = i;
}
get styleSheet() {
let e = this.o;
const i = this.t;
if (Q && e === void 0) {
const r = i !== void 0 && i.length === 1;
r && (e = oe.get(i)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && oe.set(i, e));
}
return e;
}
toString() {
return this.cssText;
}
};
const xe = (t) => new _e(typeof t == "string" ? t : t + "", void 0, K), L = (t, ...e) => {
const i = t.length === 1 ? t[0] : e.reduce((r, s, o) => r + ((a) => {
if (a._$cssResult$ === !0) return a.cssText;
if (typeof a == "number") return a;
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
})(s) + t[o + 1], t[0]);
return new _e(i, t, K);
}, Oe = (t, e) => {
if (Q) t.adoptedStyleSheets = e.map((i) => i instanceof CSSStyleSheet ? i : i.styleSheet);
else for (const i of e) {
const r = document.createElement("style"), s = F.litNonce;
s !== void 0 && r.setAttribute("nonce", s), r.textContent = i.cssText, t.appendChild(r);
}
}, ae = Q ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
let i = "";
for (const r of e.cssRules) i += r.cssText;
return xe(i);
})(t) : t;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const { is: Ee, defineProperty: De, getOwnPropertyDescriptor: Ce, getOwnPropertyNames: Re, getOwnPropertySymbols: Ie, getPrototypeOf: Pe } = Object, w = globalThis, ne = w.trustedTypes, ze = ne ? ne.emptyScript : "", j = w.reactiveElementPolyfillSupport, C = (t, e) => t, H = { toAttribute(t, e) {
switch (e) {
case Boolean:
t = t ? ze : null;
break;
case Object:
case Array:
t = t == null ? t : JSON.stringify(t);
}
return t;
}, fromAttribute(t, e) {
let i = t;
switch (e) {
case Boolean:
i = t !== null;
break;
case Number:
i = t === null ? null : Number(t);
break;
case Object:
case Array:
try {
i = JSON.parse(t);
} catch {
i = null;
}
}
return i;
} }, Y = (t, e) => !Ee(t, e), le = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Y };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), w.litPropertyMetadata ?? (w.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
class x extends HTMLElement {
static addInitializer(e) {
this._$Ei(), (this.l ?? (this.l = [])).push(e);
}
static get observedAttributes() {
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
}
static createProperty(e, i = le) {
if (i.state && (i.attribute = !1), this._$Ei(), this.elementProperties.set(e, i), !i.noAccessor) {
const r = Symbol(), s = this.getPropertyDescriptor(e, r, i);
s !== void 0 && De(this.prototype, e, s);
}
}
static getPropertyDescriptor(e, i, r) {
const { get: s, set: o } = Ce(this.prototype, e) ?? { get() {
return this[i];
}, set(a) {
this[i] = a;
} };
return { get() {
return s == null ? void 0 : s.call(this);
}, set(a) {
const l = s == null ? void 0 : s.call(this);
o.call(this, a), this.requestUpdate(e, l, r);
}, configurable: !0, enumerable: !0 };
}
static getPropertyOptions(e) {
return this.elementProperties.get(e) ?? le;
}
static _$Ei() {
if (this.hasOwnProperty(C("elementProperties"))) return;
const e = Pe(this);
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
}
static finalize() {
if (this.hasOwnProperty(C("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
const i = this.properties, r = [...Re(i), ...Ie(i)];
for (const s of r) this.createProperty(s, i[s]);
}
const e = this[Symbol.metadata];
if (e !== null) {
const i = litPropertyMetadata.get(e);
if (i !== void 0) for (const [r, s] of i) this.elementProperties.set(r, s);
}
this._$Eh = /* @__PURE__ */ new Map();
for (const [i, r] of this.elementProperties) {
const s = this._$Eu(i, r);
s !== void 0 && this._$Eh.set(s, i);
}
this.elementStyles = this.finalizeStyles(this.styles);
}
static finalizeStyles(e) {
const i = [];
if (Array.isArray(e)) {
const r = new Set(e.flat(1 / 0).reverse());
for (const s of r) i.unshift(ae(s));
} else e !== void 0 && i.push(ae(e));
return i;
}
static _$Eu(e, i) {
const r = i.attribute;
return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
}
constructor() {
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
}
_$Ev() {
var e;
this._$ES = new Promise((i) => this.enableUpdating = i), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((i) => i(this));
}
addController(e) {
var i;
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((i = e.hostConnected) == null || i.call(e));
}
removeController(e) {
var i;
(i = this._$EO) == null || i.delete(e);
}
_$E_() {
const e = /* @__PURE__ */ new Map(), i = this.constructor.elementProperties;
for (const r of i.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
e.size > 0 && (this._$Ep = e);
}
createRenderRoot() {
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return Oe(e, this.constructor.elementStyles), e;
}
connectedCallback() {
var e;
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((i) => {
var r;
return (r = i.hostConnected) == null ? void 0 : r.call(i);
});
}
enableUpdating(e) {
}
disconnectedCallback() {
var e;
(e = this._$EO) == null || e.forEach((i) => {
var r;
return (r = i.hostDisconnected) == null ? void 0 : r.call(i);
});
}
attributeChangedCallback(e, i, r) {
this._$AK(e, r);
}
_$EC(e, i) {
var o;
const r = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, r);
if (s !== void 0 && r.reflect === !0) {
const a = (((o = r.converter) == null ? void 0 : o.toAttribute) !== void 0 ? r.converter : H).toAttribute(i, r.type);
this._$Em = e, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
}
}
_$AK(e, i) {
var o;
const r = this.constructor, s = r._$Eh.get(e);
if (s !== void 0 && this._$Em !== s) {
const a = r.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : H;
this._$Em = s, this[s] = l.fromAttribute(i, a.type), this._$Em = null;
}
}
requestUpdate(e, i, r) {
if (e !== void 0) {
if (r ?? (r = this.constructor.getPropertyOptions(e)), !(r.hasChanged ?? Y)(this[e], i)) return;
this.P(e, i, r);
}
this.isUpdatePending === !1 && (this._$ES = this._$ET());
}
P(e, i, r) {
this._$AL.has(e) || this._$AL.set(e, i), r.reflect === !0 && this._$Em !== e && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(e);
}
async _$ET() {
this.isUpdatePending = !0;
try {
await this._$ES;
} catch (i) {
Promise.reject(i);
}
const e = this.scheduleUpdate();
return e != null && await e, !this.isUpdatePending;
}
scheduleUpdate() {
return this.performUpdate();
}
performUpdate() {
var r;
if (!this.isUpdatePending) return;
if (!this.hasUpdated) {
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
for (const [o, a] of this._$Ep) this[o] = a;
this._$Ep = void 0;
}
const s = this.constructor.elementProperties;
if (s.size > 0) for (const [o, a] of s) a.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], a);
}
let e = !1;
const i = this._$AL;
try {
e = this.shouldUpdate(i), e ? (this.willUpdate(i), (r = this._$EO) == null || r.forEach((s) => {
var o;
return (o = s.hostUpdate) == null ? void 0 : o.call(s);
}), this.update(i)) : this._$EU();
} catch (s) {
throw e = !1, this._$EU(), s;
}
e && this._$AE(i);
}
willUpdate(e) {
}
_$AE(e) {
var i;
(i = this._$EO) == null || i.forEach((r) => {
var s;
return (s = r.hostUpdated) == null ? void 0 : s.call(r);
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
}
_$EU() {
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
}
get updateComplete() {
return this.getUpdateComplete();
}
getUpdateComplete() {
return this._$ES;
}
shouldUpdate(e) {
return !0;
}
update(e) {
this._$Ej && (this._$Ej = this._$Ej.forEach((i) => this._$EC(i, this[i]))), this._$EU();
}
updated(e) {
}
firstUpdated(e) {
}
}
x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[C("elementProperties")] = /* @__PURE__ */ new Map(), x[C("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: x }), (w.reactiveElementVersions ?? (w.reactiveElementVersions = [])).push("2.0.4");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const R = globalThis, k = R.trustedTypes, he = k ? k.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, fe = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, me = "?" + m, Te = `<${me}>`, V = document, I = () => V.createComment(""), P = (t) => t === null || typeof t != "object" && typeof t != "function", we = Array.isArray, Me = (t) => we(t) || typeof (t == null ? void 0 : t[Symbol.iterator]) == "function", q = `[
\f\r]`, D = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, de = /-->/g, ce = />/g, S = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), ue = /'/g, pe = /"/g, $e = /^(?:script|style|textarea|title)$/i, Ue = (t) => (e, ...i) => ({ _$litType$: t, strings: e, values: i }), Z = Ue(1), A = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), ge = /* @__PURE__ */ new WeakMap(), y = V.createTreeWalker(V, 129);
function Se(t, e) {
if (!Array.isArray(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
return he !== void 0 ? he.createHTML(e) : e;
}
const Fe = (t, e) => {
const i = t.length - 1, r = [];
let s, o = e === 2 ? "<svg>" : "", a = D;
for (let l = 0; l < i; l++) {
const n = t[l];
let p, v, h = -1, _ = 0;
for (; _ < n.length && (a.lastIndex = _, v = a.exec(n), v !== null); ) _ = a.lastIndex, a === D ? v[1] === "!--" ? a = de : v[1] !== void 0 ? a = ce : v[2] !== void 0 ? ($e.test(v[2]) && (s = RegExp("</" + v[2], "g")), a = S) : v[3] !== void 0 && (a = S) : a === S ? v[0] === ">" ? (a = s ?? D, h = -1) : v[1] === void 0 ? h = -2 : (h = a.lastIndex - v[2].length, p = v[1], a = v[3] === void 0 ? S : v[3] === '"' ? pe : ue) : a === pe || a === ue ? a = S : a === de || a === ce ? a = D : (a = S, s = void 0);
const f = a === S && t[l + 1].startsWith("/>") ? " " : "";
o += a === D ? n + Te : h >= 0 ? (r.push(p), n.slice(0, h) + fe + n.slice(h) + m + f) : n + m + (h === -2 ? l : f);
}
return [Se(t, o + (t[i] || "<?>") + (e === 2 ? "</svg>" : "")), r];
};
class z {
constructor({ strings: e, _$litType$: i }, r) {
let s;
this.parts = [];
let o = 0, a = 0;
const l = e.length - 1, n = this.parts, [p, v] = Fe(e, i);
if (this.el = z.createElement(p, r), y.currentNode = this.el.content, i === 2) {
const h = this.el.content.firstChild;
h.replaceWith(...h.childNodes);
}
for (; (s = y.nextNode()) !== null && n.length < l; ) {
if (s.nodeType === 1) {
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(fe)) {
const _ = v[a++], f = s.getAttribute(h).split(m), U = /([.?@])?(.*)/.exec(_);
n.push({ type: 1, index: o, name: U[2], strings: f, ctor: U[1] === "." ? ke : U[1] === "?" ? Le : U[1] === "@" ? Ne : N }), s.removeAttribute(h);
} else h.startsWith(m) && (n.push({ type: 6, index: o }), s.removeAttribute(h));
if ($e.test(s.tagName)) {
const h = s.textContent.split(m), _ = h.length - 1;
if (_ > 0) {
s.textContent = k ? k.emptyScript : "";
for (let f = 0; f < _; f++) s.append(h[f], I()), y.nextNode(), n.push({ type: 2, index: ++o });
s.append(h[_], I());
}
}
} else if (s.nodeType === 8) if (s.data === me) n.push({ type: 2, index: o });
else {
let h = -1;
for (; (h = s.data.indexOf(m, h + 1)) !== -1; ) n.push({ type: 7, index: o }), h += m.length - 1;
}
o++;
}
}
static createElement(e, i) {
const r = V.createElement("template");
return r.innerHTML = e, r;
}
}
function O(t, e, i = t, r) {
var a, l;
if (e === A) return e;
let s = r !== void 0 ? (a = i._$Co) == null ? void 0 : a[r] : i._$Cl;
const o = P(e) ? void 0 : e._$litDirective$;
return (s == null ? void 0 : s.constructor) !== o && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), o === void 0 ? s = void 0 : (s = new o(t), s._$AT(t, i, r)), r !== void 0 ? (i._$Co ?? (i._$Co = []))[r] = s : i._$Cl = s), s !== void 0 && (e = O(t, s._$AS(t, e.values), s, r)), e;
}
class He {
constructor(e, i) {
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = i;
}
get parentNode() {
return this._$AM.parentNode;
}
get _$AU() {
return this._$AM._$AU;
}
u(e) {
const { el: { content: i }, parts: r } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? V).importNode(i, !0);
y.currentNode = s;
let o = y.nextNode(), a = 0, l = 0, n = r[0];
for (; n !== void 0; ) {
if (a === n.index) {
let p;
n.type === 2 ? p = new M(o, o.nextSibling, this, e) : n.type === 1 ? p = new n.ctor(o, n.name, n.strings, this, e) : n.type === 6 && (p = new Be(o, this, e)), this._$AV.push(p), n = r[++l];
}
a !== (n == null ? void 0 : n.index) && (o = y.nextNode(), a++);
}
return y.currentNode = V, s;
}
p(e) {
let i = 0;
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, i), i += r.strings.length - 2) : r._$AI(e[i])), i++;
}
}
class M {
get _$AU() {
var e;
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
}
constructor(e, i, r, s) {
this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = e, this._$AB = i, this._$AM = r, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
}
get parentNode() {
let e = this._$AA.parentNode;
const i = this._$AM;
return i !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = i.parentNode), e;
}
get startNode() {
return this._$AA;
}
get endNode() {
return this._$AB;
}
_$AI(e, i = this) {
e = O(this, e, i), P(e) ? e === g || e == null || e === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : e !== this._$AH && e !== A && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Me(e) ? this.k(e) : this._(e);
}
S(e) {
return this._$AA.parentNode.insertBefore(e, this._$AB);
}
T(e) {
this._$AH !== e && (this._$AR(), this._$AH = this.S(e));
}
_(e) {
this._$AH !== g && P(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
}
$(e) {
var o;
const { values: i, _$litType$: r } = e, s = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = z.createElement(Se(r.h, r.h[0]), this.options)), r);
if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(i);
else {
const a = new He(s, this), l = a.u(this.options);
a.p(i), this.T(l), this._$AH = a;
}
}
_$AC(e) {
let i = ge.get(e.strings);
return i === void 0 && ge.set(e.strings, i = new z(e)), i;
}
k(e) {
we(this._$AH) || (this._$AH = [], this._$AR());
const i = this._$AH;
let r, s = 0;
for (const o of e) s === i.length ? i.push(r = new M(this.S(I()), this.S(I()), this, this.options)) : r = i[s], r._$AI(o), s++;
s < i.length && (this._$AR(r && r._$AB.nextSibling, s), i.length = s);
}
_$AR(e = this._$AA.nextSibling, i) {
var r;
for ((r = this._$AP) == null ? void 0 : r.call(this, !1, !0, i); e && e !== this._$AB; ) {
const s = e.nextSibling;
e.remove(), e = s;
}
}
setConnected(e) {
var i;
this._$AM === void 0 && (this._$Cv = e, (i = this._$AP) == null || i.call(this, e));
}
}
class N {
get tagName() {
return this.element.tagName;
}
get _$AU() {
return this._$AM._$AU;
}
constructor(e, i, r, s, o) {
this.type = 1, this._$AH = g, this._$AN = void 0, this.element = e, this.name = i, this._$AM = s, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = g;
}
_$AI(e, i = this, r, s) {
const o = this.strings;
let a = !1;
if (o === void 0) e = O(this, e, i, 0), a = !P(e) || e !== this._$AH && e !== A, a && (this._$AH = e);
else {
const l = e;
let n, p;
for (e = o[0], n = 0; n < o.length - 1; n++) p = O(this, l[r + n], i, n), p === A && (p = this._$AH[n]), a || (a = !P(p) || p !== this._$AH[n]), p === g ? e = g : e !== g && (e += (p ?? "") + o[n + 1]), this._$AH[n] = p;
}
a && !s && this.j(e);
}
j(e) {
e === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
}
}
class ke extends N {
constructor() {
super(...arguments), this.type = 3;
}
j(e) {
this.element[this.name] = e === g ? void 0 : e;
}
}
class Le extends N {
constructor() {
super(...arguments), this.type = 4;
}
j(e) {
this.element.toggleAttribute(this.name, !!e && e !== g);
}
}
class Ne extends N {
constructor(e, i, r, s, o) {
super(e, i, r, s, o), this.type = 5;
}
_$AI(e, i = this) {
if ((e = O(this, e, i, 0) ?? g) === A) return;
const r = this._$AH, s = e === g && r !== g || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== g && (r === g || s);
s && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
}
handleEvent(e) {
var i;
typeof this._$AH == "function" ? this._$AH.call(((i = this.options) == null ? void 0 : i.host) ?? this.element, e) : this._$AH.handleEvent(e);
}
}
class Be {
constructor(e, i, r) {
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = r;
}
get _$AU() {
return this._$AM._$AU;
}
_$AI(e) {
O(this, e);
}
}
const G = R.litHtmlPolyfillSupport;
G == null || G(z, M), (R.litHtmlVersions ?? (R.litHtmlVersions = [])).push("3.1.4");
const je = (t, e, i) => {
const r = (i == null ? void 0 : i.renderBefore) ?? e;
let s = r._$litPart$;
if (s === void 0) {
const o = (i == null ? void 0 : i.renderBefore) ?? null;
r._$litPart$ = s = new M(e.insertBefore(I(), o), o, void 0, i ?? {});
}
return s._$AI(t), s;
};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
class b extends x {
constructor() {
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
}
createRenderRoot() {
var i;
const e = super.createRenderRoot();
return (i = this.renderOptions).renderBefore ?? (i.renderBefore = e.firstChild), e;
}
update(e) {
const i = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = je(i, this.renderRoot, this.renderOptions);
}
connectedCallback() {
var e;
super.connectedCallback(), (e = this._$Do) == null || e.setConnected(!0);
}
disconnectedCallback() {
var e;
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
}
render() {
return A;
}
}
var ve;
b._$litElement$ = !0, b.finalized = !0, (ve = globalThis.litElementHydrateSupport) == null || ve.call(globalThis, { LitElement: b });
const W = globalThis.litElementPolyfillSupport;
W == null || W({ LitElement: b });
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.6");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const X = (t) => (e, i) => {
i !== void 0 ? i.addInitializer(() => {
customElements.define(t, e);
}) : customElements.define(t, e);
};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const qe = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Y }, Ge = (t = qe, e, i) => {
const { kind: r, metadata: s } = i;
let o = globalThis.litPropertyMetadata.get(s);
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), o.set(i.name, t), r === "accessor") {
const { name: a } = i;
return { set(l) {
const n = e.get.call(this);
e.set.call(this, l), this.requestUpdate(a, n, t);
}, init(l) {
return l !== void 0 && this.P(a, void 0, t), l;
} };
}
if (r === "setter") {
const { name: a } = i;
return function(l) {
const n = this[a];
e.call(this, l), this.requestUpdate(a, n, t);
};
}
throw Error("Unsupported decorator location: " + r);
};
function d(t) {
return (e, i) => typeof i == "object" ? Ge(t, e, i) : ((r, s, o) => {
const a = s.hasOwnProperty(o);
return s.constructor.createProperty(o, a ? { ...r, wrapped: !0 } : r), a ? Object.getOwnPropertyDescriptor(s, o) : void 0;
})(t, e, i);
}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const We = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Je = (t) => (...e) => ({ _$litDirective$: t, values: e });
class Qe {
constructor(e) {
}
get _$AU() {
return this._$AM._$AU;
}
_$AT(e, i, r) {
this._$Ct = e, this._$AM = i, this._$Ci = r;
}
_$AS(e, i) {
return this.update(e, i);
}
update(e, i) {
return this.render(...i);
}
}
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Ke = Je(class extends Qe {
constructor(t) {
var e;
if (super(t), t.type !== We.ATTRIBUTE || t.name !== "class" || ((e = t.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
}
render(t) {
return " " + Object.keys(t).filter((e) => t[e]).join(" ") + " ";
}
update(t, [e]) {
var r, s;
if (this.st === void 0) {
this.st = /* @__PURE__ */ new Set(), t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter((o) => o !== "")));
for (const o in e) e[o] && !((r = this.nt) != null && r.has(o)) && this.st.add(o);
return this.render(e);
}
const i = t.element.classList;
for (const o of this.st) o in e || (i.remove(o), this.st.delete(o));
for (const o in e) {
const a = !!e[o];
a === this.st.has(o) || (s = this.nt) != null && s.has(o) || (a ? (i.add(o), this.st.add(o)) : (i.remove(o), this.st.delete(o)));
}
return A;
}
}), ee = L`
:host {
box-sizing: border-box;
font-family: var(--rv-font-family);
}
:host *,
:host *::before,
:host *::after {
box-sizing: inherit;
}
[hidden] {
display: none !important;
}
`, Ye = L`
${ee}
:host {
--dialog-width: 31rem;
--header-spacing: var(--rv-spacing-large);
--body-spacing: var(--rv-spacing-large);
--footer-spacing: var(--rv-spacing-large);
display: none;
}
:host([open]) {
display: contents;
}
.dialog__overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: var(--rv-dialog-background-color-overlay);
}
.dialog {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.dialog--open .dialog__panel {
display: flex;
opacity: 1;
}
.dialog__panel {
display: flex;
flex-direction: column;
z-index: 2;
width: var(--dialog-width);
max-width: calc(100% - var(--rv-spacing-2x-large));
max-height: calc(100% - var(--rv-spacing-2x-large));
background-color: var(--rv-dialog-background-color);
border-radius: var(--rv-border-radius-large);
box-shadow: var(--rv-shadow-x-large);
}
.dialog__panel:focus {
outline: none;
}
.dialog__header {
flex: 0 0 auto;
display: flex;
background-color: var(--rv-dialog-background-color-header);
height: 44px;
font-size: 1.125rem; /* 18px */
line-height: 1.4;
border-radius: var(--rv-border-radius-large) var(--rv-border-radius-large) 0 0;
}
.dialog__header-actions {
flex-shrink: 0;
display: flex;
flex-wrap: wrap;
justify-content: end;
gap: var(--rv-spacing-2x-small);
}
.dialog__title {
flex: 1 1 auto;
margin: 0;
font-weight: 600;
text-overflow: ellipsis;
padding: 0.75rem;
}
.dialog__close {
background-color: transparent;
border: none;
border-radius: var(--rv-border-radius-circle);
width: 36px;
height: 36px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background-color 0.3s;
margin: 0.25rem;
}
.dialog__close:hover {
background-color: hsl(0 0% 80% / 50%);
}
.dialog__content {
flex: 1 1 auto;
display: block;
min-height: 250px;
padding: var(--body-spacing);
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.dialog__footer {
flex: 0 0 auto;
height: 64px;
text-align: right;
background-color: var(--rv-dialog-background-color-footer);
padding: var(--rv-spacing-small);
border-radius: 0 0 var(--rv-border-radius-large) var(--rv-border-radius-large);
box-shadow: 0 -4px 8px -1px rgba(0, 0, 0, 0.1);
}
.rv-button {
background-color: var(--rv-button-background-color);
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px; /* Adjust font size as needed */
cursor: pointer;
border-radius: 20px;
transition: background-color 0.3s, box-shadow 0.3s; /* Smooth transition for hover effects */
}
.rv-button:hover {
background-color: var(--rv-button-background-color-hover);
}
`;
var Ze = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, te = (t, e, i, r) => {
for (var s = r > 1 ? void 0 : r ? Xe(e, i) : e, o = t.length - 1, a; o >= 0; o--)
(a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
return r && s && Ze(e, i, s), s;
};
let T = class extends b {
constructor() {
super(...arguments), this.title = "", this.open = !1;
}
show() {
return this.open = !0, new Promise((t) => {
this._closeResolver = t;
});
}
close(t) {
this._closeResolver && (this._closeResolver(t), this._closeResolver = void 0), this.open = !1;
}
//todo: hide header
//todo: hide close button
//todo: hide footer
render() {
return Z`
<div id="dialog" class="${Ke({
dialog: !0,
"dialog--open": this.open
})}">
<div part="overlay" class="dialog__overlay" @click="${() => this.close("overlay")}" tabindex="-1"></div>
<div part="panel" class="dialog__panel" role="dialog"
aria-modal="true"
aria-hidden=${this.open ? "false" : "true"}
tabindex="-1">
<header part="header" class="dialog__header">
<div part="title" class="dialog__title"> ${this.title.length > 0 ? this.title : "\uFEFF"} </div>
<div part="header-actions" class="dialog__header-actions">
<slot name="header-actions"></slot>
<div part="close-button" class="dialog__close" @click="${() => this.close("close-button")}">
<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 16 16" fill="currentColor" >
<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>
</svg>
</div>
</div>
</header>
<slot part="content" class="dialog__content"></slot>
<footer part="footer" class="dialog__footer">
<slot name="footer">
<button class="rv-button" @click="${() => this.close("close-button")}">Ok</button>
</slot>
</footer>
</div>
</div>
`;
}
};
T.styles = Ye;
te([
d()
], T.prototype, "title", 2);
te([
d({ type: Boolean, reflect: !0 })
], T.prototype, "open", 2);
T = te([
X("rv-dialog")
], T);
var ie = /* @__PURE__ */ ((t) => (t.Pivot = "Pivot", t.Grid = "Grid", t.AreaChart = "AreaChart", t.BarChart = "BarChart", t.BubbleChart = "BubbleChart", t.CandlestickChart = "CandlestickChart", t.ColumnChart = "ColumnChart", t.ComboChart = "ComboChart", t.DoughnutChart = "DoughnutChart", t.FunnelChart = "FunnelChart", t.LineChart = "LineChart", t.OHLC_Chart = "OHLC_Chart", t.PieChart = "PieChart", t.RadialLineChart = "RadialLineChart", t.ScatterChart = "ScatterChart", t.SplineChart = "SplineChart", t.SplineAreaChart = "SplineAreaChart", t.StackedAreaChart = "StackedAreaChart", t.StackedBarChart = "StackedBarChart", t.StackedColumnChart = "StackedColumnChart", t.StepAreaChart = "StepAreaChart", t.StepLineChart = "StepLineChart", t.RadialGauge = "RadialGauge", t.BulletGraph = "BulletGraph", t.LinearGauge = "LinearGauge", t.LabelGauge = "LabelGauge", t.TreeMap = "TreeMap", t.Image = "Image", t.DIY = "DIY", t.TextView = "TextView", t.Indicator = "Indicator", t.IndicatorTarget = "IndicatorTarget", t.Sparkline = "Sparkline", t.TextBox = "TextBox", t.Choropleth = "Choropleth", t.ScatterMap = "ScatterMap", t.TimeSeriesChart = "TimeSeriesChart", t))(ie || {});
function et(t) {
const e = t && t.constructor;
return !!(ye(t) && e && e.name && e.name !== "Object");
}
function tt(t) {
const e = Object.prototype.toString.call(t);
return e === "[object Array]" || e === "[object Array Iterator]";
}
function ye(t, e) {
return !!t && typeof t == "object" && !tt(t);
}
const it = ["__proto__", "constructor", "prototype"];
function be(t, ...e) {
const i = function(s, o) {
return typeof s != "object" && (s = {}), Object.entries(o).forEach(([a, l]) => {
it.includes(a) || (ye(l) && !et(l) ? s[a] = i(s[a] || {}, l) : s[a] = o[a]);
}), s;
}, r = e.length;
for (let s = 0; s < r; s++)
t = i(t, e[s]);
return t;
}
const rt = L`
${ee}
:host {
display: block;
height: 100%;
width: 100%;
position: relative;
> div {
height: inherit;
width: inherit;
min-height: inherit;
position: relative;
}
}
`;
class Ve {
static async load(e) {
if (!e)
return null;
if (typeof e == "string" || e instanceof Blob)
return await this.loadRVDashboard(e);
if (typeof e.toRVDashboard == "function")
return await e.toRVDashboard();
if (e.constructor.name === "RVDashboard")
return e;
throw new Error("Invalid Dashboard provided to DashboardLoader.load: " + e);
}
static async loadRVDashboard(e) {
return typeof e == "string" ? await $.ig.RVDashboard.loadDashboard(e) : $.ig.RVDashboard.loadDashboardFromContainer(e);
}
}
const J = {
AmazonAthena: {
dataSourceCreator: () => new $.ig.RVAthenaDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVAthenaDataSourceItem(t)
},
AmazonS3: {
dataSourceCreator: () => new $.ig.RVS3DataSource()
},
Excel: {
dataSourceItemCreator: (t, e) => {
const i = new $.ig.RVLocalFileDataSourceItem();
return i.uri = e.fileName ? `local:/${e.fileName}` : void 0, new $.ig.RVExcelDataSourceItem(i);
}
},
GoogleBigQuery: {
dataSourceCreator: () => new $.ig.RVBigQueryDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVBigQueryDataSourceItem(t)
},
GoogleDrive: {
dataSourceCreator: () => new $.ig.RVGoogleDriveDataSource()
},
GoogleSheets: {
dataSourceCreator: () => new $.ig.RVGoogleDriveDataSourceItem(),
dataSourceItemCreator: (t) => new $.ig.RVGoogleSheetDataSourceItem(t)
},
LocalFile: {
dataSourceItemCreator: (t, e) => {
const i = new $.ig.RVLocalFileDataSourceItem();
return i.uri = e.fileName ? `local:/${e.fileName}` : void 0, e.format === "Excel" ? new $.ig.RVExcelDataSourceItem(i) : new $.ig.RVCsvDataSourceItem(i);
}
},
MicrosoftAzureSqlServer: {
dataSourceCreator: () => new $.ig.RVAzureSqlDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVAzureSqlDataSourceItem(t)
},
MicrosoftSqlServer: {
dataSourceCreator: () => new $.ig.RVSqlServerDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVSqlServerDataSourceItem(t)
},
MongoDB: {
dataSourceCreator: () => new $.ig.RVMongoDBDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVMongoDBDataSourceItem(t)
},
MySql: {
dataSourceCreator: () => new $.ig.RVMySqlDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVMySqlDataSourceItem(t)
},
Oracle: {
dataSourceCreator: (t) => t.provider === "SID" ? new $.ig.RVOracleSIDDataSource() : new $.ig.RVOracleServiceDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVOracleDataSourceItem(t)
},
PostgreSQL: {
dataSourceCreator: () => new $.ig.RVPostgresDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVPostgresDataSourceItem(t)
},
RemoteFile: {
dataSourceItemCreator: (t, e) => {
const i = new $.ig.RVWebResourceDataSource();
i.url = e.url, i.useAnonymousAuthentication = e.useAnonymousAuthentication ?? !0;
const r = new $.ig.RVWebResourceDataSourceItem(i);
if (e.format === "JSON")
return new $.ig.RVJsonDataSourceItem(r);
if (e.format === "CSV")
return new $.ig.RVCsvDataSourceItem(r);
if (e.format === "Excel")
return new $.ig.RVExcelDataSourceItem(r);
throw new Error(`Unsupported RemoteFile: ${e.type}`);
}
},
REST: {
dataSourceCreator: (t) => {
const e = new $.ig.RVRESTDataSource();
return e.useAnonymousAuthentication = t.useAnonymousAuthentication ?? !0, e;
}
},
Snowflake: {
dataSourceCreator: () => new $.ig.RVSnowflakeDataSource(),
dataSourceItemCreator: (t) => new $.ig.RVSnowflakeDataSourceItem(t)
}
};
function st(t) {
const e = [];
let i = [];
return t && t.forEach((r) => {
var a;
let s;
const o = J[r.type].dataSourceCreator;
o && (s = o(r), nt(r, s), e.push(s)), (a = J[r.type]) != null && a.dataSourceItemCreator && i.push(...at(r, s));
}), { dataSources: e, dataSourceItems: i };
}
function ot(t) {
return "items" in t && Array.isArray(t.items);
}
function at(t, e) {
const i = [], r = J[t.type].dataSourceItemCreator;
if (!r)
throw new Error(`Unsupported dataSourceItemType: ${t.type}`);
return (ot(t) ? t.items : [t]).forEach((o) => {
const a = r(e, o);
lt(o, a), i.push(a);
}), i;
}
function nt(t, e) {
Ae(t, e);
}
function lt(t, e) {
Ae(t, e);
}
function Ae(t, e) {
for (const i in t)
t.hasOwnProperty(i) && (e[i] = t[i]);
}
const ht = Object.freeze({
canEdit: !0,
canSave: !0,
canSaveAs: !0,
dataSources: [],
saveOnServer: !0,
startInEditMode: !1,
startWithNewVisualization: !1,
header: {
showHeader: !0,
canAddVisualization: !0,
menu: {
showMenu: !0,
exportToExcel: !0,
exportToImage: !0,
exportToPdf: !0,
exportToPowerPoint: !0,
refresh: !0,
items: []
}
},
filters: {
addDashboardFiter: !0,
addDateFilter: !0,
interactiveFiltering: !0,
showFilters: !0
},
dataSourceDialog: {
showExistingDataSources: !1,
showSearch: !1
},
visualizations: {
canMaximize: !0,
categoryGroupingSeparator: " - ",
crosshairs: !1,
hoverTooltips: !0,
changeChartType: !0,
statisticalFunctions: !0,
menu: {
copy: !0,
duplicate: !0,
items: []
}
},
editor: {
defaultChartType: ie.ColumnChart,
addPostCalculatedFields: !0,
addCalculatedFields: !0,
dataBlending: !0,
editDataSource: !1,
machineLearning: !1
}
});
var dt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, u = (t, e, i, r) => {
for (var s = r > 1 ? void 0 : r ? ct(e, i) : e, o = t.length - 1, a; o >= 0; o--)
(a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
return r && s && dt(e, i, s), s;
};
let c = class extends b {
constructor() {
super(...arguments), this._revealView = null, this._mergedOptions = {}, this.dashboard = "", this.options = {};
}
/**
* Gets the dashboard date filter.
*/
get dateFilter() {
var t, e;
return (e = (t = this._revealView) == null ? void 0 : t.dashboard) == null ? void 0 : e.dateFilter;
}
/**
* Gets the dashboard filters.
*/
get filters() {
var t, e;
return (e = (t = this._revealView) == null ? void 0 : t.dashboard) == null ? void 0 : e.filters;
}
firstUpdated(t) {
console.log("firstUpdated"), this.init(this.dashboard, this.options);
}
async init(t, e) {
const i = await this.loadRVDashboard(t), r = this.renderRoot.querySelector("#rv-viewer");
this._revealView = new $.ig.RevealView(r), this._revealView.interactiveFilteringEnabled = !0, this.assignHandler(this.dataLoading, "onDataLoading", (s) => s), t && (this._revealView.dashboard = i), this.updateOptions(e), this.initializeEvents(), this.initialized && this.initialized();
}
loadRVDashboard(t) {
return Ve.load(t);
}
updateOptions(t) {
if (this._revealView) {
if (this._mergedOptions = be({}, ht, t), this._revealView.canEdit = this._mergedOptions.canEdit, this._revealView.canSave = this._mergedOptions.canSave, this._revealView.canSaveAs = this._mergedOptions.canSaveAs, this._revealView.serverSideSave = this._mergedOptions.saveOnServer, this._revealView.startInEditMode = this._mergedOptions.startInEditMode, this._revealView.startWithNewVisualization = this._mergedOptions.startWithNewVisualization, this._revealView.showHeader = this._mergedOptions.header.showHeader, this._revealView.canAddVisualization = this._mergedOptions.header.canAddVisualization, this._revealView.showMenu = this._mergedOptions.header.menu.showMenu, this._revealView.showExportToExcel = this._mergedOptions.header.menu.exportToExcel, this._revealView.showExportImage = this._mergedOptions.header.menu.exportToImage, this._revealView.showExportToPDF = this._mergedOptions.header.menu.exportToPdf, this._revealView.showExportToPowerpoint = this._mergedOptions.header.menu.exportToPowerPoint, this._revealView.showRefresh = this._mergedOptions.header.menu.refresh, this._revealView.showFilters = this._mergedOptions.filters.showFilters, this._revealView.canAddDashboardFiter = this._mergedOptions.filters.addDashboardFiter, this._revealView.canAddDateFilter = this._mergedOptions.filters.addDateFilter, this._revealView.interactiveFilteringEnabled = this._mergedOptions.filters.interactiveFiltering, this._revealView.canMaximizeVisualization = this._mergedOptions.visualizations.canMaximize, this._revealView.categoryGroupingSeparator = this._mergedOptions.visualizations.categoryGroupingSeparator, this._revealView.crosshairsEnabled = this._mergedOptions.visualizations.crosshairs, this._revealView.hoverTooltipsEnabled = this._mergedOptions.visualizations.hoverTooltips, this._revealView.showChangeVisualization = this._mergedOptions.visualizations.changeChartType, this._revealView.showStatisticalFunctions = this._mergedOptions.visualizations.statisticalFunctions, this._revealView.canCopyVisualization = this._mergedOptions.visualizations.menu.copy, this._revealView.canDuplicateVisualization = this._mergedOptions.visualizations.menu.duplicate, this._revealView.showDataSourceSelectionDialogSearch = this._mergedOptions.dataSourceDialog.showSearch, this._mergedOptions.editor.chartTypes && (this._revealView.chartTypes = this._mergedOptions.editor.chartTypes(this._revealView.chartTypes)), this._mergedOptions.editor.chartTypesToRemove && (this._revealView.chartTypes = this._revealView.chartTypes.filter((e) => !this._mergedOptions.editor.chartTypesToRemove.includes(e.chartType))), this._mergedOptions.editor.chartTypesToAdd && this._revealView.chartTypes.push(...this._mergedOptions.editor.chartTypesToAdd), typeof this._mergedOptions.editor.defaultChartType == "string") {
const e = Object.values(ie).includes(this._mergedOptions.editor.defaultChartType);
this._revealView.defaultChartType = e ? this._mergedOptions.editor.defaultChartType : void 0, this._revealView.defaultCustomChartType = e ? void 0 : this._mergedOptions.editor.defaultChartType;
} else
this._revealView.defaultChartType = this._mergedOptions.editor.defaultChartType;
this._revealView.canAddCalculatedFields = this._mergedOptions.editor.addCalculatedFields, this._revealView.canAddPostCalculatedFields = this._mergedOptions.editor.addPostCalculatedFields, this._revealView.showDataBlending = this._mergedOptions.editor.dataBlending, this._revealView.showEditDataSource = this._mergedOptions.editor.editDataSource, this._revealView.showMachineLearningModelsIntegration = this._mergedOptions.editor.machineLearning;
}
}
async updateDashboard(t) {
this._revealView && (this._revealView.dashboard = await this.loadRVDashboard(t));
}
initializeEvents() {
this.assignHandler(this.dataPointClicked, "onVisualizationDataPointClicked", (t, e, i) => ({ visualization: t, cell: e, row: i })), this.assignHandler(this.dataSourceDialogOpening, "onDataSourceSelectionDialogShowing", (t) => t), this.assignHandler(this.fieldsInitializing, "onFieldsInitializing", (t) => t), this.assignHandler(this.tooltipShowing, "onTooltipShowing", (t) => t), this.assignHandler(this.editorClosed, "onVisualizationEditorClosed", (t) => t), this.assignHandler(this.editorClosing, "onVisualizationEditorClosing", (t) => t), this.assignHandler(this.editorOpened, "onVisualizationEditorOpened", (t) => t), this.assignHandler(this.editorOpening, "onVisualizationEditorOpening", (t) => t), this.assignHandler(this.imageExported, "onImageExported", (t) => ({ image: t })), this.assignHandler(this.linkSelectionDialogOpening, "onDashboardSelectorRequested", (t) => t), this.assignHandler(this.saving, "onSave", (t, e) => e), this.seriesColorRequested !== void 0 && (this._revealView.onVisualizationSeriesColorAssigning = (t, e, i, r) => {
var s;
return (s = this.seriesColorRequested) == null ? void 0 : s.call(this, {
visualization: t,
defaultColor: e,
fieldName: i,
categoryName: r
});
}), this._revealView.onMenuOpening = (t, e) => {
const i = (r, s) => {
r.forEach((o) => {
const a = o.icon ? new $.ig.RVImage(o.icon) : void 0;
e.menuItems.push(new $.ig.RVMenuItem(o.title, a, () => s(o)));
});
};
if (t === null) {
const r = this._mergedOptions.header.menu.items;
i(r, (s) => s.click());
} else {
const r = this._mergedOptions.visualizations.menu.items;
i(r, (s) => s.click(t));
}
this.assignHandler(this.menuOpening, "onMenuOpening", (r) => r);
}, this._revealView.onDataSourcesRequested = (t, e) => {
const { dataSources: i, dataSourceItems: r } = st(this._mergedOptions.dataSources);
if (this.dataSourcesRequested !== void 0) {
const s = this.dataSourcesRequested({ trigger: e });
i.push(...s.dataSources), r.push(...s.dataSourceItems);
}
t(new $.ig.RevealDataSources(i, r, this._mergedOptions.dataSourceDialog.showExistingDataSources));
}, this._revealView.onLinkedDashboardProviderAsync = (t, e) => {
let i = t;
return this.dashboardLinkRequested !== void 0 && (i = this.dashboardLinkRequested({ dashboardId: t, title: e })), $.ig.RVDashboard.loadDashboard(i);
};
}
assignHandler(t, e, i) {
t !== void 0 && (this._revealView[e] = (...r) => {
t && t(i(...r));
});
}
/**
* Gets the RVDashboard instance from the underlying RevealView object.
* @returns The RVDashboard instance.
*/
getRVDashboard() {
return this._revealView ? this._revealView.dashboard : null;
}
/**
* Export the dashboard to Excel.
*/
exportToExcel() {
this._revealView._dashboardView.exportToExcel();
}
/**
* Export the dashboard to an image.
* @param showDialog - If true, the export dialog will be shown. If false, the image will be exported directly.
* @returns A promise that resolves to the exported image element or null.
*/
exportToImage(t = !0) {
if (t) {
this._revealView._dashboardView.exportImage();
return;
}
return this._revealView.toImage();
}
/**
* Export the dashboard to PDF.
*/
exportToPdf() {
this._revealView._dashboardView.exportToFormat("pdf");
}
/**
* Export the dashboard to PowerPoint.
*/
exportToPowerPoint() {
this._revealView._dashboardView.exportToFormat("pptx");
}
/**
* Refreshes the data in the dashboard.
* If no parameter is provided, the entire dashboard is refreshed.
* If a string ID is provided, the visualization with that ID is refreshed.
* If a number index is provided, the visualization at that index is refreshed.
* @param input The ID or index of the visualization to refresh, or nothing to refresh the entire dashboard.
*/
refreshData(t) {
typeof t == "string" ? this._revealView._dashboardView.refreshWidget(t) : typeof t == "number" ? this._revealView._dashboardView.refreshWidget(this._revealView.dashboard.visualizations[t].id) : this._revealView.refreshDashboardData();
}
updated(t) {
const e = t.has("dashboard") && this.dashboard !== void 0, i = t.has("options") && this.options !== void 0;
e && this.updateDashboard(this.dashboard), i && this.updateOptions(this.options);
}
render() {
return Z`
<div id="rv-viewer"></div>
`;
}
};
c.styles = rt;
u([
d({ type: String })
], c.prototype, "dashboard", 2);
u([
d({ type: Object, attribute: !1 })
], c.prototype, "options", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "dataLoading", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "dataPointClicked", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "dataSourceDialogOpening", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "dataSourcesRequested", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "dashboardLinkRequested", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "editorClosed", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "editorClosing", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "editorOpened", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "editorOpening", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "fieldsInitializing", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "imageExported", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "initialized", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "linkSelectionDialogOpening", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "menuOpening", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "saving", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "seriesColorRequested", 2);
u([
d({ type: Function, attribute: !1 })
], c.prototype, "tooltipShowing", 2);
c = u([
X("rv-reveal-view")
], c);
const ut = Object.freeze({
categoryGroupingSeparator: " - ",
crosshairs: !1,
hoverTooltips: !0,
showFilters: !1,
changeChartType: !1,
statisticalFunctions: !1,
menu: {
items: [],
copy: !0,
duplicate: !0,
exportToExcel: !0,
exportToImage: !0,
showMenu: !1,
refresh: !0
}
}), pt = L`
${ee}
:host {
display: block;
height: 100%;
width: 100%;
position: relative;
> div {
height: inherit;
width: inherit;
min-height: inherit;
position: relative;
}
}
`;
var gt = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, B = (t, e, i, r) => {
for (var s = r > 1 ? void 0 : r ? vt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
(a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
return r && s && gt(e, i, s), s;
};
let E = class extends b {
constructor() {
super(...arguments), this._revealView = null, this._mergedOptions = {}, this.dashboard = "", this.options = {}, this.visualization = 0;
}
firstUpdated(t) {
this.init(this.dashboard, this.visualization, this.options);
}
async init(t, e, i) {
const r = await this.loadRVDashboard(t), s = this.renderRoot.querySelector("#rv-viewer");
this._revealView = new $.ig.RevealView(s), this._revealView.singleVisualizationMode = !0, this.updateOptions(i), this._revealView.dashboard = r, this.setVisualization(r, e), this._revealView.onMenuOpening = (o, a) => {
o !== null && this._mergedOptions.menu.items.forEach((n) => {
a.menuItems.push(new $.ig.RVMenuItem(n.title, n.icon, () => n.click(o)));
});
};
}
setVisualization(t, e) {
if (!t || !t.visualizations || t.visualizations.length === 0) {
this._revealView.maximizedVisualization = null;
return;
}
e = e !== void 0 ? e : 0;
let i = null;
typeof e == "string" ? (i = t.visualizations.getByTitle(e), i === null && (i = t.visualizations.getById(e)), i === null && (i = t.visualizations[e])) : typeof e == "number" && (i = t.visualizations[e]), i || console.log(`Visualization ${typeof e == "string" ? `with ID or title "${e}"` : `at index ${e}`} is not found. Loading the default vizualization.`), this._revealView.maximizedVisualization = i;
}
async updateDashboard(t, e) {
this._revealView && (this._revealView.dashboard = await this.loadRVDashboard(t), this.setVisualization(this._revealView.dashboard, e));
}
updateOptions(t) {
this._revealView && (this._mergedOptions = be({}, ut, t), this._revealView.showExportToExcel = this._mergedOptions.menu.exportToExcel, this._revealView.showExportImage = this._mergedOptions.menu.exportToImage, this._revealView.showMenu = this._mergedOptions.menu.showMenu, this._revealView.showRefresh = this._mergedOptions.menu.refresh, this._revealView.showFilters = this._mergedOptions.showFilters, this._revealView.categoryGroupingSeparator = this._mergedOptions.categoryGroupingSeparator, this._revealView.crosshairsEnabled = this._mergedOptions.crosshairs, this._revealView.hoverTooltipsEnabled = this._mergedOptions.hoverTooltips, this._revealView.showChangeVisualization = this._mergedOptions.changeChartType, this._revealView.showStatisticalFunctions = this._mergedOptions.statisticalFunctions, this._revealView.canCopyVisualization = this._mergedOptions.menu.copy, this._revealView.canDuplicateVisualization = this._mergedOptions.menu.duplicate);
}
updateVisualization(t) {
this._revealView && this.setVisualization(this._revealView.dashboard, t);
}
async loadRVDashboard(t) {
return Ve.load(t);
}
updated(t) {
const e = t.has("dashboard") && this.dashboard !== void 0, i = t.has("visualization") && this.visualization !== void 0, r = t.has("options") && this.options !== void 0;
e ? this.updateDashboard(this.dashboard, this.visualization) : i && this.updateVisualization(this.visualization), r && this.updateOptions(this.options);
}
render() {
return Z`
<div id="rv-viewer"></div>
`;
}
};
E.styles = pt;
B([
d({ type: String })
], E.prototype, "dashboard", 2);
B([
d({ type: Object, attribute: !1 })
], E.prototype, "options", 2);
B([
d({ type: String })
], E.prototype, "visualization", 2);
E = B([
X("rv-visualization-viewer")
], E);
export {
ie as ChartType,
se as RevealSdkSettings,
T as RvDialog,
c as RvRevealView,
E as RvVisualizationViewer
};