@schibsted/account-sdk-browser 5.2.5 → 5.2.6

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.
package/es5/index.js CHANGED
@@ -12175,7 +12175,7 @@ __webpack_require__.r(__webpack_exports__);
12175
12175
 
12176
12176
 
12177
12177
 
12178
- var version = '5.2.5';
12178
+ var version = '5.2.6';
12179
12179
  /* harmony default export */ __webpack_exports__["default"] = (version);
12180
12180
 
12181
12181
  /***/ }),
@@ -12249,31 +12249,37 @@ __webpack_require__.r(__webpack_exports__);
12249
12249
  /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15__);
12250
12250
  /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(173);
12251
12251
  /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16__);
12252
- /* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(175);
12253
- /* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_17__);
12254
- /* harmony import */ var core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(176);
12255
- /* harmony import */ var core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_18__);
12256
- /* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(177);
12257
- /* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_19__);
12258
- /* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(178);
12259
- /* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_20__);
12260
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(179);
12261
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21__);
12262
- /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(181);
12263
- /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_22__);
12264
- /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(182);
12265
- /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_23__);
12266
- /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(183);
12267
- /* harmony import */ var _url_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(203);
12268
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(204);
12269
- /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(205);
12270
- /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_27__);
12271
- /* harmony import */ var _RESTClient_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(214);
12272
- /* harmony import */ var _cache_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(206);
12273
- /* harmony import */ var _spidTalk_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(222);
12274
- /* harmony import */ var _SDKError_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(189);
12275
- /* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(223);
12276
- /* harmony import */ var _global_registry_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(224);
12252
+ /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(73);
12253
+ /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17__);
12254
+ /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(182);
12255
+ /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18__);
12256
+ /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(146);
12257
+ /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19__);
12258
+ /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(181);
12259
+ /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_20__);
12260
+ /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(200);
12261
+ /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_21__);
12262
+ /* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(175);
12263
+ /* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_22__);
12264
+ /* harmony import */ var core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(176);
12265
+ /* harmony import */ var core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_23__);
12266
+ /* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(177);
12267
+ /* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_24__);
12268
+ /* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(178);
12269
+ /* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_25__);
12270
+ /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(179);
12271
+ /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_26__);
12272
+ /* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(183);
12273
+ /* harmony import */ var _url_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(203);
12274
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(204);
12275
+ /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(205);
12276
+ /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_30__);
12277
+ /* harmony import */ var _RESTClient_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(214);
12278
+ /* harmony import */ var _cache_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(206);
12279
+ /* harmony import */ var _spidTalk_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(222);
12280
+ /* harmony import */ var _SDKError_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(189);
12281
+ /* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(223);
12282
+ /* harmony import */ var _global_registry_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(224);
12277
12283
  /* Copyright 2024 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.
12278
12284
  * See LICENSE.md in the project root.
12279
12285
  */
@@ -12282,6 +12288,12 @@ __webpack_require__.r(__webpack_exports__);
12282
12288
 
12283
12289
  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); }
12284
12290
  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; }
12291
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12292
+ 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."); }
12293
+ 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); }
12294
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12295
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12296
+ 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; }
12285
12297
  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); } }
12286
12298
  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); }); }; }
12287
12299
 
@@ -12304,6 +12316,9 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
12304
12316
 
12305
12317
 
12306
12318
 
12319
+
12320
+
12321
+
12307
12322
 
12308
12323
 
12309
12324
 
@@ -12360,21 +12375,22 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12360
12375
  window = _ref$window === void 0 ? globalWindow() : _ref$window;
12361
12376
  _classCallCheck(this, Monetization);
12362
12377
  _this = _super.call(this);
12363
- _spidTalk_js__WEBPACK_IMPORTED_MODULE_30__["emulate"](window);
12378
+ _spidTalk_js__WEBPACK_IMPORTED_MODULE_33__["emulate"](window);
12364
12379
  // validate options
12365
- Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["isNonEmptyString"])(clientId), 'clientId parameter is required');
12366
- _this.cache = new _cache_js__WEBPACK_IMPORTED_MODULE_29__["default"](function () {
12380
+ Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isNonEmptyString"])(clientId), 'clientId parameter is required');
12381
+ _this.cache = new _cache_js__WEBPACK_IMPORTED_MODULE_32__["default"](function () {
12367
12382
  return window && window.sessionStorage;
12368
12383
  });
12369
12384
  _this.clientId = clientId;
12370
12385
  _this.env = env;
12371
12386
  _this.redirectUri = redirectUri;
12387
+ _this.pendingHasAccessRequests = {};
12372
12388
  _this._setSpidServerUrl(env);
12373
12389
  if (sessionDomain) {
12374
- Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["isUrl"])(sessionDomain), 'sessionDomain parameter is not a valid URL');
12390
+ Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isUrl"])(sessionDomain), 'sessionDomain parameter is not a valid URL');
12375
12391
  _this._setSessionServiceUrl(sessionDomain);
12376
12392
  }
