@sassoftware/va-report-components
Version:
The SAS Visual Analytics SDK is a set of JavaScript APIs and web components that enable SAS Visual Analytics report content to be easily embedded in a third-party application or web page.
1,683 lines (1,572 loc) • 10.6 MB
JavaScript
import e, { createElement as t, Fragment as o, useState as a, useEffect as r, useMemo as s, useCallback as l, createContext as n, useContext as c, useRef as i, forwardRef as d, useSyncExternalStore as h, useReducer as p, lazy as m, memo as u, useImperativeHandle as g, Suspense as v, cloneElement as f, Children as C, isValidElement as M, useLayoutEffect as y, createRef as b, startTransition as w, PureComponent as x, Component as S } from "react";
import { createRoot as z } from "react-dom/client";
import { __extends as V, __assign as N, __awaiter as T, __generator as L, __rest as H } from "tslib";
import { BehaviorSubject as A, ReplaySubject as I, Subject as k, from as D, EMPTY as F, combineLatest as E, asyncScheduler as R, using as B, throwError as O, fromEventPattern as _, of as P, merge as j, animationFrameScheduler as U, concat as G, AsyncSubject as Z, firstValueFrom as W } from "rxjs";
import { takeUntil as K, filter as Y, take as Q, distinct as J, share as X, mergeMap as q, catchError as $, scan as ee, distinctUntilChanged as te, skip as oe, debounceTime as ae, map as re, withLatestFrom as se, tap as le, ignoreElements as ne, publish as ce, delay as ie, switchMap as de, concatMap as he, first as pe, shareReplay as me, mergeMapTo as ue, finalize as ge, startWith as ve, endWith as fe, skipWhile as Ce, last as Me, find as ye } from "rxjs/operators";
import be from "i18next";
import { useTranslation as we, initReactI18next as xe } from "react-i18next";
import Se, { createPortal as ze, flushSync as Ve } from "react-dom";
import Ne, { FreeFocusInside as Te, AutoFocusInside as Le, MoveFocusInside as He } from "react-focus-lock";
import Ae from "classnames";
import { MotionConfig as Ie, AnimatePresence as ke, motion as De, useMotionValue as Fe, useDragControls as Ee, useAnimate as Re } from "framer-motion";
import "handlebars";
import { z as Be } from "zod";
import { hsl as Oe, parseToHsl as _e, opacify as Pe, transparentize as je, rgba as Ue, toColorString as Ge, hslToColorString as Ze, grayscale as We, mix as Ke, parseToRgb as Ye, rgb as Qe, getContrast as Je, lighten as Xe, darken as qe } from "polished";
import { jsx as $e, jsxs as et } from "react/jsx-runtime";
import tt from "axios";
import { createSelector as ot, defaultMemoize as at } from "reselect";
import { b as rt, a as st, c as lt, d as nt, e as ct, f as it, g as dt, h as ht, i as pt, j as mt, k as ut, l as gt, m as vt, n as ft, o as Ct, p as Mt, q as yt, r as bt, s as wt, t as xt, u as St, v as zt, w as Vt, x as Nt, y as Tt, z as Lt, A as Ht, B as At, C as It, D as kt, E as Dt, F as Ft, G as Et, H as Rt, I as Bt, J as Ot, K as _t, L as Pt, M as jt, N as Ut, O as Gt, P as Zt, Q as Wt, R as Kt, S as Yt, T as Qt, U as Jt, V as Xt, W as qt, X as $t, Y as eo, Z as to, _ as oo, $ as ao, a0 as ro, a1 as so } from "./i18n/nova_i18n.mjs";
import { usePopper as lo } from "react-popper";
import "@popperjs/core";
import no from "memoize-one";
import co from "cldr-core/supplemental/weekData.json";
import { useCallback as io } from "use-memo-one";
import { useQuery as ho, QueryClient as po } from "@tanstack/react-query";
import mo from "react-cropper";
import { ofType as uo, createEpicMiddleware as go, combineEpics as vo } from "redux-observable";
import { combineReducers as fo, createStore as Co, applyMiddleware as Mo, bindActionCreators as yo } from "redux";
import { composeWithDevTools as bo } from "@redux-devtools/extension";
import { connect as wo, shallowEqual as xo } from "react-redux";
let So;
let zo = new Map;
function Vo() {
return So;
}
async function No(e) {
const t = await (e?.importType === "mobile" ? import("./chunk2.mjs").then((e => ({
type: "mobile",
...e
}))) : import("./chunk7.mjs").then((e => ({
type: "dynamic",
...e
}))));
if (e?.initialize) {
await (e?.initialize(t));
}
So = t;
if (zo) {
for (const e of zo.values()) {
e();
}
}
zo = undefined;
}
function To(e, t) {
zo?.set(e, t);
}
function Lo(e) {
zo?.delete(e);
}
let Ho = 0;
function Ao() {
return `vaReportComponentContainer${Ho++}`;
}
class Io extends HTMLElement {
constructor(...e) {
super(...e);
this._validationTimerId = 0;
this._root = void 0;
this._needsUnmount = false;
this._connected = false;
this._render = () => {
if (this._needsUnmount) {
this._root?.unmount();
this._root = undefined;
this._needsUnmount = false;
}
if (this._connected && !this._root) {
this._root = z(this);
}
const e = this._getRenderer();
if (!e) {
if (this._root) {
this._root.render(t(o));
}
return;
}
const a = this._root && this.getRenderProps();
clearTimeout(this._validationTimerId);
this._validationTimerId = 0;
if (a) {
this._root.render(t(e, a));
} else if (this._root) {
this._root.render(t(o));
}
};
}
_getConnected() {
return this._connected;
}
_invalidateProps() {
if (this._getConnected()) {
this._queueRender();
}
}
_queueRender() {
if (this._validationTimerId === 0) {
this._validationTimerId = window.setTimeout((() => {
this._validationTimerId = 0;
this._render();
}), 0);
}
}
connectedCallback() {
this._connected = true;
this._queueRender();
}
disconnectedCallback() {
this._connected = false;
this._needsUnmount = true;
this._queueRender();
}
attributeChangedCallback(e, t, o) {
this._invalidateProps();
}
static get observedAttributes() {
return [];
}
}
function ko(e) {
if (!e) {
return;
}
switch (e.toLowerCase()) {
case "guest":
return "guest";
case "credentials":
return "credentials";
}
}
class Do extends Io {
constructor(...e) {
super(...e);
this._elementKey = Ao();
this._stateRetained = false;
this._initialized = false;
this._menuItemProvider = void 0;
this._contextKey = void 0;
this._refHandle = void 0;
this._isHandleValid = false;
this._handle = void 0;
this._handlePromise = void 0;
this._handlePromiseCallbacks = void 0;
this._setRef = e => {
this._handle = e;
if (e) {
this._acceptHandlePromise();
}
};
}
_acceptHandlePromise() {
this._isHandleValid = true;
if (this._handle) {
this._handlePromiseCallbacks?.accept(this._handle);
this._handlePromiseCallbacks = undefined;
} else {
console.warn("_acceptHandlePromise called when no report handle was available");
}
}
_invalidateHandleRequests(e) {
this._isHandleValid = false;
this._handlePromiseCallbacks?.reject(e);
this._handlePromiseCallbacks = undefined;
this._handlePromise = undefined;
}
getReportHandle() {
if (!this._handlePromise) {
this._handlePromise = this._handle && this._isHandleValid ? Promise.resolve(this._handle) : new Promise(((e, t) => {
this._handlePromiseCallbacks = {
accept: e,
reject: t
};
}));
}
return this._handlePromise;
}
_getContextKey(e) {
return "url" in e ? `${e.url}:${e.reportUri}:${this._elementKey}` : `${e.packageUri}:${this._elementKey}`;
}
_invalidateProps() {
let e = undefined;
const t = this.getRenderProps();
if (t) {
e = this._getContextKey(t);
}
if (this._contextKey !== e) {
this._refHandle = undefined;
this._invalidateHandleRequests("An element attribute was changed and the handle request has been cancelled");
}
this._contextKey = e;
super._invalidateProps();
}
static get observedAttributes() {
return [ ...super.observedAttributes, "url", "reporturi", "authenticationtype", "packageuri", "popoverrootid", "restrictviewportgestures" ];
}
attributeChangedCallback(e, t, o) {
super.attributeChangedCallback(e, t, o);
if (e === "authenticationType" && this.hasAttribute("authenticationType") && !ko(o)) {
console.warn(`Invalid AuthenticationType: ${o}`);
}
}
connectedCallback() {
To(this, (() => {
if (this._initialized) {
return;
}
this._initialized = true;
this._initializeWithImports();
}));
super.connectedCallback();
}
disconnectedCallback() {
if (!this.preserveStateOnUnmount) {
this._invalidateHandleRequests("The element was removed from the DOM and the handle request has been cancelled");
}
if (this._stateRetained) {
Lo(this);
}
super.disconnectedCallback();
}
_initializeWithImports() {
super._invalidateProps();
const e = this._stateRetained;
this._stateRetained = false;
this.preserveStateOnUnmount = e;
}
get preserveStateOnUnmount() {
return this._stateRetained;
}
set preserveStateOnUnmount(e) {
if (this._stateRetained === !!e) {
return;
}
if (!this._stateRetained && !this._getConnected()) {
Lo(this);
}
const {extendStoreLifetime: t, releaseStoreLifetime: o} = this._getDynamicImports() ?? {};
this._stateRetained = !!e;
if (this._stateRetained) {
t?.(this._elementKey);
} else {
o?.(this._elementKey);
if (!this._getConnected()) {
this._invalidateHandleRequests("preserveStateOnUnmount was set to false while the element was removed from the DOM");
}
}
}
_getDynamicImports() {
const e = Vo();
if (e?.type === "dynamic") {
return e;
}
return;
}
getCommonProps() {
if (!this._refHandle) {
this._refHandle = e => this._setRef(e);
}
const e = {
elementKey: this._elementKey,
ref: this._refHandle,
menuItemProvider: this._menuItemProvider,
popoverRootId: this.popoverRootId ?? undefined,
restrictViewportGestures: this.restrictViewportGestures
};
if (this.reportUri && this.url) {
return {
...e,
authenticationType: this.authenticationType,
reportUri: this.reportUri,
url: this.url
};
} else if (this.packageUri) {
return {
...e,
packageUri: this.packageUri
};
}
return null;
}
get url() {
return this.getAttribute("url");
}
set url(e) {
if (e && typeof e === "string") {
this.setAttribute("url", e);
} else {
this.removeAttribute("url");
}
}
get packageUri() {
return this.getAttribute("packageUri");
}
set packageUri(e) {
if (e && typeof e === "string") {
this.setAttribute("packageUri", e);
} else {
this.removeAttribute("packageUri");
}
}
get reportUri() {
return this.getAttribute("reportUri");
}
set reportUri(e) {
if (e && typeof e === "string") {
this.setAttribute("reportUri", e);
} else {
this.removeAttribute("reportUri");
}
}
get authenticationType() {
return ko(this.getAttribute("authenticationType")) || "credentials";
}
set authenticationType(e) {
if (e) {
if (typeof e !== "string" || !ko(e)) {
console.warn(`Invalid AuthenticationType: ${e}`);
this.removeAttribute("authenticationType");
} else {
this.setAttribute("authenticationType", e.toLowerCase());
}
} else {
this.removeAttribute("authenticationType");
}
}
get popoverRootId() {
return this.getAttribute("popoverRootId");
}
set popoverRootId(e) {
if (e && typeof e === "string") {
this.setAttribute("popoverRootId", e);
} else {
this.removeAttribute("popoverRootId");
}
}
get restrictViewportGestures() {
const e = this.getAttribute("restrictViewportGestures");
if (!e) {
return undefined;
}
const t = e.toLowerCase();
if (t === "true") {
return true;
} else if (t === "false") {
return false;
}
return undefined;
}
set restrictViewportGestures(e) {
if (typeof e === "boolean") {
this.setAttribute("restrictViewportGestures", e.toString());
return;
} else if (!e) {
this.removeAttribute("restrictViewportGestures");
} else {
console.warn(`Invalid value for restrictViewportGestures: ${e}`);
this.removeAttribute("restrictViewportGestures");
}
}
_resetElementKey() {
this._invalidateProps();
const e = this._elementKey;
this._elementKey = Ao();
if (this._stateRetained) {
const t = this._getDynamicImports();
t?.extendStoreLifetime?.(this._elementKey);
setTimeout((() => t?.releaseStoreLifetime?.(e)), 0);
}
}
set menuItemProvider(e) {
e = e ?? undefined;
if (e === this._menuItemProvider) {
return;
}
this._invalidateProps();
this._menuItemProvider = e;
}
get menuItemProvider() {
return this._menuItemProvider;
}
}
function Fo(e) {
if (e && typeof e === "string") {
const t = e.toLocaleLowerCase();
return [ "true", "false", "auto" ].indexOf(t) > -1;
}
return true;
}
class Eo extends Do {
constructor(...e) {
super(...e);
this._graphCSS = void 0;
this._themeOverrides = null;
this._unprocessedOverrides = void 0;
}
_getRenderer() {
return Vo()?.SASReport;
}
static get observedAttributes() {
return [ ...super.observedAttributes, "hidenavigation" ];
}
attributeChangedCallback(e, t, o) {
super.attributeChangedCallback(e, t, o);
if (e === "hideNavigation" && this.hasAttribute("hideNavigation") && !Fo(o)) {
console.warn(`Invalid value for hideNavigation: ${o}`);
}
}
_initializeWithImports() {
super._initializeWithImports();
if (this._unprocessedOverrides) {
this.unsafe_setCustomReportTheme(this._unprocessedOverrides);
this._unprocessedOverrides = undefined;
}
}
getRenderProps() {
const e = this.getCommonProps();
return e && {
...e,
hideNavigation: this.hideNavigation,
themeOverrides: this._themeOverrides || undefined,
graphCSS: this._graphCSS
};
}
get hideNavigation() {
if (!this.hasAttribute("hideNavigation")) return "auto";
const e = this.getAttribute("hideNavigation");
if (typeof e === "string") {
switch (e.toLocaleLowerCase()) {
case "true":
case "":
return true;
case "false":
return false;
case "auto":
default:
return "auto";
}
}
return true;
}
set hideNavigation(e) {
if (typeof e === "string") {
if (!Fo(e)) {
console.warn(`Invalid value for hideNavigation: ${e}`);
this.removeAttribute("hideNavigation");
} else {
this.setAttribute("hideNavigation", e);
}
} else if (typeof e === "boolean") {
this.setAttribute("hideNavigation", e.toString());
return;
} else if (!e) {
this.removeAttribute("hideNavigation");
} else {
console.warn(`Invalid value for hideNavigation: ${e}`);
this.removeAttribute("hideNavigation");
}
}
unsafe_setCustomReportTheme(e) {
const t = Vo();
if (!t) {
this._unprocessedOverrides = e;
return;
}
if (t.type === "mobile") {
console.error("customReportThemes not supported in this render mode.");
return;
}
let o;
if (typeof e === "object" && e !== null) {
const a = e;
const r = {
baseThemeId: "light",
styleData: {}
};
if (typeof a.baseThemeId === "string") {
r.baseThemeId = a.baseThemeId;
} else {
console.error("Objects passed to unsafe_setCustomReportTheme must have a string for the baseThemeId property");
}
if (typeof a.styleData === "object" && a.styleData !== null) {
r.styleData = a.styleData;
} else {
console.error("Objects passed to unsafe_setCustomReportTheme must have an object for the styleData property");
}
o = t.convertThemeServiceResponseToThemeParameterOverrides(r);
} else if (e === null || e === undefined) {
o = null;
} else {
o = null;
console.error("Invalid value passed to unsafe_setCustomReportTheme: " + e);
}
if (this._themeOverrides === o) {
return;
}
this._themeOverrides = o;
this._invalidateProps();
}
unsafe_setGraphCSS(e) {
let t;
if (typeof e === "string") {
t = e;
} else if (e === null || e === undefined) {
t = undefined;
} else {
t = undefined;
console.error("Invalid value passed to unsafe_setGraphCSS: " + e);
}
if (this._graphCSS === t) {
return;
}
this._graphCSS = t;
this._resetElementKey();
this._invalidateProps();
}
}
function Ro(e) {
if (e && typeof e === "string") {
const t = e.toLocaleLowerCase();
return [ "true", "false" ].indexOf(t) > -1;
}
return true;
}
class Bo extends Do {
constructor(...e) {
super(...e);
this._objectHandlePromise = void 0;
this._rejectObjectHandleCallback = void 0;
}
_getRenderer() {
return Vo()?.SASReportObject;
}
static get observedAttributes() {
return [ ...super.observedAttributes, "objectname", "reportcontextkey", "hideloadimage" ];
}
_getContextKey(e) {
return "url" in e ? `${e.url}:${e.reportUri}:${e.reportContextKey}:${e.objectName}` : `${e.packageUri}:${e.reportContextKey}:${e.objectName}`;
}
getRenderProps() {
const e = this.getCommonProps();
if (e && this.objectName) {
return {
...e,
objectName: this.objectName,
reportContextKey: this.reportContextKey,
hideLoadImage: this.hideLoadImage
};
} else {
return null;
}
}
get objectName() {
return this.getAttribute("objectName");
}
set objectName(e) {
if (e && typeof e === "string") {
this.setAttribute("objectName", e);
} else {
this.removeAttribute("objectName");
}
}
get reportContextKey() {
return this.getAttribute("reportContextKey") || undefined;
}
set reportContextKey(e) {
if (e && typeof e === "string") {
this.setAttribute("reportContextKey", e);
} else {
this.removeAttribute("reportContextKey");
}
}
get hideLoadImage() {
if (!this.hasAttribute("hideLoadImage")) return false;
const e = this.getAttribute("hideLoadImage");
if (typeof e === "string") {
switch (e.toLocaleLowerCase()) {
case "true":
case "":
return true;
case "false":
return false;
default:
return false;
}
}
return true;
}
set hideLoadImage(e) {
if (typeof e === "string") {
if (!Ro(e)) {
console.warn(`Invalid value for hideLoadImage: ${e}`);
this.removeAttribute("hideLoadImage");
} else {
this.setAttribute("hideLoadImage", e);
}
} else if (typeof e === "boolean") {
this.setAttribute("hideLoadImage", e.toString());
return;
} else if (!e) {
this.removeAttribute("hideLoadImage");
} else {
console.warn(`Invalid value for hideLoadImage: ${e}`);
this.removeAttribute("hideLoadImage");
}
}
_invalidateHandleRequests(e) {
super._invalidateHandleRequests(e);
this._rejectObjectHandleCallback?.(e);
this._rejectObjectHandleCallback = undefined;
this._objectHandlePromise = undefined;
}
getObjectHandle() {
const e = this.objectName;
if (!e) {
return Promise.reject("Cannot get an ObjectHandle before setting objectName");
}
if (!this._objectHandlePromise) {
this._objectHandlePromise = Promise.race([ this.getReportHandle().then((t => t.getObjectHandle(e))), new Promise(((e, t) => {
this._rejectObjectHandleCallback = t;
})) ]);
}
return this._objectHandlePromise;
}
}
class Oo extends Do {
_getRenderer() {
return Vo()?.SASReportPage;
}
static get observedAttributes() {
return [ ...super.observedAttributes, "pagename", "pageindex", "reportcontextkey" ];
}
_getContextKey(e) {
if (!e.reportContextKey) {
return super._getContextKey(e);
}
return "url" in e ? `${e.url}:${e.reportUri}:${e.reportContextKey}` : `${e.packageUri}:${e.reportContextKey}`;
}
getRenderProps() {
const e = this.getCommonProps();
if (!e) {
return null;
}
const t = this.pageIndex;
if (this.pageName) {
return {
...e,
pageName: this.pageName,
reportContextKey: this.reportContextKey
};
} else if (t !== null) {
return {
...e,
pageIndex: t,
reportContextKey: this.reportContextKey
};
}
return null;
}
get pageName() {
return this.getAttribute("pageName");
}
set pageName(e) {
if (e && typeof e === "string") {
this.setAttribute("pageName", e);
} else {
this.removeAttribute("pageName");
}
}
get pageIndex() {
const e = this.getAttribute("pageIndex");
return _o(e);
}
set pageIndex(e) {
const t = _o(e);
if (t !== null) {
this.setAttribute("pageIndex", t.toString());
} else {
this.removeAttribute("pageIndex");
}
}
get reportContextKey() {
return this.getAttribute("reportContextKey") || undefined;
}
set reportContextKey(e) {
if (e && typeof e === "string") {
this.setAttribute("reportContextKey", e);
} else {
this.removeAttribute("reportContextKey");
}
}
}
function _o(e) {
if (typeof e === "string" && /^\d+$/.test(e)) {
return Number(e);
} else if (typeof e === "number" && e >= 0 && Number.isSafeInteger(e)) {
return Math.abs(e);
} else {
return null;
}
}
function Po(e) {
No(e);
if (!customElements.get("sas-report")) {
customElements.define("sas-report", Eo);
}
if (!customElements.get("sas-report-object")) {
customElements.define("sas-report-object", Bo);
}
if (!customElements.get("sas-report-page")) {
customElements.define("sas-report-page", Oo);
}
}
function jo(e, t, o, a) {
if (!o) return;
Object.defineProperty(e, t, {
enumerable: o.enumerable,
configurable: o.configurable,
writable: o.writable,
value: o.initializer ? o.initializer.call(a) : void 0
});
}
function Uo(e, t, o, a, r) {
var s = {};
Object.keys(a).forEach((function(e) {
s[e] = a[e];
}));
s.enumerable = !!s.enumerable;
s.configurable = !!s.configurable;
if ("value" in s || s.initializer) {
s.writable = true;
}
s = o.slice().reverse().reduce((function(o, a) {
return a(e, t, o) || o;
}), s);
if (r && s.initializer !== void 0) {
s.value = s.initializer ? s.initializer.call(r) : void 0;
s.initializer = undefined;
}
if (s.initializer === void 0) {
Object.defineProperty(e, t, s);
s = null;
}
return s;
}
var Go = globalThis;
Go.sas = Go.sas || {};
sas.ltjs = sas.ltjs || {};
sas.ltjslib = sas.ltjslib || {};
sas.ltjslib.ltjs = sas.ltjslib.ltjs || {};
var Zo = sas.ltjs;
var Wo = sas.ltjslib.ltjs;
var Ko = /sas\/ltjs\/([^\/]+).*\/([^\/]+)/;
function Yo(e) {
var t = e.match(Ko);
if (t && t.length === 3) {
var o = t[1];
var a = t[2];
return "".concat(o, "::").concat(a);
}
throw new Error("Unexpected LTJS module path structure: ".concat(e));
}
var Qo = function() {
function e() {
this._typeMap = new Map;
this._moduleMap = new Map;
}
e.prototype.initFromModuleTypeMap = function(e) {
var t = e.length;
for (var o = 0; o < t; o++) {
var a = e[o];
if (a) {
var r = a[0], s = a[1];
var l = Yo(r);
this._typeMap.set(o, {
typeId: o,
moduleName: l,
modulePath: r,
parentTypeId: s
});
}
}
};
e.prototype.getTypeEntry = function(e) {
return this._typeMap.get(e);
};
e.prototype.addClassToModuleMap = function(e, t) {
this._moduleMap.set(e, t);
};
e.prototype.getModuleByName = function(e) {
return this._moduleMap.get(e);
};
return e;
}();
var Jo = [ 1, 2, 4, 8, 16, 32, 64, 128 ];
function Xo(e) {
if (e) {
for (var t = 0, o = e.length; t < o; t++) {
e[t] = e[t] >>> 0;
}
}
return e;
}
function qo(e) {
if (e) {
for (var t = 0, o = e.length; t < o; t++) {
e[t] = !!e[t];
}
}
return e;
}
var $o = function() {
function e(e) {
var t = this;
this.wasmCrashed = false;
this.abortCallbacks = [];
this._module = e;
this.runtime.onAborts.push(this.onAbort.bind(this));
if (!this._module.onAbort) {
this._module.onAbort = function() {
for (var e = 0, o = t.runtime.onAborts; e < o.length; e++) {
var a = o[e];
a();
}
};
}
}
Object.defineProperty(e.prototype, "runtime", {
get: function() {
if (!this.module._ltjsRuntime) {
var e = {
ltjsInitialized: false,
wrappersInitialized: false,
wrapperInitFunctions: [],
platformInitialized: false,
onPlatformInitialized: [],
onReadyFunctions: [],
initializeWrappers: function() {
e.wrappersInitialized = true;
for (var t = 0, o = e.wrapperInitFunctions; t < o.length; t++) {
var a = o[t];
a();
}
e.wrapperInitFunctions.length = 0;
},
executeRunWhenInitializedCallbacks: function() {
e.ltjsInitialized = true;
for (var t = 0, o = e.onReadyFunctions; t < o.length; t++) {
var a = o[t];
a();
}
e.onReadyFunctions.length = 0;
},
onAborts: [],
typeMapAvailable: false,
typeMapInitializers: [],
initializedTypemap: function() {
e.typeMapAvailable = true;
for (var t = 0, o = e.typeMapInitializers; t < o.length; t++) {
var a = o[t];
a();
}
e.typeMapInitializers = [];
},
activeVisualizationManagers: new Set,
themeOverrideCallbacks: new Set,
dispatchBridgeMap: new Map
};
this.module._ltjsRuntime = e;
}
return this.module._ltjsRuntime;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "module", {
get: function() {
return this._module;
},
enumerable: false,
configurable: true
});
e.prototype.onAbort = function() {
this.wasmCrashed = true;
for (var e = 0, t = this.abortCallbacks; e < t.length; e++) {
var o = t[e];
o();
}
this.abortCallbacks = [];
};
e.prototype.addAbortCallback = function(e) {
if (this.wasmCrashed) {
e();
} else {
this.abortCallbacks.push(e);
}
};
e.prototype.removeAbortCallback = function(e) {
this.abortCallbacks = this.abortCallbacks.filter((function(t) {
return t !== e;
}));
};
Object.defineProperty(e.prototype, "exports", {
get: function() {
return this._module.exports;
},
enumerable: false,
configurable: true
});
e.prototype.getStringContentsOfFile = function(e) {
return this._module.getStringContentsOfFile(e);
};
e.prototype.writeNLSBundleToFS = function(e, t) {
return this._module.writeNLSBundleToFS(e, t);
};
e.prototype.setInstantiateWasmCallback = function(e) {
this._module.instantiateWasm = e;
};
e.prototype.setMemoryInitializerRequest = function(e) {
this._module.memoryInitializerRequest = e;
};
e.prototype.setUseAsm = function() {
this._module.wasmJSMethod = "asmjs";
};
e.prototype.removeBlockingDependency = function(e) {
if (this._module.removeBlockingDependency) {
this._module.removeBlockingDependency(e);
}
};
Object.defineProperty(e.prototype, "deps", {
set: function(e) {
this._module.deps = e;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "libraryLoadingCompleted", {
set: function(e) {
this._module.libraryLoadingCompleted = e;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "onRuntimeInitialized", {
set: function(e) {
this._module.onRuntimeInitialized = e;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "ltjsRuntimeInitialized", {
set: function(e) {
this._module.ltjsRuntimeInitialized = e;
},
enumerable: false,
configurable: true
});
e.prototype.setIsShuttingDown = function(e) {
if (this._module.setIsShuttingDown) {
this._module.setIsShuttingDown(e);
}
};
e.prototype.getTypeId = function(e) {
return this._module._ltjs_commons_Closet_getTypeID(e);
};
e.prototype.commitStagedObject = function(e) {
return this._module._ltjs_commons_Closet_commitStagedObject(e);
};
e.prototype.discardStagedObject = function(e) {
this._module._ltjs_commons_Closet_discardStagedObject(e);
};
e.prototype.getStagedVectorSize = function(e) {
return this._module._ltjs_commons_Closet_getStagedVectorSize(e);
};
e.prototype.stageObjectAt = function(e) {
return this._module._ltjs_commons_Closet_stageObjectAt(e);
};
e.prototype.discardStagedVector = function(e) {
this._module._ltjs_commons_Closet_discardStagedVector(e);
};
e.prototype._copyValuesIntoCloset = function(e, t, o, a, r) {
if (r === void 0) {
r = false;
}
if (!e || !o || !a) {
return 0;
}
var s = e.length;
var l = this._module._malloc(s * t);
if (r) {
for (var n = 0; n < s; ++n) {
var c = NaN;
var i = e[n];
if (typeof i === "number") {
c = i;
} else if (!isNaN(i)) {
var d = parseFloat(i);
if (!isNaN(d)) {
c = d;
}
}
this._module.setValue(l + n * t, c, o);
}
} else {
for (var n = 0; n < s; ++n) {
this._module.setValue(l + n * t, e[n], o);
}
}
var h = a(s, l);
this._module._free(l);
return h;
};
e.prototype._copyValuesFromCloset = function(e, t, o, a) {
if (a === 0) {
return [];
}
if (!t || e <= 0 || o === 0 || a < 0) {
return null;
}
var r = [];
for (var s = 0; s < a; ++s) {
r[s] = this._module.getValue(o + s * e, t);
}
return r;
};
e.prototype.convertStringToC = function(e) {
if (typeof e !== "string") {
return 0;
}
var t = this._module.stringToNewUTF8(e);
var o = this._module._ltjs_commons_Closet_createString(t);
this._module._free(t);
return o;
};
e.prototype.convertStringFromC = function(e) {
if (!e) {
return null;
}
var t = this._module._ltjs_commons_Closet_getCString(e);
return this._module.UTF8ToString(t);
};
e.prototype.convertStringArrayToC = function(e) {
if (!e) {
return 0;
}
var t = [];
for (var o = 0, a = e.length; o < a; ++o) {
var r = this.convertStringToC(e[o]);
if (r < 0) {
console.error("Conversion error for: " + e[o]);
}
t[o] = r;
}
return this.convertIntArrayToC(t);
};
e.prototype.convertStringArrayFromC = function(e) {
var t = this.convertIntArrayFromC(e);
if (!t) {
return null;
}
var o = [];
var a = t ? t.length : 0;
for (var r = 0; r < a; ++r) {
o[r] = this.convertStringFromC(t[r]);
}
this._module._ltjs_commons_Closet_releaseAllPrimitives(e);
return o;
};
e.prototype.convertIntArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 4, "i32", this._module._ltjs_commons_Closet_createIntVector, true);
};
e.prototype.convertIntArrayFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfIntVector(e), this._module._ltjs_commons_Closet_getSizeOfIntVector(e));
};
e.prototype.convertIntMVectorFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfIntMVector(e), this._module._ltjs_commons_Closet_getSizeOfIntMVector(e));
};
e.prototype.convertUnsignedArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 4, "i32", this._module._ltjs_commons_Closet_createUnsignedVector, true);
};
e.prototype.convertUnsignedArrayFromC = function(e) {
if (!e) {
return null;
}
return Xo(this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfUnsignedVector(e), this._module._ltjs_commons_Closet_getSizeOfUnsignedVector(e)));
};
e.prototype.convertUnsignedMVectorFromC = function(e) {
if (!e) {
return null;
}
return Xo(this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfUnsignedMVector(e), this._module._ltjs_commons_Closet_getSizeOfUnsignedMVector(e)));
};
e.prototype.convertDoubleArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 8, "double", this._module._ltjs_commons_Closet_createDoubleVector, true);
};
e.prototype.convertDoubleArrayFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(8, "double", this._module._ltjs_commons_Closet_getAddressOfDoubleVector(e), this._module._ltjs_commons_Closet_getSizeOfDoubleVector(e));
};
e.prototype.convertDoubleMVectorFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(8, "double", this._module._ltjs_commons_Closet_getAddressOfDoubleMVector(e), this._module._ltjs_commons_Closet_getSizeOfDoubleMVector(e));
};
e.prototype.convertFloatArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 4, "float", this._module._ltjs_commons_Closet_createFloatVector, true);
};
e.prototype.convertFloatArrayFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "float", this._module._ltjs_commons_Closet_getAddressOfFloatVector(e), this._module._ltjs_commons_Closet_getSizeOfFloatVector(e));
};
e.prototype.convertFloatMVectorFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "float", this._module._ltjs_commons_Closet_getAddressOfFloatMVector(e), this._module._ltjs_commons_Closet_getSizeOfFloatMVector(e));
};
e.prototype.convertBoolArrayToC = function(e) {
e = qo(e);
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 1, "i8", this._module._ltjs_commons_Closet_createBoolVector);
};
e.prototype.convertBoolArrayFromC = function(e) {
if (!e) {
return null;
}
var t = this._module._ltjs_commons_Closet_getBoolVectorAsBitset(e);
var o = this._module._ltjs_commons_Closet_getAddressOfBitset(t);
var a = this._module._ltjs_commons_PrimitiveCloset_getSizeOfBoolVector(e);
var r = this.convertBitsetToBoolArray(o, a);
this._module._ltjs_commons_Closet_releasePrimitive(t);
return r;
};
e.prototype.convertBoolMVectorFromC = function(e) {
if (!e) {
return null;
}
var t = this._module._ltjs_commons_Closet_getBoolMVectorAsBitset(e);
var o = this._module._ltjs_commons_Closet_getAddressOfBitset(t);
var a = this._module._ltjs_commons_PrimitiveCloset_getSizeOfBoolMVector(e);
var r = this.convertBitsetToBoolArray(o, a);
this._module._ltjs_commons_Closet_releasePrimitive(t);
return r;
};
e.prototype.convertBitsetToBoolArray = function(e, t) {
if (t === 0) {
return [];
}
var o = this._module.HEAP8;
if (!o || e === 0 || t < 0) {
return null;
}
var a = [];
for (var r = 0; r < t; ++r) {
var s = o[e + Math.floor(r / 8)];
a[r] = !!(s & Jo[r % 8]);
}
return a;
};
e.prototype.convertObjectToC = function(e) {
return e ? e.getClosetAddress() : 0;
};
e.prototype.convertObjectArrayToC = function(e) {
if (!e) {
return 0;
}
var t = [];
for (var o = 0, a = e.length; o < a; ++o) {
t[o] = this.convertObjectToC(e[o]);
}
return this.convertIntArrayToC(t);
};
e.prototype.convertGeometryArrayFromC = function(e) {
var t = this.convertIntArrayFromC(e);
if (!t) {
return null;
}
var o = [];
for (var a = 0, r = t.length; a < r; ++a) {
o[a] = this.convertFloatArrayFromC(t[a]);
}
this.releaseAllPrimitives(e);
return o;
};
e.prototype.convertGeometryArrayToC = function(e) {
if (!e) {
return 0;
}
var t = [];
for (var o = 0, a = e.length; o < a; ++o) {
t[o] = this.convertFloatArrayToC(e[o]);
}
return this.convertIntArrayToC(t);
};
e.prototype.getWrappableClosetSize = function() {
return this._module._ltjs_commons_Closet_getWrappableClosetSize();
};
e.prototype.getPrimitiveClosetSize = function() {
return this._module._ltjs_commons_Closet_getPrimitiveClosetSize();
};
e.prototype.releaseWrappable = function(e) {
this._module._ltjs_commons_Closet_releaseWrappable(e);
};
e.prototype.releasePrimitive = function(e) {
this._module._ltjs_commons_Closet_releasePrimitive(e);
};
e.prototype.releaseAllPrimitives = function(e) {
this._module._ltjs_commons_Closet_releaseAllPrimitives(e);
};
e.prototype.releaseAllWrappables = function(e) {
var t = this.convertIntArrayToC(e);
this._module._ltjs_commons_Closet_releaseAllWrappables(t);
};
e.prototype.getClosetKey = function(e) {
return this._module._ltjs_commons_Closet_getAddress(e);
};
e.prototype.closetObjectsEqual = function(e, t) {
return this._module._ltjs_commons_Closet_equals(e, t);
};
return e;
}();
var ea = new $o(Wo);
var ta = ea;
var oa = [];
var aa;
var ra = 0;
var sa = [];
var la = new Map;
var na = new Qo;
if (ta.runtime.typeMapAvailable) {
na.initFromModuleTypeMap(Wo.typeMap);
} else {
ta.runtime.typeMapInitializers.push((function() {
na.initFromModuleTypeMap(Wo.typeMap);
}));
}
function ca() {
ra--;
if (ra <= 0) {
ea.runtime.executeRunWhenInitializedCallbacks();
}
}
function ia() {
ea.runtime.initializeWrappers();
var e = sa.concat(ea.runtime.onPlatformInitialized);
ea.runtime.platformInitialized = true;
ea.runtime.onPlatformInitialized = [];
sa.length = 0;
ra = e.length;
for (var t = 0, o = e; t < o.length; t++) {
var a = o[t];
a(ca);
}
if (ra <= 0) {
ea.runtime.executeRunWhenInitializedCallbacks();
}
}
function da() {
if (!ha()) {
return;
}
if (ea.removeBlockingDependency) {
ea.removeBlockingDependency("librariesLoaded");
}
ea.libraryLoadingCompleted = true;
}
function ha() {
var e = sas.ltjs.loaderRuntime;
var t = sas.ltjs.runtime;
return !e || t === e;
}
function pa(e, t) {
if (e && oa.indexOf(e) < 0) {
oa.push(e);
}
if (sas.ltjs.registerDependency) {
sas.ltjs.registerDependency(e);
}
la.set(e, t);
}
function ma() {
return oa;
}
function ua() {
var e = [];
for (var t = 0, o = oa; t < o.length; t++) {
var a = o[t];
var r = la.get(a);
if (r) {
e = e.concat(r);
}
}
return e;
}
function ga(e) {
if (fa()) {
e();
} else {
ea.runtime.onReadyFunctions.push(e);
}
}
function va() {
if (fa()) {
return Promise.resolve();
} else {
if (!aa) {
aa = new Promise((function(e) {
ea.runtime.onReadyFunctions.push(e);
}));
}
return aa;
}
}
function fa() {
return ea.runtime.ltjsInitialized || Ca();
}
function Ca() {
return !!sas.ltjs.jest && sas.ltjs.jest.isInitialized;
}
function Ma(e, t) {
if (t === void 0) {
t = false;
}
if (ea.runtime.platformInitialized || Ca()) {
e();
} else if (t) {
sa.push(e);
} else {
ea.runtime.onPlatformInitialized.push(e);
}
}
function ya(e) {
if (ea.runtime.wrappersInitialized || Ca()) {
e();
} else {
ea.runtime.wrapperInitFunctions.push(e);
}
}
function ba(e) {
var t = na.getModuleByName(e);
if (t === undefined) {
throw new Error("Module is not defined for name: ".concat(e));
}
return t;
}
function wa(e, t) {
if (t && t.default) {
return t.default;
}
return ba(e);
}
function xa(e) {
return function(e) {
V(t, e);
function t() {
return e !== null && e.apply(this, arguments) || this;
}
return t;
}(e);
}
function Sa(e, t) {
var o = na.getModuleByName(e);
if (!o) {
o = xa(t);
na.addClassToModuleMap(e, o);
}
return o;
}
function za(e, t, o) {
var a = o;
for (var r = 0, s = t; r < s.length; r++) {
var l = s[r];
a = Sa(l, a);
}
return Sa(e, a);
}
function Va() {
na.initFromModuleTypeMap(Wo.typeMap);
}
var Na = Object.freeze({
__proto__: null,
_ltjsModule: ta,
createModule: za,
currentRuntimeIsLoaderRuntime: ha,
getRegisteredModules: ma,
getRegisteredPortablePackages: ua,
initialize: ia,
initializeWrapper: ya,
isInitialized: fa,
ltjsModule: ea,
moduleLookup: ba,
moduleLookupAsDefault: wa,
registerModule: pa,
reinitializeTypemap: Va,
runWhenInitialized: ga,
runWhenPlatformInitialized: Ma,
setupLtjsEnvironment: da,
typeMap: na,
whenInitialized: va
});
function Ta(e) {
if (!e) {
return 0;
}
if (!Array.isArray(e)) {
return e.getClosetAddress();
}
return e.map(Ta);
}
function La(e) {
if (!e) {
return 0;
}
if (!Array.isArray(e)) {
return ea.getClosetKey(e.getClosetAddress());
}
return e.map(La);
}
var Ha;
(function(e) {
e[e["IE"] = 1] = "IE";
e[e["EDGE"] = 2] = "EDGE";
e[e["FIREFOX"] = 3] = "FIREFOX";
e[e["CHROME"] = 4] = "CHROME";
e[e["SAFARI"] = 5] = "SAFARI";
e[e["UNKNOWN"] = 6] = "UNKNOWN";
})(Ha || (Ha = {}));
function Aa(e) {
if (/Edge\/[\w\.]*/.test(e)) {
return Ha.EDGE;
} else if (/Chrome\/[\w\.]*/.test(e)) {
return Ha.CHROME;
} else if (/Firefox\/[\w\.]*/.test(e)) {
return Ha.FIREFOX;
} else if (/Safari\/[\w\.]*/.test(e)) {
return Ha.SAFARI;
} else if (/MSIE /.test(e) || /Trident\//.test(e)) {
return Ha.IE;
}
return Ha.UNKNOWN;
}
var Ia = null;
function ka() {
if (Ia === null) {
Ia = Aa(window.navigator.userAgent);
}
return Ia;
}
var Da = sas.ltjs.isOpenUI;
var Fa;
var Ea;
function Ra(e) {
if (Ba(e)) {
if (Da) {
return sas.hc.ui.core.util.getProxyUrl(e, false);
}
if (Oa(e)) {
return e;
}
}
if (e.startsWith("http://") || e.startsWith("https://")) {
return e;
}
if (e.startsWith("./resources/")) {
e = e.substring(12);
} else if (e.startsWith("/resources/")) {
e = e.substring(11);
}
if (e.startsWith("/")) {
e = e.substring(1);
}
if (sas.ltjs.getResourceUrl) {
var t = sas.ltjs.getResourceUrl(e);
if (t) {
return t;
}
}
var o;
if (Da) {
o = jQuery.sap.getResourcePath(e, "");
if (e.endsWith("/") && !o.endsWith("/")) {
o += "/";
}
return o;
}
if (!sas.ltjs.resourceUrl) {
console.warn('sas.ltjs.resourceUrl not configured, defaulting to "/"');
sas.ltjs.resourceUrl = "/";
}
return "".concat(sas.ltjs.resourceUrl).concat(sas.ltjs.resourceUrl.endsWith("/") ? "" : "/").concat(e);
}
function Ba(e) {
if (sas.ltjs.node) {
return false;
}
if (Da) {
return sas.hc.ui.core.util.isUrlCrossDomain(e);
}
if (!Fa) {
Fa = document.createElement("a");
}
try {
Fa.href = e;
} catch (t) {
console.warn("Failed to parse url: ", e);
return true;
}
if (!Fa.protocol) {
return false;
}
if (Fa.protocol !== location.protocol || Fa.hostname !== location.hostname) {
return true;
}
var t = Fa.port === "80" || Fa.port === "443" ? "" : Fa.port;
if (t !== null && t !== location.port || t === null && location.port !== "") {
return true;
}
return false;
}
function Oa(e) {
try {
new URL(e);
return true;
} catch (e) {
return false;
}
}
function _a(e) {
return !!void 0;
}
function Pa(e, t) {
if (!globalThis.location) {
return t;
}
if (!Ea) {
Ea = {};
var o = globalThis.location.search.substring(1);
var a = o.split("&");
for (var r = 0; r < a.length; r++)