@nebula.js/stardust
Version:
Product and framework agnostic integration API for Qlik's Associative Engine
1,644 lines (1,484 loc) • 1.58 MB
JavaScript
/*
* @nebula.js/stardust v2.12.0
* Copyright (c) 2022 QlikTech International AB
* Released under the MIT license.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.stardust = {}));
})(this, (function (exports) { 'use strict';
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
var runtime = {exports: {}};
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
(function (module) {
var runtime = (function (exports) {
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined$1; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
return obj[key];
}
try {
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
define({}, "");
} catch (err) {
define = function(obj, key, value) {
return obj[key] = value;
};
}
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
define(IteratorPrototype, iteratorSymbol, function () {
return this;
});
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = GeneratorFunctionPrototype;
define(Gp, "constructor", GeneratorFunctionPrototype);
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
GeneratorFunction.displayName = define(
GeneratorFunctionPrototype,
toStringTagSymbol,
"GeneratorFunction"
);
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
define(prototype, method, function(arg) {
return this._invoke(method, arg);
});
});
}
exports.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
exports.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
define(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function(error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
return this;
});
exports.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0) PromiseImpl = Promise;
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList),
PromiseImpl
);
return exports.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined$1) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined$1;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined$1;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
define(Gp, toStringTagSymbol, "Generator");
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
define(Gp, iteratorSymbol, function() {
return this;
});
define(Gp, "toString", function() {
return "[object Generator]";
});
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined$1;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
exports.values = values;
function doneResult() {
return { value: undefined$1, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined$1;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined$1;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined$1;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined$1;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined$1;
}
return ContinueSentinel;
}
};
// Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}(
// If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
module.exports
));
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, in modern engines
// we can explicitly access globalThis. In older engines we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
if (typeof globalThis === "object") {
globalThis.regeneratorRuntime = runtime;
} else {
Function("r", "regeneratorRuntime = r")(runtime);
}
}
} (runtime));
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
enumerableOnly && (symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
function _defineProperty$2(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _extends$b() {
_extends$b = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$b.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$4(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties$2(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose$4(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
const format = function () {
let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
const arr = typeof args === 'string' || typeof args === 'number' ? [args] : args;
return message.replace(/\{(\d+)\}/g, (match, number) => typeof arr[number] !== 'undefined' ? arr[number] : match);
};
function translator() {
let {
initial = 'en-US',
fallback = 'en-US'
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const dictionaries = {};
let currentLocale = initial;
/**
* @class Translator
*/
const api =
/** @lends Translator# */
{
language: lang => {
if (lang) {
currentLocale = lang;
}
return currentLocale;
},
/**
* Registers a string in multiple locales
* @param {object} item
* @param {string} item.id
* @param {object<string,string>} item.locale
* @example
* translator.add({
* id: 'company.hello_user',
* locale: {
* 'en-US': 'Hello {0}',
* 'sv-SE': 'Hej {0}'
* }
* });
* translator.get('company.hello_user', ['John']); // Hello John
*/
add: item => {
// TODO - disallow override?
const {
id,
locale
} = item;
Object.keys(locale).forEach(lang => {
if (!dictionaries[lang]) {
dictionaries[lang] = {};
}
dictionaries[lang][id] = locale[lang];
});
},
/**
* Translates a string for current locale.
* @param {string} str - ID of the registered string.
* @param {Array<string>=} args - Values passed down for string interpolation.
* @returns {string} The translated string.
*/
get(str, args) {
let v;
if (dictionaries[currentLocale] && typeof dictionaries[currentLocale][str] !== 'undefined') {
v = dictionaries[currentLocale][str];
} else if (dictionaries[fallback] && typeof dictionaries[fallback][str] !== 'undefined') {
v = dictionaries[fallback][str];
} else {
v = str;
}
return typeof args !== 'undefined' ? format(v, args) : v;
}
};
return api;
}
const locale = function () {
let {
initial = 'en-US',
fallback = 'en-US'
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
const t = translator({
initial,
fallback
});
return {
translator: t
};
};
var Cancel$1 = {
id: "Cancel",
locale: {
"de-DE": "Abbrechen",
"en-US": "Cancel",
"es-ES": "Cancelar",
"fr-FR": "Annuler",
"it-IT": "Annulla",
"ja-JP": "キャンセル",
"ko-KR": "취소",
"nl-NL": "Annuleren",
"pl-PL": "Anuluj",
"pt-BR": "Cancelar",
"ru-RU": "Отмена",
"sv-SE": "Avbryt",
"tr-TR": "İptal",
"zh-CN": "取消",
"zh-TW": "取消"
}
};
var CurrentSelections_All = {
id: "CurrentSelections.All",
locale: {
"de-DE": "ALLES",
"en-US": "ALL",
"es-ES": "TODOS",
"fr-FR": "TOUS",
"it-IT": "TUTTI",
"ja-JP": "すべて",
"ko-KR": "모두",
"nl-NL": "ALLE",
"pl-PL": "WSZYSTKO",
"pt-BR": "TODOS",
"ru-RU": "ВСЕ",
"sv-SE": "ALLA",
"tr-TR": "TÜMÜ",
"zh-CN": "全部",
"zh-TW": "全部"
}
};
var CurrentSelections_Of = {
id: "CurrentSelections.Of",
locale: {
"de-DE": "{0} von {1}",
"en-US": "{0} of {1}",
"es-ES": "{0} de {1}",
"fr-FR": "{0} sur {1}",
"it-IT": "{0} di {1}",
"ja-JP": "{0}/ {1}",
"ko-KR": "{0} / {1}",
"nl-NL": "{0} van {1}",
"pl-PL": "{0} z {1}",
"pt-BR": "{0} de {1}",
"ru-RU": "{0} из {1}",
"sv-SE": "{0} av {1}",
"tr-TR": "{0} / {1}",
"zh-CN": "{0}/ {1}",
"zh-TW": "{0}/ {1}"
}
};
var Listbox_Lock = {
id: "Listbox.Lock",
locale: {
"de-DE": "Auswahlen sperren",
"en-US": "Lock selections",
"es-ES": "Bloquear selecciones",
"fr-FR": "Verrouiller les sélections",
"it-IT": "Blocca selezioni",
"ja-JP": "選択をロック",
"ko-KR": "선택 내용 잠금",
"nl-NL": "Selecties vergrendelen",
"pl-PL": "Zablokuj wybory",
"pt-BR": "Bloquear seleções",
"ru-RU": "Заблокировать выборки",
"sv-SE": "Lås urval",
"tr-TR": "Seçimleri kilitle",
"zh-CN": "锁定选择项",
"zh-TW": "鎖定選項"
}
};
var Listbox_Search = {
id: "Listbox.Search",
locale: {
"de-DE": "In Listenfeld suchen",
"en-US": "Search in listbox",
"es-ES": "Buscar en cuadro de lista",
"fr-FR": "Rechercher dans la liste de sélection",
"it-IT": "Cerca nella casella di elenco",
"ja-JP": "リストボックス内を検索",
"ko-KR": "목록 상자에서 검색",
"nl-NL": "Zoeken in keuzelijst",
"pl-PL": "Wyszukaj w liście wartości",
"pt-BR": "Pesquisar na caixa de listagem",
"ru-RU": "Поиск в списке",
"sv-SE": "Sök i listruta",
"tr-TR": "Liste kutusunda ara",
"zh-CN": "在列表框中搜索",
"zh-TW": "在清單方塊中搜尋"
}
};
var Listbox_Unlock = {
id: "Listbox.Unlock",
locale: {
"de-DE": "Auswahlen entsperren",
"en-US": "Unlock selections",
"es-ES": "Desbloquear selecciones",
"fr-FR": "Déverrouiller les sélections",
"it-IT": "Sblocca selezioni",
"ja-JP": "選択をロック解除",
"ko-KR": "선택 내용 잠금 해제",
"nl-NL": "Selecties ontgrendelen",
"pl-PL": "Odblokuj wybory",
"pt-BR": "Desbloquear seleções",
"ru-RU": "Разблокировать выборки",
"sv-SE": "Lås upp urval",
"tr-TR": "Seçimlerin kilidini aç",
"zh-CN": "将选择项解锁",
"zh-TW": "解鎖選項"
}
};
var Menu_More = {
id: "Menu.More",
locale: {
"de-DE": "Mehr",
"en-US": "More",
"es-ES": "Más",
"fr-FR": "Plus",
"it-IT": "Altro",
"ja-JP": "詳細",
"ko-KR": "자세히",
"nl-NL": "Meer",
"pl-PL": "Więcej",
"pt-BR": "Mais",
"ru-RU": "Дополнительно",
"sv-SE": "Mer",
"tr-TR": "Daha fazla",
"zh-CN": "更多",
"zh-TW": "更多"
}
};
var Navigate_Back = {
id: "Navigate.Back",
locale: {
"de-DE": "Schritt zurück",
"en-US": "Step back",
"es-ES": "Atrás",
"fr-FR": "Retour en arrière",
"it-IT": "Torna indietro",
"ja-JP": "1 段階戻る",
"ko-KR": "이전 단계",
"nl-NL": "Stap terug",
"pl-PL": "Krok do tyłu",
"pt-BR": "Voltar uma etapa",
"ru-RU": "Шаг назад",
"sv-SE": "Gå bakåt",
"tr-TR": "Bir adım geri",
"zh-CN": "后退",
"zh-TW": "倒退"
}
};
var Navigate_Forward = {
id: "Navigate.Forward",
locale: {
"de-DE": "Schritt vor",
"en-US": "Step forward",
"es-ES": "Avanzar",
"fr-FR": "Étape suivante",
"it-IT": "Vai avanti",
"ja-JP": "1段階進む",
"ko-KR": "다음 단계",
"nl-NL": "Stap vooruit",
"pl-PL": "Krok do przodu",
"pt-BR": "Avançar uma etapa",
"ru-RU": "Шаг вперед",
"sv-SE": "Gå framåt",
"tr-TR": "Bir adım ileri",
"zh-CN": "前进",
"zh-TW": "前進"
}
};
var OK = {
id: "OK",
locale: {
"de-DE": "OK",
"en-US": "OK",
"es-ES": "Aceptar",
"fr-FR": "OK",
"it-IT": "OK",
"ja-JP": "OK",
"ko-KR": "확인",
"nl-NL": "OK",
"pl-PL": "OK",
"pt-BR": "OK",
"ru-RU": "ОК",
"sv-SE": "OK",
"tr-TR": "Tamam",
"zh-CN": "确定",
"zh-TW": "確定"
}
};
var Object_Update_Active = {
id: "Object.Update.Active",
locale: {
"de-DE": "Laden von Daten",
"en-US": "Updating data",
"es-ES": "Cargando datos",
"fr-FR": "Chargement de données en cours",
"it-IT": "Caricamento dati in corso",
"ja-JP": "データのロード中",
"ko-KR": "데이터 로드 중",
"nl-NL": "Gegevens worden geladen",
"pl-PL": "Ładowanie danych",
"pt-BR": "Carregando dados",
"ru-RU": "Загрузка данных",
"sv-SE": "Laddar data",
"tr-TR": "Veriler yükleniyor",
"zh-CN": "加载数据",
"zh-TW": "正在載入資料"
}
};
var Object_Update_Cancelled = {
id: "Object.Update.Cancelled",
locale: {
"de-DE": "Datenaktualisierung wurde abgebrochen",
"en-US": "Data update was cancelled",
"es-ES": "Se ha cancelado la actualización de datos",
"fr-FR": "Mise à jour des données annulée",
"it-IT": "Aggiornamento dati annullato",
"ja-JP": "データの更新がキャンセルされました",
"ko-KR": "데이터 업데이트가 취소되었습니다.",
"nl-NL": "Gegevensupdate is geannuleerd",
"pl-PL": "Aktualizacja danych została anulowana",
"pt-BR": "A atualização de dados foi cancelada",
"ru-RU": "Обновление данных отменено",
"sv-SE": "Datauppdateringen avbröts.",
"tr-TR": "Veri güncelleştirme iptal edildi",
"zh-CN": "数据更新已取消",
"zh-TW": "資料更新已取消"
}
};
var Retry$1 = {
id: "Retry",
locale: {
"de-DE": "Wiederholen",
"en-US": "Retry",
"es-ES": "Intentar de nuevo",
"fr-FR": "Réessayer",
"it-IT": "Riprova",
"ja-JP": "再試行",
"ko-KR": "다시 시도",
"nl-NL": "Opnieuw",
"pl-PL": "Ponów próbę",
"pt-BR": "Tentar novamente",
"ru-RU": "Повторить попытку",
"sv-SE": "Försök igen",
"tr-TR": "Yeniden dene",
"zh-CN": "重试",
"zh-TW": "重試"
}
};
var Selection_Cancel = {
id: "Selection.Cancel",
locale: {
"de-DE": "Auswahl abbrechen",
"en-US": "Cancel selection",
"es-ES": "Cancelar selección",
"fr-FR": "Annuler la sélection",
"it-IT": "Annulla selezione",
"ja-JP": "選択のキャンセル",
"ko-KR": "선택 취소",
"nl-NL": "Selectie annuleren",
"pl-PL": "Anuluj selekcję",
"pt-BR": "Cancelar seleção",
"ru-RU": "Отменить выборку",
"sv-SE": "Avbryt urval",
"tr-TR": "Seçimi iptal et",
"zh-CN": "取消选择",
"zh-TW": "取消選取"
}
};
var Selection_Clear = {
id: "Selection.Clear",
locale: {
"de-DE": "Auswahl löschen",
"en-US": "Clear selection",
"es-ES": "Borrar selección",
"fr-FR": "Effacer la sélection",
"it-IT": "Cancella selezione",
"ja-JP": "選択をクリア",
"ko-KR": "선택 해제",
"nl-NL": "Selectie wissen",
"pl-PL": "Wyczyść selekcję",
"pt-BR": "Limpar seleção",
"ru-RU": "Очистить выбор",
"sv-SE": "Rensa urval",
"tr-TR": "Seçimi temizle",
"zh-CN": "清除选择",
"zh-TW": "清除選項"
}
};
var Selection_ClearAll = {
id: "Selection.ClearAll",
locale: {
"de-DE": "Alle Auswahlen löschen",
"en-US": "Clear all selections",
"es-ES": "Borrar todas las selecciones",
"fr-FR": "Effacer toutes les sélections",
"it-IT": "Cancella tutte le selezioni",
"ja-JP": "選択をすべてクリアする",
"ko-KR": "모든 선택 해제",
"nl-NL": "Alle selecties wissen",
"pl-PL": "Wyczyść wszystkie selekcje",
"pt-BR": "Limpar todas as seleções",
"ru-RU": "Очистить от всех выборок",
"sv-SE": "Radera alla urval",
"tr-TR": "Tüm seçimleri temizle",
"zh-CN": "清除所有选择项",
"zh-TW": "清除所有選項"
}
};
var Selection_ClearAllStates = {
id: "Selection.ClearAllStates",
locale: {
"de-DE": "Alle Status löschen",
"en-US": "Clear all states",
"es-ES": "Borrar todos los estados",
"fr-FR": "Effacer tous les états",
"it-IT": "Cancella tutti gli stati",
"ja-JP": "全ステートをクリア",
"ko-KR": "모든 상태 지우기",
"nl-NL": "Alle states wissen",
"pl-PL": "Wyczyść wszystkie stany",
"pt-BR": "Limpar todos os estados",
"ru-RU": "Очистить все состояния",
"sv-SE": "Rensa alla tillstånd",
"tr-TR": "Tüm durumları temizle",
"zh-CN": "清除所有状态",
"zh-TW": "清除所有狀態"
}
};
var Selection_Confirm = {
id: "Selection.Confirm",
locale: {
"de-DE": "Auswahl bestätigen",
"en-US": "Confirm selection",
"es-ES": "Confirmar selección",
"fr-FR": "Confirmer la sélection",
"it-IT": "Conferma selezione",
"ja-JP": "選択の確認",
"ko-KR": "선택 확인",
"nl-NL": "Selectie bevestigen",
"pl-PL": "Potwierdź selekcję",
"pt-BR": "Confirmar seleção",
"ru-RU": "Подтвердить выборку",
"sv-SE": "Bekräfta urval",
"tr-TR": "Seçimi onayla",
"zh-CN": "确认选择",
"zh-TW": "確認選取"
}
};
var Selection_Menu = {
id: "Selection.Menu",
locale: {
"de-DE": "Auswahlmenü",
"en-US": "Selection menu",
"es-ES": "Menú de selección",
"fr-FR": "Menu Sélection",
"it-IT": "Menu Selezione",
"ja-JP": "選択メニュー",
"ko-KR": "선택 메뉴",
"nl-NL": "Selectiemenu",
"pl-PL": "Menu selekcji",
"pt-BR": "Menu de seleção",
"ru-RU": "Меню \"Выборка\"",
"sv-SE": "Urvalsmeny",
"tr-TR": "Seçim menüsü",
"zh-CN": "选择菜单",
"zh-TW": "選項功能表"
}
};
var Selection_SelectAll = {
id: "Selection.SelectAll",
locale: {
"de-DE": "Alle auswählen",
"en-US": "Select all",
"es-ES": "Seleccionar todo",
"fr-FR": "Sélectionner tout",
"it-IT": "Seleziona tutto",
"ja-JP": "すべて選択",
"ko-KR": "모두 선택",
"nl-NL": "Alles selecteren",
"pl-PL": "Wybierz wszystko",
"pt-BR": "Selecionar todos",
"ru-RU": "Выбрать все",
"sv-SE": "Välj alla",
"tr-TR": "Tümünü seç",
"zh-CN": "全选",
"zh-TW": "全選"
}
};
var Selection_SelectAlternative = {
id: "Selection.SelectAlternative",
locale: {
"de-DE": "Alternative Werte auswählen",
"en-US": "Select alternative",
"es-ES": "Seleccionar alternativos",
"fr-FR": "Sélectionner des valeurs alternatives",
"it-IT": "Seleziona alternativi",
"ja-JP": "代替値を選択",
"ko-KR": "대안 선택",
"nl-NL": "Alternatief selecteren",
"pl-PL": "Wybierz alternatywę",
"pt-BR": "Selecionar alternativa",
"ru-RU": "Выбрать альтернативные",
"sv-SE": "Välj alternativ",
"tr-TR": "Alternatifi seç",
"zh-CN": "选择替代项",
"zh-TW": "選取替代選項"
}
};
var Selection_SelectExcluded = {
id: "Selection.SelectExcluded",
locale: {
"de-DE": "Ausgeschlossene Werte auswählen",
"en-US": "Select excluded",
"es-ES": "Seleccionar excluidos",
"fr-FR": "Sélectionner les valeurs exclues",
"it-IT": "Seleziona esclusi",
"ja-JP": "除外値を選択",
"ko-KR": "제외 항목 선택",
"nl-NL": "Uitgesloten waarden selecteren",
"pl-PL": "Wybierz wykluczone",
"pt-BR": "Selecionar excluído",
"ru-RU": "Выбрать исключенные",
"sv-SE": "Välj uteslutna",
"tr-TR": "Hariç tutulanı seç",
"zh-CN": "选择排除项",
"zh-TW": "選取排除值"
}
};
var Selection_SelectPossible = {
id: "Selection.SelectPossible",
locale: {
"de-DE": "Wählbare Werte auswählen",
"en-US": "Select possible",
"es-ES": "Seleccionar posibles",
"fr-FR": "Sélectionner les valeurs possibles",
"it-IT": "Seleziona possibili",
"ja-JP": "絞込値を選択",
"ko-KR": "사용 가능 항목 선택",
"nl-NL": "Mogelijke waarden selecteren",
"pl-PL": "Wybierz możliwe",
"pt-BR": "Selecionar possível",
"ru-RU": "Выбрать возможные",
"sv-SE": "Välj möjliga",
"tr-TR": "Olasıyı seç",
"zh-CN": "选择可能值",
"zh-TW": "選取可能值"
}
};
var Visualization_Incomplete = {
id: "Visualization.Incomplete",
locale: {
"de-DE": "Unvollständige Visualisierung",
"en-US": "Incomplete visualization",
"es-ES": "Visualización incompleta",
"fr-FR": "Visualisation incomplète",
"it-IT": "Visualizzazione incompleta",
"ja-JP": "未完了のビジュアライゼーション",
"ko-KR": "완료되지 않은 시각화",
"nl-NL": "Onvolledige visualisatie",
"pl-PL": "Niekompletna wizualizacja",
"pt-BR": "Visualização incompleta",
"ru-RU": "Незавершенная визуализация",
"sv-SE": "Ofullständig visualisering",
"tr-TR": "Tamamlanmamış görselleştirme",
"zh-CN": "不完整的可视化",
"zh-TW": "視覺化未完成"
}
};
var Visualization_Incomplete_Dimensions = {
id: "Visualization.Incomplete.Dimensions",
locale: {
"de-DE": "{0} von {1} Dimensionen",
"en-US": "{0} of {1} dimensions",
"es-ES": "{0} de {1} dimensiones",
"fr-FR": "{0} dimensions sur {1}",
"it-IT": "{0} di {1} dimensioni",
"ja-JP": "{0} / {1} 軸",
"ko-KR": "{1} 차원의 {0}",
"nl-NL": "{0} van {1} dimensies",
"pl-PL": "{0} z {1} wymiarów",
"pt-BR": "{0} de {1} dimensões",
"ru-RU": "Измерения: {0} из {1}",
"sv-SE": "{0} av {1} dimensioner",
"tr-TR": "{0}/{1} boyut",
"zh-CN": "{0} / {1} 个维度",
"zh-TW": "{1} 個維度中的 {0} 個"
}
};
var Visualization_Incomplete_Measures = {
id: "Visualization.Incomplete.Measures",
locale: {
"de-DE": "{0} von {1} Kennzahlen",
"en-US": "{0} of {1} measures",
"es-ES": "{0} de {1} medidas",
"fr-FR": "{0} mesures sur {1}",
"it-IT": "{0} di {1} misure",
"ja-JP": "{0} / {1} メジャー",
"ko-KR": "{1} 측정값의 {0}",
"nl-NL": "{0} van {1} metingen",
"pl-PL": "{0} z {1} miar",
"pt-BR": "{0} de {1} medidas",
"ru-RU": "Меры: {0} из {1}",
"sv-SE": "{0} av {1} mått",
"tr-TR": "{0}/{1} hesaplama",
"zh-CN": "{0} / {1} 个度量",
"zh-TW": "{1} 個量值中的 {0} 個"
}
};
var Visualization_Invalid_Dimension = {
id: "Visualization.Invalid.Dimension",
locale: {
"de-DE": "Ungültige Dimension",
"en-US": "Invalid dimension",
"es-ES": "Dimensión no válida",
"fr-FR": "Dimension non valide",
"it-IT": "Dimensione non valida",
"ja-JP": "無効な軸です",
"ko-KR": "잘못된 차원",
"nl-NL": "Ongeldige dimensie",
"pl-PL": "Nieprawidłowy wymiar",
"pt-BR": "Dimensão inválida",
"ru-RU": "Недопустимое измерение",
"sv-SE": "Ogiltig dimension",
"tr-TR": "Geçersiz boyut",
"zh-CN": "无效维度",
"zh-TW": "維度無效"
}
};
var Visualization_Invalid_Measure = {
id: "Visualization.Invalid.Measure",
locale: {
"de-DE": "Ungültige Kennzahl",
"en-US": "Invalid measure",
"es-ES": "Medida no válida",
"fr-FR": "Mesure non valide",
"it-IT": "Misura non valida",
"ja-JP": "無効なメジャーです",
"ko-KR": "잘못된 측정값",
"nl-NL": "Ongeldige meting",
"pl-PL": "Nieprawidłowa miara",
"pt-BR": "Medida inválida",
"ru-RU": "Недопустимая мера",
"sv-SE": "Ogiltigt mått",
"tr-TR": "Geçersiz hesaplama",
"zh-CN": "无效度量项",
"zh-TW": "量值無效"
}
};
var Visualization_LayoutError = {
id: "Visualization.LayoutError",
locale: {
"de-DE": "Fehler",
"en-US": "Error",
"es-ES": "Error",
"fr-FR": "Erreur",
"it-IT": "Errore",
"ja-JP": "エラー",
"ko-KR": "오류",
"nl-NL": "Fout",
"pl-PL": "Błąd",
"pt-BR": "Erro",
"ru-RU": "Ошибка",
"sv-SE": "Fel",
"tr-TR": "Hata",
"zh-CN": "错误",
"zh-TW": "錯誤"
}
};
var Visualization_UnfulfilledCalculationCondition = {
id: "Visualization.UnfulfilledCalculationCondition",
locale: {
"de-DE": "Die Berechnungsbedingung ist nicht erfüllt",
"en-US": "The calculation condition is not fulfilled",
"es-ES": "La condición de cálculo no se cumple",
"fr-FR": "Condition de calcul non remplie",
"it-IT": "La condizione di calcolo non è soddisfatta",
"ja-JP": "演算実行条件が満たされていません",
"ko-KR": "계산 조건이 충족되지 않았습니다.",
"nl-NL": "Er is niet aan de berekeningsvoorwaarde voldaan",
"pl-PL": "Warunek obliczenia nie jest spełniony",
"pt-BR": "A condição de cálculo não foi atendida",
"ru-RU": "Условие вычисления не выполнено",
"sv-SE": "Beräkningsvillkoret uppfylls inte",
"tr-TR": "Hesaplama koşulu yerine getirilmedi",
"zh-CN": "不满足计算条件",
"zh-TW": "不符計算條件"
}
};
var all = {
Cancel: Cancel$1,
CurrentSelections_All: CurrentSelections_All,
CurrentSelections_Of: CurrentSelections_Of,
Listbox_Lock: Listbox_Lock,
Listbox_Search: Listbox_Search,
Listbox_Unlock: Listbox_Unlock,
Menu_More: Menu_More,
Navigate_Back: Navigate_Back,
Navigate_Forward: Navigate_Forward,
OK: OK,
Object_Update_Active: Object_Update_Active,
Object_Update_Cancelled: Object_Update_Cancelled,
Retry: Retry$1,
Selection_Cancel: Selection_Cancel,
Selection_Clear: Selection_Clear,
Selection_ClearAll: Selection_ClearAll,
Selection_ClearAllStates: Selection_ClearAllStates,
Selection_Confirm: Selection_Confirm,
Selection_Menu: Selection_Menu,
Selection_SelectAll: Selection_SelectAll,
Selection_SelectAlternative: Selection_SelectAlternative,
Selection_SelectExcluded: Selection_SelectExcluded,
Selection_SelectPossible: Selection_SelectPossible,
Visualization_Incomplete: Visualization_Incomplete,
Visualization_Incomplete_Dimensions: Visualization_Incomplete_Dimensions,
Visualization_Incomplete_Measures: Visualization_Incomplete_Measures,
Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
Visualization_Invalid_Measure: Visualization_Invalid_Measure,
Visualization_LayoutError: Visualization_LayoutError,
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
};
function appLocaleFn(language) {
const l = locale({
initial: language
});
Object.keys(all).forEach(key => {
l.translator.add(all[key]);
});
return {
translator: l.translator
};
}
/**
* Utility functions
*/
var util = {};
util.isObject = function isObject(arg) {
return typeof arg === 'object' && arg !== null;
};
util.isNumber = function isNumber(arg) {
return typeof arg === 'number';
};
util.isUndefined = function isUndefined(arg) {
return arg === void 0;
};
util.isFunction = function isFunction(arg){
return typeof arg === 'function';
};
/**
* EventEmitter class
*/
function EventEmitter() {
EventEmitter.init.call(this);
}
var nodeEventEmitter = E