@staffbase/plugins-client-sdk 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"plugins-client-sdk.esm.js","sources":["../node_modules/regenerator-runtime/runtime.js","../node_modules/@babel/runtime/regenerator/index.js","../node_modules/object.entries-ponyfill/entries.js","../node_modules/object.entries-ponyfill/index.js","../src/lib/utils/reverseObject.js","../src/lib/connection/commands.js","../src/lib/connection/connector/postmessage-legacy-protocol.js","../src/lib/utils/genId.js","../src/model/locales.js","../src/lib/utils/normalize.js","../src/lib/connection/connector/fallback-handlers.js","../src/lib/connection/connector/postmessage-protocol.js","../node_modules/compare-versions/index.js"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","module.exports = require(\"regenerator-runtime\");\n","'use strict'\n\nvar has = function (obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop) }\nvar isEnumerable = function (obj, prop) {\n return Object.prototype.propertyIsEnumerable.call(obj, prop)\n}\n\nfunction entries (obj) {\n if (obj == null) {\n throw new TypeError('Cannot convert undefined or null to object')\n }\n var pairs = []\n for (var key in obj) {\n if (has(obj, key) && isEnumerable(obj, key)) {\n pairs.push([key, obj[key]])\n }\n }\n return pairs\n}\n\nmodule.exports = entries\n","module.exports = typeof Object.entries === 'function' ? Object.entries : require('./entries')\n","import entries from 'object.entries-ponyfill';\n\n/**\n * Reverses the keys and properties of the given object\n *\n * @param {object} obj the object to reverse\n * @return {object}\n */\nconst reverse = obj =>\n entries(obj).reduce((acc, [k, p]) => {\n acc[p] = k;\n return acc;\n }, {});\n\nexport default reverse;\n","import reverse from '../utils/reverseObject';\n\n/**\n * @typedef { Object.<string, string> } PlatformCommands\n * @typedef { Object.<string, string> } ReversedPlatformCommands\n */\n\n/**\n * Platform independent definition\n * of supported commands\n *\n * @type {PlatformCommands}\n */\nexport const commands = {\n ios: 'dev-ios',\n android: 'dev-android',\n version: 'app-version',\n mobile: 'app-mobile',\n native: 'app-native',\n openLink: 'openExternalLink',\n nativeUpload: 'nativeFileUpload',\n nativeShare: 'nativeShareDialog',\n langInfos: 'getLanguageInfos',\n branchDefaultLang: 'getBranchDefaultLanguage',\n prefContentLang: 'getPreferredContentLocale'\n};\n\n/**\n * All supported commands with reversed keys and properties\n *\n * @type {ReversedPlatformCommands>}\n */\nexport const reversedCommands = reverse(commands);\n\nexport default commands;\n","import { commands } from '../commands';\n\n/**\n * Postmessage legacy protocol (3.5)\n */\n\nexport default {\n init: 'pluginLoaded', // send this if ready to communicate\n platformInfo: 'platformInfo', // receive this after pluginLoaded was sent\n startUpload: 'startImageUploadForPlugin', // start a file upload process\n finishUpload: 'finishedImageUploadForPlugin' // return the file data uploaded\n};\n\nexport const invocationMapping = {\n [commands.nativeUpload]: 'nativeFileUpload'\n};\n","/**\n * Generates an unique id of 4 alpha numerical chars\n *\n * @return {string} unique id\n */\nconst genID = () => {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n};\n\nexport default genID;\n","export default {\n ar: {\n key: 'ar',\n locale: 'ar_AE',\n name: 'العربية'\n },\n bg: {\n key: 'bg',\n locale: 'bg_BG',\n name: 'български'\n },\n bn: {\n key: 'bn',\n locale: 'bn_BD',\n name: 'বাংলা'\n },\n cs: {\n key: 'cs',\n locale: 'cs_CZ',\n name: 'Čeština'\n },\n da: {\n key: 'da',\n locale: 'da_DK',\n name: 'Dansk'\n },\n de: {\n key: 'de',\n locale: 'de_DE',\n name: 'Deutsch'\n },\n el: {\n key: 'el',\n locale: 'el_GR',\n name: 'Ελληνικά'\n },\n en: {\n key: 'en',\n locale: 'en_US',\n name: 'English'\n },\n es: {\n key: 'es',\n locale: 'es_ES',\n name: 'Español'\n },\n et: {\n key: 'et',\n locale: 'et_EE',\n name: 'Eesti keel'\n },\n fi: {\n key: 'fi',\n locale: 'fi_FI',\n name: 'Suomi'\n },\n fr: {\n key: 'fr',\n locale: 'fr_FR',\n name: 'Français'\n },\n he: {\n key: 'he',\n locale: 'he_IL',\n name: 'עִבְרִית'\n },\n hi: {\n key: 'hi',\n locale: 'hi_IN',\n name: 'िन्दी'\n },\n hr: {\n key: 'hr',\n locale: 'hr_HR',\n name: 'Hrvatski'\n },\n hu: {\n key: 'hu',\n locale: 'hu_HU',\n name: 'Magyar'\n },\n is: {\n key: 'is',\n locale: 'is_IS',\n name: 'Íslenska'\n },\n it: {\n key: 'it',\n locale: 'it_IT',\n name: 'Italiano'\n },\n ja: {\n key: 'ja',\n locale: 'ja_JP',\n name: '日本語'\n },\n ko: {\n key: 'ko',\n locale: 'ko_KR',\n name: '한국어'\n },\n lt: {\n key: 'lt',\n locale: 'lt_LT',\n name: 'Lietuvių'\n },\n lv: {\n key: 'lv',\n locale: 'lv_LV',\n name: 'Latviešu'\n },\n mk: {\n key: 'mk',\n locale: 'mk_MK',\n name: 'Македонски'\n },\n ms: {\n key: 'ms',\n locale: 'ms_MY',\n name: 'Bahasa Melayu'\n },\n nl: {\n key: 'nl',\n locale: 'nl_NL',\n name: 'Nederlands'\n },\n no: {\n key: 'no',\n locale: 'no_NO',\n name: 'Norsk'\n },\n pl: {\n key: 'pl',\n locale: 'pl_PL',\n name: 'Polski'\n },\n pt: {\n key: 'pt',\n locale: 'pt_BR',\n name: 'Português'\n },\n ro: {\n key: 'ro',\n locale: 'ro_RO',\n name: 'Română'\n },\n ru: {\n key: 'ru',\n locale: 'ru_RU',\n name: 'Русский'\n },\n sk: {\n key: 'sk',\n locale: 'sk_SK',\n name: 'Slovenský'\n },\n sl: {\n key: 'sl',\n locale: 'sl_SI',\n name: 'Slovenščina'\n },\n sr: {\n key: 'sr',\n locale: 'sr_RS',\n name: 'Српски'\n },\n sv: {\n key: 'sv',\n locale: 'sv_SE',\n name: 'Svenska'\n },\n th: {\n key: 'th',\n locale: 'th_TH',\n name: 'ภาษาไทย'\n },\n tr: {\n key: 'tr',\n locale: 'tr_TR',\n name: 'Türkçe'\n },\n uk: {\n key: 'uk',\n locale: 'uk_UA',\n name: 'Українська'\n },\n vi: {\n key: 'vi',\n locale: 'vi_VN',\n name: 'Tiếng Việt'\n },\n zh: {\n key: 'zh',\n locale: 'zh_CN',\n name: '简体中文'\n }\n};\n","/**\n * Handles the locale codes as the frontend\n *\n * @param {string} locale the locale code\n *\n * @return {string} the first part of the locale\n */\nconst normalize = locale => {\n locale = (locale && locale.split(/-|_/)[0]) || locale; // use only first part\n\n if (['nb', 'nn'].indexOf(locale) !== -1) {\n // fix Norwegian language code to conform with our non-standard stuff\n locale = 'no';\n }\n\n if (locale === 'iw') {\n // fix legacy Hebrew language code from our backend to conform with our frontend\n locale = 'he';\n }\n\n return locale;\n};\n\nexport default normalize;\n","/**\n * Fallbacks for all sdk commands\n */\nimport locales from './../../../model/locales';\nimport normalize from './../../utils/normalize';\n\nconst log = require('loglevel');\nconst userAgent = navigator.userAgent || navigator.vendor || window.opera || '';\nconst currentLanguage = normalize(window && window.navigator.language);\n\n// initialize Staffbase/platform namespace for ios frontend js code injection\n// in case of executeJs of app version 3.5 this object gets overwritten\nif (typeof window !== 'undefined') {\n window.Staffbase = window.Staffbase || {};\n window.Staffbase.platform = window.Staffbase.platform || {\n version: '3.4',\n mobile: /Android|webOS|iPhone|iPad|BlackBerry|BB10|IEMobile|Opera Mini/i.test(userAgent),\n native: false\n };\n}\n\n/**\n * Get the current Staffbase app version\n *\n * @return {String} version\n */\nexport const getVersion = () => {\n log.debug('fallback/getVersion');\n return window.Staffbase.platform.version;\n};\n\n/**\n * Are we running in a native app\n *\n * works only for ios or old initial native data\n * @return {Boolean}\n */\nexport const isNative = () => {\n log.debug('fallback/isNative');\n const safari = /safari/i.test(userAgent);\n return (\n window.Staffbase.platform.native === 'android' ||\n window.Staffbase.platform.native === 'ios' ||\n (!safari && isIos())\n );\n};\n\n/**\n * Are we running on a mobile device\n *\n * @return {Boolean}\n */\nexport const isMobile = () => {\n log.debug('fallback/isMobile');\n return window.Staffbase.platform.mobile;\n};\n\n/**\n * Are we running on a desktop device\n *\n * @return {Boolean}\n */\nexport const isDesktop = () => {\n log.debug('fallback/isDesktop');\n return /Win|Mac|Linux/i.test(userAgent);\n};\n\n/**\n * Are we running on android\n *\n * @return {Boolean}\n */\nexport const isAndroid = () => {\n log.debug('fallback/isAndroid');\n return window.Staffbase.platform.native === 'android' || /Android/i.test(userAgent);\n};\n\n/**\n * Are we running on ios\n *\n * @return {Boolean}\n */\nexport const isIos = () => {\n log.debug('fallback/isIos');\n return window.Staffbase.platform.native === 'ios' || /iPhone|iPad|iPod/i.test(userAgent);\n};\n\n/**\n * Open an external link\n *\n * @param {String} url address\n */\nexport const openLink = url => {\n log.debug('fallback/openLink');\n window.open(url, '_blank');\n};\n\n/**\n * Handler for unpossible functions\n *\n * @param {String} cmd command name\n */\nexport const unSupported = cmd => {\n log.debug('fallback/' + cmd);\n log.warn('Command is not possible in fallback mode.');\n // nothing we can do here\n return;\n};\n\n/**\n * Get extensive locale information.\n *\n * @return {Object} containing various language informations\n */\nexport const langInfos = () => {\n log.debug('fallback/langInfos');\n const branchDefaultLanguage = getBranchDefaultLanguage();\n\n return {\n contentLanguage: branchDefaultLanguage,\n branchLanguages: locales,\n branchDefaultLanguage: branchDefaultLanguage,\n deviceLanguage: branchDefaultLanguage,\n contentLanguages: locales\n };\n};\n\n/**\n * Get the default language object\n *\n * @return {Object} the language object\n */\nexport const getBranchDefaultLanguage = () => {\n log.debug('fallback/getBranchDefaultLanguage');\n\n return locales[currentLanguage] || locales.en;\n};\n\n/**\n * Gets the chosen language from a given content object\n *\n * @param {?object|array} content\n *\n * @return {string}\n */\nexport const getPreferredContentLocale = content => {\n log.debug('fallback/getPreferredContentLocale');\n const locale = getBranchDefaultLanguage().locale;\n\n if (!content) {\n return locale;\n }\n\n if (Array.isArray(content)) {\n const index = content.indexOf(locale);\n\n return content[index] || content[0];\n } else {\n const keys = Object.keys(content);\n const index = keys.indexOf(locale);\n\n return keys[index] || keys[0];\n }\n};\n","import { commands } from '../commands';\n\n/**\n * Postmessage protocol (3.6)\n */\n\nexport default {\n HELLO: 'HELLO', // send this if ready to communicate\n SUCCESS: 'SUCCESS', // receive this after pluginLoaded was sent\n INVOCATION: 'INVOCATION', // send this to call a function in the frontend\n ERROR: 'ERROR' // receive this when something goes wrong\n};\n\nexport const invocationMapping = {\n [commands.openLink]: 'openLink',\n [commands.nativeUpload]: 'nativeFileUpload',\n [commands.nativeShare]: 'nativeShareDialog',\n [commands.langInfos]: 'getPluginLanguageInfo',\n [commands.prefContentLang]: 'getPreferredContentLocale'\n};\n","/* global define */\n(function (root, factory) {\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.compareVersions = factory();\n }\n}(this, function () {\n\n var semver = /^v?(?:\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+))?(?:-[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\n\n function indexOrEnd(str, q) {\n return str.indexOf(q) === -1 ? str.length : str.indexOf(q);\n }\n\n function split(v) {\n var c = v.replace(/^v/, '').replace(/\\+.*$/, '');\n var patchIndex = indexOrEnd(c, '-');\n var arr = c.substring(0, patchIndex).split('.');\n arr.push(c.substring(patchIndex + 1));\n return arr;\n }\n\n function tryParse(v) {\n return isNaN(Number(v)) ? v : Number(v);\n }\n\n function validate(version) {\n if (typeof version !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n if (!semver.test(version)) {\n throw new Error('Invalid argument not valid semver (\\''+version+'\\' received)');\n }\n }\n\n function compareVersions(v1, v2) {\n [v1, v2].forEach(validate);\n\n var s1 = split(v1);\n var s2 = split(v2);\n\n for (var i = 0; i < Math.max(s1.length - 1, s2.length - 1); i++) {\n var n1 = parseInt(s1[i] || 0, 10);\n var n2 = parseInt(s2[i] || 0, 10);\n\n if (n1 > n2) return 1;\n if (n2 > n1) return -1;\n }\n\n var sp1 = s1[s1.length - 1];\n var sp2 = s2[s2.length - 1];\n\n if (sp1 && sp2) {\n var p1 = sp1.split('.').map(tryParse);\n var p2 = sp2.split('.').map(tryParse);\n\n for (i = 0; i < Math.max(p1.length, p2.length); i++) {\n if (p1[i] === undefined || typeof p2[i] === 'string' && typeof p1[i] === 'number') return -1;\n if (p2[i] === undefined || typeof p1[i] === 'string' && typeof p2[i] === 'number') return 1;\n\n if (p1[i] > p2[i]) return 1;\n if (p2[i] > p1[i]) return -1;\n }\n } else if (sp1 || sp2) {\n return sp1 ? -1 : 1;\n }\n\n return 0;\n };\n\n var allowedOperators = [\n '>',\n '>=',\n '=',\n '<',\n '<='\n ];\n\n function validateOperator(op) {\n if (typeof op !== 'string') {\n throw new TypeError('Invalid operator type, expected string but got ' + typeof op);\n }\n if (allowedOperators.indexOf(op) === -1) {\n throw new TypeError('Invalid operator, expected one of ' + allowedOperators.join('|'));\n }\n }\n\n compareVersions.compare = function (v1, v2, operator) {\n // Validate operator\n validateOperator(operator);\n\n // TODO: there might be a better way instead of doing this\n switch(operator) {\n case '>':\n return compareVersions(v1, v2) > 0;\n case '>=':\n return compareVersions(v1, v2) >= 0;\n case '<':\n return compareVersions(v1, v2) < 0;\n case '<=':\n return compareVersions(v1, v2) <= 0;\n default:\n // Since validateOperator already checks the operator, this case in the switch checks for the '=' operator\n return compareVersions(v1, v2) === 0;\n }\n }\n\n return compareVersions;\n}));\n"],"names":["undefined","require$$0","reverse","obj","entries","reduce","acc","k","p","commands","ios","android","version","mobile","native","openLink","nativeUpload","nativeShare","langInfos","branchDefaultLang","prefContentLang","reversedCommands","init","platformInfo","startUpload","finishUpload","invocationMapping","genID","Math","floor","random","toString","substring","ar","key","locale","name","bg","bn","cs","da","de","el","en","es","et","fi","fr","he","hi","hr","hu","is","it","ja","ko","lt","lv","mk","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh","normalize","split","indexOf","HELLO","SUCCESS","INVOCATION","ERROR","this"],"mappings":";;;;;;;;;;;;;;AAOA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;;EAGhC,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;EAC1B,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;EAC/B,IAAIA,WAAS,CAAC;EACd,IAAI,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,GAAG,EAAE,CAAC;EACzD,IAAI,cAAc,GAAG,OAAO,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugins-client-sdk.esm.js","sources":["../node_modules/loglevel/lib/loglevel.js","../node_modules/object.entries-ponyfill/entries.js","../node_modules/object.entries-ponyfill/index.js","../src/lib/utils/reverseObject.js","../src/lib/connection/commands.js","../src/model/locales.js","../src/lib/utils/normalize.js","../src/lib/connection/connector/fallback-handlers.js","../src/lib/connection/connector/fallback.js","../src/lib/connection/connector/postmessage-protocol.js","../src/lib/utils/genId.js","../src/lib/connection/manager.js","../src/lib/connection/connector/postmessage.js","../src/lib/connection/connector/putMessage.js","../src/lib/connection/connection.js","../src/lib/app.js","../node_modules/compare-versions/index.mjs","../src/lib/device.js","../src/main.js"],"sourcesContent":["/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","'use strict'\n\nvar has = function (obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop) }\nvar isEnumerable = function (obj, prop) {\n return Object.prototype.propertyIsEnumerable.call(obj, prop)\n}\n\nfunction entries (obj) {\n if (obj == null) {\n throw new TypeError('Cannot convert undefined or null to object')\n }\n var pairs = []\n for (var key in obj) {\n if (has(obj, key) && isEnumerable(obj, key)) {\n pairs.push([key, obj[key]])\n }\n }\n return pairs\n}\n\nmodule.exports = entries\n","module.exports = typeof Object.entries === 'function' ? Object.entries : require('./entries')\n","import entries from 'object.entries-ponyfill';\n\n/**\n * Reverses the keys and properties of the given object\n *\n * @param {object} obj the object to reverse\n * @return {object}\n */\nconst reverse = (obj) =>\n entries(obj).reduce((acc, [k, p]) => {\n acc[p] = k;\n return acc;\n }, {});\n\nexport default reverse;\n","import reverse from '../utils/reverseObject';\n\n/**\n * @typedef { Object.<string, string> } PlatformCommands\n * @typedef { Object.<string, string> } ReversedPlatformCommands\n */\n\n/**\n * Platform independent definition\n * of supported commands\n *\n * @type {PlatformCommands}\n */\nexport const commands = {\n ios: 'dev-ios',\n android: 'dev-android',\n version: 'app-version',\n mobile: 'app-mobile',\n native: 'app-native',\n openLink: 'openExternalLink',\n nativeUpload: 'nativeFileUpload',\n nativeShare: 'nativeShareDialog',\n langInfos: 'getLanguageInfos',\n branchDefaultLang: 'getBranchDefaultLanguage',\n prefContentLang: 'getPreferredContentLocale'\n};\n\n/**\n * All supported commands with reversed keys and properties\n *\n * @type {ReversedPlatformCommands>}\n */\nexport const reversedCommands = reverse(commands);\n\nexport default commands;\n","export default {\n ar: {\n key: 'ar',\n locale: 'ar_AE',\n name: 'العربية'\n },\n bg: {\n key: 'bg',\n locale: 'bg_BG',\n name: 'български'\n },\n bn: {\n key: 'bn',\n locale: 'bn_BD',\n name: 'বাংলা'\n },\n cs: {\n key: 'cs',\n locale: 'cs_CZ',\n name: 'Čeština'\n },\n da: {\n key: 'da',\n locale: 'da_DK',\n name: 'Dansk'\n },\n de: {\n key: 'de',\n locale: 'de_DE',\n name: 'Deutsch'\n },\n el: {\n key: 'el',\n locale: 'el_GR',\n name: 'Ελληνικά'\n },\n en: {\n key: 'en',\n locale: 'en_US',\n name: 'English'\n },\n es: {\n key: 'es',\n locale: 'es_ES',\n name: 'Español'\n },\n et: {\n key: 'et',\n locale: 'et_EE',\n name: 'Eesti keel'\n },\n fi: {\n key: 'fi',\n locale: 'fi_FI',\n name: 'Suomi'\n },\n fr: {\n key: 'fr',\n locale: 'fr_FR',\n name: 'Français'\n },\n he: {\n key: 'he',\n locale: 'he_IL',\n name: 'עִבְרִית'\n },\n hi: {\n key: 'hi',\n locale: 'hi_IN',\n name: 'िन्दी'\n },\n hr: {\n key: 'hr',\n locale: 'hr_HR',\n name: 'Hrvatski'\n },\n hu: {\n key: 'hu',\n locale: 'hu_HU',\n name: 'Magyar'\n },\n is: {\n key: 'is',\n locale: 'is_IS',\n name: 'Íslenska'\n },\n it: {\n key: 'it',\n locale: 'it_IT',\n name: 'Italiano'\n },\n ja: {\n key: 'ja',\n locale: 'ja_JP',\n name: '日本語'\n },\n ko: {\n key: 'ko',\n locale: 'ko_KR',\n name: '한국어'\n },\n lt: {\n key: 'lt',\n locale: 'lt_LT',\n name: 'Lietuvių'\n },\n lv: {\n key: 'lv',\n locale: 'lv_LV',\n name: 'Latviešu'\n },\n mk: {\n key: 'mk',\n locale: 'mk_MK',\n name: 'Македонски'\n },\n ms: {\n key: 'ms',\n locale: 'ms_MY',\n name: 'Bahasa Melayu'\n },\n nl: {\n key: 'nl',\n locale: 'nl_NL',\n name: 'Nederlands'\n },\n no: {\n key: 'no',\n locale: 'no_NO',\n name: 'Norsk'\n },\n pl: {\n key: 'pl',\n locale: 'pl_PL',\n name: 'Polski'\n },\n pt: {\n key: 'pt',\n locale: 'pt_BR',\n name: 'Português'\n },\n ro: {\n key: 'ro',\n locale: 'ro_RO',\n name: 'Română'\n },\n ru: {\n key: 'ru',\n locale: 'ru_RU',\n name: 'Русский'\n },\n sk: {\n key: 'sk',\n locale: 'sk_SK',\n name: 'Slovenský'\n },\n sl: {\n key: 'sl',\n locale: 'sl_SI',\n name: 'Slovenščina'\n },\n sr: {\n key: 'sr',\n locale: 'sr_RS',\n name: 'Српски'\n },\n sv: {\n key: 'sv',\n locale: 'sv_SE',\n name: 'Svenska'\n },\n th: {\n key: 'th',\n locale: 'th_TH',\n name: 'ภาษาไทย'\n },\n tr: {\n key: 'tr',\n locale: 'tr_TR',\n name: 'Türkçe'\n },\n uk: {\n key: 'uk',\n locale: 'uk_UA',\n name: 'Українська'\n },\n vi: {\n key: 'vi',\n locale: 'vi_VN',\n name: 'Tiếng Việt'\n },\n zh: {\n key: 'zh',\n locale: 'zh_CN',\n name: '简体中文'\n }\n};\n","/**\n * Handles the locale codes as the frontend\n *\n * @param {string} locale the locale code\n *\n * @return {string} the first part of the locale\n */\nconst normalize = (locale) => {\n locale = (locale && locale.split(/-|_/)[0]) || locale; // use only first part\n\n if (['nb', 'nn'].indexOf(locale) !== -1) {\n // fix Norwegian language code to conform with our non-standard stuff\n locale = 'no';\n }\n\n if (locale === 'iw') {\n // fix legacy Hebrew language code from our backend to conform with our frontend\n locale = 'he';\n }\n\n return locale;\n};\n\nexport default normalize;\n","/**\n * Fallbacks for all sdk commands\n */\nimport locales from './../../../model/locales';\nimport normalize from './../../utils/normalize';\n\nimport log from 'loglevel';\n\nconst userAgent = navigator.userAgent || navigator.vendor || window.opera || '';\nconst currentLanguage = normalize(window && window.navigator.language);\n\n// initialize Staffbase/platform namespace for ios frontend js code injection\n// in case of executeJs of app version 3.5 this object gets overwritten\nif (typeof window !== 'undefined') {\n window.Staffbase = window.Staffbase || {};\n window.Staffbase.platform = window.Staffbase.platform || {\n version: '3.4',\n mobile: /Android|webOS|iPhone|iPad|BlackBerry|BB10|IEMobile|Opera Mini/i.test(userAgent),\n native: false\n };\n}\n\n/**\n * Get the current Staffbase app version\n *\n * @return {String} version\n */\nexport const getVersion = () => {\n log.debug('fallback/getVersion');\n return window.Staffbase.platform.version;\n};\n\n/**\n * Are we running in a native app\n *\n * works only for ios or old initial native data\n * @return {Boolean}\n */\nexport const isNative = () => {\n log.debug('fallback/isNative');\n const safari = /safari/i.test(userAgent);\n return (\n window.Staffbase.platform.native === 'android' ||\n window.Staffbase.platform.native === 'ios' ||\n (!safari && isIos())\n );\n};\n\n/**\n * Are we running on a mobile device\n *\n * @return {Boolean}\n */\nexport const isMobile = () => {\n log.debug('fallback/isMobile');\n return window.Staffbase.platform.mobile;\n};\n\n/**\n * Are we running on a desktop device\n *\n * @return {Boolean}\n */\nexport const isDesktop = () => {\n log.debug('fallback/isDesktop');\n return /Win|Mac|Linux/i.test(userAgent);\n};\n\n/**\n * Are we running on android\n *\n * @return {Boolean}\n */\nexport const isAndroid = () => {\n log.debug('fallback/isAndroid');\n return window.Staffbase.platform.native === 'android' || /Android/i.test(userAgent);\n};\n\n/**\n * Are we running on ios\n *\n * @return {Boolean}\n */\nexport const isIos = () => {\n log.debug('fallback/isIos');\n return window.Staffbase.platform.native === 'ios' || /iPhone|iPad|iPod/i.test(userAgent);\n};\n\n/**\n * Open an external link\n *\n * @param {String} url address\n */\nexport const openLink = (url) => {\n log.debug('fallback/openLink');\n window.open(url, '_blank');\n};\n\n/**\n * Handler for unpossible functions\n *\n * @param {String} cmd command name\n */\nexport const unSupported = (cmd) => {\n log.debug('fallback/' + cmd);\n log.warn('Command is not possible in fallback mode.');\n // nothing we can do here\n return;\n};\n\n/**\n * Get extensive locale information.\n *\n * @return {Object} containing various language informations\n */\nexport const langInfos = () => {\n log.debug('fallback/langInfos');\n const branchDefaultLanguage = getBranchDefaultLanguage();\n\n return {\n contentLanguage: branchDefaultLanguage,\n branchLanguages: locales,\n branchDefaultLanguage: branchDefaultLanguage,\n deviceLanguage: branchDefaultLanguage,\n contentLanguages: locales\n };\n};\n\n/**\n * Get the default language object\n *\n * @return {Object} the language object\n */\nexport const getBranchDefaultLanguage = () => {\n log.debug('fallback/getBranchDefaultLanguage');\n\n return locales[currentLanguage] || locales.en;\n};\n\n/**\n * Gets the chosen language from a given content object\n *\n * @param {?object|array} content\n *\n * @return {string}\n */\nexport const getPreferredContentLocale = (content) => {\n log.debug('fallback/getPreferredContentLocale');\n const locale = getBranchDefaultLanguage().locale;\n\n if (!content) {\n return locale;\n }\n\n if (Array.isArray(content)) {\n const index = content.indexOf(locale);\n\n return content[index] || content[0];\n } else {\n const keys = Object.keys(content);\n const index = keys.indexOf(locale);\n\n return keys[index] || keys[0];\n }\n};\n","import { commands as action } from '../commands';\nimport * as fallbacks from './fallback-handlers';\nimport log from 'loglevel';\n\nlet connection = null;\nconst fallbackKickIn = 500;\n\n/**\n * Fake connection to the Staffbase App after a period of time.\n *\n * The fallback message handler will signal an established connection\n * after the time specified in fallbackKickIn runs out.\n * @return {Promise<function>} An appropriate send function\n */\nexport default () => {\n if (connection) {\n return connection;\n }\n\n connection = new Promise((resolve) => {\n setTimeout(function () {\n log.info('fallback/connect succeeded');\n resolve(sendMessage);\n }, fallbackKickIn);\n });\n\n return connection;\n};\n\n/**\n * Disconnect from the Staffbase App\n *\n * Only useful for tests.\n */\nexport const disconnect = () => {\n connection = null;\n};\n\n/**\n * Send a SDK command to the Staffbase App.\n *\n * Maps SDK commands to fallback handlers.\n * @param {String} cmd an SDK command\n * @param {any} payload for the command\n * @return {Promise<any>} which awaits the response of the Staffbase App\n * @throws {Error} on commands not supported by protocol\n */\nexport const sendMessage = async (cmd, ...payload) => {\n log.info('fallback/sendMessage ' + cmd);\n log.debug('fallback/sendMessage/payload ' + JSON.stringify(payload));\n\n switch (cmd) {\n case action.version:\n return fallbacks.getVersion();\n case action.native:\n return fallbacks.isNative();\n case action.mobile:\n return fallbacks.isMobile();\n case action.ios:\n return fallbacks.isIos();\n case action.android:\n return fallbacks.isAndroid();\n case action.openLink:\n return fallbacks.openLink.apply(null, payload);\n case action.langInfos:\n return fallbacks.langInfos();\n case action.branchDefaultLang:\n return fallbacks.getBranchDefaultLanguage();\n case action.prefContentLang:\n return fallbacks.getPreferredContentLocale.apply(null, payload);\n case action.nativeUpload:\n case action.nativeShare:\n return fallbacks.unSupported(cmd);\n default:\n // should actually never ever happen\n throw new Error('Command ' + cmd + ' not supported by driver');\n }\n};\n","import { commands } from '../commands';\n\n/**\n * Postmessage protocol (3.6)\n */\n\nexport default {\n HELLO: 'HELLO', // send this if ready to communicate\n SUCCESS: 'SUCCESS', // receive this after pluginLoaded was sent\n INVOCATION: 'INVOCATION', // send this to call a function in the frontend\n ERROR: 'ERROR' // receive this when something goes wrong\n};\n\nexport const invocationMapping = {\n [commands.openLink]: 'openLink',\n [commands.nativeUpload]: 'nativeFileUpload',\n [commands.nativeShare]: 'nativeShareDialog',\n [commands.langInfos]: 'getPluginLanguageInfo',\n [commands.prefContentLang]: 'getPreferredContentLocale'\n};\n","/**\n * Generates an unique id of 4 alpha numerical chars\n *\n * @return {string} unique id\n */\nconst genID = () => {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n};\n\nexport default genID;\n","import genID from './../utils/genId';\nimport log from 'loglevel';\n/**\n * @type {Object.<string, {resolve: function, reject: function, promise: Promise}>}\n */\nlet promiseMap = {};\n\n/**\n * Create an info object for a new promise in the map.\n *\n * @return {string} id of the promise\n */\nfunction createPromiseObject() {\n const id = genID();\n\n // When the id is already used, it invokes the function again\n if (id in promiseMap) return createPromiseObject();\n\n promiseMap[id] = { resolve: null, reject: null, promise: null };\n return id;\n}\n\n/**\n * Create a promise and return it's id.\n *\n * The id can be used to operate on the promise using other interface functions.\n *\n * @return {string} id of the promise\n */\nexport const create = () => {\n const id = createPromiseObject();\n\n const p = new Promise(function (resolve, reject) {\n promiseMap[id].resolve = resolve;\n promiseMap[id].reject = reject;\n });\n\n promiseMap[id].promise = p;\n log.debug('promiseManager/create ' + id);\n return id;\n};\n\n/**\n * Resolve a promise by id.\n *\n * @param {string} id of the promise\n * @param {any} msg the message which will will be passed to resolve\n *\n * @throws {Error} on unknown id\n */\nexport const resolve = (id, msg) => {\n log.debug('promiseManager/resolve ' + id);\n if (!(id in promiseMap)) throw new Error('Tried to resolve an unknown [' + id + '] promise.');\n\n promiseMap[id].resolve(msg);\n\n delete promiseMap[id];\n};\n\n/**\n * Reject a promise by id.\n *\n * @param {string} id of the promise\n * @param {any} err the error which will will be passed to reject\n * @throws {Error} on unknown id\n */\nexport const reject = (id, err) => {\n log.debug('promiseManager/reject ' + id);\n if (!(id in promiseMap)) throw new Error('Tried to reject an unknown [' + id + '] promise.');\n\n promiseMap[id].reject(err);\n delete promiseMap[id];\n};\n\n/**\n * Get a promise by id.\n *\n * @param {string} id of the promise\n * @return {Promise} the promise identified by id\n * @throws {Error} on unknown id\n */\nexport const get = (id) => {\n if (!(id in promiseMap)) throw new Error('Tried to get an unknown [' + id + '] promise.');\n\n return promiseMap[id].promise;\n};\n\n/**\n * Resets the state to the default\n */\nexport const unload = () => {\n promiseMap = {};\n};\n","import { commands as actions, reversedCommands as reversedActions } from '../commands.js';\nimport protocol, { invocationMapping } from './postmessage-protocol.js';\nimport {\n create as createPromise,\n resolve as resolvePromise,\n reject as rejectPromise,\n get as getPromise\n} from '../manager.js';\n\nimport log from 'loglevel';\n\n/**\n * @typedef {{ mobile: boolean, version: string|number, native: string }} PlatformInfos\n * @typedef {{ key: string, locale: string, name: string, localizedName: string }} BranchDefaultLanguage\n * @typedef { Object.<string, BranchDefaultLanguage> } BranchLanguage\n * @typedef {{ branchDefaultLanguage: BranchDefaultLanguage, branchLanguage: BranchLanguage, contentLanguage: BranchDefaultLanguage, contentLanguages: BranchLanguage, deviceLanguage: BranchDefaultLanguage }} LanguageInfos\n * @typedef {{ platform: PlatformInfos, language: LanguageInfos }} InitialValues\n *\n * @typedef {{ mobile: boolean, version: string|number, native: string, ios: boolean, android: boolean, langInfos: LanguageInfos, branchDefaultLanguage: BranchDefaultLanguage }} StaticValueStore\n */\n\n/**\n * Simple store solution to make the initial data available\n * as static values\n *\n * @param {InitialValues} initial the initial data from the frontend\n * @static\n * @return {StaticValueStore}\n */\nconst dataStore = ({ platform, language }) => ({\n mobile: platform.mobile,\n version: platform.version,\n native: !!platform.native,\n ios: platform.native === 'ios',\n android: platform.native === 'android',\n langInfos: language,\n branchDefaultLanguage: language.branchDefaultLanguage\n});\n\nlet connection = null;\nconst targetOrigin = '*';\n\n/**\n * Connect to the Staffbase App.\n *\n * Create a connection to a Staffbase app 3.6\n * @return {Promise<function>} An appropriate send function\n */\nconst connect = () => {\n if (connection) {\n return connection;\n }\n\n const connectId = createPromise();\n connection = getPromise(connectId).then(function (payload) {\n log.info('postMessage/connect succeeded');\n return sendMessage(dataStore(payload));\n });\n\n window.addEventListener('message', receiveMessage);\n window.parent.postMessage([protocol.HELLO, connectId, []], targetOrigin);\n\n return connection;\n};\n\nexport default connect;\n\n/**\n * Disconnect from the Staffbase App\n *\n * Only useful for tests.\n */\nexport const disconnect = () => {\n window.removeEventListener('message', receiveMessage);\n connection = null;\n};\n\n/**\n * Handler that receives a message from the Staffbase app\n *\n * Can be attached to window.onPostMessage\n * @param {MessageEvent} evt onPostMessage event result\n */\nconst receiveMessage = async (evt) => {\n log.info('postMessage/receiveMessage ' + evt);\n\n let type;\n let id;\n let payload;\n\n // safe destructure\n try {\n ({\n data: [type, id, payload]\n } = evt);\n } catch (e) {\n // even thought catch-ignore is a bad style\n // there may be other participants listening\n // to messages in a different format so we\n // silently ignore here\n return;\n }\n\n log.debug('postMessage/receiveMessage/payload ' + JSON.stringify([type, id, payload]));\n\n switch (type) {\n case protocol.SUCCESS:\n log.debug('postMessage/receiveMessage/success ' + JSON.stringify(id));\n resolvePromise(id, payload);\n break;\n case protocol.ERROR:\n log.debug('postMessage/receiveMessage/error ' + JSON.stringify(id));\n rejectPromise(id, payload);\n break;\n default:\n // even thought catch-ignore is a bad style\n // there may be other participants listening\n // to messages in a different format so we\n // silently ignore here\n return;\n }\n};\n\n/**\n * Send a SDK command to the Staffbase App.\n *\n * Translates SDK commands into protocol native commands.\n * @param {StaticValueStore} store the store object\n * @param {String} cmd an SDK command\n * @param {array} payload for the command\n * @return {Promise<any>} which awaits the response of the Staffbase App\n * @throws {Error} on commands not supported by protocol\n */\nconst sendMessage =\n (store) =>\n async (cmd, ...payload) => {\n log.info('postMessage/sendMessage ' + cmd);\n log.debug('postMessage/sendMessage/payload ' + JSON.stringify(payload));\n\n switch (cmd) {\n case actions.version:\n case actions.native:\n case actions.mobile:\n case actions.ios:\n case actions.android:\n case actions.branchDefaultLang:\n return store[reversedActions[cmd]];\n case actions.langInfos:\n case actions.openLink:\n case actions.nativeUpload:\n case actions.nativeShare:\n case actions.prefContentLang:\n return sendInvocationCall(createPromise())(invocationMapping[cmd], payload);\n default:\n throw new Error('Command ' + cmd + ' not supported by driver');\n }\n };\n\n/**\n * Create a promise and send an invocation call to the frontend\n *\n * @param {number} promiseID the id of the connection promise\n * @param {string} process the name of the process to call\n * @param {array} args an array of arguments\n *\n * @return {Promise}\n */\nconst sendInvocationCall = (promiseID) => (process, args) => {\n log.info('postMessage/sendInvocationCall ' + process);\n log.debug('postMessage/sendInvocationCall/payload ' + JSON.stringify(args));\n\n window.parent.postMessage([protocol.INVOCATION, promiseID, process, args], targetOrigin);\n\n return getPromise(promiseID);\n};\n","import { commands as actions, reversedCommands as reversedActions } from '../commands.js';\nimport protocol, { invocationMapping } from './postmessage-protocol.js';\nimport {\n create as createPromise,\n resolve as resolvePromise,\n reject as rejectPromise,\n get as getPromise\n} from '../manager.js';\n\nimport log from 'loglevel';\n\nlet connection = null;\nlet outMsgQueue = [];\n\n/**\n * Simple store solution to make the initial data available\n * as static values\n *\n * @param {InitialValues} initial the initial data from the frontend\n * @static\n * @return {StaticValueStore}\n */\nconst dataStore = ({ platform, language }) => ({\n mobile: platform.mobile,\n version: platform.version,\n native: platform.native,\n ios: platform.native === 'ios',\n android: platform.native === 'android',\n langInfos: language,\n branchDefaultLang: language.branchDefaultLanguage\n});\n\nwindow.Staffbase = window.Staffbase || {};\nwindow.Staffbase.plugins = {\n getMessages: multiMessageProvider,\n putMessage: singleMessageReceiver\n};\n\n/**\n * Connect to the Staffbase App.\n *\n * Create a connection to a Staffbase app 3.6 from a native tab\n * @return {Promise<function>} An appropriate send function\n */\nconst connect = () => {\n if (connection) {\n return connection;\n }\n\n log.info('putMessage/connect start');\n const connectId = createPromise();\n connection = getPromise(connectId).then(function (payload) {\n log.info('putMessage/connect succeeded');\n return sendMessage(dataStore(payload));\n });\n\n outMsgQueue.push([protocol.HELLO, connectId, []]);\n\n return connection;\n};\n\nexport default connect;\n\n/**\n * A function which returns an array of messages\n *\n * The return value holds all messages in the order the were\n * received over time by sendMessage\n *\n * @return {Array} ordered list of messages\n */\nfunction multiMessageProvider() {\n const queueRef = outMsgQueue;\n if (queueRef.length) {\n log.debug('putMessage/multiMessageProvider/queue', queueRef);\n }\n outMsgQueue = [];\n return queueRef;\n}\n\n/**\n * A function which can receive a single message.\n *\n * Can be attached to window.onPostMessage\n * @param {Array} msg Staffbase 3.6 message\n */\nfunction singleMessageReceiver(msg) {\n log.info('putMessage/singleMessageReceiver ' + JSON.stringify(msg));\n\n let type;\n let id;\n let payload;\n\n // safe destructure\n try {\n [type, id, payload] = msg;\n\n switch (type) {\n case protocol.SUCCESS:\n log.debug('putMessage/singleMessageReceiver/success ' + id);\n resolvePromise(id, payload);\n break;\n case protocol.ERROR:\n log.debug('putMessage/singleMessageReceiver/error ' + id);\n rejectPromise(id, payload);\n break;\n default:\n // even thought catch-ignore is a bad style\n // there may be other participants listening\n // to messages in a different format so we\n // silently ignore here\n return;\n }\n } catch (e) {\n // even thought catch-ignore is a bad style\n // there may be other participants listening\n // to messages in a different format so we\n // silently ignore here\n return;\n }\n}\n\n/**\n * Disconnect from the Staffbase App\n *\n * Only useful for tests.\n */\nexport const disconnect = () => {\n connection = null;\n outMsgQueue = [];\n};\n\n/**\n * Send a SDK command to the Staffbase App.\n *\n * Translates SDK commands into protocol native commands.\n * @param {StaticValueStore} store the store object\n * @param {String} cmd an SDK command\n * @param {array} payload for the command\n * @return {Promise<any>} which awaits the response of the Staffbase App\n * @throws {Error} on commands not supported by protocol\n */\nconst sendMessage =\n (store) =>\n async (cmd, ...payload) => {\n log.info('putMessage/sendMessage ' + cmd);\n log.debug('putMessage/sendMessage/payload ' + JSON.stringify(payload));\n switch (cmd) {\n case actions.version:\n case actions.native:\n case actions.mobile:\n case actions.ios:\n case actions.android:\n case actions.langInfos:\n case actions.branchDefaultLang:\n return store[reversedActions[cmd]];\n case actions.openLink:\n case actions.prefContentLang:\n return sendInvocationCall(invocationMapping[cmd], payload);\n default:\n throw new Error('Command ' + cmd + ' not supported by driver');\n }\n };\n\n/**\n * Create a promise and send an invocation call to the frontend\n *\n * @param {string} process the name of the process to call\n * @param {array} args an array of arguments\n *\n * @return {Promise}\n */\nconst sendInvocationCall = (process, args) => {\n log.info('putMessage/sendInvocationCall ' + process);\n log.debug('putMessage/sendInvocationCall/payload: ' + JSON.stringify(args));\n\n const promiseID = createPromise();\n\n log.debug('putMessage/sendInvocationCall/queue/before ' + JSON.stringify(outMsgQueue));\n outMsgQueue.push([protocol.INVOCATION, promiseID, process, args]);\n log.debug('putMessage/sendInvocationCall/queue/after ' + JSON.stringify(outMsgQueue));\n\n return getPromise(promiseID);\n};\n","import fallback, { disconnect as fallbackDisconnect } from './connector/fallback.js';\nimport postMessage, { disconnect as postMessageDisconnect } from './connector/postmessage.js';\nimport putMessage, { disconnect as putMessageDisconnect } from './connector/putMessage.js';\nimport { unload as unloadManager } from './manager';\nimport log from 'loglevel';\n\nlet connector;\n\nconst connect = async () => {\n const putMessageConnection = putMessage();\n const postMessageConnection = postMessage();\n const fallbackConnection = fallback();\n\n const realConnectionBucket = [putMessageConnection, postMessageConnection];\n const fallbackConnectionBucket = realConnectionBucket.concat(fallbackConnection);\n\n // Wait on the real communication and replace the connector with\n Promise.race(realConnectionBucket).then((newConnector) => {\n log.debug('connection/replace connector ' + newConnector.toString());\n connector = newConnector;\n });\n\n return await Promise.race(fallbackConnectionBucket);\n};\n\nexport const disconnect = () => {\n postMessageDisconnect();\n putMessageDisconnect();\n fallbackDisconnect();\n unloadManager();\n connector = null;\n};\n\n/**\n * Send a message to the App\n *\n * Will reuse the determined connector\n * to send a message to the Staffbase App\n *\n * @param {any} msg message to send to Staffbase App\n * @param {any} payload that will be attached to the message\n * @return {Promise<any>} result of the request\n */\nconst sendMessage = async (msg, ...payload) => {\n log.info('connection/sendMessage ' + msg);\n log.debug('connection/sendMessage/payload ' + JSON.stringify(payload));\n\n if (!connector) {\n connector = connect();\n }\n\n const sendFn = await connector;\n return sendFn(msg, ...payload);\n};\n\nexport default sendMessage;\n","import cmd from './connection/commands';\nimport sendMessage from './connection/connection';\nimport log from 'loglevel';\n\n/**\n * Get the version of the Staffbase App.\n *\n * @return {Promise<string>}\n */\nexport const getVersion = async () => {\n log.debug('app/getVersion');\n return sendMessage(cmd.version);\n};\n\n/**\n * Check if app is native.\n *\n * @return {Promise<boolean>}\n */\nexport const isNative = async () => {\n log.debug('app/isNative');\n return sendMessage(cmd.native);\n};\n\n/**\n * Check if app is mobile.\n *\n * @return {Promise<boolean>}\n */\nexport const isMobile = async () => {\n log.debug('app/isMobile');\n return sendMessage(cmd.mobile);\n};\n\n/**\n * Open a link through the app.\n *\n * Where Staffbase decides which browser (External/Internal)\n * should be used.\n *\n * @param {string} url the url to open in the browser\n *\n * @return {Promise<any>}\n */\nexport const openLink = async (url) => {\n log.debug('app/openLink');\n return sendMessage(cmd.openLink, url);\n};\n\n/**\n * Open a link explicitly in the external browser.\n *\n * @param {string} url the url to open in the browser\n *\n * @return {Promise<any>}\n */\nexport const openLinkExternal = async (url) => {\n log.debug('app/openLinkExternal');\n return sendMessage(cmd.openLink, url, { inAppBrowser: false });\n};\n\n/**\n * Open a link explicitly in the internal browser.\n *\n * @param {string} url the url to open in the browser\n *\n * @return {Promise<any>}\n */\nexport const openLinkInternal = async (url) => {\n log.debug('app/openLinkInternal');\n return sendMessage(cmd.openLink, url, { inAppBrowser: true });\n};\n\n/**\n * Open a native file upload dialog on device which do not support it by default.\n *\n * Works only for android now\n *\n * @return {Promise<any>}\n */\nexport const openNativeFileDialog = async () => {\n log.debug('app/openNativeFileDialog');\n return sendMessage(cmd.nativeUpload);\n};\n\n/**\n * Open a share dialog on native devices\n *\n * @example\n * openNativeShareDialog({\n * image: \"https://example.com/test.png\",\n * subject: \"The string you would like to use as a subject for the share\",\n * text: \"This text is shared\",\n * url: \"https://example.com\"\n * })\n *\n * @param {object} content the content to share\n *\n * @return {Promise<string>}\n */\nexport const openNativeShareDialog = async (content) => {\n log.debug('app/openNativeShareDialog');\n return sendMessage(cmd.nativeShare, content);\n};\n\n/**\n * Get the content languages configured for the branch.\n *\n * @return {Promise<Object>}\n */\nexport const getBranchLanguages = async () => {\n log.debug('app/getContentLanguages');\n return sendMessage(cmd.langInfos).then((res) => res.branchLanguages);\n};\n\n/**\n * Get the default content language configured for the branch.\n *\n * @return {Promise<Object>}\n */\nexport const getBranchDefaultLanguage = async () => {\n log.debug('app/getBranchDefaultLanguage');\n return sendMessage(cmd.langInfos).then((res) => res.branchDefaultLanguage);\n};\n\n/**\n * Get all content languages supported by the Staffbase app.\n *\n * @return {Promise<Object>}\n */\nexport const getContentLanguages = async () => {\n log.debug('app/getContentLanguages');\n return sendMessage(cmd.langInfos).then((res) => res.contentLanguages);\n};\n\n/**\n * Gets the chosen language from a given content object\n *\n * @example\n * getPreferredContentLocale(['de_DE', 'en_EN']) // => 'de_DE'\n * getPreferredContentLocale({'de_DE': {1,'eins'}, 'en_EN': {1: 'one'}}) // => 'de_DE'\n *\n * @param {object|array} content the content to choose the locale from\n *\n * @return {Promise<string>}\n */\nexport const getPreferredContentLocale = async (content) => {\n log.debug('app/getPreferredContentLocale');\n return sendMessage(cmd.prefContentLang, content);\n};\n","export default function compareVersions(v1, v2) {\n // validate input and split into segments\n const n1 = validateAndParse(v1);\n const n2 = validateAndParse(v2);\n\n // pop off the patch\n const p1 = n1.pop();\n const p2 = n2.pop();\n\n // validate numbers\n const r = compareSegments(n1, n2);\n if (r !== 0) return r;\n\n // validate pre-release\n if (p1 && p2) {\n return compareSegments(p1.split('.'), p2.split('.'));\n } else if (p1 || p2) {\n return p1 ? -1 : 1;\n }\n\n return 0;\n}\n\nexport const validate = (v) =>\n typeof v === 'string' && /^[v\\d]/.test(v) && semver.test(v);\n\nexport const compare = (v1, v2, operator) => {\n // validate input operator\n assertValidOperator(operator);\n\n // since result of compareVersions can only be -1 or 0 or 1\n // a simple map can be used to replace switch\n const res = compareVersions(v1, v2);\n\n return operatorResMap[operator].includes(res);\n};\n\nexport const satisfies = (v, r) => {\n // if no range operator then \"=\"\n const m = r.match(/^([<>=~^]+)/);\n const op = m ? m[1] : '=';\n\n // if gt/lt/eq then operator compare\n if (op !== '^' && op !== '~') return compare(v, r, op);\n\n // else range of either \"~\" or \"^\" is assumed\n const [v1, v2, v3] = validateAndParse(v);\n const [r1, r2, r3] = validateAndParse(r);\n if (compareStrings(v1, r1) !== 0) return false;\n if (op === '^') {\n return compareSegments([v2, v3], [r2, r3]) >= 0;\n }\n if (compareStrings(v2, r2) !== 0) return false;\n return compareStrings(v3, r3) >= 0;\n};\n\n// export CJS style for parity\ncompareVersions.validate = validate;\ncompareVersions.compare = compare;\ncompareVersions.sastisfies = satisfies;\n\nconst semver =\n /^[v^~<>=]*?(\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+))?(?:-([\\da-z\\-]+(?:\\.[\\da-z\\-]+)*))?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\n\nconst validateAndParse = (v) => {\n if (typeof v !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n const match = v.match(semver);\n if (!match) {\n throw new Error(`Invalid argument not valid semver ('${v}' received)`);\n }\n match.shift();\n return match;\n};\n\nconst isWildcard = (s) => s === '*' || s === 'x' || s === 'X';\n\nconst tryParse = (v) => {\n const n = parseInt(v, 10);\n return isNaN(n) ? v : n;\n};\n\nconst forceType = (a, b) =>\n typeof a !== typeof b ? [String(a), String(b)] : [a, b];\n\nconst compareStrings = (a, b) => {\n if (isWildcard(a) || isWildcard(b)) return 0;\n const [ap, bp] = forceType(tryParse(a), tryParse(b));\n if (ap > bp) return 1;\n if (ap < bp) return -1;\n return 0;\n};\n\nconst compareSegments = (a, b) => {\n for (let i = 0; i < Math.max(a.length, b.length); i++) {\n const r = compareStrings(a[i] || 0, b[i] || 0);\n if (r !== 0) return r;\n }\n return 0;\n};\n\nconst operatorResMap = {\n '>': [1],\n '>=': [0, 1],\n '=': [0],\n '<=': [-1, 0],\n '<': [-1],\n};\n\nconst allowedOperators = Object.keys(operatorResMap);\n\nconst assertValidOperator = (op) => {\n if (typeof op !== 'string') {\n throw new TypeError(\n `Invalid operator type, expected string but got ${typeof op}`\n );\n }\n if (allowedOperators.indexOf(op) === -1) {\n throw new Error(\n `Invalid operator, expected one of ${allowedOperators.join('|')}`\n );\n }\n};\n","/* eslint-disable no-unused-vars */\nimport cmd from './connection/commands';\nimport sendMessage from './connection/connection';\nimport { isNative, getVersion } from './app';\nimport compareVersions from 'compare-versions';\nimport log from 'loglevel';\n/**\n * Check if device is using ios.\n *\n * @return {Promise<boolean>}\n */\nexport const isIos = async () => {\n log.debug('device/isIos');\n return sendMessage(cmd.ios);\n};\n\n/**\n * Check if device is using android.\n *\n * @return {Promise<boolean>}\n */\nexport const isAndroid = async () => {\n log.debug('device/isAndroid');\n return sendMessage(cmd.android);\n};\n\n/**\n * Check if device is able to perform a download.\n *\n * @return {Promise<boolean>}\n */\nexport const canDownload = async () => {\n log.debug('device/canDownload');\n let [native, version, ios] = await Promise.all([isNative(), getVersion(), isIos()]);\n\n // support any development versions like X.Y-dev for compare versions\n const dashIndex = version.indexOf('-');\n version = version.substring(0, dashIndex != -1 ? dashIndex : version.length);\n\n // mobile ios devices can not download with an app version less than 3.5\n // but apps below 3.5 don't have the platform information from the frontend available\n // so we disable download for all native ios devices under these conditions\n return !(compareVersions(version, '3.5') < 0 && native && ios);\n};\n","/**\n * Interface exports\n */\n\n/**\n * @ignore\n */\nimport log from 'loglevel';\nlog.enableAll(); /* experimental */\n\nimport * as device from './lib/device';\nimport * as app from './lib/app';\n\n/**\n * Check if device is able to perform a download.\n * @function\n * @return {Promise<boolean>}\n */\nexport const deviceCanDownload = async () => device.canDownload();\n\n/**\n * Check if device is using ios.\n * @function\n * @return {Promise<boolean>}\n */\nexport const isIosDevice = async () => device.isIos();\n\n/**\n * Check if device is using android.\n * @function\n * @return {Promise<boolean>}\n */\nexport const isAndroidDevice = async () => device.isAndroid();\n\n/**\n * Get the version of the Staffbase App.\n * @function\n * @return {Promise<string>}\n */\nexport const getAppVersion = async () => app.getVersion();\n\n/**\n * Check if app is native.\n * @function\n * @return {Promise<boolean>}\n */\nexport const isNativeApp = async () => app.isNative();\n\n/**\n * Check if app is mobile.\n * @function\n * @return {Promise<boolean>}\n */\nexport const isMobileApp = async () => app.isMobile();\n\n/**\n * Open a link through the app.\n *\n * Where Staffbase decides which browser (External/Internal)\n * should be used.\n *\n * @param {string} url the url to open in the browser\n * @function\n * @return {Promise<any>}\n */\nexport const openLink = async (url) => app.openLink(url);\n\n/**\n * Open a link explicitly in the external browser.\n *\n * @param {string} url the url to open in the browser\n * @function\n * @return {Promise<any>}\n */\nexport const openLinkExternal = async (url) => app.openLinkExternal(url);\n\n/**\n * Open a link explicitly in the internal browser.\n *\n * @param {string} url the url to open in the browser\n * @function\n * @return {Promise<any>}\n */\nexport const openLinkInternal = async (url) => app.openLinkInternal(url);\n\n/**\n * Get all enabled content languages configured in the app.\n * @function\n * @return {Promise<any>}\n */\nexport const getBranchLanguages = async () => app.getBranchLanguages();\n\n/**\n * Get the default content language configured in the app.\n * @function\n * @return {Promise<any>}\n */\nexport const getBranchDefaultLanguage = async () => app.getBranchDefaultLanguage();\n\n/**\n * Get all content languages supported by the app.\n * @function\n * @return {Promise<any>}\n */\nexport const getContentLanguages = async () => app.getContentLanguages();\n\n/**\n * Gets the chosen language from a given content object\n *\n * @example\n * getPreferredContentLocale(['de_DE', 'en_EN']) // => 'de_DE'\n * getPreferredContentLocale({'de_DE': {1,'eins'}, 'en_EN': {1: 'one'}}) // => 'de_DE'\n *\n * @param {object|array} content the content to choose the locale from\n * @function\n * @return {Promise<string>}\n */\nexport const getPreferredContentLocale = async (content) => app.getPreferredContentLocale(content);\n\n/**\n * Open a share dialog on native devices\n *\n * @example\n * openNativeShareDialog({\n * image: \"https://example.com/test.png\",\n * subject: \"The string you would like to use as a subject for the share\",\n * text: \"This text is shared\",\n * url: \"https://example.com\"\n * })\n *\n * @param {object} content the content to share\n *\n * @return {Promise<string>}\n */\nexport const openNativeShareDialog = async (content) => app.openNativeShareDialog(content);\n\n/** @inheritdoc */\nexport { openNativeFileDialog } from './lib/app'; /* experimental */\n"],"names":["has","obj","prop","Object","prototype","hasOwnProperty","call","isEnumerable","propertyIsEnumerable","entries","TypeError","pairs","key","push","entries_1","object_entriesPonyfill","require$$0","reverse","reduce","acc","k","p","commands","ios","android","version","mobile","native","openLink","nativeUpload","nativeShare","langInfos","branchDefaultLang","prefContentLang","reversedCommands","ar","locale","name","bg","bn","cs","da","de","el","en","es","et","fi","fr","he","hi","hr","hu","is","it","ja","ko","lt","lv","mk","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh","normalize","split","indexOf","HELLO","SUCCESS","INVOCATION","ERROR","invocationMapping","genID","Math","floor","random","toString","substring","window","compareVersions","v1","v2","n1","validateAndParse","n2","p1","pop","p2","r","compareSegments","validate","v","test","semver","compare","operator","assertValidOperator","res","operatorResMap","includes","satisfies","m","match","op","v3","r1","r2","r3","compareStrings","sastisfies","Error","shift","isWildcard","s","tryParse","n","parseInt","isNaN","forceType","a","b","String","ap","bp","i","max","length","allowedOperators","keys","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,UADO,uCAE3BN,QAAQ,CAACO,YAFkB,EAEH,kBAFG,uCAG3BP,QAAQ,CAACQ,WAHkB,EAGJ,mBAHI,uCAI3BR,QAAQ,CAACS,SAJkB,EAIN,uBAJM,uCAK3BT,QAAQ,CAACW,eALkB,EAKA,2BALA,sBAAvB;;ACbP;AACA;AACA;AACA;AACA;AACA,IAAMmD,KAAK,GAAG,SAARA,KAAQ,GAAM;AAClB,SAAOC,IAAI,CAACC,KAAL,CAAW,CAAC,IAAID,IAAI,CAACE,MAAL,EAAL,IAAsB,OAAjC,EACJC,QADI,CACK,EADL,EAEJC,SAFI,CAEM,CAFN,CAAP;AAGD,CAJD;;ACHA;AACA;AACA;;AACA,mBAAA;AAEA;AACA;AACA;AACA;AACA;;AACA,4BAAA;;;;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;;;;;;;;;;;;CAAA;;AAUA,uBAAA;AACA,sBAAA;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA;;;;;;;;;;;;CAAA;AA6BA;AACA;AACA;AACA;AACA;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;;AArIA,yBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqIA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;;;;;CAAA;;AC5JA,qBAAA;AACA,oBAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;;;;;;;;;;;;CAAA;;AAUAC,gBAAA,yBAAA;AACAA,gBAAA,QAAA;;;CAAA;AAKA;AACA;AACA;AACA;AACA;AACA;;AACA;;;;;;;;;;;CAAA;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,6BAAA;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;;;AACA,8BAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;;AA9IA,yBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8IA;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;;;;CAAA;;ACtKA,aAAA;;AAEA;;;;;;;;;;;;;;CAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AA3CA,uBAAA;;;;;;;;;AAAA;;;;;;;;OAAA;;;;;CA2CA;;ACvCA;AACA;AACA;AACA;AACA;;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjJe,SAASC,eAAT,CAAyBC,EAAzB,EAA6BC,EAA7B,EAAiC;AAC9C;AACA,QAAMC,EAAE,GAAGC,gBAAgB,CAACH,EAAD,CAA3B;AACA,Q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