@elastic/ems-client 8.4.0 → 8.4.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,14 +1,14 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
6
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
7
7
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
9
- 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; }
10
- function _objectSpread(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(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; }
11
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 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) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(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; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(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 ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
12
12
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
13
13
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
14
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -37,17 +37,6 @@ import { colorizeColor } from './utils';
37
37
  export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
38
38
  _inherits(TMSService, _AbstractEmsService);
39
39
  var _super = _createSuper(TMSService);
40
- /*
41
- List of supported languages with labels and OMT codes extracted
42
- from https://openmaptiles.org/languages
43
- Keys are values for i18.locale from Kibana settings
44
- and OMT codes for the rest.
45
- */
46
-
47
- /*
48
- Suggested default operations for the different EMS styles
49
- */
50
-
51
40
  function TMSService(config, emsClient, proxyPath) {
52
41
  var _this;
53
42
  _classCallCheck(this, TMSService);
@@ -56,134 +45,128 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
56
45
  _defineProperty(_assertThisInitialized(_this), "_getRasterStyleJson", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
57
46
  var rasterUrl, url;
58
47
  return _regeneratorRuntime().wrap(function _callee$(_context) {
59
- while (1) {
60
- switch (_context.prev = _context.next) {
61
- case 0:
62
- rasterUrl = _this._getStyleUrlForLocale('raster');
63
- if (!rasterUrl) {
64
- _context.next = 6;
65
- break;
66
- }
67
- url = _this._proxyPath + _this._getAbsoluteUrl(rasterUrl);
68
- return _context.abrupt("return", _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url)));
69
- case 6:
70
- return _context.abrupt("return");
71
- case 7:
72
- case "end":
73
- return _context.stop();
74
- }
48
+ while (1) switch (_context.prev = _context.next) {
49
+ case 0:
50
+ rasterUrl = _this._getStyleUrlForLocale('raster');
51
+ if (!rasterUrl) {
52
+ _context.next = 6;
53
+ break;
54
+ }
55
+ url = _this._proxyPath + _this._getAbsoluteUrl(rasterUrl);
56
+ return _context.abrupt("return", _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url)));
57
+ case 6:
58
+ return _context.abrupt("return");
59
+ case 7:
60
+ case "end":
61
+ return _context.stop();
75
62
  }
76
63
  }, _callee);
77
64
  }))));
78
65
  _defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonRaw", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
79
66
  var vectorUrl, url, vectorJson;
80
67
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
81
- while (1) {
82
- switch (_context2.prev = _context2.next) {
83
- case 0:
84
- vectorUrl = _this._getStyleUrlForLocale('vector');
85
- if (!vectorUrl) {
86
- _context2.next = 9;
87
- break;
88
- }
89
- url = _this._proxyPath + _this._getAbsoluteUrl(vectorUrl);
90
- _context2.next = 5;
91
- return _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url));
92
- case 5:
93
- vectorJson = _context2.sent;
94
- return _context2.abrupt("return", _objectSpread({}, vectorJson));
95
- case 9:
96
- return _context2.abrupt("return");
97
- case 10:
98
- case "end":
99
- return _context2.stop();
100
- }
68
+ while (1) switch (_context2.prev = _context2.next) {
69
+ case 0:
70
+ vectorUrl = _this._getStyleUrlForLocale('vector');
71
+ if (!vectorUrl) {
72
+ _context2.next = 9;
73
+ break;
74
+ }
75
+ url = _this._proxyPath + _this._getAbsoluteUrl(vectorUrl);
76
+ _context2.next = 5;
77
+ return _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url));
78
+ case 5:
79
+ vectorJson = _context2.sent;
80
+ return _context2.abrupt("return", _objectSpread({}, vectorJson));
81
+ case 9:
82
+ return _context2.abrupt("return");
83
+ case 10:
84
+ case "end":
85
+ return _context2.stop();
101
86
  }
102
87
  }, _callee2);
103
88
  }))));
104
89
  _defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
105
90
  var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, _sourceJson$tiles, sourceUrl, extendedUrl, sourceJson, tiles;
