@stytch/vanilla-js 3.0.1 → 3.0.3
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/CHANGELOG.md +22 -0
- package/dist/b2b/index.d.ts +8 -9
- package/dist/b2b/index.esm.d.ts +8 -9
- package/dist/b2b/index.esm.js +4041 -4099
- package/dist/b2b/index.headless.d.ts +8 -9
- package/dist/b2b/index.headless.esm.d.ts +8 -9
- package/dist/b2b/index.headless.esm.js +390 -425
- package/dist/b2b/index.headless.js +359 -394
- package/dist/b2b/index.js +3970 -4028
- package/dist/index.esm.js +1 -1
- package/dist/index.headless.esm.js +176 -172
- package/dist/index.headless.js +539 -535
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _iterableToArrayLimit(
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
9
|
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."); }
|
|
10
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
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; }
|
|
12
|
+
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; }
|
|
13
13
|
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(_e4) { throw _e4; }, 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(_e5) { didErr = true; err = _e5; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
@@ -28,7 +28,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
28
28
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
29
29
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
30
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
31
|
-
function _typeof(
|
|
31
|
+
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); }
|
|
32
32
|
function e(e, r) {
|
|
33
33
|
return function (e) {
|
|
34
34
|
if (Array.isArray(e)) return e;
|
|
@@ -84,19 +84,20 @@ function n(e) {
|
|
|
84
84
|
function i() {
|
|
85
85
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
86
86
|
i = function i() {
|
|
87
|
-
return
|
|
87
|
+
return t;
|
|
88
88
|
};
|
|
89
|
-
var e
|
|
90
|
-
t =
|
|
91
|
-
r =
|
|
92
|
-
o =
|
|
89
|
+
var e,
|
|
90
|
+
t = {},
|
|
91
|
+
r = Object.prototype,
|
|
92
|
+
o = r.hasOwnProperty,
|
|
93
|
+
s = Object.defineProperty || function (e, t, r) {
|
|
93
94
|
e[t] = r.value;
|
|
94
95
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
function
|
|
96
|
+
a = "function" == typeof Symbol ? Symbol : {},
|
|
97
|
+
c = a.iterator || "@@iterator",
|
|
98
|
+
u = a.asyncIterator || "@@asyncIterator",
|
|
99
|
+
l = a.toStringTag || "@@toStringTag";
|
|
100
|
+
function d(e, t, r) {
|
|
100
101
|
return Object.defineProperty(e, t, {
|
|
101
102
|
value: r,
|
|
102
103
|
enumerable: !0,
|
|
@@ -105,21 +106,21 @@ function i() {
|
|
|
105
106
|
}), e[t];
|
|
106
107
|
}
|
|
107
108
|
try {
|
|
108
|
-
|
|
109
|
+
d({}, "");
|
|
109
110
|
} catch (e) {
|
|
110
|
-
|
|
111
|
+
d = function d(e, t, r) {
|
|
111
112
|
return e[t] = r;
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
var i = t && t.prototype instanceof
|
|
116
|
-
|
|
117
|
-
a = new
|
|
118
|
-
return o
|
|
119
|
-
value:
|
|
120
|
-
}),
|
|
115
|
+
function h(e, t, r, n) {
|
|
116
|
+
var i = t && t.prototype instanceof g ? t : g,
|
|
117
|
+
o = Object.create(i.prototype),
|
|
118
|
+
a = new R(n || []);
|
|
119
|
+
return s(o, "_invoke", {
|
|
120
|
+
value: P(e, r, a)
|
|
121
|
+
}), o;
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function p(e, t, r) {
|
|
123
124
|
try {
|
|
124
125
|
return {
|
|
125
126
|
type: "normal",
|
|
@@ -132,166 +133,165 @@ function i() {
|
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
|
-
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
t.wrap = h;
|
|
137
|
+
var _ = "suspendedStart",
|
|
138
|
+
m = "suspendedYield",
|
|
139
|
+
f = "executing",
|
|
140
|
+
v = "completed",
|
|
141
|
+
b = {};
|
|
142
|
+
function g() {}
|
|
143
|
+
function y() {}
|
|
144
|
+
function k() {}
|
|
145
|
+
var S = {};
|
|
146
|
+
d(S, c, function () {
|
|
142
147
|
return this;
|
|
143
148
|
});
|
|
144
|
-
var
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var
|
|
148
|
-
function
|
|
149
|
+
var w = Object.getPrototypeOf,
|
|
150
|
+
A = w && w(w(I([])));
|
|
151
|
+
A && A !== r && o.call(A, c) && (S = A);
|
|
152
|
+
var T = k.prototype = g.prototype = Object.create(S);
|
|
153
|
+
function O(e) {
|
|
149
154
|
["next", "throw", "return"].forEach(function (t) {
|
|
150
|
-
|
|
155
|
+
d(e, t, function (e) {
|
|
151
156
|
return this._invoke(t, e);
|
|
152
157
|
});
|
|
153
158
|
});
|
|
154
159
|
}
|
|
155
|
-
function
|
|
156
|
-
function i
|
|
157
|
-
var u =
|
|
160
|
+
function E(e, t) {
|
|
161
|
+
function r(i, s, a, c) {
|
|
162
|
+
var u = p(e[i], e, s);
|
|
158
163
|
if ("throw" !== u.type) {
|
|
159
164
|
var l = u.arg,
|
|
160
165
|
d = l.value;
|
|
161
|
-
return d && "object" == n(d) &&
|
|
162
|
-
|
|
166
|
+
return d && "object" == n(d) && o.call(d, "__await") ? t.resolve(d.__await).then(function (e) {
|
|
167
|
+
r("next", e, a, c);
|
|
163
168
|
}, function (e) {
|
|
164
|
-
|
|
169
|
+
r("throw", e, a, c);
|
|
165
170
|
}) : t.resolve(d).then(function (e) {
|
|
166
171
|
l.value = e, a(l);
|
|
167
172
|
}, function (e) {
|
|
168
|
-
return
|
|
173
|
+
return r("throw", e, a, c);
|
|
169
174
|
});
|
|
170
175
|
}
|
|
171
176
|
c(u.arg);
|
|
172
177
|
}
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
value: function value(e,
|
|
176
|
-
function
|
|
177
|
-
return new t(function (t,
|
|
178
|
-
|
|
178
|
+
var i;
|
|
179
|
+
s(this, "_invoke", {
|
|
180
|
+
value: function value(e, n) {
|
|
181
|
+
function o() {
|
|
182
|
+
return new t(function (t, i) {
|
|
183
|
+
r(e, n, t, i);
|
|
179
184
|
});
|
|
180
185
|
}
|
|
181
|
-
return
|
|
186
|
+
return i = i ? i.then(o, o) : o();
|
|
182
187
|
}
|
|
183
188
|
});
|
|
184
189
|
}
|
|
185
|
-
function
|
|
186
|
-
var
|
|
187
|
-
return function (
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if ("throw" ===
|
|
191
|
-
return
|
|
190
|
+
function P(t, r, n) {
|
|
191
|
+
var i = _;
|
|
192
|
+
return function (o, s) {
|
|
193
|
+
if (i === f) throw new Error("Generator is already running");
|
|
194
|
+
if (i === v) {
|
|
195
|
+
if ("throw" === o) throw s;
|
|
196
|
+
return {
|
|
197
|
+
value: e,
|
|
198
|
+
done: !0
|
|
199
|
+
};
|
|
192
200
|
}
|
|
193
|
-
for (
|
|
194
|
-
var
|
|
195
|
-
if (
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
return
|
|
201
|
+
for (n.method = o, n.arg = s;;) {
|
|
202
|
+
var a = n.delegate;
|
|
203
|
+
if (a) {
|
|
204
|
+
var c = C(a, n);
|
|
205
|
+
if (c) {
|
|
206
|
+
if (c === b) continue;
|
|
207
|
+
return c;
|
|
200
208
|
}
|
|
201
209
|
}
|
|
202
|
-
if ("next" ===
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
} else "return" ===
|
|
206
|
-
|
|
207
|
-
var
|
|
208
|
-
if ("normal" ===
|
|
209
|
-
if (
|
|
210
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
211
|
+
if (i === _) throw i = v, n.arg;
|
|
212
|
+
n.dispatchException(n.arg);
|
|
213
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
214
|
+
i = f;
|
|
215
|
+
var u = p(t, r, n);
|
|
216
|
+
if ("normal" === u.type) {
|
|
217
|
+
if (i = n.done ? v : m, u.arg === b) continue;
|
|
210
218
|
return {
|
|
211
|
-
value:
|
|
212
|
-
done:
|
|
219
|
+
value: u.arg,
|
|
220
|
+
done: n.done
|
|
213
221
|
};
|
|
214
222
|
}
|
|
215
|
-
"throw" ===
|
|
223
|
+
"throw" === u.type && (i = v, n.method = "throw", n.arg = u.arg);
|
|
216
224
|
}
|
|
217
225
|
};
|
|
218
226
|
}
|
|
219
|
-
function
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
if (
|
|
223
|
-
var
|
|
224
|
-
if ("throw" ===
|
|
225
|
-
var
|
|
226
|
-
return
|
|
227
|
+
function C(t, r) {
|
|
228
|
+
var n = r.method,
|
|
229
|
+
i = t.iterator[n];
|
|
230
|
+
if (i === e) return r.delegate = null, "throw" === n && t.iterator["return"] && (r.method = "return", r.arg = e, C(t, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), b;
|
|
231
|
+
var o = p(i, t.iterator, r.arg);
|
|
232
|
+
if ("throw" === o.type) return r.method = "throw", r.arg = o.arg, r.delegate = null, b;
|
|
233
|
+
var s = o.arg;
|
|
234
|
+
return s ? s.done ? (r[t.resultName] = s.value, r.next = t.nextLoc, "return" !== r.method && (r.method = "next", r.arg = e), r.delegate = null, b) : s : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, b);
|
|
227
235
|
}
|
|
228
|
-
function
|
|
236
|
+
function x(e) {
|
|
229
237
|
var t = {
|
|
230
238
|
tryLoc: e[0]
|
|
231
239
|
};
|
|
232
240
|
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
|
|
233
241
|
}
|
|
234
|
-
function
|
|
242
|
+
function B(e) {
|
|
235
243
|
var t = e.completion || {};
|
|
236
244
|
t.type = "normal", delete t.arg, e.completion = t;
|
|
237
245
|
}
|
|
238
|
-
function
|
|
246
|
+
function R(e) {
|
|
239
247
|
this.tryEntries = [{
|
|
240
248
|
tryLoc: "root"
|
|
241
|
-
}], e.forEach(
|
|
249
|
+
}], e.forEach(x, this), this.reset(!0);
|
|
242
250
|
}
|
|
243
|
-
function
|
|
244
|
-
if (
|
|
245
|
-
var
|
|
246
|
-
if (
|
|
247
|
-
if ("function" == typeof
|
|
248
|
-
if (!isNaN(
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
for (; ++
|
|
252
|
-
return
|
|
251
|
+
function I(t) {
|
|
252
|
+
if (t || "" === t) {
|
|
253
|
+
var r = t[c];
|
|
254
|
+
if (r) return r.call(t);
|
|
255
|
+
if ("function" == typeof t.next) return t;
|
|
256
|
+
if (!isNaN(t.length)) {
|
|
257
|
+
var i = -1,
|
|
258
|
+
s = function r() {
|
|
259
|
+
for (; ++i < t.length;) if (o.call(t, i)) return r.value = t[i], r.done = !1, r;
|
|
260
|
+
return r.value = e, r.done = !0, r;
|
|
253
261
|
};
|
|
254
|
-
return
|
|
262
|
+
return s.next = s;
|
|
255
263
|
}
|
|
256
264
|
}
|
|
257
|
-
|
|
258
|
-
next: C
|
|
259
|
-
};
|
|
265
|
+
throw new TypeError(n(t) + " is not iterable");
|
|
260
266
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
value: void 0,
|
|
264
|
-
done: !0
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
return m.prototype = f, o(y, "constructor", {
|
|
268
|
-
value: f,
|
|
267
|
+
return y.prototype = k, s(T, "constructor", {
|
|
268
|
+
value: k,
|
|
269
269
|
configurable: !0
|
|
270
|
-
}),
|
|
271
|
-
value:
|
|
270
|
+
}), s(k, "constructor", {
|
|
271
|
+
value: y,
|
|
272
272
|
configurable: !0
|
|
273
|
-
}),
|
|
273
|
+
}), y.displayName = d(k, l, "GeneratorFunction"), t.isGeneratorFunction = function (e) {
|
|
274
274
|
var t = "function" == typeof e && e.constructor;
|
|
275
|
-
return !!t && (t ===
|
|
276
|
-
},
|
|
277
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(e,
|
|
278
|
-
},
|
|
275
|
+
return !!t && (t === y || "GeneratorFunction" === (t.displayName || t.name));
|
|
276
|
+
}, t.mark = function (e) {
|
|
277
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, k) : (e.__proto__ = k, d(e, l, "GeneratorFunction")), e.prototype = Object.create(T), e;
|
|
278
|
+
}, t.awrap = function (e) {
|
|
279
279
|
return {
|
|
280
280
|
__await: e
|
|
281
281
|
};
|
|
282
|
-
},
|
|
282
|
+
}, O(E.prototype), d(E.prototype, u, function () {
|
|
283
283
|
return this;
|
|
284
|
-
}),
|
|
284
|
+
}), t.AsyncIterator = E, t.async = function (e, r, n, i, o) {
|
|
285
285
|
void 0 === o && (o = Promise);
|
|
286
|
-
var s = new
|
|
287
|
-
return
|
|
286
|
+
var s = new E(h(e, r, n, i), o);
|
|
287
|
+
return t.isGeneratorFunction(r) ? s : s.next().then(function (e) {
|
|
288
288
|
return e.done ? e.value : s.next();
|
|
289
289
|
});
|
|
290
|
-
},
|
|
290
|
+
}, O(T), d(T, l, "Generator"), d(T, c, function () {
|
|
291
291
|
return this;
|
|
292
|
-
}),
|
|
292
|
+
}), d(T, "toString", function () {
|
|
293
293
|
return "[object Generator]";
|
|
294
|
-
}),
|
|
294
|
+
}), t.keys = function (e) {
|
|
295
295
|
var t = Object(e),
|
|
296
296
|
r = [];
|
|
297
297
|
for (var n in t) r.push(n);
|
|
@@ -302,10 +302,10 @@ function i() {
|
|
|
302
302
|
}
|
|
303
303
|
return e.done = !0, e;
|
|
304
304
|
};
|
|
305
|
-
},
|
|
306
|
-
constructor:
|
|
307
|
-
reset: function reset(
|
|
308
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
305
|
+
}, t.values = I, R.prototype = {
|
|
306
|
+
constructor: R,
|
|
307
|
+
reset: function reset(t) {
|
|
308
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(B), !t) for (var r in this) "t" === r.charAt(0) && o.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
|
|
309
309
|
},
|
|
310
310
|
stop: function stop() {
|
|
311
311
|
this.done = !0;
|
|
@@ -313,51 +313,51 @@ function i() {
|
|
|
313
313
|
if ("throw" === e.type) throw e.arg;
|
|
314
314
|
return this.rval;
|
|
315
315
|
},
|
|
316
|
-
dispatchException: function dispatchException(
|
|
317
|
-
if (this.done) throw
|
|
318
|
-
var
|
|
319
|
-
function n(
|
|
320
|
-
return
|
|
316
|
+
dispatchException: function dispatchException(t) {
|
|
317
|
+
if (this.done) throw t;
|
|
318
|
+
var r = this;
|
|
319
|
+
function n(n, i) {
|
|
320
|
+
return a.type = "throw", a.arg = t, r.next = n, i && (r.method = "next", r.arg = e), !!i;
|
|
321
321
|
}
|
|
322
322
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
if ("root" ===
|
|
326
|
-
if (
|
|
327
|
-
var
|
|
328
|
-
|
|
329
|
-
if (
|
|
330
|
-
if (this.prev <
|
|
331
|
-
if (this.prev <
|
|
332
|
-
} else if (
|
|
333
|
-
if (this.prev <
|
|
323
|
+
var s = this.tryEntries[i],
|
|
324
|
+
a = s.completion;
|
|
325
|
+
if ("root" === s.tryLoc) return n("end");
|
|
326
|
+
if (s.tryLoc <= this.prev) {
|
|
327
|
+
var c = o.call(s, "catchLoc"),
|
|
328
|
+
u = o.call(s, "finallyLoc");
|
|
329
|
+
if (c && u) {
|
|
330
|
+
if (this.prev < s.catchLoc) return n(s.catchLoc, !0);
|
|
331
|
+
if (this.prev < s.finallyLoc) return n(s.finallyLoc);
|
|
332
|
+
} else if (c) {
|
|
333
|
+
if (this.prev < s.catchLoc) return n(s.catchLoc, !0);
|
|
334
334
|
} else {
|
|
335
|
-
if (!
|
|
336
|
-
if (this.prev <
|
|
335
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
336
|
+
if (this.prev < s.finallyLoc) return n(s.finallyLoc);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
},
|
|
341
341
|
abrupt: function abrupt(e, t) {
|
|
342
|
-
for (var
|
|
343
|
-
var
|
|
344
|
-
if (
|
|
345
|
-
var
|
|
342
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
343
|
+
var n = this.tryEntries[r];
|
|
344
|
+
if (n.tryLoc <= this.prev && o.call(n, "finallyLoc") && this.prev < n.finallyLoc) {
|
|
345
|
+
var i = n;
|
|
346
346
|
break;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
|
|
350
|
-
var s =
|
|
351
|
-
return s.type = e, s.arg = t,
|
|
349
|
+
i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc && (i = null);
|
|
350
|
+
var s = i ? i.completion : {};
|
|
351
|
+
return s.type = e, s.arg = t, i ? (this.method = "next", this.next = i.finallyLoc, b) : this.complete(s);
|
|
352
352
|
},
|
|
353
353
|
complete: function complete(e, t) {
|
|
354
354
|
if ("throw" === e.type) throw e.arg;
|
|
355
|
-
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t),
|
|
355
|
+
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), b;
|
|
356
356
|
},
|
|
357
357
|
finish: function finish(e) {
|
|
358
358
|
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
|
|
359
359
|
var r = this.tryEntries[t];
|
|
360
|
-
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc),
|
|
360
|
+
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), B(r), b;
|
|
361
361
|
}
|
|
362
362
|
},
|
|
363
363
|
"catch": function _catch(e) {
|
|
@@ -367,21 +367,21 @@ function i() {
|
|
|
367
367
|
var n = r.completion;
|
|
368
368
|
if ("throw" === n.type) {
|
|
369
369
|
var i = n.arg;
|
|
370
|
-
|
|
370
|
+
B(r);
|
|
371
371
|
}
|
|
372
372
|
return i;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
throw new Error("illegal catch attempt");
|
|
376
376
|
},
|
|
377
|
-
delegateYield: function delegateYield(
|
|
377
|
+
delegateYield: function delegateYield(t, r, n) {
|
|
378
378
|
return this.delegate = {
|
|
379
|
-
iterator:
|
|
380
|
-
resultName:
|
|
381
|
-
nextLoc:
|
|
382
|
-
}, "next" === this.method && (this.arg =
|
|
379
|
+
iterator: I(t),
|
|
380
|
+
resultName: r,
|
|
381
|
+
nextLoc: n
|
|
382
|
+
}, "next" === this.method && (this.arg = e), b;
|
|
383
383
|
}
|
|
384
|
-
},
|
|
384
|
+
}, t;
|
|
385
385
|
}
|
|
386
386
|
function o(e, t) {
|
|
387
387
|
for (var r = 0; r < t.length; r++) {
|
|
@@ -519,7 +519,7 @@ function S(e, t, r, n) {
|
|
|
519
519
|
c((n = n.apply(e, t || [])).next());
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
|
-
|
|
522
|
+
"function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
523
523
|
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
|
|
524
524
|
}(f || (f = {})), function (e) {
|
|
525
525
|
e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
|
|
@@ -688,22 +688,22 @@ function L(e) {
|
|
|
688
688
|
}));
|
|
689
689
|
}
|
|
690
690
|
var M = new Uint8Array(16);
|
|
691
|
-
function
|
|
691
|
+
function j() {
|
|
692
692
|
if (!I && !(I = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
693
693
|
return I(M);
|
|
694
694
|
}
|
|
695
|
-
var
|
|
695
|
+
var N = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
696
696
|
for (var F = [], K = 0; K < 256; ++K) F.push((K + 256).toString(16).substr(1));
|
|
697
697
|
function U(e) {
|
|
698
698
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
|
|
699
699
|
r = (F[e[t + 0]] + F[e[t + 1]] + F[e[t + 2]] + F[e[t + 3]] + "-" + F[e[t + 4]] + F[e[t + 5]] + "-" + F[e[t + 6]] + F[e[t + 7]] + "-" + F[e[t + 8]] + F[e[t + 9]] + "-" + F[e[t + 10]] + F[e[t + 11]] + F[e[t + 12]] + F[e[t + 13]] + F[e[t + 14]] + F[e[t + 15]]).toLowerCase();
|
|
700
700
|
if (!function (e) {
|
|
701
|
-
return "string" == typeof e &&
|
|
701
|
+
return "string" == typeof e && N.test(e);
|
|
702
702
|
}(r)) throw TypeError("Stringified UUID is invalid");
|
|
703
703
|
return r;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
var n = (e = e || {}).random || (e.rng ||
|
|
705
|
+
function W(e, t, r) {
|
|
706
|
+
var n = (e = e || {}).random || (e.rng || j)();
|
|
707
707
|
if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
|
|
708
708
|
r = r || 0;
|
|
709
709
|
for (var i = 0; i < 16; ++i) t[r + i] = n[i];
|
|
@@ -711,19 +711,19 @@ function z(e, t, r) {
|
|
|
711
711
|
}
|
|
712
712
|
return U(n);
|
|
713
713
|
}
|
|
714
|
-
var
|
|
714
|
+
var z = {};
|
|
715
715
|
function G(e, t) {
|
|
716
716
|
return S(this, void 0, void 0, i().mark(function r() {
|
|
717
717
|
return i().wrap(function (r) {
|
|
718
718
|
for (;;) switch (r.prev = r.next) {
|
|
719
719
|
case 0:
|
|
720
|
-
if (void 0 ===
|
|
720
|
+
if (void 0 === z[e]) {
|
|
721
721
|
r.next = 2;
|
|
722
722
|
break;
|
|
723
723
|
}
|
|
724
|
-
return r.abrupt("return",
|
|
724
|
+
return r.abrupt("return", z[e]);
|
|
725
725
|
case 2:
|
|
726
|
-
return
|
|
726
|
+
return z[e] = H(e, t), r.abrupt("return", z[e]);
|
|
727
727
|
case 4:
|
|
728
728
|
case "end":
|
|
729
729
|
return r.stop();
|
|
@@ -1695,29 +1695,31 @@ var ne = Promise.resolve({
|
|
|
1695
1695
|
o = r.organization_slug,
|
|
1696
1696
|
s = r.login_redirect_url,
|
|
1697
1697
|
a = r.signup_redirect_url,
|
|
1698
|
-
c = r.custom_scopes
|
|
1698
|
+
c = r.custom_scopes,
|
|
1699
|
+
u = r.provider_params;
|
|
1699
1700
|
return S(t, void 0, void 0, i().mark(function t() {
|
|
1700
|
-
var r,
|
|
1701
|
+
var r, l, d, h, p, _;
|
|
1701
1702
|
return i().wrap(function (t) {
|
|
1702
1703
|
for (;;) switch (t.prev = t.next) {
|
|
1703
1704
|
case 0:
|
|
1704
1705
|
return t.next = 2, this._dynamicConfig;
|
|
1705
1706
|
case 2:
|
|
1706
|
-
return r = t.sent,
|
|
1707
|
+
return r = t.sent, l = r.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
|
|
1707
1708
|
case 6:
|
|
1708
|
-
if (
|
|
1709
|
-
|
|
1709
|
+
if (d = t.sent, (h = new URL("".concat(d, "/v1/b2b/public/oauth/").concat(e, "/start"))).searchParams.set("public_token", this._config.publicToken), n && "" != n && h.searchParams.set("organization_id", n), o && "" != o && h.searchParams.set("slug", o), c && (Q("startOAuthFlow").isStringArray("custom_scopes", c), h.searchParams.set("custom_scopes", c.join(" "))), u) for (p in Q("startOAuthFlow").isOptionalObject("provider_params", u), u) h.searchParams.set("provider_" + p, u[p]);
|
|
1710
|
+
if (!l) {
|
|
1711
|
+
t.next = 20;
|
|
1710
1712
|
break;
|
|
1711
1713
|
}
|
|
1712
|
-
return t.next =
|
|
1713
|
-
case
|
|
1714
|
-
|
|
1714
|
+
return t.next = 16, this._pkceManager.startPKCETransaction();
|
|
1715
|
+
case 16:
|
|
1716
|
+
_ = t.sent, h.searchParams.set("pkce_code_challenge", _.code_challenge), t.next = 21;
|
|
1715
1717
|
break;
|
|
1716
|
-
case 19:
|
|
1717
|
-
this._pkceManager.clearPKPair();
|
|
1718
1718
|
case 20:
|
|
1719
|
-
|
|
1720
|
-
case
|
|
1719
|
+
this._pkceManager.clearPKPair();
|
|
1720
|
+
case 21:
|
|
1721
|
+
s && h.searchParams.set("login_redirect_url", s), a && h.searchParams.set("signup_redirect_url", a), window.location.href = h.toString();
|
|
1722
|
+
case 24:
|
|
1721
1723
|
case "end":
|
|
1722
1724
|
return t.stop();
|
|
1723
1725
|
}
|
|
@@ -1731,29 +1733,31 @@ var ne = Promise.resolve({
|
|
|
1731
1733
|
var t = this;
|
|
1732
1734
|
return function (r) {
|
|
1733
1735
|
var n = r.discovery_redirect_url,
|
|
1734
|
-
o = r.custom_scopes
|
|
1736
|
+
o = r.custom_scopes,
|
|
1737
|
+
s = r.provider_params;
|
|
1735
1738
|
return S(t, void 0, void 0, i().mark(function t() {
|
|
1736
|
-
var r,
|
|
1739
|
+
var r, a, c, u, l, d;
|
|
1737
1740
|
return i().wrap(function (t) {
|
|
1738
1741
|
for (;;) switch (t.prev = t.next) {
|
|
1739
1742
|
case 0:
|
|
1740
1743
|
return t.next = 2, this._dynamicConfig;
|
|
1741
1744
|
case 2:
|
|
1742
|
-
return r = t.sent,
|
|
1745
|
+
return r = t.sent, a = r.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
|
|
1743
1746
|
case 6:
|
|
1744
|
-
if (
|
|
1745
|
-
|
|
1747
|
+
if (c = t.sent, (u = new URL("".concat(c, "/v1/b2b/public/oauth/").concat(e, "/discovery/start"))).searchParams.set("public_token", this._config.publicToken), o && (Q("startOAuthFlow").isStringArray("custom_scopes", o), u.searchParams.set("custom_scopes", o.join(" "))), s) for (l in Q("startOAuthFlow").isOptionalObject("provider_params", s), s) u.searchParams.set("provider_" + l, s[l]);
|
|
1748
|
+
if (!a) {
|
|
1749
|
+
t.next = 18;
|
|
1746
1750
|
break;
|
|
1747
1751
|
}
|
|
1748
|
-
return t.next =
|
|
1749
|
-
case
|
|
1750
|
-
|
|
1752
|
+
return t.next = 14, this._pkceManager.startPKCETransaction();
|
|
1753
|
+
case 14:
|
|
1754
|
+
d = t.sent, u.searchParams.set("pkce_code_challenge", d.code_challenge), t.next = 19;
|
|
1751
1755
|
break;
|
|
1752
|
-
case 17:
|
|
1753
|
-
this._pkceManager.clearPKPair();
|
|
1754
1756
|
case 18:
|
|
1755
|
-
|
|
1756
|
-
case
|
|
1757
|
+
this._pkceManager.clearPKPair();
|
|
1758
|
+
case 19:
|
|
1759
|
+
n && u.searchParams.set("discovery_redirect_url", n), window.location.href = u.toString();
|
|
1760
|
+
case 21:
|
|
1757
1761
|
case "end":
|
|
1758
1762
|
return t.stop();
|
|
1759
1763
|
}
|
|
@@ -2180,7 +2184,7 @@ function Ae(e, t, r, n) {
|
|
|
2180
2184
|
c((n = n.apply(e, t || [])).next());
|
|
2181
2185
|
});
|
|
2182
2186
|
}
|
|
2183
|
-
we.REFRESH_INTERVAL_MS = 18e4, function (e) {
|
|
2187
|
+
we.REFRESH_INTERVAL_MS = 18e4, "function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
2184
2188
|
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
|
|
2185
2189
|
}(de || (de = {})), function (e) {
|
|
2186
2190
|
e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
|
|
@@ -2619,9 +2623,8 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2619
2623
|
return this._networkClient.retriableFetchSDK({
|
|
2620
2624
|
url: "/b2b/passwords/session/reset",
|
|
2621
2625
|
method: "POST",
|
|
2622
|
-
errorMessage: "Failed to reset session.",
|
|
2626
|
+
errorMessage: "Failed to reset by session.",
|
|
2623
2627
|
body: {
|
|
2624
|
-
organization_id: e.organization_id,
|
|
2625
2628
|
password: e.password,
|
|
2626
2629
|
captcha_token: r,
|
|
2627
2630
|
dfp_telemetry_id: t
|
|
@@ -2879,9 +2882,9 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2879
2882
|
key: "createTelemetryBlob",
|
|
2880
2883
|
value: function createTelemetryBlob() {
|
|
2881
2884
|
return Object.assign(Object.assign({
|
|
2882
|
-
event_id: "event-id-".concat(
|
|
2883
|
-
app_session_id: "app-session-id-".concat(
|
|
2884
|
-
persistent_id: "persistent-id-".concat(
|
|
2885
|
+
event_id: "event-id-".concat(W()),
|
|
2886
|
+
app_session_id: "app-session-id-".concat(W()),
|
|
2887
|
+
persistent_id: "persistent-id-".concat(W()),
|
|
2885
2888
|
client_sent_at: new Date().toISOString(),
|
|
2886
2889
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
2887
2890
|
}, this.additionalTelemetryDataFn()), {
|
|
@@ -2890,7 +2893,7 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2890
2893
|
},
|
|
2891
2894
|
sdk: {
|
|
2892
2895
|
identifier: "Stytch.js Javascript SDK",
|
|
2893
|
-
version: "3.0.
|
|
2896
|
+
version: "3.0.3"
|
|
2894
2897
|
}
|
|
2895
2898
|
});
|
|
2896
2899
|
}
|
|
@@ -3004,52 +3007,16 @@ var Ie = /*#__PURE__*/function () {
|
|
|
3004
3007
|
}]);
|
|
3005
3008
|
return Ie;
|
|
3006
3009
|
}();
|
|
3007
|
-
|
|
3008
|
-
function De(e, t) {
|
|
3009
|
-
_classCallCheck(this, De);
|
|
3010
|
-
this._networkClient = e, this._subscriptionService = t;
|
|
3011
|
-
}
|
|
3012
|
-
_createClass(De, [{
|
|
3013
|
-
key: "resetBySession",
|
|
3014
|
-
value: function resetBySession(e) {
|
|
3015
|
-
return Ae(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
3016
|
-
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
3017
|
-
while (1) switch (_context16.prev = _context16.next) {
|
|
3018
|
-
case 0:
|
|
3019
|
-
Oe("stytch.passwords.resetBySession").isString("password", e.password);
|
|
3020
|
-
_context16.next = 3;
|
|
3021
|
-
return this._networkClient.fetchSDK({
|
|
3022
|
-
url: "/b2b/passwords/session/reset",
|
|
3023
|
-
method: "POST",
|
|
3024
|
-
errorMessage: "Failed to reset session.",
|
|
3025
|
-
body: {
|
|
3026
|
-
organization_id: e.organization_id,
|
|
3027
|
-
password: e.password,
|
|
3028
|
-
session_token: e.session_token
|
|
3029
|
-
}
|
|
3030
|
-
});
|
|
3031
|
-
case 3:
|
|
3032
|
-
return _context16.abrupt("return", _context16.sent);
|
|
3033
|
-
case 4:
|
|
3034
|
-
case "end":
|
|
3035
|
-
return _context16.stop();
|
|
3036
|
-
}
|
|
3037
|
-
}, _callee16, this);
|
|
3038
|
-
}));
|
|
3039
|
-
}
|
|
3040
|
-
}]);
|
|
3041
|
-
return De;
|
|
3042
|
-
}();
|
|
3043
|
-
function Le(e) {
|
|
3010
|
+
function De(e) {
|
|
3044
3011
|
var t = e.toString(16);
|
|
3045
3012
|
return 1 === t.length && (t = "0" + t), t;
|
|
3046
3013
|
}
|
|
3047
|
-
var
|
|
3048
|
-
function
|
|
3049
|
-
_classCallCheck(this,
|
|
3014
|
+
var Le = /*#__PURE__*/function () {
|
|
3015
|
+
function Le(e, t) {
|
|
3016
|
+
_classCallCheck(this, Le);
|
|
3050
3017
|
this._dataLayer = e, this.namespace = t;
|
|
3051
3018
|
}
|
|
3052
|
-
_createClass(
|
|
3019
|
+
_createClass(Le, [{
|
|
3053
3020
|
key: "key",
|
|
3054
3021
|
value: function key() {
|
|
3055
3022
|
return "PKCE_VERIFIER:" + this.namespace;
|
|
@@ -3057,21 +3024,21 @@ var Me = /*#__PURE__*/function () {
|
|
|
3057
3024
|
}, {
|
|
3058
3025
|
key: "startPKCETransaction",
|
|
3059
3026
|
value: function startPKCETransaction() {
|
|
3060
|
-
return Ae(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3027
|
+
return Ae(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
3061
3028
|
var e;
|
|
3062
|
-
return _regeneratorRuntime().wrap(function
|
|
3063
|
-
while (1) switch (
|
|
3029
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
3030
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
3064
3031
|
case 0:
|
|
3065
|
-
|
|
3066
|
-
return
|
|
3032
|
+
_context16.next = 2;
|
|
3033
|
+
return Le.createProofkeyPair();
|
|
3067
3034
|
case 2:
|
|
3068
|
-
e =
|
|
3069
|
-
return
|
|
3035
|
+
e = _context16.sent;
|
|
3036
|
+
return _context16.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
|
|
3070
3037
|
case 4:
|
|
3071
3038
|
case "end":
|
|
3072
|
-
return
|
|
3039
|
+
return _context16.stop();
|
|
3073
3040
|
}
|
|
3074
|
-
},
|
|
3041
|
+
}, _callee16, this);
|
|
3075
3042
|
}));
|
|
3076
3043
|
}
|
|
3077
3044
|
}, {
|
|
@@ -3092,39 +3059,39 @@ var Me = /*#__PURE__*/function () {
|
|
|
3092
3059
|
}], [{
|
|
3093
3060
|
key: "createProofkeyPair",
|
|
3094
3061
|
value: function createProofkeyPair() {
|
|
3095
|
-
return Ae(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3062
|
+
return Ae(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
3096
3063
|
var _String$fromCharCode;
|
|
3097
3064
|
var e, t, r, n;
|
|
3098
|
-
return _regeneratorRuntime().wrap(function
|
|
3099
|
-
while (1) switch (
|
|
3065
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
3066
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
3100
3067
|
case 0:
|
|
3101
3068
|
e = new Uint32Array(16);
|
|
3102
3069
|
window.crypto.getRandomValues(e);
|
|
3103
|
-
t = Array.from(e).map(
|
|
3104
|
-
|
|
3070
|
+
t = Array.from(e).map(De).join("");
|
|
3071
|
+
_context17.next = 5;
|
|
3105
3072
|
return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
|
|
3106
3073
|
case 5:
|
|
3107
|
-
r =
|
|
3108
|
-
return
|
|
3074
|
+
r = _context17.sent;
|
|
3075
|
+
return _context17.abrupt("return", {
|
|
3109
3076
|
code_challenge: (n = r, btoa((_String$fromCharCode = String.fromCharCode).call.apply(_String$fromCharCode, [null].concat(_toConsumableArray(new Uint8Array(n))))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")),
|
|
3110
3077
|
code_verifier: t
|
|
3111
3078
|
});
|
|
3112
3079
|
case 7:
|
|
3113
3080
|
case "end":
|
|
3114
|
-
return
|
|
3081
|
+
return _context17.stop();
|
|
3115
3082
|
}
|
|
3116
|
-
},
|
|
3083
|
+
}, _callee17);
|
|
3117
3084
|
}));
|
|
3118
3085
|
}
|
|
3119
3086
|
}]);
|
|
3120
|
-
return
|
|
3087
|
+
return Le;
|
|
3121
3088
|
}();
|
|
3122
|
-
var
|
|
3123
|
-
function
|
|
3124
|
-
_classCallCheck(this,
|
|
3089
|
+
var Me = /*#__PURE__*/function () {
|
|
3090
|
+
function Me(e) {
|
|
3091
|
+
_classCallCheck(this, Me);
|
|
3125
3092
|
this._networkClient = e;
|
|
3126
3093
|
}
|
|
3127
|
-
_createClass(
|
|
3094
|
+
_createClass(Me, [{
|
|
3128
3095
|
key: "searchUser",
|
|
3129
3096
|
value: function searchUser(e) {
|
|
3130
3097
|
return this._networkClient.fetchSDK({
|
|
@@ -3162,7 +3129,7 @@ var Ne = /*#__PURE__*/function () {
|
|
|
3162
3129
|
});
|
|
3163
3130
|
}
|
|
3164
3131
|
}]);
|
|
3165
|
-
return
|
|
3132
|
+
return Me;
|
|
3166
3133
|
}();
|
|
3167
3134
|
var je = function je(e) {
|
|
3168
3135
|
return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
|
|
@@ -3173,17 +3140,17 @@ var je = function je(e) {
|
|
|
3173
3140
|
}).length > 1;
|
|
3174
3141
|
};
|
|
3175
3142
|
/*! js-cookie v3.0.1 | MIT */
|
|
3176
|
-
function
|
|
3143
|
+
function Ne(e) {
|
|
3177
3144
|
for (var t = 1; t < arguments.length; t++) {
|
|
3178
3145
|
var r = arguments[t];
|
|
3179
3146
|
for (var n in r) e[n] = r[n];
|
|
3180
3147
|
}
|
|
3181
3148
|
return e;
|
|
3182
3149
|
}
|
|
3183
|
-
var
|
|
3150
|
+
var Fe = function e(t, r) {
|
|
3184
3151
|
function n(e, n, i) {
|
|
3185
3152
|
if ("undefined" != typeof document) {
|
|
3186
|
-
"number" == typeof (i =
|
|
3153
|
+
"number" == typeof (i = Ne({}, r, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
3187
3154
|
var o = "";
|
|
3188
3155
|
for (var s in i) i[s] && (o += "; " + s, !0 !== i[s] && (o += "=" + i[s].split(";")[0]));
|
|
3189
3156
|
return document.cookie = e + "=" + t.write(n, e) + o;
|
|
@@ -3205,15 +3172,15 @@ var Ke = function e(t, r) {
|
|
|
3205
3172
|
}
|
|
3206
3173
|
},
|
|
3207
3174
|
remove: function remove(e, t) {
|
|
3208
|
-
n(e, "",
|
|
3175
|
+
n(e, "", Ne({}, t, {
|
|
3209
3176
|
expires: -1
|
|
3210
3177
|
}));
|
|
3211
3178
|
},
|
|
3212
3179
|
withAttributes: function withAttributes(t) {
|
|
3213
|
-
return e(this.converter,
|
|
3180
|
+
return e(this.converter, Ne({}, this.attributes, t));
|
|
3214
3181
|
},
|
|
3215
3182
|
withConverter: function withConverter(t) {
|
|
3216
|
-
return e(
|
|
3183
|
+
return e(Ne({}, this.converter, t), this.attributes);
|
|
3217
3184
|
}
|
|
3218
3185
|
}, {
|
|
3219
3186
|
attributes: {
|
|
@@ -3233,26 +3200,26 @@ var Ke = function e(t, r) {
|
|
|
3233
3200
|
}, {
|
|
3234
3201
|
path: "/"
|
|
3235
3202
|
});
|
|
3236
|
-
var
|
|
3203
|
+
var Ke = function Ke(e) {
|
|
3237
3204
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
3238
3205
|
return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
|
|
3239
3206
|
};
|
|
3240
|
-
var
|
|
3241
|
-
function
|
|
3207
|
+
var Ue = /*#__PURE__*/function () {
|
|
3208
|
+
function Ue(e, t) {
|
|
3242
3209
|
var _this4 = this;
|
|
3243
|
-
_classCallCheck(this,
|
|
3210
|
+
_classCallCheck(this, Ue);
|
|
3244
3211
|
this.browserSessionStorage = {
|
|
3245
3212
|
getItem: function getItem(e) {
|
|
3246
|
-
return sessionStorage.getItem(
|
|
3213
|
+
return sessionStorage.getItem(Ke(_this4.publicToken, e));
|
|
3247
3214
|
},
|
|
3248
3215
|
setItem: function setItem(e, t) {
|
|
3249
|
-
return sessionStorage.setItem(
|
|
3216
|
+
return sessionStorage.setItem(Ke(_this4.publicToken, e), t);
|
|
3250
3217
|
},
|
|
3251
3218
|
removeItem: function removeItem(e) {
|
|
3252
|
-
return sessionStorage.removeItem(
|
|
3219
|
+
return sessionStorage.removeItem(Ke(_this4.publicToken, e));
|
|
3253
3220
|
}
|
|
3254
3221
|
}, this.publicToken = e, this.state = null, this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (Q("SubscriptionDataLayer").isOptionalString("cookieOptions.opaqueTokenCookieName", t.cookieOptions.opaqueTokenCookieName).isOptionalString("cookieOptions.jwtCookieName", t.cookieOptions.jwtCookieName).isOptionalString("cookieOptions.istCookieName", t.cookieOptions.istCookieName).isOptionalString("cookieOptions.path", t.cookieOptions.path).isOptionalString("cookieOptions.domain", t.cookieOptions.domain), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._domain = t.cookieOptions.domain || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._domain = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
|
|
3255
|
-
var r = localStorage.getItem(
|
|
3222
|
+
var r = localStorage.getItem(Ke(this.publicToken));
|
|
3256
3223
|
if (!r) return;
|
|
3257
3224
|
var n;
|
|
3258
3225
|
try {
|
|
@@ -3262,7 +3229,7 @@ var ze = /*#__PURE__*/function () {
|
|
|
3262
3229
|
}
|
|
3263
3230
|
this.state = n;
|
|
3264
3231
|
}
|
|
3265
|
-
_createClass(
|
|
3232
|
+
_createClass(Ue, [{
|
|
3266
3233
|
key: "opaqueTokenCookieName",
|
|
3267
3234
|
get: function get() {
|
|
3268
3235
|
var e;
|
|
@@ -3284,14 +3251,14 @@ var ze = /*#__PURE__*/function () {
|
|
|
3284
3251
|
key: "readSessionCookie",
|
|
3285
3252
|
value: function readSessionCookie() {
|
|
3286
3253
|
return {
|
|
3287
|
-
session_token:
|
|
3288
|
-
session_jwt:
|
|
3254
|
+
session_token: Fe.get(this.opaqueTokenCookieName),
|
|
3255
|
+
session_jwt: Fe.get(this.jwtCookieName)
|
|
3289
3256
|
};
|
|
3290
3257
|
}
|
|
3291
3258
|
}, {
|
|
3292
3259
|
key: "readIntermediateSessionTokenCookie",
|
|
3293
3260
|
value: function readIntermediateSessionTokenCookie() {
|
|
3294
|
-
return
|
|
3261
|
+
return Fe.get(this.istCookieName);
|
|
3295
3262
|
}
|
|
3296
3263
|
}, {
|
|
3297
3264
|
key: "writeSessionCookie",
|
|
@@ -3300,32 +3267,32 @@ var ze = /*#__PURE__*/function () {
|
|
|
3300
3267
|
var o = e.state,
|
|
3301
3268
|
s = e.session_token,
|
|
3302
3269
|
a = e.session_jwt,
|
|
3303
|
-
c =
|
|
3270
|
+
c = Ue.generateCookieOpts({
|
|
3304
3271
|
expiresAt: null !== (r = null === (t = null == o ? void 0 : o.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
|
|
3305
3272
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3306
3273
|
path: this._cookiePath,
|
|
3307
3274
|
domain: this._domain
|
|
3308
3275
|
});
|
|
3309
|
-
|
|
3310
|
-
var u =
|
|
3276
|
+
Fe.set(this.opaqueTokenCookieName, s, c), Fe.set(this.jwtCookieName, a, c);
|
|
3277
|
+
var u = Ue.generateCookieOpts({
|
|
3311
3278
|
expiresAt: null !== (i = null === (n = null == o ? void 0 : o.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
|
|
3312
3279
|
availableToSubdomains: !this._cookieAvailableToSubdomains,
|
|
3313
3280
|
path: this._cookiePath,
|
|
3314
3281
|
domain: this._domain
|
|
3315
3282
|
});
|
|
3316
|
-
je(this.jwtCookieName) &&
|
|
3283
|
+
je(this.jwtCookieName) && Fe.remove(this.jwtCookieName, u), je(this.opaqueTokenCookieName) && Fe.remove(this.opaqueTokenCookieName, u), je(this.jwtCookieName) && $("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), je(this.opaqueTokenCookieName) && $("Could not remove extraneous opaque token cookie.");
|
|
3317
3284
|
}
|
|
3318
3285
|
}, {
|
|
3319
3286
|
key: "writeIntermediateSessionTokenCookie",
|
|
3320
3287
|
value: function writeIntermediateSessionTokenCookie(e) {
|
|
3321
3288
|
var t = new Date(Date.now() + 6e5),
|
|
3322
|
-
r =
|
|
3289
|
+
r = Ue.generateCookieOpts({
|
|
3323
3290
|
expiresAt: t.toString(),
|
|
3324
3291
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3325
3292
|
path: this._cookiePath,
|
|
3326
3293
|
domain: this._domain
|
|
3327
3294
|
});
|
|
3328
|
-
|
|
3295
|
+
Fe.set(this.istCookieName, e, r);
|
|
3329
3296
|
}
|
|
3330
3297
|
}, {
|
|
3331
3298
|
key: "removeSessionCookie",
|
|
@@ -3344,14 +3311,14 @@ var ze = /*#__PURE__*/function () {
|
|
|
3344
3311
|
[!0, !1].forEach(function (t) {
|
|
3345
3312
|
[_this5._cookiePath, null].forEach(function (r) {
|
|
3346
3313
|
[_this5._domain, null].forEach(function (n) {
|
|
3347
|
-
var i =
|
|
3314
|
+
var i = Ue.generateCookieOpts({
|
|
3348
3315
|
expiresAt: new Date(0).toString(),
|
|
3349
3316
|
availableToSubdomains: t,
|
|
3350
3317
|
path: r,
|
|
3351
3318
|
domain: n
|
|
3352
3319
|
});
|
|
3353
3320
|
e.forEach(function (e) {
|
|
3354
|
-
|
|
3321
|
+
Fe.remove(e, i);
|
|
3355
3322
|
});
|
|
3356
3323
|
});
|
|
3357
3324
|
});
|
|
@@ -3360,22 +3327,22 @@ var ze = /*#__PURE__*/function () {
|
|
|
3360
3327
|
}, {
|
|
3361
3328
|
key: "syncToLocalStorage",
|
|
3362
3329
|
value: function syncToLocalStorage() {
|
|
3363
|
-
localStorage.setItem(
|
|
3330
|
+
localStorage.setItem(Ke(this.publicToken), JSON.stringify(this.state));
|
|
3364
3331
|
}
|
|
3365
3332
|
}, {
|
|
3366
3333
|
key: "getItem",
|
|
3367
3334
|
value: function getItem(e) {
|
|
3368
|
-
return localStorage.getItem(
|
|
3335
|
+
return localStorage.getItem(Ke(this.publicToken, e));
|
|
3369
3336
|
}
|
|
3370
3337
|
}, {
|
|
3371
3338
|
key: "setItem",
|
|
3372
3339
|
value: function setItem(e, t) {
|
|
3373
|
-
return localStorage.setItem(
|
|
3340
|
+
return localStorage.setItem(Ke(this.publicToken, e), t);
|
|
3374
3341
|
}
|
|
3375
3342
|
}, {
|
|
3376
3343
|
key: "removeItem",
|
|
3377
3344
|
value: function removeItem(e) {
|
|
3378
|
-
return localStorage.removeItem(
|
|
3345
|
+
return localStorage.removeItem(Ke(this.publicToken, e));
|
|
3379
3346
|
}
|
|
3380
3347
|
}], [{
|
|
3381
3348
|
key: "generateCookieOpts",
|
|
@@ -3391,31 +3358,31 @@ var ze = /*#__PURE__*/function () {
|
|
|
3391
3358
|
return e && (i.path = e), Boolean("localhost" === window.location.hostname || "[::1]" === window.location.hostname || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ? i.secure = !1 : (r && (i.domain = t || window.location.host), i.secure = !0), i;
|
|
3392
3359
|
}
|
|
3393
3360
|
}]);
|
|
3394
|
-
return
|
|
3361
|
+
return Ue;
|
|
3395
3362
|
}();
|
|
3396
|
-
var We = /*#__PURE__*/function (
|
|
3397
|
-
_inherits(We,
|
|
3363
|
+
var We = /*#__PURE__*/function (_Ue) {
|
|
3364
|
+
_inherits(We, _Ue);
|
|
3398
3365
|
var _super2 = _createSuper(We);
|
|
3399
3366
|
function We() {
|
|
3400
3367
|
_classCallCheck(this, We);
|
|
3401
3368
|
return _super2.apply(this, arguments);
|
|
3402
3369
|
}
|
|
3403
3370
|
return _createClass(We);
|
|
3404
|
-
}(
|
|
3405
|
-
var
|
|
3406
|
-
|
|
3371
|
+
}(Ue);
|
|
3372
|
+
var ze = Symbol["for"]("__stytch_b2b_DataLayer"),
|
|
3373
|
+
Ge = function Ge(e, t) {
|
|
3407
3374
|
var r = function () {
|
|
3408
3375
|
var e = window;
|
|
3409
|
-
return e[
|
|
3376
|
+
return e[ze] || (e[ze] = {}), e[ze];
|
|
3410
3377
|
}();
|
|
3411
3378
|
return r[e] || (r[e] = new We(e, t)), r[e];
|
|
3412
3379
|
},
|
|
3413
|
-
|
|
3380
|
+
He = function He(e, t) {
|
|
3414
3381
|
Object.values(e).forEach(function (e) {
|
|
3415
3382
|
return e(t);
|
|
3416
3383
|
});
|
|
3417
3384
|
},
|
|
3418
|
-
|
|
3385
|
+
qe = function () {
|
|
3419
3386
|
var t = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
|
|
3420
3387
|
r = void 0 === t ? [] : t;
|
|
3421
3388
|
return function t(i, o) {
|
|
@@ -3434,12 +3401,12 @@ var Ge = Symbol["for"]("__stytch_b2b_DataLayer"),
|
|
|
3434
3401
|
}({
|
|
3435
3402
|
KEYS_TO_EXCLUDE: ["last_accessed_at"]
|
|
3436
3403
|
});
|
|
3437
|
-
var
|
|
3438
|
-
function
|
|
3404
|
+
var Ye = /*#__PURE__*/function () {
|
|
3405
|
+
function Ye(e, t) {
|
|
3439
3406
|
var _this6 = this;
|
|
3440
|
-
_classCallCheck(this,
|
|
3407
|
+
_classCallCheck(this, Ye);
|
|
3441
3408
|
this._publicToken = e, this._datalayer = t, this._listen = function (e) {
|
|
3442
|
-
if (e.key !==
|
|
3409
|
+
if (e.key !== Ke(_this6._publicToken)) return;
|
|
3443
3410
|
if (null === e.newValue || "null" === e.newValue) return void _this6.destroyState();
|
|
3444
3411
|
var t = JSON.parse(e.newValue);
|
|
3445
3412
|
_this6.updateState(t);
|
|
@@ -3448,7 +3415,7 @@ var Ve = /*#__PURE__*/function () {
|
|
|
3448
3415
|
r = _this$_datalayer$read.session_token;
|
|
3449
3416
|
r || this.destroyState();
|
|
3450
3417
|
}
|
|
3451
|
-
_createClass(
|
|
3418
|
+
_createClass(Ye, [{
|
|
3452
3419
|
key: "getTokens",
|
|
3453
3420
|
value: function getTokens() {
|
|
3454
3421
|
var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
|
|
@@ -3479,7 +3446,7 @@ var Ve = /*#__PURE__*/function () {
|
|
|
3479
3446
|
value: function _updateStateAndTokensInternal(e) {
|
|
3480
3447
|
var t = this._datalayer.state,
|
|
3481
3448
|
r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
|
|
3482
|
-
this._datalayer.state = r,
|
|
3449
|
+
this._datalayer.state = r, qe(t, r) || He(this._datalayer.subscriptions, r);
|
|
3483
3450
|
}
|
|
3484
3451
|
}, {
|
|
3485
3452
|
key: "updateStateAndTokens",
|
|
@@ -3491,7 +3458,7 @@ var Ve = /*#__PURE__*/function () {
|
|
|
3491
3458
|
value: function updateState(e) {
|
|
3492
3459
|
var t = this._datalayer.state,
|
|
3493
3460
|
r = null === e ? null : Object.assign(Object.assign({}, this._datalayer.state), e);
|
|
3494
|
-
this._datalayer.state = r,
|
|
3461
|
+
this._datalayer.state = r, qe(t, r) || (He(this._datalayer.subscriptions, r), this._datalayer.syncToLocalStorage());
|
|
3495
3462
|
}
|
|
3496
3463
|
}, {
|
|
3497
3464
|
key: "updateTokens",
|
|
@@ -3531,14 +3498,14 @@ var Ve = /*#__PURE__*/function () {
|
|
|
3531
3498
|
return null;
|
|
3532
3499
|
}
|
|
3533
3500
|
}]);
|
|
3534
|
-
return
|
|
3501
|
+
return Ye;
|
|
3535
3502
|
}();
|
|
3536
|
-
var
|
|
3537
|
-
_inherits(
|
|
3538
|
-
var _super3 = _createSuper(
|
|
3539
|
-
function
|
|
3503
|
+
var Ve = /*#__PURE__*/function (_Ye) {
|
|
3504
|
+
_inherits(Ve, _Ye);
|
|
3505
|
+
var _super3 = _createSuper(Ve);
|
|
3506
|
+
function Ve() {
|
|
3540
3507
|
var _this7;
|
|
3541
|
-
_classCallCheck(this,
|
|
3508
|
+
_classCallCheck(this, Ve);
|
|
3542
3509
|
_this7 = _super3.apply(this, arguments), _this7.updateMember = function (e) {
|
|
3543
3510
|
return _this7.updateState({
|
|
3544
3511
|
member: e
|
|
@@ -3552,41 +3519,41 @@ var $e = /*#__PURE__*/function (_Ve) {
|
|
|
3552
3519
|
};
|
|
3553
3520
|
return _this7;
|
|
3554
3521
|
}
|
|
3555
|
-
return _createClass(
|
|
3556
|
-
}(
|
|
3557
|
-
var
|
|
3558
|
-
function
|
|
3559
|
-
return
|
|
3522
|
+
return _createClass(Ve);
|
|
3523
|
+
}(Ye);
|
|
3524
|
+
var $e = Symbol["for"]("stytch__internal_b2b");
|
|
3525
|
+
function Je(e) {
|
|
3526
|
+
return Je = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
|
|
3560
3527
|
return _typeof(e);
|
|
3561
3528
|
} : function (e) {
|
|
3562
3529
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
|
|
3563
|
-
},
|
|
3530
|
+
}, Je(e);
|
|
3564
3531
|
}
|
|
3565
|
-
function
|
|
3532
|
+
function Xe(e, t) {
|
|
3566
3533
|
for (var r = 0; r < t.length; r++) {
|
|
3567
3534
|
var n = t[r];
|
|
3568
3535
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (i = n.key, o = void 0, o = function (e, t) {
|
|
3569
|
-
if ("object" !==
|
|
3536
|
+
if ("object" !== Je(e) || null === e) return e;
|
|
3570
3537
|
var r = e[Symbol.toPrimitive];
|
|
3571
3538
|
if (void 0 !== r) {
|
|
3572
3539
|
var n = r.call(e, t || "default");
|
|
3573
|
-
if ("object" !==
|
|
3540
|
+
if ("object" !== Je(n)) return n;
|
|
3574
3541
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3575
3542
|
}
|
|
3576
3543
|
return ("string" === t ? String : Number)(e);
|
|
3577
|
-
}(i, "string"), "symbol" ===
|
|
3544
|
+
}(i, "string"), "symbol" === Je(o) ? o : String(o)), n);
|
|
3578
3545
|
}
|
|
3579
3546
|
var i, o;
|
|
3580
3547
|
}
|
|
3581
|
-
function
|
|
3582
|
-
return t &&
|
|
3548
|
+
function Ze(e, t, r) {
|
|
3549
|
+
return t && Xe(e.prototype, t), r && Xe(e, r), Object.defineProperty(e, "prototype", {
|
|
3583
3550
|
writable: !1
|
|
3584
3551
|
}), e;
|
|
3585
3552
|
}
|
|
3586
|
-
function
|
|
3553
|
+
function Qe(e, t) {
|
|
3587
3554
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
3588
3555
|
}
|
|
3589
|
-
function
|
|
3556
|
+
function et(e, t) {
|
|
3590
3557
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
3591
3558
|
e.prototype = Object.create(t && t.prototype, {
|
|
3592
3559
|
constructor: {
|
|
@@ -3596,31 +3563,31 @@ function tt(e, t) {
|
|
|
3596
3563
|
}
|
|
3597
3564
|
}), Object.defineProperty(e, "prototype", {
|
|
3598
3565
|
writable: !1
|
|
3599
|
-
}), t &&
|
|
3566
|
+
}), t && st(e, t);
|
|
3600
3567
|
}
|
|
3601
|
-
function
|
|
3602
|
-
var t =
|
|
3568
|
+
function tt(e) {
|
|
3569
|
+
var t = ot();
|
|
3603
3570
|
return function () {
|
|
3604
3571
|
var r,
|
|
3605
|
-
n =
|
|
3572
|
+
n = at(e);
|
|
3606
3573
|
if (t) {
|
|
3607
|
-
var i =
|
|
3574
|
+
var i = at(this).constructor;
|
|
3608
3575
|
r = Reflect.construct(n, arguments, i);
|
|
3609
3576
|
} else r = n.apply(this, arguments);
|
|
3610
3577
|
return function (e, t) {
|
|
3611
|
-
if (t && ("object" ===
|
|
3578
|
+
if (t && ("object" === Je(t) || "function" == typeof t)) return t;
|
|
3612
3579
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
3613
|
-
return
|
|
3580
|
+
return rt(e);
|
|
3614
3581
|
}(this, r);
|
|
3615
3582
|
};
|
|
3616
3583
|
}
|
|
3617
|
-
function
|
|
3584
|
+
function rt(e) {
|
|
3618
3585
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3619
3586
|
return e;
|
|
3620
3587
|
}
|
|
3621
|
-
function
|
|
3588
|
+
function nt(e) {
|
|
3622
3589
|
var t = "function" == typeof Map ? new Map() : void 0;
|
|
3623
|
-
return
|
|
3590
|
+
return nt = function nt(e) {
|
|
3624
3591
|
if (null === e || (r = e, -1 === Function.toString.call(r).indexOf("[native code]"))) return e;
|
|
3625
3592
|
var r;
|
|
3626
3593
|
if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function");
|
|
@@ -3629,7 +3596,7 @@ function it(e) {
|
|
|
3629
3596
|
t.set(e, n);
|
|
3630
3597
|
}
|
|
3631
3598
|
function n() {
|
|
3632
|
-
return
|
|
3599
|
+
return it(e, arguments, at(this).constructor);
|
|
3633
3600
|
}
|
|
3634
3601
|
return n.prototype = Object.create(e.prototype, {
|
|
3635
3602
|
constructor: {
|
|
@@ -3638,18 +3605,18 @@ function it(e) {
|
|
|
3638
3605
|
writable: !0,
|
|
3639
3606
|
configurable: !0
|
|
3640
3607
|
}
|
|
3641
|
-
}),
|
|
3642
|
-
},
|
|
3608
|
+
}), st(n, e);
|
|
3609
|
+
}, nt(e);
|
|
3643
3610
|
}
|
|
3644
|
-
function
|
|
3645
|
-
return
|
|
3611
|
+
function it(e, t, r) {
|
|
3612
|
+
return it = ot() ? Reflect.construct.bind() : function (e, t, r) {
|
|
3646
3613
|
var n = [null];
|
|
3647
3614
|
n.push.apply(n, t);
|
|
3648
3615
|
var i = new (Function.bind.apply(e, n))();
|
|
3649
|
-
return r &&
|
|
3650
|
-
},
|
|
3616
|
+
return r && st(i, r.prototype), i;
|
|
3617
|
+
}, it.apply(null, arguments);
|
|
3651
3618
|
}
|
|
3652
|
-
function
|
|
3619
|
+
function ot() {
|
|
3653
3620
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
|
3654
3621
|
if (Reflect.construct.sham) return !1;
|
|
3655
3622
|
if ("function" == typeof Proxy) return !0;
|
|
@@ -3659,15 +3626,15 @@ function st() {
|
|
|
3659
3626
|
return !1;
|
|
3660
3627
|
}
|
|
3661
3628
|
}
|
|
3662
|
-
function
|
|
3663
|
-
return
|
|
3629
|
+
function st(e, t) {
|
|
3630
|
+
return st = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
|
|
3664
3631
|
return e.__proto__ = t, e;
|
|
3665
|
-
},
|
|
3632
|
+
}, st(e, t);
|
|
3666
3633
|
}
|
|
3667
|
-
function
|
|
3668
|
-
return
|
|
3634
|
+
function at(e) {
|
|
3635
|
+
return at = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
3669
3636
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
3670
|
-
},
|
|
3637
|
+
}, at(e);
|
|
3671
3638
|
}
|
|
3672
3639
|
exports.Products = void 0, function (e) {
|
|
3673
3640
|
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
|
|
@@ -3682,43 +3649,43 @@ exports.Products = void 0, function (e) {
|
|
|
3682
3649
|
}(exports.OTPMethods || (exports.OTPMethods = {})), exports.StytchEventType = void 0, function (e) {
|
|
3683
3650
|
e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
|
|
3684
3651
|
}(exports.StytchEventType || (exports.StytchEventType = {}));
|
|
3685
|
-
var
|
|
3686
|
-
|
|
3687
|
-
var t =
|
|
3652
|
+
var ct = function (e) {
|
|
3653
|
+
et(r, nt(Error));
|
|
3654
|
+
var t = tt(r);
|
|
3688
3655
|
function r(e, n) {
|
|
3689
3656
|
var i;
|
|
3690
|
-
return
|
|
3657
|
+
return Qe(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(rt(i), r.prototype), i;
|
|
3691
3658
|
}
|
|
3692
|
-
return
|
|
3659
|
+
return Ze(r);
|
|
3693
3660
|
}(),
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
var t =
|
|
3661
|
+
ut = function (e) {
|
|
3662
|
+
et(r, nt(Error));
|
|
3663
|
+
var t = tt(r);
|
|
3697
3664
|
function r(e, n) {
|
|
3698
3665
|
var i;
|
|
3699
|
-
return
|
|
3666
|
+
return Qe(this, r), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + n, i;
|
|
3700
3667
|
}
|
|
3701
|
-
return
|
|
3668
|
+
return Ze(r);
|
|
3702
3669
|
}(),
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
var t =
|
|
3670
|
+
lt = function (e) {
|
|
3671
|
+
et(r, nt(Error));
|
|
3672
|
+
var t = tt(r);
|
|
3706
3673
|
function r(e) {
|
|
3707
3674
|
var n, i;
|
|
3708
|
-
|
|
3675
|
+
Qe(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
|
|
3709
3676
|
var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
|
|
3710
3677
|
return "".concat(e.dataPath, ": ").concat(e.message);
|
|
3711
3678
|
}).join("\n");
|
|
3712
3679
|
return n.message = "[400] Request does not match expected schema\n".concat(o), n;
|
|
3713
3680
|
}
|
|
3714
|
-
return
|
|
3681
|
+
return Ze(r);
|
|
3715
3682
|
}(),
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
var t =
|
|
3683
|
+
dt = function (e) {
|
|
3684
|
+
et(r, nt(Error));
|
|
3685
|
+
var t = tt(r);
|
|
3719
3686
|
function r(e) {
|
|
3720
3687
|
var n;
|
|
3721
|
-
|
|
3688
|
+
Qe(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
|
|
3722
3689
|
var i = e.status_code,
|
|
3723
3690
|
o = e.error_type,
|
|
3724
3691
|
s = e.error_message,
|
|
@@ -3726,16 +3693,16 @@ var ut = function (e) {
|
|
|
3726
3693
|
c = e.request_id;
|
|
3727
3694
|
return n.error_type = o, n.error_message = s, n.error_url = a, n.request_id = c, n.status_code = i, n.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(s, "\n") + "See ".concat(a, " for more information.\n") + (c ? "request_id: ".concat(c, "\n") : ""), n;
|
|
3728
3695
|
}
|
|
3729
|
-
return
|
|
3696
|
+
return Ze(r);
|
|
3730
3697
|
}(),
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
var t =
|
|
3698
|
+
ht = function (e) {
|
|
3699
|
+
et(r, nt(Error));
|
|
3700
|
+
var t = tt(r);
|
|
3734
3701
|
function r(e) {
|
|
3735
3702
|
var n;
|
|
3736
|
-
return
|
|
3703
|
+
return Qe(this, r), (n = t.call(this)).name = "StytchSDKNativeError", n.error_type = e, n.message = "".concat(e), n;
|
|
3737
3704
|
}
|
|
3738
|
-
return
|
|
3705
|
+
return Ze(r);
|
|
3739
3706
|
}();
|
|
3740
3707
|
exports.BiometricsErrors = void 0, function (e) {
|
|
3741
3708
|
e.BiometricsSensorError = "biometrics_sensor_error", e.DeviceCredentialsNotAllowed = "device_credentials_not_allowed", e.DeviceHardwareError = "device_hardware_error", e.InternalError = "internal_error", e.KeyInvalidated = "key_invalidated", e.KeystoreUnavailable = "keystore_unavailable", e.NoBiometricsEnrolled = "no_biometrics_enrolled", e.NoBiometricsRegistration = "no_biometrics_registration", e.SessionExpired = "session_expired", e.UserCancellation = "user_cancellation", e.UserLockedOut = "user_locked_out", e.BiometricsNotAvailable = "biometrics_not_available";
|
|
@@ -3745,7 +3712,7 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3745
3712
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
3746
3713
|
}(exports.AuthFlowType || (exports.AuthFlowType = {})), exports.B2BOAuthProviders = void 0, function (e) {
|
|
3747
3714
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
3748
|
-
}(exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {})), exports.SDKAPIUnreachableError =
|
|
3715
|
+
}(exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {})), exports.SDKAPIUnreachableError = ct, exports.StytchB2BHeadlessClient = /*#__PURE__*/function () {
|
|
3749
3716
|
function _class(e, t) {
|
|
3750
3717
|
var _this8 = this;
|
|
3751
3718
|
_classCallCheck(this, _class);
|
|
@@ -3765,8 +3732,8 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3765
3732
|
}
|
|
3766
3733
|
};
|
|
3767
3734
|
var s, a, c, u, l, d, h, p, _, m, f;
|
|
3768
|
-
this._dataLayer =
|
|
3769
|
-
var v = new
|
|
3735
|
+
this._dataLayer = Ge(e, i), this._subscriptionService = new Ve(e, this._dataLayer);
|
|
3736
|
+
var v = new Le(this._dataLayer, "passwords");
|
|
3770
3737
|
this._networkClient = new Ie(e, this._dataLayer, o.endpoints.sdkBackendURL, function () {
|
|
3771
3738
|
var e, t, r, n;
|
|
3772
3739
|
return {
|
|
@@ -3776,18 +3743,17 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3776
3743
|
});
|
|
3777
3744
|
var b = new Be(e, this._networkClient, this._dataLayer),
|
|
3778
3745
|
g = new Re(b.getAsync()),
|
|
3779
|
-
y = new ee(e, o.endpoints.dfpBackendURL, b.getAsync(), g.executeRecaptcha)
|
|
3780
|
-
|
|
3781
|
-
this.organization = new ae(this._networkClient), this.member = new oe(this._networkClient, this._subscriptionService), this.session = new ue(this._networkClient, this._subscriptionService), this.magicLinks = new ie(this._networkClient, this._subscriptionService, new Me(this._dataLayer, "magic_links"), v, b.getAsync(), y), this.oauth = new ce(this._networkClient, this._subscriptionService, new Me(this._dataLayer, "oauth"), b.getAsync(), {
|
|
3746
|
+
y = new ee(e, o.endpoints.dfpBackendURL, b.getAsync(), g.executeRecaptcha);
|
|
3747
|
+
this.organization = new ae(this._networkClient), this.member = new oe(this._networkClient, this._subscriptionService), this.session = new ue(this._networkClient, this._subscriptionService), this.magicLinks = new ie(this._networkClient, this._subscriptionService, new Le(this._dataLayer, "magic_links"), v, b.getAsync(), y), this.oauth = new ce(this._networkClient, this._subscriptionService, new Le(this._dataLayer, "oauth"), b.getAsync(), {
|
|
3782
3748
|
publicToken: e,
|
|
3783
3749
|
testAPIURL: o.endpoints.testAPIURL,
|
|
3784
3750
|
liveAPIURL: o.endpoints.liveAPIURL
|
|
3785
|
-
}, y), this.sso = new se(this._networkClient, this._subscriptionService, new
|
|
3751
|
+
}, y), this.sso = new se(this._networkClient, this._subscriptionService, new Le(this._dataLayer, "sso"), b.getAsync(), {
|
|
3786
3752
|
publicToken: e,
|
|
3787
3753
|
testAPIURL: o.endpoints.testAPIURL,
|
|
3788
3754
|
liveAPIURL: o.endpoints.liveAPIURL
|
|
3789
3755
|
}), this.discovery = new le(this._networkClient, this._subscriptionService), this.passwords = new Ce(this._networkClient, this._subscriptionService, v, b.getAsync(), y), this.otps = new Se(this._networkClient, this._subscriptionService, y), this._sessionManager = new we(this._subscriptionService, this.session);
|
|
3790
|
-
var
|
|
3756
|
+
var k = new Me(this._networkClient);
|
|
3791
3757
|
this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
|
|
3792
3758
|
name: "b2b_sdk_instance_instantiated",
|
|
3793
3759
|
details: {
|
|
@@ -3797,15 +3763,14 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3797
3763
|
}
|
|
3798
3764
|
});
|
|
3799
3765
|
(function (e, t) {
|
|
3800
|
-
Object.assign(e, _defineProperty({},
|
|
3766
|
+
Object.assign(e, _defineProperty({}, $e, t));
|
|
3801
3767
|
})(this, {
|
|
3802
3768
|
bootstrap: b,
|
|
3803
3769
|
publicToken: e,
|
|
3804
|
-
searchManager:
|
|
3805
|
-
passwordResetClient: k,
|
|
3770
|
+
searchManager: k,
|
|
3806
3771
|
dataLayer: this._dataLayer,
|
|
3807
3772
|
networkClient: this._networkClient
|
|
3808
3773
|
});
|
|
3809
3774
|
}
|
|
3810
3775
|
return _createClass(_class);
|
|
3811
|
-
}(), exports.StytchSDKAPIError =
|
|
3776
|
+
}(), exports.StytchSDKAPIError = dt, exports.StytchSDKNativeError = ht, exports.StytchSDKSchemaError = lt, exports.StytchSDKUsageError = ut, exports.UNRECOVERABLE_ERROR_TYPES = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
|