12377
- Object(_global_registry_js__WEBPACK_IMPORTED_MODULE_33__["registerGlobal"])(window, 'Monetization', _assertThisInitialized(_this));
12393
+ Object(_global_registry_js__WEBPACK_IMPORTED_MODULE_36__["registerGlobal"])(window, 'Monetization', _assertThisInitialized(_this));
12378
12394
  return _this;
12379
12395
  }
12380
12396
 
@@ -12387,9 +12403,9 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12387
12403
  _createClass(Monetization, [{
12388
12404
  key: "_setSpidServerUrl",
12389
12405
  value: function _setSpidServerUrl(url) {
12390
- Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["isStr"])(url), "url parameter is invalid: ".concat(url));
12391
- this._spid = new _RESTClient_js__WEBPACK_IMPORTED_MODULE_28__["default"]({
12392
- serverUrl: Object(_url_js__WEBPACK_IMPORTED_MODULE_25__["urlMapper"])(url, _config_js__WEBPACK_IMPORTED_MODULE_26__["ENDPOINTS"].SPiD),
12406
+ Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isStr"])(url), "url parameter is invalid: ".concat(url));
12407
+ this._spid = new _RESTClient_js__WEBPACK_IMPORTED_MODULE_31__["default"]({
12408
+ serverUrl: Object(_url_js__WEBPACK_IMPORTED_MODULE_28__["urlMapper"])(url, _config_js__WEBPACK_IMPORTED_MODULE_29__["ENDPOINTS"].SPiD),
12393
12409
  defaultParams: {
12394
12410
  client_id: this.clientId,
12395
12411
  redirect_uri: this.redirectUri
@@ -12406,15 +12422,15 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12406
12422
  }, {
12407
12423
  key: "_setSessionServiceUrl",
12408
12424
  value: function _setSessionServiceUrl(domain) {
12409
- Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["isStr"])(domain), "domain parameter is invalid: ".concat(domain));
12410
- var client_sdrn = "sdrn:".concat(_config_js__WEBPACK_IMPORTED_MODULE_26__["NAMESPACE"][this.env], ":client:").concat(this.clientId);
12411
- this._sessionService = new _RESTClient_js__WEBPACK_IMPORTED_MODULE_28__["default"]({
12425
+ Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isStr"])(domain), "domain parameter is invalid: ".concat(domain));
12426
+ var client_sdrn = "sdrn:".concat(_config_js__WEBPACK_IMPORTED_MODULE_29__["NAMESPACE"][this.env], ":client:").concat(this.clientId);
12427
+ this._sessionService = new _RESTClient_js__WEBPACK_IMPORTED_MODULE_31__["default"]({
12412
12428
  serverUrl: domain,
12413
12429
  log: this.log,
12414
12430
  defaultParams: {
12415
12431
  client_sdrn: client_sdrn,
12416
12432
  redirect_uri: this.redirectUri,
12417
- sdk_version: _version_js__WEBPACK_IMPORTED_MODULE_32__["default"]
12433
+ sdk_version: _version_js__WEBPACK_IMPORTED_MODULE_35__["default"]
12418
12434
  }
12419
12435
  });
12420
12436
  }
@@ -12432,7 +12448,7 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12432
12448
  key: "hasAccess",
12433
12449
  value: function () {
12434
12450
  var _hasAccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(productIds, userId) {
12435
- var sortedIds, cacheKey, data, expiresSeconds;
12451
+ var sortedIds, cacheKey, data, promise, expiresSeconds;
12436
12452
  return _regeneratorRuntime().wrap(function _callee$(_context) {
12437
12453
  while (1) switch (_context.prev = _context.next) {
12438
12454
  case 0:
@@ -12440,50 +12456,62 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12440
12456
  _context.next = 2;
12441
12457
  break;
12442
12458
  }
12443
- throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_31__["default"]("hasAccess can only be called if 'sessionDomain' is configured");
12459
+ throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_34__["default"]("hasAccess can only be called if 'sessionDomain' is configured");
12444
12460
  case 2:
12445
12461
  if (userId) {
12446
12462
  _context.next = 4;
12447
12463
  break;
12448
12464
  }
12449
- throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_31__["default"]("'userId' must be specified");
12465
+ throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_34__["default"]("'userId' must be specified");
12450
12466
  case 4:
12451
12467
  if (Array.isArray(productIds)) {
12452
12468
  _context.next = 6;
12453
12469
  break;
12454
12470
  }
12455
- throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_31__["default"]("'productIds' must be an array");
12471
+ throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_34__["default"]("'productIds' must be an array");
12456
12472
  case 6:
12457
- sortedIds = productIds.sort();
12458
- cacheKey = this._accessCacheKey(productIds, userId);
12473
+ sortedIds = _toConsumableArray(productIds).sort();
12474
+ cacheKey = this._accessCacheKey(sortedIds, userId);
12459
12475
  data = this.cache.get(cacheKey);
12460
12476
  if (data) {
12461
- _context.next = 15;
12477
+ _context.next = 21;
12462
12478
  break;
12463
12479
  }
12464
- _context.next = 12;
12465
- return this._sessionService.get("/hasAccess/".concat(sortedIds.join(',')));
12466
- case 12:
12480
+ if (!this.pendingHasAccessRequests[cacheKey]) {
12481
+ this.pendingHasAccessRequests[cacheKey] = this._sessionService.get("/hasAccess/".concat(sortedIds.join(',')));
12482
+ }
12483
+ promise = this.pendingHasAccessRequests[cacheKey];
12484
+ _context.prev = 12;
12485
+ _context.next = 15;
12486
+ return promise;
12487
+ case 15:
12467
12488
  data = _context.sent;
12468
12489
  expiresSeconds = data.ttl;
12469
12490
  this.cache.set(cacheKey, data, expiresSeconds * 1000);
12470
- case 15:
12491
+ case 18:
12492
+ _context.prev = 18;
12493
+ // If it rejects, we still want to clear the pending request
12494
+ if (this.pendingHasAccessRequests[cacheKey] === promise) {
12495
+ delete this.pendingHasAccessRequests[cacheKey];
12496
+ }
12497
+ return _context.finish(18);
12498
+ case 21:
12471
12499
  if (data.entitled) {
12472
- _context.next = 17;
12500
+ _context.next = 23;
12473
12501
  break;
12474
12502
  }
12475
12503
  return _context.abrupt("return", null);
12476
- case 17:
12504
+ case 23:
12477
12505
  this.emit('hasAccess', {
12478
12506
  ids: sortedIds,
12479
12507
  data: data
12480
12508
  });
12481
12509
  return _context.abrupt("return", data);
12482
- case 19:
12510
+ case 25:
12483
12511
  case "end":
12484
12512
  return _context.stop();
12485
12513
  }
12486
- }, _callee, this);
12514
+ }, _callee, this, [[12,, 18, 21]]);
12487
12515
  }));
12488
12516
  function hasAccess(_x, _x2) {
12489
12517
  return _hasAccess.apply(this, arguments);
@@ -12512,7 +12540,7 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12512
12540
  }, {
12513
12541
  key: "_accessCacheKey",
12514
12542
  value: function _accessCacheKey(productIds, userId) {
12515
- return "prd_".concat(productIds.sort(), "_").concat(userId);
12543
+ return "prd_".concat(_toConsumableArray(productIds).sort(), "_").concat(userId);
12516
12544
  }
12517
12545
 
12518
12546
  /**
@@ -12524,7 +12552,7 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12524
12552
  key: "subscriptionsUrl",
12525
12553
  value: function subscriptionsUrl() {
12526
12554
  var redirectUri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.redirectUri;
12527
- Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["isUrl"])(redirectUri), "subscriptionsUrl(): redirectUri is invalid");
12555
+ Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isUrl"])(redirectUri), "subscriptionsUrl(): redirectUri is invalid");
12528
12556
  return this._spid.makeUrl('account/subscriptions', {
12529
12557
  redirect_uri: redirectUri
12530
12558
  });
@@ -12539,14 +12567,14 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
12539
12567
  key: "productsUrl",
12540
12568
  value: function productsUrl() {
12541
12569
  var redirectUri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.redirectUri;
12542
- Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_24__["isUrl"])(redirectUri), "productsUrl(): redirectUri is invalid");
12570
+ Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isUrl"])(redirectUri), "productsUrl(): redirectUri is invalid");
12543
12571
  return this._spid.makeUrl('account/products', {
12544
12572
  redirect_uri: redirectUri
12545
12573
  });
12546
12574
  }
12547
12575
  }]);
12548
12576
  return Monetization;
12549
- }(tiny_emitter__WEBPACK_IMPORTED_MODULE_27___default.a);
12577
+ }(tiny_emitter__WEBPACK_IMPORTED_MODULE_30___default.a);
12550
12578
  /* harmony default export */ __webpack_exports__["default"] = (Monetization);
12551
12579
 
12552
12580
  /***/ }),