106
91
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
107
- while (1) {
108
- switch (_context3.prev = _context3.next) {
109
- case 0:
110
- _context3.next = 2;
111
- return _this._getVectorStyleJsonRaw();
112
- case 2:
113
- vectorJson = _context3.sent;
114
- if (!vectorJson) {
115
- _context3.next = 44;
116
- break;
117
- }
118
- inlinedSources = {};
119
- sources = vectorJson.sources;
120
- _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
121
- _context3.prev = 7;
122
- _iterator.s();
123
- case 9:
124
- if ((_step = _iterator.n()).done) {
125
- _context3.next = 22;
126
- break;
127
- }
128
- _sourceName = _step.value;
129
- url = sources[_sourceName].url;
130
- if (!url) {
131
- _context3.next = 20;
132
- break;
133
- }
134
- sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
135
- extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
136
- _context3.next = 17;
137
- return _this._emsClient.getManifest(extendedUrl);
138
- case 17:
139
- sourceJson = _context3.sent;
140
- tiles = sourceJson === null || sourceJson === void 0 ? void 0 : (_sourceJson$tiles = sourceJson.tiles) === null || _sourceJson$tiles === void 0 ? void 0 : _sourceJson$tiles.map(function (tileUrl) {
141
- var directUrl = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
142
- return _this._emsClient.extendUrlWithParams(directUrl);
143
- });
144
- inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
145
- type: 'vector',
146
- tiles: tiles
147
- });
148
- case 20:
149
- _context3.next = 9;
92
+ while (1) switch (_context3.prev = _context3.next) {
93
+ case 0:
94
+ _context3.next = 2;
95
+ return _this._getVectorStyleJsonRaw();
96
+ case 2:
97
+ vectorJson = _context3.sent;
98
+ if (!vectorJson) {
99
+ _context3.next = 44;
150
100
  break;
151
- case 22:
152
- _context3.next = 27;
101
+ }
102
+ inlinedSources = {};
103
+ sources = vectorJson.sources;
104
+ _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
105
+ _context3.prev = 7;
106
+ _iterator.s();
107
+ case 9:
108
+ if ((_step = _iterator.n()).done) {
109
+ _context3.next = 22;
153
110
  break;
154
- case 24:
155
- _context3.prev = 24;
156
- _context3.t0 = _context3["catch"](7);
157
- _iterator.e(_context3.t0);
158
- case 27:
159
- _context3.prev = 27;
160
- _iterator.f();
161
- return _context3.finish(27);
162
- case 30:
163
- _context3.t1 = _objectSpread;
164
- _context3.t2 = _objectSpread({}, vectorJson);
165
- _context3.t3 = {};
166
- _context3.t4 = inlinedSources;
167
- _context3.next = 36;
168
- return _this._getSpriteSheetRootPath();
169
- case 36:
170
- _context3.t5 = _context3.sent;
171
- _context3.next = 39;
172
- return _this._getUrlTemplateForGlyphs();
173
- case 39:
174
- _context3.t6 = _context3.sent;
175
- _context3.t7 = {
176
- sources: _context3.t4,
177
- sprite: _context3.t5,
178
- glyphs: _context3.t6
179
- };
180
- return _context3.abrupt("return", (0, _context3.t1)(_context3.t2, _context3.t3, _context3.t7));
181
- case 44:
182
- return _context3.abrupt("return");
183
- case 45:
184
- case "end":
185
- return _context3.stop();
186
- }
111
+ }
112
+ _sourceName = _step.value;
113
+ url = sources[_sourceName].url;
114
+ if (!url) {
115
+ _context3.next = 20;
116
+ break;
117
+ }
118
+ sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
119
+ extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
120
+ _context3.next = 17;
121
+ return _this._emsClient.getManifest(extendedUrl);
122
+ case 17:
123
+ sourceJson = _context3.sent;
124
+ tiles = sourceJson === null || sourceJson === void 0 || (_sourceJson$tiles = sourceJson.tiles) === null || _sourceJson$tiles === void 0 ? void 0 : _sourceJson$tiles.map(function (tileUrl) {
125
+ var directUrl = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
126
+ return _this._emsClient.extendUrlWithParams(directUrl);
127
+ });
128
+ inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
129
+ type: 'vector',
130
+ tiles: tiles
131
+ });
132
+ case 20:
133
+ _context3.next = 9;
134
+ break;
135
+ case 22:
136
+ _context3.next = 27;
137
+ break;
138
+ case 24:
139
+ _context3.prev = 24;
140
+ _context3.t0 = _context3["catch"](7);
141
+ _iterator.e(_context3.t0);
142
+ case 27:
143
+ _context3.prev = 27;
144
+ _iterator.f();
145
+ return _context3.finish(27);
146
+ case 30:
147
+ _context3.t1 = _objectSpread;
148
+ _context3.t2 = _objectSpread({}, vectorJson);
149
+ _context3.t3 = {};
150
+ _context3.t4 = inlinedSources;
151
+ _context3.next = 36;
152
+ return _this._getSpriteSheetRootPath();
153
+ case 36:
154
+ _context3.t5 = _context3.sent;
155
+ _context3.next = 39;
156
+ return _this._getUrlTemplateForGlyphs();
157
+ case 39:
158
+ _context3.t6 = _context3.sent;
159
+ _context3.t7 = {
160
+ sources: _context3.t4,
161
+ sprite: _context3.t5,
162
+ glyphs: _context3.t6
163
+ };
164
+ return _context3.abrupt("return", (0, _context3.t1)(_context3.t2, _context3.t3, _context3.t7));
165
+ case 44:
166
+ return _context3.abrupt("return");
167
+ case 45:
168
+ case "end":
169
+ return _context3.stop();
187
170
  }
188
171
  }, _callee3, null, [[7, 24, 27, 30]]);
189
172
  }))));
@@ -202,29 +185,27 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
202
185
  var _this2 = this;
203
186
  var tileJson, tiles;
204
187
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
205
- while (1) {
206
- switch (_context4.prev = _context4.next) {
207
- case 0:
208
- _context4.next = 2;
209
- return this._getRasterStyleJson();
210
- case 2:
211
- tileJson = _context4.sent;
212
- if (!tileJson) {
213
- _context4.next = 8;
214
- break;
215
- }
216
- tiles = tileJson.tiles.map(function (tile) {
217
- return _this2._proxyPath + _this2._getAbsoluteUrl(tile);
218
- });
219
- return _context4.abrupt("return", _objectSpread(_objectSpread({}, tileJson), {
220
- tiles: tiles
221
- }));
222
- case 8:
223
- return _context4.abrupt("return");
224
- case 9:
225
- case "end":
226
- return _context4.stop();
227
- }
188
+ while (1) switch (_context4.prev = _context4.next) {
189
+ case 0:
190
+ _context4.next = 2;
191
+ return this._getRasterStyleJson();
192
+ case 2:
193
+ tileJson = _context4.sent;
194
+ if (!tileJson) {
195
+ _context4.next = 8;
196
+ break;
197
+ }
198
+ tiles = tileJson.tiles.map(function (tile) {
199
+ return _this2._proxyPath + _this2._getAbsoluteUrl(tile);
200
+ });
201
+ return _context4.abrupt("return", _objectSpread(_objectSpread({}, tileJson), {
202
+ tiles: tiles
203
+ }));
204
+ case 8:
205
+ return _context4.abrupt("return");
206
+ case 9:
207
+ case "end":
208
+ return _context4.stop();
228
209
  }
229
210
  }, _callee4, this);
230
211
  }));
@@ -239,25 +220,23 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
239
220
  var _getUrlTemplate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
240
221
  var tileJson, directUrl;
241
222
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
242
- while (1) {
243
- switch (_context5.prev = _context5.next) {
244
- case 0:
245
- _context5.next = 2;
246
- return this._getRasterStyleJson();
247
- case 2:
248
- tileJson = _context5.sent;
249
- if (!tileJson) {
250
- _context5.next = 8;
251
- break;
252
- }
253
- directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
254
- return _context5.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
255
- case 8:
256
- return _context5.abrupt("return", '');
257
- case 9:
258
- case "end":
259
- return _context5.stop();
260
- }
223
+ while (1) switch (_context5.prev = _context5.next) {
224
+ case 0:
225
+ _context5.next = 2;
226
+ return this._getRasterStyleJson();
227
+ case 2:
228
+ tileJson = _context5.sent;
229
+ if (!tileJson) {
230
+ _context5.next = 8;
231
+ break;
232
+ }
233
+ directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
234
+ return _context5.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
235
+ case 8:
236
+ return _context5.abrupt("return", '');
237
+ case 9:
238
+ case "end":
239
+ return _context5.stop();
261
240
  }
262
241
  }, _callee5, this);
263
242
  }));
@@ -270,29 +249,27 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
270
249
  key: "getUrlTemplateForVector",
271
250
  value: function () {
272
251
  var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sourceId) {
273
- var _tileJson$sources$sou, _tileJson$sources$sou2;
252
+ var _tileJson$sources$sou;
274
253
  var tileJson, url, directUrl;
275
254
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
276
- while (1) {
277
- switch (_context6.prev = _context6.next) {
278
- case 0:
279
- _context6.next = 2;
280
- return this._getVectorStyleJsonInlined();
281
- case 2:
282
- tileJson = _context6.sent;
283
- url = tileJson === null || tileJson === void 0 ? void 0 : (_tileJson$sources$sou = tileJson.sources[sourceId]) === null || _tileJson$sources$sou === void 0 ? void 0 : (_tileJson$sources$sou2 = _tileJson$sources$sou.tiles) === null || _tileJson$sources$sou2 === void 0 ? void 0 : _tileJson$sources$sou2.pop();
284
- if (!url) {
285
- _context6.next = 9;
286
- break;
287
- }
288
- directUrl = this._proxyPath + this._getAbsoluteUrl(url);
289
- return _context6.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
290
- case 9:
291
- return _context6.abrupt("return", '');
292
- case 10:
293
- case "end":
294
- return _context6.stop();
295
- }
255
+ while (1) switch (_context6.prev = _context6.next) {
256
+ case 0:
257
+ _context6.next = 2;
258
+ return this._getVectorStyleJsonInlined();
259
+ case 2:
260
+ tileJson = _context6.sent;
261
+ url = tileJson === null || tileJson === void 0 || (_tileJson$sources$sou = tileJson.sources[sourceId]) === null || _tileJson$sources$sou === void 0 || (_tileJson$sources$sou = _tileJson$sources$sou.tiles) === null || _tileJson$sources$sou === void 0 ? void 0 : _tileJson$sources$sou.pop();
262
+ if (!url) {
263
+ _context6.next = 9;
264
+ break;
265
+ }
266
+ directUrl = this._proxyPath + this._getAbsoluteUrl(url);
267
+ return _context6.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
268
+ case 9:
269
+ return _context6.abrupt("return", '');
270
+ case 10:
271
+ case "end":
272
+ return _context6.stop();
296
273
  }
297
274
  }, _callee6, this);
298
275
  }));
@@ -306,17 +283,15 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
306
283
  value: function () {
307
284
  var _getVectorStyleSheet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
308
285
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
309
- while (1) {
310
- switch (_context7.prev = _context7.next) {
311
- case 0:
312
- _context7.next = 2;
313
- return this._getVectorStyleJsonInlined();
314
- case 2:
315
- return _context7.abrupt("return", _context7.sent);
316
- case 3:
317
- case "end":
318
- return _context7.stop();
319
- }
286
+ while (1) switch (_context7.prev = _context7.next) {
287
+ case 0:
288
+ _context7.next = 2;
289
+ return this._getVectorStyleJsonInlined();
290
+ case 2:
291
+ return _context7.abrupt("return", _context7.sent);
292
+ case 3:
293
+ case "end":
294
+ return _context7.stop();
320
295
  }
321
296
  }, _callee7, this);
322
297
  }));
@@ -330,17 +305,15 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
330
305
  value: function () {
331
306
  var _getVectorStyleSheetRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
332
307
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
333
- while (1) {
334
- switch (_context8.prev = _context8.next) {
335
- case 0:
336
- _context8.next = 2;
337
- return this._getVectorStyleJsonRaw();
338
- case 2:
339
- return _context8.abrupt("return", _context8.sent);
340
- case 3:
341
- case "end":
342
- return _context8.stop();
343
- }
308
+ while (1) switch (_context8.prev = _context8.next) {
309
+ case 0:
310
+ _context8.next = 2;
311
+ return this._getVectorStyleJsonRaw();
312
+ case 2:
313
+ return _context8.abrupt("return", _context8.sent);
314
+ case 3:
315
+ case "end":
316
+ return _context8.stop();
344
317
  }
345
318
  }, _callee8, this);
346
319
  }));
@@ -360,37 +333,35 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
360
333
  jsonMeta,
361
334
  _args9 = arguments;
362
335
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
363
- while (1) {
364
- switch (_context9.prev = _context9.next) {
365
- case 0:
366
- isRetina = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
367
- _context9.next = 3;
368
- return this.getSpriteSheetJsonPath(isRetina);
369
- case 3:
370
- metaUrl = _context9.sent;
371
- _context9.next = 6;
372
- return this.getSpriteSheetPngPath(isRetina);
373
- case 6:
374
- spritePngs = _context9.sent;
375
- if (!(metaUrl && spritePngs)) {
376
- _context9.next = 15;
377
- break;
378
- }
379
- metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
380
- _context9.next = 11;
381
- return this._emsClient.getManifest(metaUrlExtended);
382
- case 11:
383
- jsonMeta = _context9.sent;
384
- return _context9.abrupt("return", {
385
- png: spritePngs,
386
- json: jsonMeta
387
- });
388
- case 15:
389
- return _context9.abrupt("return");
390
- case 16:
391
- case "end":
392
- return _context9.stop();
393
- }
336
+ while (1) switch (_context9.prev = _context9.next) {
337
+ case 0:
338
+ isRetina = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
339
+ _context9.next = 3;
340
+ return this.getSpriteSheetJsonPath(isRetina);
341
+ case 3:
342
+ metaUrl = _context9.sent;
343
+ _context9.next = 6;
344
+ return this.getSpriteSheetPngPath(isRetina);
345
+ case 6:
346
+ spritePngs = _context9.sent;
347
+ if (!(metaUrl && spritePngs)) {
348
+ _context9.next = 15;
349
+ break;
350
+ }
351
+ metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
352
+ _context9.next = 11;
353
+ return this._emsClient.getManifest(metaUrlExtended);
354
+ case 11:
355
+ jsonMeta = _context9.sent;
356
+ return _context9.abrupt("return", {
357
+ png: spritePngs,
358
+ json: jsonMeta
359
+ });
360
+ case 15:
361
+ return _context9.abrupt("return");
362
+ case 16:
363
+ case "end":
364
+ return _context9.stop();
394
365
  }
395
366
  }, _callee9, this);
396
367
  }));
@@ -408,26 +379,24 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
408
379
  suffix,
409
380
  _args10 = arguments;
410
381
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
411
- while (1) {
412
- switch (_context10.prev = _context10.next) {
413
- case 0:
414
- isRetina = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : false;
415
- _context10.next = 3;
416
- return this._getSpriteSheetRootPath();
417
- case 3:
418
- spriteSheetRootPath = _context10.sent;
419
- if (!spriteSheetRootPath) {
420
- _context10.next = 9;
421
- break;
422
- }
423
- suffix = isRetina ? '@2x' : '';
424
- return _context10.abrupt("return", spriteSheetRootPath + suffix + '.json');
425
- case 9:
426
- return _context10.abrupt("return", '');
427
- case 10:
428
- case "end":
429
- return _context10.stop();
430
- }
382
+ while (1) switch (_context10.prev = _context10.next) {
383
+ case 0:
384
+ isRetina = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : false;
385
+ _context10.next = 3;
386
+ return this._getSpriteSheetRootPath();
387
+ case 3:
388
+ spriteSheetRootPath = _context10.sent;
389
+ if (!spriteSheetRootPath) {
390
+ _context10.next = 9;
391
+ break;
392
+ }
393
+ suffix = isRetina ? '@2x' : '';
394
+ return _context10.abrupt("return", spriteSheetRootPath + suffix + '.json');
395
+ case 9:
396
+ return _context10.abrupt("return", '');
397
+ case 10:
398
+ case "end":
399
+ return _context10.stop();
431
400
  }
432
401
  }, _callee10, this);
433
402
  }));
@@ -445,26 +414,24 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
445
414
  suffix,
446
415
  _args11 = arguments;
447
416
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
448
- while (1) {
449
- switch (_context11.prev = _context11.next) {
450
- case 0:
451
- isRetina = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : false;
452
- _context11.next = 3;
453
- return this._getSpriteSheetRootPath();
454
- case 3:
455
- spriteSheetRootPath = _context11.sent;
456
- if (!spriteSheetRootPath) {
457
- _context11.next = 9;
458
- break;
459
- }
460
- suffix = isRetina ? '@2x' : '';
461
- return _context11.abrupt("return", spriteSheetRootPath + suffix + '.png');
462
- case 9:
463
- return _context11.abrupt("return", '');
464
- case 10:
465
- case "end":
466
- return _context11.stop();
467
- }
417
+ while (1) switch (_context11.prev = _context11.next) {
418
+ case 0:
419
+ isRetina = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : false;
420
+ _context11.next = 3;
421
+ return this._getSpriteSheetRootPath();
422
+ case 3:
423
+ spriteSheetRootPath = _context11.sent;
424
+ if (!spriteSheetRootPath) {
425
+ _context11.next = 9;
426
+ break;
427
+ }
428
+ suffix = isRetina ? '@2x' : '';
429
+ return _context11.abrupt("return", spriteSheetRootPath + suffix + '.png');
430
+ case 9:
431
+ return _context11.abrupt("return", '');
432
+ case 10:
433
+ case "end":
434
+ return _context11.stop();
468
435
  }
469
436
  }, _callee11, this);
470
437
  }));
@@ -489,54 +456,52 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
489
456
  minzoom,
490
457
  _args12 = arguments;
491
458
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
492
- while (1) {
493
- switch (_context12.prev = _context12.next) {
494
- case 0:
495
- format = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : 'vector';
496
- _context12.t0 = format;
497
- _context12.next = _context12.t0 === 'vector' ? 4 : _context12.t0 === 'raster' ? 12 : 20;
459
+ while (1) switch (_context12.prev = _context12.next) {
460
+ case 0:
461
+ format = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : 'vector';
462
+ _context12.t0 = format;
463
+ _context12.next = _context12.t0 === 'vector' ? 4 : _context12.t0 === 'raster' ? 12 : 20;
464
+ break;
465
+ case 4:
466
+ _context12.next = 6;
467
+ return this._getVectorStyleJsonInlined();
468
+ case 6:
469
+ _context12.t1 = _context12.sent;
470
+ if (_context12.t1) {
471
+ _context12.next = 9;
498
472
  break;
499
- case 4:
500
- _context12.next = 6;
501
- return this._getVectorStyleJsonInlined();
502
- case 6:
503
- _context12.t1 = _context12.sent;
504
- if (_context12.t1) {
505
- _context12.next = 9;
506
- break;
507
- }
508
- _context12.t1 = {
509
- sources: {}
510
- };
511
- case 9:
512
- _ref4 = _context12.t1;
513
- sources = _ref4.sources;
514
- return _context12.abrupt("return", Math.min.apply(Math, _toConsumableArray(Object.values(sources).map(function (_ref5) {
515
- var minzoom = _ref5.minzoom;
516
- return minzoom;
517
- }).filter(function (minzoom) {
518
- return Number.isFinite(minzoom);
519
- }))));
520
- case 12:
521
- _context12.next = 14;
522
- return this._getRasterStyleJson();
523
- case 14:
524
- _context12.t2 = _context12.sent;
525
- if (_context12.t2) {
526
- _context12.next = 17;
527
- break;
528
- }
529
- _context12.t2 = {};
530
- case 17:
531
- _ref6 = _context12.t2;
532
- minzoom = _ref6.minzoom;
533
- return _context12.abrupt("return", minzoom);
534
- case 20:
535
- return _context12.abrupt("return");
536
- case 21:
537
- case "end":
538
- return _context12.stop();
539
- }
473
+ }
474
+ _context12.t1 = {
475
+ sources: {}
476
+ };
477
+ case 9:
478
+ _ref4 = _context12.t1;
479
+ sources = _ref4.sources;
480
+ return _context12.abrupt("return", Math.min.apply(Math, _toConsumableArray(Object.values(sources).map(function (_ref5) {
481
+ var minzoom = _ref5.minzoom;
482
+ return minzoom;
483
+ }).filter(function (minzoom) {
484
+ return Number.isFinite(minzoom);
485
+ }))));
486
+ case 12:
487
+ _context12.next = 14;
488
+ return this._getRasterStyleJson();
489
+ case 14:
490
+ _context12.t2 = _context12.sent;
491
+ if (_context12.t2) {
492
+ _context12.next = 17;
493
+ break;
494
+ }
495
+ _context12.t2 = {};
496
+ case 17:
497
+ _ref6 = _context12.t2;
498
+ minzoom = _ref6.minzoom;
499
+ return _context12.abrupt("return", minzoom);
500
+ case 20:
501
+ return _context12.abrupt("return");
502
+ case 21:
503
+ case "end":
504
+ return _context12.stop();
540
505
  }
541
506
  }, _callee12, this);
542
507
  }));
@@ -556,54 +521,52 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
556
521
  maxzoom,
557
522
  _args13 = arguments;
558
523
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
559
- while (1) {
560
- switch (_context13.prev = _context13.next) {
561
- case 0:
562
- format = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : 'vector';
563
- _context13.t0 = format;
564
- _context13.next = _context13.t0 === 'vector' ? 4 : _context13.t0 === 'raster' ? 12 : 20;
524
+ while (1) switch (_context13.prev = _context13.next) {
525
+ case 0:
526
+ format = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : 'vector';
527
+ _context13.t0 = format;
528
+ _context13.next = _context13.t0 === 'vector' ? 4 : _context13.t0 === 'raster' ? 12 : 20;
529
+ break;
530
+ case 4:
531
+ _context13.next = 6;
532
+ return this._getVectorStyleJsonInlined();
533
+ case 6:
534
+ _context13.t1 = _context13.sent;
535
+ if (_context13.t1) {
536
+ _context13.next = 9;
565
537
  break;
566
- case 4:
567
- _context13.next = 6;
568
- return this._getVectorStyleJsonInlined();
569
- case 6:
570
- _context13.t1 = _context13.sent;
571
- if (_context13.t1) {
572
- _context13.next = 9;
573
- break;
574
- }
575
- _context13.t1 = {
576
- sources: {}
577
- };
578
- case 9:
579
- _ref7 = _context13.t1;
580
- sources = _ref7.sources;
581
- return _context13.abrupt("return", Math.max.apply(Math, _toConsumableArray(Object.values(sources).map(function (_ref8) {
582
- var maxzoom = _ref8.maxzoom;
583
- return maxzoom;
584
- }).filter(function (maxzoom) {
585
- return Number.isFinite(maxzoom);
586
- }))));
587
- case 12:
588
- _context13.next = 14;
589
- return this._getRasterStyleJson();
590
- case 14:
591
- _context13.t2 = _context13.sent;
592
- if (_context13.t2) {
593
- _context13.next = 17;
594
- break;
595
- }
596
- _context13.t2 = {};
597
- case 17:
598
- _ref9 = _context13.t2;
599
- maxzoom = _ref9.maxzoom;
600
- return _context13.abrupt("return", maxzoom);
601
- case 20:
602
- return _context13.abrupt("return");
603
- case 21:
604
- case "end":
605
- return _context13.stop();
606
- }
538
+ }
539
+ _context13.t1 = {
540
+ sources: {}
541
+ };
542
+ case 9:
543
+ _ref7 = _context13.t1;
544
+ sources = _ref7.sources;
545
+ return _context13.abrupt("return", Math.max.apply(Math, _toConsumableArray(Object.values(sources).map(function (_ref8) {
546
+ var maxzoom = _ref8.maxzoom;
547
+ return maxzoom;
548
+ }).filter(function (maxzoom) {
549
+ return Number.isFinite(maxzoom);
550
+ }))));
551
+ case 12:
552
+ _context13.next = 14;
553
+ return this._getRasterStyleJson();
554
+ case 14:
555
+ _context13.t2 = _context13.sent;
556
+ if (_context13.t2) {
557
+ _context13.next = 17;
558
+ break;
559
+ }
560
+ _context13.t2 = {};
561
+ case 17:
562
+ _ref9 = _context13.t2;
563
+ maxzoom = _ref9.maxzoom;
564
+ return _context13.abrupt("return", maxzoom);
565
+ case 20:
566
+ return _context13.abrupt("return");
567
+ case 21:
568
+ case "end":
569
+ return _context13.stop();
607
570
  }
608
571
  }, _callee13, this);
609
572
  }));
@@ -657,24 +620,22 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
657
620
  var _getSpriteSheetRootPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
658
621
  var vectorStyleJson;
659
622
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
660
- while (1) {
661
- switch (_context14.prev = _context14.next) {
662
- case 0:
663
- _context14.next = 2;
664
- return this._getVectorStyleJsonRaw();
665
- case 2:
666
- vectorStyleJson = _context14.sent;
667
- if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.sprite)) {
668
- _context14.next = 7;
669
- break;
670
- }
671
- return _context14.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite));
672
- case 7:
673
- return _context14.abrupt("return", '');
674
- case 8:
675
- case "end":
676
- return _context14.stop();
677
- }
623
+ while (1) switch (_context14.prev = _context14.next) {
624
+ case 0:
625
+ _context14.next = 2;
626
+ return this._getVectorStyleJsonRaw();
627
+ case 2:
628
+ vectorStyleJson = _context14.sent;
629
+ if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.sprite)) {
630
+ _context14.next = 7;
631
+ break;
632
+ }
633
+ return _context14.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite));
634
+ case 7:
635
+ return _context14.abrupt("return", '');
636
+ case 8:
637
+ case "end":
638
+ return _context14.stop();
678
639
  }
679
640
  }, _callee14, this);
680
641
  }));
@@ -689,24 +650,22 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
689
650
  var _getUrlTemplateForGlyphs2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
690
651
  var vectorStyleJson;
691
652
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
692
- while (1) {
693
- switch (_context15.prev = _context15.next) {
694
- case 0:
695
- _context15.next = 2;
696
- return this._getVectorStyleJsonRaw();
697
- case 2:
698
- vectorStyleJson = _context15.sent;
699
- if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.glyphs)) {
700
- _context15.next = 7;
701
- break;
702
- }
703
- return _context15.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs));
704
- case 7:
705
- return _context15.abrupt("return", '');
706
- case 8:
707
- case "end":
708
- return _context15.stop();
709
- }
653
+ while (1) switch (_context15.prev = _context15.next) {
654
+ case 0:
655
+ _context15.next = 2;
656
+ return this._getVectorStyleJsonRaw();
657
+ case 2:
658
+ vectorStyleJson = _context15.sent;
659
+ if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.glyphs)) {
660
+ _context15.next = 7;
661
+ break;
662
+ }
663
+ return _context15.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs));
664
+ case 7:
665
+ return _context15.abrupt("return", '');
666
+ case 8:
667
+ case "end":
668
+ return _context15.stop();
710
669
  }
711
670
  }, _callee15, this);
712
671
  }));
@@ -776,6 +735,12 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
776
735
  }]);
777
736
  return TMSService;
778
737
  }(AbstractEmsService);
738
+ /*
739
+ List of supported languages with labels and OMT codes extracted
740
+ from https://openmaptiles.org/languages
741
+ Keys are values for i18.locale from Kibana settings
742
+ and OMT codes for the rest.
743
+ */
779
744
  _defineProperty(TMSService, "SupportedLanguages", [{
780
745
  key: 'ar',
781
746
  omt: 'ar'
@@ -954,6 +919,9 @@ _defineProperty(TMSService, "SupportedLanguages", [{
954
919
  key: 'zh-cn',
955
920
  omt: 'zh'
956
921
  }]);
922
+ /*
923
+ Suggested default operations for the different EMS styles
924
+ */
957
925
  _defineProperty(TMSService, "colorOperationDefaults", [{
958
926
  style: 'road_map',
959
927
  operation: 'mix',