diff --git a/assets/img/.DS_Store b/assets/img/.DS_Store deleted file mode 100644 index ebef8db..0000000 Binary files a/assets/img/.DS_Store and /dev/null differ diff --git a/assets/libs/magic.js b/assets/libs/magic.js index fe579fc..b24e155 100644 --- a/assets/libs/magic.js +++ b/assets/libs/magic.js @@ -1 +1 @@ -var Magic = function () { function e() { return (e = Object.assign || function (e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t]; for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]) } return e }).apply(this, arguments) } function t(e, t) { e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e.__proto__ = t } function r(e, t) { (null == t || t > e.length) && (t = e.length); for (var r = 0, n = new Array(t); r < t; r++)n[r] = e[r]; return n } var n = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}; function o(e, t) { return e(t = { exports: {} }, t.exports), t.exports } function i() { throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs") } o(function (e) { var t = function (e) { var t = Object.prototype, r = t.hasOwnProperty, n = "function" == typeof Symbol ? Symbol : {}, o = n.iterator || "@@iterator", i = n.asyncIterator || "@@asyncIterator", a = n.toStringTag || "@@toStringTag"; function s(e, t, r, n) { var o = Object.create((t && t.prototype instanceof f ? t : f).prototype), i = new I(n || []); return o._invoke = function (e, t, r) { var n = "suspendedStart"; return function (o, i) { if ("executing" === n) throw new Error("Generator is already running"); if ("completed" === n) { if ("throw" === o) throw i; return { value: void 0, done: !0 } } for (r.method = o, r.arg = i; ;) { var a = r.delegate; if (a) { var s = E(a, r); if (s) { if (s === u) continue; return s } } if ("next" === r.method) r.sent = r._sent = r.arg; else if ("throw" === r.method) { if ("suspendedStart" === n) throw n = "completed", r.arg; r.dispatchException(r.arg) } else "return" === r.method && r.abrupt("return", r.arg); n = "executing"; var f = c(e, t, r); if ("normal" === f.type) { if (n = r.done ? "completed" : "suspendedYield", f.arg === u) continue; return { value: f.arg, done: r.done } } "throw" === f.type && (n = "completed", r.method = "throw", r.arg = f.arg) } } }(e, r, i), o } function c(e, t, r) { try { return { type: "normal", arg: e.call(t, r) } } catch (e) { return { type: "throw", arg: e } } } e.wrap = s; var u = {}; function f() { } function l() { } function d() { } var h = {}; h[o] = function () { return this }; var p = Object.getPrototypeOf, v = p && p(p(w([]))); v && v !== t && r.call(v, o) && (h = v); var y = d.prototype = f.prototype = Object.create(h); function m(e) { ["next", "throw", "return"].forEach(function (t) { e[t] = function (e) { return this._invoke(t, e) } }) } function g(e, t) { var n; this._invoke = function (o, i) { function a() { return new t(function (n, a) { !function n(o, i, a, s) { var u = c(e[o], e, i); if ("throw" !== u.type) { var f = u.arg, l = f.value; return l && "object" == typeof l && r.call(l, "__await") ? t.resolve(l.__await).then(function (e) { n("next", e, a, s) }, function (e) { n("throw", e, a, s) }) : t.resolve(l).then(function (e) { f.value = e, a(f) }, function (e) { return n("throw", e, a, s) }) } s(u.arg) }(o, i, n, a) }) } return n = n ? n.then(a, a) : a() } } function E(e, t) { var r = e.iterator[t.method]; if (void 0 === r) { if (t.delegate = null, "throw" === t.method) { if (e.iterator.return && (t.method = "return", t.arg = void 0, E(e, t), "throw" === t.method)) return u; t.method = "throw", t.arg = new TypeError("The iterator does not provide a 'throw' method") } return u } var n = c(r, e.iterator, t.arg); if ("throw" === n.type) return t.method = "throw", t.arg = n.arg, t.delegate = null, u; var o = n.arg; return o ? o.done ? (t[e.resultName] = o.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = void 0), t.delegate = null, u) : o : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, u) } function _(e) { var t = { tryLoc: e[0] }; 1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t) } function b(e) { var t = e.completion || {}; t.type = "normal", delete t.arg, e.completion = t } function I(e) { this.tryEntries = [{ tryLoc: "root" }], e.forEach(_, this), this.reset(!0) } function w(e) { if (e) { var t = e[o]; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var n = -1, i = function t() { for (; ++n < e.length;)if (r.call(e, n)) return t.value = e[n], t.done = !1, t; return t.value = void 0, t.done = !0, t }; return i.next = i } } return { next: A } } function A() { return { value: void 0, done: !0 } } return l.prototype = y.constructor = d, d.constructor = l, d[a] = l.displayName = "GeneratorFunction", e.isGeneratorFunction = function (e) { var t = "function" == typeof e && e.constructor; return !!t && (t === l || "GeneratorFunction" === (t.displayName || t.name)) }, e.mark = function (e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, d) : (e.__proto__ = d, a in e || (e[a] = "GeneratorFunction")), e.prototype = Object.create(y), e }, e.awrap = function (e) { return { __await: e } }, m(g.prototype), g.prototype[i] = function () { return this }, e.AsyncIterator = g, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new g(s(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (e) { return e.done ? e.value : a.next() }) }, m(y), y[a] = "Generator", y[o] = function () { return this }, y.toString = function () { return "[object Generator]" }, e.keys = function (e) { var t = []; for (var r in e) t.push(r); return t.reverse(), function r() { for (; t.length;) { var n = t.pop(); if (n in e) return r.value = n, r.done = !1, r } return r.done = !0, r } }, e.values = w, I.prototype = { constructor: I, reset: function (e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(b), !e) for (var t in this) "t" === t.charAt(0) && r.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0) }, stop: function () { this.done = !0; var e = this.tryEntries[0].completion; if ("throw" === e.type) throw e.arg; return this.rval }, dispatchException: function (e) { if (this.done) throw e; var t = this; function n(r, n) { return a.type = "throw", a.arg = e, t.next = r, n && (t.method = "next", t.arg = void 0), !!n } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return n("end"); if (i.tryLoc <= this.prev) { var s = r.call(i, "catchLoc"), c = r.call(i, "finallyLoc"); if (s && c) { if (this.prev < i.catchLoc) return n(i.catchLoc, !0); if (this.prev < i.finallyLoc) return n(i.finallyLoc) } else if (s) { if (this.prev < i.catchLoc) return n(i.catchLoc, !0) } else { if (!c) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return n(i.finallyLoc) } } } }, abrupt: function (e, t) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var o = this.tryEntries[n]; if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break } } i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = e, a.arg = t, i ? (this.method = "next", this.next = i.finallyLoc, u) : this.complete(a) }, complete: function (e, t) { if ("throw" === e.type) throw e.arg; 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), u }, finish: function (e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var r = this.tryEntries[t]; if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), b(r), u } }, catch: function (e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var r = this.tryEntries[t]; if (r.tryLoc === e) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; b(r) } return o } } throw new Error("illegal catch attempt") }, delegateYield: function (e, t, r) { return this.delegate = { iterator: w(e), resultName: t, nextLoc: r }, "next" === this.method && (this.arg = void 0), u } }, e }(e.exports); try { regeneratorRuntime = t } catch (e) { Function("r", "regeneratorRuntime = r")(t) } }); var a = function (e, t) { return (a = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t } || function (e, t) { for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]) })(e, t) }; function s(e, t) { function r() { this.constructor = e } a(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) } var c = function () { return (c = Object.assign || function (e) { for (var t, r = 1, n = arguments.length; r < n; r++)for (var o in t = arguments[r]) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); return e }).apply(this, arguments) }; function u(e, t, r, n) { return new (r || (r = Promise))(function (o, i) { function a(e) { try { c(n.next(e)) } catch (e) { i(e) } } function s(e) { try { c(n.throw(e)) } catch (e) { i(e) } } function c(e) { var t; e.done ? o(e.value) : (t = e.value, t instanceof r ? t : new r(function (e) { e(t) })).then(a, s) } c((n = n.apply(e, t || [])).next()) }) } function f(e, t) { var r, n, o, i, a = { label: 0, sent: function () { if (1 & o[0]) throw o[1]; return o[1] }, trys: [], ops: [] }; return i = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (i[Symbol.iterator] = function () { return this }), i; function s(i) { return function (s) { return function (i) { if (r) throw new TypeError("Generator is already executing."); for (; a;)try { if (r = 1, n && (o = 2 & i[0] ? n.return : i[0] ? n.throw || ((o = n.return) && o.call(n), 0) : n.next) && !(o = o.call(n, i[1])).done) return o; switch (n = 0, o && (i = [2 & i[0], o.value]), i[0]) { case 0: case 1: o = i; break; case 4: return a.label++, { value: i[1], done: !1 }; case 5: a.label++, n = i[1], i = [0]; continue; case 7: i = a.ops.pop(), a.trys.pop(); continue; default: if (!((o = (o = a.trys).length > 0 && o[o.length - 1]) || 6 !== i[0] && 2 !== i[0])) { a = 0; continue } if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) { a.label = i[1]; break } if (6 === i[0] && a.label < o[1]) { a.label = o[1], o = i; break } if (o && a.label < o[2]) { a.label = o[2], a.ops.push(i); break } o[2] && a.ops.pop(), a.trys.pop(); continue }i = t.call(e, a) } catch (e) { i = [6, e], n = 0 } finally { r = o = 0 } if (5 & i[0]) throw i[1]; return { value: i[0] ? i[1] : void 0, done: !0 } }([i, s]) } } } function l(e, t) { var r = "function" == typeof Symbol && e[Symbol.iterator]; if (!r) return e; var n, o, i = r.call(e), a = []; try { for (; (void 0 === t || t-- > 0) && !(n = i.next()).done;)a.push(n.value) } catch (e) { o = { error: e } } finally { try { n && !n.done && (r = i.return) && r.call(i) } finally { if (o) throw o.error } } return a } function d() { for (var e = [], t = 0; t < arguments.length; t++)e = e.concat(l(arguments[t])); return e } var h, p, v, y, m, g, E, _ = { SEMVER_SPEC_VERSION: "2.0.0", MAX_LENGTH: 256, MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991, MAX_SAFE_COMPONENT_LENGTH: 16 }, b = "object" == typeof process && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? function () { var e; return (e = console).error.apply(e, ["SEMVER"].concat([].slice.call(arguments))) } : function () { }, I = o(function (e, t) { var r = _.MAX_SAFE_COMPONENT_LENGTH, n = (t = e.exports = {}).re = [], o = t.src = [], i = t.t = {}, a = 0, s = function (e, t, r) { var s = a++; b(s, t), i[e] = s, o[s] = t, n[s] = new RegExp(t, r ? "g" : void 0) }; s("NUMERICIDENTIFIER", "0|[1-9]\\d*"), s("NUMERICIDENTIFIERLOOSE", "[0-9]+"), s("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*"), s("MAINVERSION", "(" + o[i.NUMERICIDENTIFIER] + ")\\.(" + o[i.NUMERICIDENTIFIER] + ")\\.(" + o[i.NUMERICIDENTIFIER] + ")"), s("MAINVERSIONLOOSE", "(" + o[i.NUMERICIDENTIFIERLOOSE] + ")\\.(" + o[i.NUMERICIDENTIFIERLOOSE] + ")\\.(" + o[i.NUMERICIDENTIFIERLOOSE] + ")"), s("PRERELEASEIDENTIFIER", "(?:" + o[i.NUMERICIDENTIFIER] + "|" + o[i.NONNUMERICIDENTIFIER] + ")"), s("PRERELEASEIDENTIFIERLOOSE", "(?:" + o[i.NUMERICIDENTIFIERLOOSE] + "|" + o[i.NONNUMERICIDENTIFIER] + ")"), s("PRERELEASE", "(?:-(" + o[i.PRERELEASEIDENTIFIER] + "(?:\\." + o[i.PRERELEASEIDENTIFIER] + ")*))"), s("PRERELEASELOOSE", "(?:-?(" + o[i.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + o[i.PRERELEASEIDENTIFIERLOOSE] + ")*))"), s("BUILDIDENTIFIER", "[0-9A-Za-z-]+"), s("BUILD", "(?:\\+(" + o[i.BUILDIDENTIFIER] + "(?:\\." + o[i.BUILDIDENTIFIER] + ")*))"), s("FULLPLAIN", "v?" + o[i.MAINVERSION] + o[i.PRERELEASE] + "?" + o[i.BUILD] + "?"), s("FULL", "^" + o[i.FULLPLAIN] + "$"), s("LOOSEPLAIN", "[v=\\s]*" + o[i.MAINVERSIONLOOSE] + o[i.PRERELEASELOOSE] + "?" + o[i.BUILD] + "?"), s("LOOSE", "^" + o[i.LOOSEPLAIN] + "$"), s("GTLT", "((?:<|>)?=?)"), s("XRANGEIDENTIFIERLOOSE", o[i.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"), s("XRANGEIDENTIFIER", o[i.NUMERICIDENTIFIER] + "|x|X|\\*"), s("XRANGEPLAIN", "[v=\\s]*(" + o[i.XRANGEIDENTIFIER] + ")(?:\\.(" + o[i.XRANGEIDENTIFIER] + ")(?:\\.(" + o[i.XRANGEIDENTIFIER] + ")(?:" + o[i.PRERELEASE] + ")?" + o[i.BUILD] + "?)?)?"), s("XRANGEPLAINLOOSE", "[v=\\s]*(" + o[i.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + o[i.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + o[i.XRANGEIDENTIFIERLOOSE] + ")(?:" + o[i.PRERELEASELOOSE] + ")?" + o[i.BUILD] + "?)?)?"), s("XRANGE", "^" + o[i.GTLT] + "\\s*" + o[i.XRANGEPLAIN] + "$"), s("XRANGELOOSE", "^" + o[i.GTLT] + "\\s*" + o[i.XRANGEPLAINLOOSE] + "$"), s("COERCE", "(^|[^\\d])(\\d{1," + r + "})(?:\\.(\\d{1," + r + "}))?(?:\\.(\\d{1," + r + "}))?(?:$|[^\\d])"), s("COERCERTL", o[i.COERCE], !0), s("LONETILDE", "(?:~>?)"), s("TILDETRIM", "(\\s*)" + o[i.LONETILDE] + "\\s+", !0), t.tildeTrimReplace = "$1~", s("TILDE", "^" + o[i.LONETILDE] + o[i.XRANGEPLAIN] + "$"), s("TILDELOOSE", "^" + o[i.LONETILDE] + o[i.XRANGEPLAINLOOSE] + "$"), s("LONECARET", "(?:\\^)"), s("CARETTRIM", "(\\s*)" + o[i.LONECARET] + "\\s+", !0), t.caretTrimReplace = "$1^", s("CARET", "^" + o[i.LONECARET] + o[i.XRANGEPLAIN] + "$"), s("CARETLOOSE", "^" + o[i.LONECARET] + o[i.XRANGEPLAINLOOSE] + "$"), s("COMPARATORLOOSE", "^" + o[i.GTLT] + "\\s*(" + o[i.LOOSEPLAIN] + ")$|^$"), s("COMPARATOR", "^" + o[i.GTLT] + "\\s*(" + o[i.FULLPLAIN] + ")$|^$"), s("COMPARATORTRIM", "(\\s*)" + o[i.GTLT] + "\\s*(" + o[i.LOOSEPLAIN] + "|" + o[i.XRANGEPLAIN] + ")", !0), t.comparatorTrimReplace = "$1$2$3", s("HYPHENRANGE", "^\\s*(" + o[i.XRANGEPLAIN] + ")\\s+-\\s+(" + o[i.XRANGEPLAIN] + ")\\s*$"), s("HYPHENRANGELOOSE", "^\\s*(" + o[i.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + o[i.XRANGEPLAINLOOSE] + ")\\s*$"), s("STAR", "(<|>)?=?\\s*\\*"), s("GTE0", "^\\s*>=\\s*0.0.0\\s*$"), s("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$") }), w = /^[0-9]+$/, A = _.MAX_LENGTH, N = _.MAX_SAFE_INTEGER, O = I.re, R = I.t, S = function (e, t) { var r = w.test(e), n = w.test(t); return r && n && (e = +e, t = +t), e === t ? 0 : r && !n ? -1 : n && !r ? 1 : e < t ? -1 : 1 }, L = function () { function e(t, r) { if (r && "object" == typeof r || (r = { loose: !!r, includePrerelease: !1 }), t instanceof e) { if (t.loose === !!r.loose && t.includePrerelease === !!r.includePrerelease) return t; t = t.version } else if ("string" != typeof t) throw new TypeError("Invalid Version: " + t); if (t.length > A) throw new TypeError("version is longer than " + A + " characters"); b("SemVer", t, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease; var n = t.trim().match(r.loose ? O[R.LOOSE] : O[R.FULL]); if (!n) throw new TypeError("Invalid Version: " + t); if (this.raw = t, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > N || this.major < 0) throw new TypeError("Invalid major version"); if (this.minor > N || this.minor < 0) throw new TypeError("Invalid minor version"); if (this.patch > N || this.patch < 0) throw new TypeError("Invalid patch version"); this.prerelease = n[4] ? n[4].split(".").map(function (e) { if (/^[0-9]+$/.test(e)) { var t = +e; if (t >= 0 && t < N) return t } return e }) : [], this.build = n[5] ? n[5].split(".") : [], this.format() } var t = e.prototype; return t.format = function () { return this.version = this.major + "." + this.minor + "." + this.patch, this.prerelease.length && (this.version += "-" + this.prerelease.join(".")), this.version }, t.toString = function () { return this.version }, t.compare = function (t) { if (b("SemVer.compare", this.version, this.options, t), !(t instanceof e)) { if ("string" == typeof t && t === this.version) return 0; t = new e(t, this.options) } return t.version === this.version ? 0 : this.compareMain(t) || this.comparePre(t) }, t.compareMain = function (t) { return t instanceof e || (t = new e(t, this.options)), S(this.major, t.major) || S(this.minor, t.minor) || S(this.patch, t.patch) }, t.comparePre = function (t) { if (t instanceof e || (t = new e(t, this.options)), this.prerelease.length && !t.prerelease.length) return -1; if (!this.prerelease.length && t.prerelease.length) return 1; if (!this.prerelease.length && !t.prerelease.length) return 0; var r = 0; do { var n = this.prerelease[r], o = t.prerelease[r]; if (b("prerelease compare", r, n, o), void 0 === n && void 0 === o) return 0; if (void 0 === o) return 1; if (void 0 === n) return -1; if (n !== o) return S(n, o) } while (++r) }, t.compareBuild = function (t) { t instanceof e || (t = new e(t, this.options)); var r = 0; do { var n = this.build[r], o = t.build[r]; if (b("prerelease compare", r, n, o), void 0 === n && void 0 === o) return 0; if (void 0 === o) return 1; if (void 0 === n) return -1; if (n !== o) return S(n, o) } while (++r) }, t.inc = function (e, t) { switch (e) { case "premajor": this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t); break; case "preminor": this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t); break; case "prepatch": this.prerelease.length = 0, this.inc("patch", t), this.inc("pre", t); break; case "prerelease": 0 === this.prerelease.length && this.inc("patch", t), this.inc("pre", t); break; case "major": 0 === this.minor && 0 === this.patch && 0 !== this.prerelease.length || this.major++, this.minor = 0, this.patch = 0, this.prerelease = []; break; case "minor": 0 === this.patch && 0 !== this.prerelease.length || this.minor++, this.patch = 0, this.prerelease = []; break; case "patch": 0 === this.prerelease.length && this.patch++, this.prerelease = []; break; case "pre": if (0 === this.prerelease.length) this.prerelease = [0]; else { for (var r = this.prerelease.length; --r >= 0;)"number" == typeof this.prerelease[r] && (this.prerelease[r]++, r = -2); -1 === r && this.prerelease.push(0) } t && (this.prerelease[0] === t ? isNaN(this.prerelease[1]) && (this.prerelease = [t, 0]) : this.prerelease = [t, 0]); break; default: throw new Error("invalid increment argument: " + e) }return this.format(), this.raw = this.version, this }, e }(), T = function (e, t, r) { return new L(e, r).compare(new L(t, r)) }, M = function (e, t, r, n) { switch (t) { case "===": return "object" == typeof e && (e = e.version), "object" == typeof r && (r = r.version), e === r; case "!==": return "object" == typeof e && (e = e.version), "object" == typeof r && (r = r.version), e !== r; case "": case "=": case "==": return function (e, t, r) { return 0 === T(e, t, r) }(e, r, n); case "!=": return function (e, t, r) { return 0 !== T(e, t, r) }(e, r, n); case ">": return function (e, t, r) { return T(e, t, r) > 0 }(e, r, n); case ">=": return function (e, t, r) { return T(e, t, r) >= 0 }(e, r, n); case "<": return function (e, t, r) { return T(e, t, r) < 0 }(e, r, n); case "<=": return function (e, t, r) { return T(e, t, r) <= 0 }(e, r, n); default: throw new TypeError("Invalid operator: " + t) } }, P = Symbol("SemVer ANY"), j = function () { var e; function t(e, r) { if (r && "object" == typeof r || (r = { loose: !!r, includePrerelease: !1 }), e instanceof t) { if (e.loose === !!r.loose) return e; e = e.value } b("comparator", e, r), this.options = r, this.loose = !!r.loose, this.parse(e), this.value = this.semver === P ? "" : this.operator + this.semver.version, b("comp", this) } (e = [{ key: "ANY", get: function () { return P } }]) && function (e, t) { for (var r = 0; r < t.length; r++) { var n = t[r]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } }(t, e); var r = t.prototype; return r.parse = function (e) { var t = e.match(this.options.loose ? C[D.COMPARATORLOOSE] : C[D.COMPARATOR]); if (!t) throw new TypeError("Invalid comparator: " + e); this.operator = void 0 !== t[1] ? t[1] : "", "=" === this.operator && (this.operator = ""), this.semver = t[2] ? new L(t[2], this.options.loose) : P }, r.toString = function () { return this.value }, r.test = function (e) { if (b("Comparator.test", e, this.options.loose), this.semver === P || e === P) return !0; if ("string" == typeof e) try { e = new L(e, this.options) } catch (e) { return !1 } return M(e, this.operator, this.semver, this.options) }, r.intersects = function (e, r) { if (!(e instanceof t)) throw new TypeError("a Comparator is required"); if (r && "object" == typeof r || (r = { loose: !!r, includePrerelease: !1 }), "" === this.operator) return "" === this.value || new k(e.value, r).test(this.value); if ("" === e.operator) return "" === e.value || new k(this.value, r).test(e.semver); var n = !(">=" !== this.operator && ">" !== this.operator || ">=" !== e.operator && ">" !== e.operator), o = !("<=" !== this.operator && "<" !== this.operator || "<=" !== e.operator && "<" !== e.operator), i = this.semver.version === e.semver.version, a = !(">=" !== this.operator && "<=" !== this.operator || ">=" !== e.operator && "<=" !== e.operator), s = M(this.semver, "<", e.semver, r) && (">=" === this.operator || ">" === this.operator) && ("<=" === e.operator || "<" === e.operator), c = M(this.semver, ">", e.semver, r) && ("<=" === this.operator || "<" === this.operator) && (">=" === e.operator || ">" === e.operator); return n || o || i && a || s || c }, t }(), C = I.re, D = I.t, k = function () { function e(t, r) { var n = this; if (r && "object" == typeof r || (r = { loose: !!r, includePrerelease: !1 }), t instanceof e) return t.loose === !!r.loose && t.includePrerelease === !!r.includePrerelease ? t : new e(t.raw, r); if (t instanceof j) return this.raw = t.value, this.set = [[t]], this.format(), this; if (this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease, this.raw = t, this.set = t.split(/\s*\|\|\s*/).map(function (e) { return n.parseRange(e.trim()) }).filter(function (e) { return e.length }), !this.set.length) throw new TypeError("Invalid SemVer Range: " + t); this.format() } var t = e.prototype; return t.format = function () { return this.range = this.set.map(function (e) { return e.join(" ").trim() }).join("||").trim(), this.range }, t.toString = function () { return this.range }, t.parseRange = function (e) { var t = this, r = this.options.loose; e = (e = e.trim()).replace(r ? x[F.HYPHENRANGELOOSE] : x[F.HYPHENRANGE], Z(this.options.includePrerelease)), b("hyphen replace", e), e = e.replace(x[F.COMPARATORTRIM], G), b("comparator trim", e, x[F.COMPARATORTRIM]), e = (e = (e = e.replace(x[F.TILDETRIM], U)).replace(x[F.CARETTRIM], B)).split(/\s+/).join(" "); var n = r ? x[F.COMPARATORLOOSE] : x[F.COMPARATOR]; return e.split(" ").map(function (e) { return z(e, t.options) }).join(" ").split(/\s+/).map(function (e) { return Q(e, t.options) }).filter(this.options.loose ? function (e) { return !!e.match(n) } : function () { return !0 }).map(function (e) { return new j(e, t.options) }) }, t.intersects = function (t, r) { if (!(t instanceof e)) throw new TypeError("a Range is required"); return this.set.some(function (e) { return W(e, r) && t.set.some(function (t) { return W(t, r) && e.every(function (e) { return t.every(function (t) { return e.intersects(t, r) }) }) }) }) }, t.test = function (e) { if (!e) return !1; if ("string" == typeof e) try { e = new L(e, this.options) } catch (e) { return !1 } for (var t = 0; t < this.set.length; t++)if (ee(this.set[t], e, this.options)) return !0; return !1 }, e }(), x = I.re, F = I.t, G = I.comparatorTrimReplace, U = I.tildeTrimReplace, B = I.caretTrimReplace, W = function (e, t) { for (var r = !0, n = e.slice(), o = n.pop(); r && n.length;)r = n.every(function (e) { return o.intersects(e, t) }), o = n.pop(); return r }, z = function (e, t) { return b("comp", e, t), e = V(e, t), b("caret", e), e = X(e, t), b("tildes", e), e = K(e, t), b("xrange", e), e = J(e, t), b("stars", e), e }, H = function (e) { return !e || "x" === e.toLowerCase() || "*" === e }, X = function (e, t) { return e.trim().split(/\s+/).map(function (e) { return q(e, t) }).join(" ") }, q = function (e, t) { return e.replace(t.loose ? x[F.TILDELOOSE] : x[F.TILDE], function (t, r, n, o, i) { var a; return b("tilde", e, t, r, n, o, i), H(r) ? a = "" : H(n) ? a = ">=" + r + ".0.0 <" + (+r + 1) + ".0.0-0" : H(o) ? a = ">=" + r + "." + n + ".0 <" + r + "." + (+n + 1) + ".0-0" : i ? (b("replaceTilde pr", i), a = ">=" + r + "." + n + "." + o + "-" + i + " <" + r + "." + (+n + 1) + ".0-0") : a = ">=" + r + "." + n + "." + o + " <" + r + "." + (+n + 1) + ".0-0", b("tilde return", a), a }) }, V = function (e, t) { return e.trim().split(/\s+/).map(function (e) { return Y(e, t) }).join(" ") }, Y = function (e, t) { b("caret", e, t); var r = t.includePrerelease ? "-0" : ""; return e.replace(t.loose ? x[F.CARETLOOSE] : x[F.CARET], function (t, n, o, i, a) { var s; return b("caret", e, t, n, o, i, a), H(n) ? s = "" : H(o) ? s = ">=" + n + ".0.0" + r + " <" + (+n + 1) + ".0.0-0" : H(i) ? s = "0" === n ? ">=" + n + "." + o + ".0" + r + " <" + n + "." + (+o + 1) + ".0-0" : ">=" + n + "." + o + ".0" + r + " <" + (+n + 1) + ".0.0-0" : a ? (b("replaceCaret pr", a), s = "0" === n ? "0" === o ? ">=" + n + "." + o + "." + i + "-" + a + " <" + n + "." + o + "." + (+i + 1) + "-0" : ">=" + n + "." + o + "." + i + "-" + a + " <" + n + "." + (+o + 1) + ".0-0" : ">=" + n + "." + o + "." + i + "-" + a + " <" + (+n + 1) + ".0.0-0") : (b("no pr"), s = "0" === n ? "0" === o ? ">=" + n + "." + o + "." + i + r + " <" + n + "." + o + "." + (+i + 1) + "-0" : ">=" + n + "." + o + "." + i + r + " <" + n + "." + (+o + 1) + ".0-0" : ">=" + n + "." + o + "." + i + " <" + (+n + 1) + ".0.0-0"), b("caret return", s), s }) }, K = function (e, t) { return b("replaceXRanges", e, t), e.split(/\s+/).map(function (e) { return $(e, t) }).join(" ") }, $ = function (e, t) { return (e = e.trim()).replace(t.loose ? x[F.XRANGELOOSE] : x[F.XRANGE], function (r, n, o, i, a, s) { b("xRange", e, r, n, o, i, a, s); var c = H(o), u = c || H(i), f = u || H(a); return "=" === n && f && (n = ""), s = t.includePrerelease ? "-0" : "", c ? r = ">" === n || "<" === n ? "<0.0.0-0" : "*" : n && f ? (u && (i = 0), a = 0, ">" === n ? (n = ">=", u ? (o = +o + 1, i = 0, a = 0) : (i = +i + 1, a = 0)) : "<=" === n && (n = "<", u ? o = +o + 1 : i = +i + 1), "<" === n && (s = "-0"), r = n + o + "." + i + "." + a + s) : u ? r = ">=" + o + ".0.0" + s + " <" + (+o + 1) + ".0.0-0" : f && (r = ">=" + o + "." + i + ".0" + s + " <" + o + "." + (+i + 1) + ".0-0"), b("xRange return", r), r }) }, J = function (e, t) { return b("replaceStars", e, t), e.trim().replace(x[F.STAR], "") }, Q = function (e, t) { return b("replaceGTE0", e, t), e.trim().replace(x[t.includePrerelease ? F.GTE0PRE : F.GTE0], "") }, Z = function (e) { return function (t, r, n, o, i, a, s, c, u, f, l, d, h) { return ((r = H(n) ? "" : H(o) ? ">=" + n + ".0.0" + (e ? "-0" : "") : H(i) ? ">=" + n + "." + o + ".0" + (e ? "-0" : "") : a ? ">=" + r : ">=" + r + (e ? "-0" : "")) + " " + (c = H(u) ? "" : H(f) ? "<" + (+u + 1) + ".0.0-0" : H(l) ? "<" + u + "." + (+f + 1) + ".0-0" : d ? "<=" + u + "." + f + "." + l + "-" + d : e ? "<" + u + "." + f + "." + (+l + 1) + "-0" : "<=" + c)).trim() } }, ee = function (e, t, r) { for (var n = 0; n < e.length; n++)if (!e[n].test(t)) return !1; if (t.prerelease.length && !r.includePrerelease) { for (var o = 0; o < e.length; o++)if (b(e[o].semver), e[o].semver !== j.ANY && e[o].semver.prerelease.length > 0) { var i = e[o].semver; if (i.major === t.major && i.minor === t.minor && i.patch === t.patch) return !0 } return !1 } return !0 }, te = function (e, t, r) { try { t = new k(t, r) } catch (e) { return !1 } return t.test(e) }; function re(e) { return String.fromCharCode(parseInt(e.slice(1), 16)) } function ne(e) { return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2) } function oe(e) { return t = JSON.stringify(e), btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g, re)); var t } function ie(e) { return JSON.parse(decodeURIComponent(Array.from(atob(e), ne).join(""))) } function ae(e) { return void 0 === e } function se(e) { return function (e) { return null === e }(e) || ae(e) } function ce(e) { if (!e) return !0; for (var t in e) if (Object.hasOwnProperty.call(e, t)) return !1; return !0 } !function (e) { e.LoginWithMagicLink = "magic_auth_login_with_magic_link", e.LoginWithCredential = "magic_auth_login_with_credential", e.GetIdToken = "magic_auth_get_id_token", e.GenerateIdToken = "magic_auth_generate_id_token", e.GetMetadata = "magic_auth_get_metadata", e.IsLoggedIn = "magic_auth_is_logged_in", e.Logout = "magic_auth_logout", e.UpdateEmail = "magic_auth_update_email", e.LoginWithMagicLinkTestMode = "magic_login_with_magic_link_testing_mode", e.LoginWithCredentialTestMode = "magic_auth_login_with_credential_testing_mode", e.GetIdTokenTestMode = "magic_auth_get_id_token_testing_mode", e.GenerateIdTokenTestMode = "magic_auth_generate_id_token_testing_mode", e.GetMetadataTestMode = "magic_auth_get_metadata_testing_mode", e.IsLoggedInTestMode = "magic_auth_is_logged_in_testing_mode", e.LogoutTestMode = "magic_auth_logout_testing_mode", e.UpdateEmailTestMode = "magic_auth_update_email_testing_mode" }(h || (h = {})), function (e) { e.MAGIC_HANDLE_RESPONSE = "MAGIC_HANDLE_RESPONSE", e.MAGIC_OVERLAY_READY = "MAGIC_OVERLAY_READY", e.MAGIC_SHOW_OVERLAY = "MAGIC_SHOW_OVERLAY", e.MAGIC_HIDE_OVERLAY = "MAGIC_HIDE_OVERLAY", e.MAGIC_HANDLE_EVENT = "MAGIC_HANDLE_EVENT" }(p || (p = {})), function (e) { e.MAGIC_HANDLE_REQUEST = "MAGIC_HANDLE_REQUEST" }(v || (v = {})), function (e) { e.MissingApiKey = "MISSING_API_KEY", e.ModalNotReady = "MODAL_NOT_READY", e.MalformedResponse = "MALFORMED_RESPONSE", e.InvalidArgument = "INVALID_ARGUMENT", e.ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED", e.IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS" }(y || (y = {})), function (e) { e.SyncWeb3Method = "SYNC_WEB3_METHOD", e.DuplicateIframe = "DUPLICATE_IFRAME", e.ReactNativeEndpointConfiguration = "REACT_NATIVE_ENDPOINT_CONFIGURATION", e.DeprecationNotice = "DEPRECATION_NOTICE" }(m || (m = {})), function (e) { e[e.ParseError = -32700] = "ParseError", e[e.InvalidRequest = -32600] = "InvalidRequest", e[e.MethodNotFound = -32601] = "MethodNotFound", e[e.InvalidParams = -32602] = "InvalidParams", e[e.InternalError = -32603] = "InternalError", e[e.MagicLinkFailedVerification = -1e4] = "MagicLinkFailedVerification", e[e.MagicLinkExpired = -10001] = "MagicLinkExpired", e[e.MagicLinkRateLimited = -10002] = "MagicLinkRateLimited", e[e.MagicLinkInvalidRedirectURL = -10006] = "MagicLinkInvalidRedirectURL", e[e.UserAlreadyLoggedIn = -10003] = "UserAlreadyLoggedIn", e[e.UpdateEmailFailed = -10004] = "UpdateEmailFailed", e[e.UserRequestEditEmail = -10005] = "UserRequestEditEmail", e[e.InactiveRecipient = -10010] = "InactiveRecipient", e[e.AccessDeniedToUser = -10011] = "AccessDeniedToUser" }(g || (g = {})), function (e) { e.Harmony = "HARMONY" }(E || (E = {})); var ue = {}, fe = { "magic-sdk": "magic-sdk", "@magic-sdk/react-native": "magic-sdk-rn" }, le = function (e) { function t(r, n) { var o = e.call(this, "Magic SDK Error: [" + r + "] " + n) || this; return o.code = r, o.rawMessage = n, o.__proto__ = Error, Object.setPrototypeOf(o, t.prototype), o } return s(t, e), t }(Error), de = function (e) { function t(r) { var n = e.call(this) || this; n.__proto__ = Error; var o, i = Number(null == r ? void 0 : r.code); return n.rawMessage = (null == r ? void 0 : r.message) || "Internal error", n.code = !se(o = i) && "number" == typeof o && Object.values(g).includes(o) ? i : g.InternalError, n.message = "Magic RPC Error: [" + n.code + "] " + n.rawMessage, Object.setPrototypeOf(n, t.prototype), n } return s(t, e), t }(Error), he = function () { function e(e, t) { this.code = e, this.rawMessage = t, this.message = "Magic SDK Warning: [" + e + "] " + t } return e.prototype.log = function () { console.warn(this.message) }, e }(), pe = function (e) { function t(r, n, o, i) { var a = e.call(this, "Magic Extension Error (" + r.name + "): [" + n + "] " + o) || this; return a.code = n, a.rawMessage = o, a.data = i, a.__proto__ = Error, Object.setPrototypeOf(a, t.prototype), a } return s(t, e), t }(Error), ve = function () { function e(e, t, r) { this.code = t, this.rawMessage = r, this.message = "Magic Extension Warning (" + e.name + "): [" + t + "] " + r } return e.prototype.log = function () { console.warn(this.message) }, e }(), ye = function () { var e; return f(this, function (t) { switch (t.label) { case 0: e = 0, t.label = 1; case 1: return e < Number.MAX_SAFE_INTEGER ? [4, ++e] : [3, 3]; case 2: return t.sent(), [3, 4]; case 3: e = 0, t.label = 4; case 4: return [3, 1]; case 5: return [2] } }) }(); function me() { return ye.next().value } var ge = Symbol("Payload pre-processed by Magic SDK"); function Ee(e) { return Object.defineProperty(e, ge, { value: !0, enumerable: !1 }), e } function _e(e) { var t, r, n; return function (e) { return !!e[ge] }(e) || (e.jsonrpc = null !== (t = e.jsonrpc) && void 0 !== t ? t : "2.0", e.id = me(), e.method = null !== (r = e.method) && void 0 !== r ? r : "noop", e.params = null !== (n = e.params) && void 0 !== n ? n : [], Ee(e)), e } function be(e, t) { return void 0 === t && (t = []), Ee({ params: t, method: e, jsonrpc: "2.0", id: me() }) } var Ie = function () { function e(t) { var r; t instanceof e ? (this._jsonrpc = t.payload.jsonrpc, this._id = t.payload.id, this._result = t.payload.result, this._error = t.payload.error) : se(r = t) || ae(r.jsonrpc) || ae(r.id) || ae(r.result) && ae(r.error) ? (this._jsonrpc = t.jsonrpc, this._id = t.id, this._result = void 0, this._error = void 0) : (this._jsonrpc = t.jsonrpc, this._id = t.id, this._result = t.result, this._error = t.error) } return e.prototype.applyError = function (e) { return this._error = e, this }, e.prototype.applyResult = function (e) { return this._result = e, this }, Object.defineProperty(e.prototype, "hasError", { get: function () { return null != this._error }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "hasResult", { get: function () { return void 0 !== this._result }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "payload", { get: function () { return { jsonrpc: this._jsonrpc, id: this._id, result: this._result, error: this._error } }, enumerable: !0, configurable: !0 }), e }(), we = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return s(t, e), t }(o(function (e) { var t = Object.prototype.hasOwnProperty, r = "~"; function n() { } function o(e, t, r) { this.fn = e, this.context = t, this.once = r || !1 } function i(e, t, n, i, a) { if ("function" != typeof n) throw new TypeError("The listener must be a function"); var s = new o(n, i || e, a), c = r ? r + t : t; return e._events[c] ? e._events[c].fn ? e._events[c] = [e._events[c], s] : e._events[c].push(s) : (e._events[c] = s, e._eventsCount++), e } function a(e, t) { 0 == --e._eventsCount ? e._events = new n : delete e._events[t] } function s() { this._events = new n, this._eventsCount = 0 } Object.create && (n.prototype = Object.create(null), (new n).__proto__ || (r = !1)), s.prototype.eventNames = function () { var e, n, o = []; if (0 === this._eventsCount) return o; for (n in e = this._events) t.call(e, n) && o.push(r ? n.slice(1) : n); return Object.getOwnPropertySymbols ? o.concat(Object.getOwnPropertySymbols(e)) : o }, s.prototype.listeners = function (e) { var t = this._events[r ? r + e : e]; if (!t) return []; if (t.fn) return [t.fn]; for (var n = 0, o = t.length, i = new Array(o); n < o; n++)i[n] = t[n].fn; return i }, s.prototype.listenerCount = function (e) { var t = this._events[r ? r + e : e]; return t ? t.fn ? 1 : t.length : 0 }, s.prototype.emit = function (e, t, n, o, i, a) { var s = r ? r + e : e; if (!this._events[s]) return !1; var c, u, f = this._events[s], l = arguments.length; if (f.fn) { switch (f.once && this.removeListener(e, f.fn, void 0, !0), l) { case 1: return f.fn.call(f.context), !0; case 2: return f.fn.call(f.context, t), !0; case 3: return f.fn.call(f.context, t, n), !0; case 4: return f.fn.call(f.context, t, n, o), !0; case 5: return f.fn.call(f.context, t, n, o, i), !0; case 6: return f.fn.call(f.context, t, n, o, i, a), !0 }for (u = 1, c = new Array(l - 1); u < l; u++)c[u - 1] = arguments[u]; f.fn.apply(f.context, c) } else { var d, h = f.length; for (u = 0; u < h; u++)switch (f[u].once && this.removeListener(e, f[u].fn, void 0, !0), l) { case 1: f[u].fn.call(f[u].context); break; case 2: f[u].fn.call(f[u].context, t); break; case 3: f[u].fn.call(f[u].context, t, n); break; case 4: f[u].fn.call(f[u].context, t, n, o); break; default: if (!c) for (d = 1, c = new Array(l - 1); d < l; d++)c[d - 1] = arguments[d]; f[u].fn.apply(f[u].context, c) } } return !0 }, s.prototype.on = function (e, t, r) { return i(this, e, t, r, !1) }, s.prototype.once = function (e, t, r) { return i(this, e, t, r, !0) }, s.prototype.removeListener = function (e, t, n, o) { var i = r ? r + e : e; if (!this._events[i]) return this; if (!t) return a(this, i), this; var s = this._events[i]; if (s.fn) s.fn !== t || o && !s.once || n && s.context !== n || a(this, i); else { for (var c = 0, u = [], f = s.length; c < f; c++)(s[c].fn !== t || o && !s[c].once || n && s[c].context !== n) && u.push(s[c]); u.length ? this._events[i] = 1 === u.length ? u[0] : u : a(this, i) } return this }, s.prototype.removeAllListeners = function (e) { var t; return e ? this._events[t = r ? r + e : e] && a(this, t) : (this._events = new n, this._eventsCount = 0), this }, s.prototype.off = s.prototype.removeListener, s.prototype.addListener = s.prototype.on, s.prefixed = r, s.EventEmitter = s, e.exports = s })); function Ae() { var e = new we; return { emitter: e, createChainingEmitterMethod: function (t, r) { return function () { for (var n = [], o = 0; o < arguments.length; o++)n[o] = arguments[o]; return e[t].apply(e, n), r } }, createBoundEmitterMethod: function (t) { return function () { for (var r = [], n = 0; n < arguments.length; n++)r[n] = arguments[n]; return e[t].apply(e, r) } } } } var Ne = Symbol("isPromiEvent"); function Oe(e) { return !!e[Ne] } function Re(e) { var t = Se(e), r = Ae(), n = r.createBoundEmitterMethod, o = r.createChainingEmitterMethod, i = Symbol("Promise.then"), a = Symbol("Promise.catch"), s = Symbol("Promise.finally"), c = function (e, t) { return function () { for (var r = [], n = 0; n < arguments.length; n++)r[n] = arguments[n]; var o = t[e].apply(t, r); return u(o) } }, u = function (e) { var t; return Object.assign(e, ((t = {})[Ne] = !0, t[i] = e[i] || e.then, t[a] = e[a] || e.catch, t[s] = e[s] || e.finally, t.then = c(i, e), t.catch = c(a, e), t.finally = c(s, e), t.on = o("on", e), t.once = o("once", e), t.addListener = o("addListener", e), t.off = o("off", e), t.removeListener = o("removeListener", e), t.removeAllListeners = o("removeAllListeners", e), t.emit = n("emit"), t.eventNames = n("eventNames"), t.listeners = n("listeners"), t.listenerCount = n("listenerCount"), t)) }, f = u(t.then(function (e) { return f.emit("done", e), f.emit("settled"), e }, function (e) { throw f.emit("error", e), f.emit("settled"), e })); return f } function Se(e) { return new Promise(function (t, r) { var n = e(t, r); Promise.resolve(n).catch(r) }) } var Le, Te = function () { function e(e) { this.sdk = e } return Object.defineProperty(e.prototype, "transport", { get: function () { return this.sdk.transport }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "overlay", { get: function () { return this.sdk.overlay }, enumerable: !0, configurable: !0 }), e.prototype.request = function (e) { var t = this.transport.post(this.overlay, v.MAGIC_HANDLE_REQUEST, _e(e)), r = Re(function (e, r) { t.then(function (t) { if (n(), t.hasError) r(new de(t.payload.error)); else { if (!t.hasResult) throw new le(y.MalformedResponse, "Response from the Magic iframe is malformed."); e(t.payload.result) } }).catch(function (e) { n(), r(e) }) }), n = this.transport.on(p.MAGIC_HANDLE_EVENT, function (t) { var n, o = t.data.response; if (o.id === e.id && (null === (n = o.result) || void 0 === n ? void 0 : n.event)) { var i = o.result, a = i.params; r.emit.apply(r, d([i.event], void 0 === a ? [] : a)) } }); return r }, e }(), Me = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return s(t, e), t.prototype.loginWithMagicLink = function (e) { var t = e.showUI, r = be(this.sdk.testMode ? h.LoginWithMagicLinkTestMode : h.LoginWithMagicLink, [{ email: e.email, showUI: void 0 === t || t, redirectURI: e.redirectURI }]); return this.request(r) }, t.prototype.loginWithCredential = function (e) { var t = null != e ? e : ""; if (!e && "web" === ue.platform) { t = window.location.search; var r = window.location.origin + window.location.pathname; window.history.replaceState(null, "", r) } var n = be(this.sdk.testMode ? h.LoginWithCredentialTestMode : h.LoginWithCredential, [t]); return this.request(n) }, t }(Te), Pe = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return s(t, e), t.prototype.getIdToken = function (e) { var t = be(this.sdk.testMode ? h.GetIdTokenTestMode : h.GetIdToken, [e]); return this.request(t) }, t.prototype.generateIdToken = function (e) { var t = be(this.sdk.testMode ? h.GenerateIdTokenTestMode : h.GenerateIdToken, [e]); return this.request(t) }, t.prototype.getMetadata = function () { var e = be(this.sdk.testMode ? h.GetMetadataTestMode : h.GetMetadata); return this.request(e) }, t.prototype.updateEmail = function (e) { var t = e.showUI, r = be(this.sdk.testMode ? h.UpdateEmailTestMode : h.UpdateEmail, [{ email: e.email, showUI: void 0 === t || t }]); return this.request(r) }, t.prototype.isLoggedIn = function () { var e = be(this.sdk.testMode ? h.IsLoggedInTestMode : h.IsLoggedIn); return this.request(e) }, t.prototype.logout = function () { var e = be(this.sdk.testMode ? h.LogoutTestMode : h.Logout); return this.request(e) }, t }(Te), je = Ae(), Ce = je.createBoundEmitterMethod, De = je.createChainingEmitterMethod, ke = function (e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.isMagic = !0, t.on = De("on", t), t.once = De("once", t), t.addListener = De("addListener", t), t.off = De("off", t), t.removeListener = De("removeListener", t), t.removeAllListeners = De("removeAllListeners", t), t.emit = Ce("emit"), t.eventNames = Ce("eventNames"), t.listeners = Ce("listeners"), t.listenerCount = Ce("listenerCount"), t } return s(t, e), t.prototype.sendAsync = function (e, t) { var r, n, o, i, a = this; if (!t) throw new le(y.InvalidArgument, "Invalid " + (i = (n = (r = { procedure: "Magic.rpcProvider.sendAsync", argument: 1, expected: "function", received: null === t ? "null" : typeof t }).argument + 1) % 100, (1 == (o = n % 10) && 11 !== i ? n + "st" : 2 === o && 12 !== i ? n + "nd" : 3 === o && 13 !== i ? n + "rd" : n + "th") + " argument given to `") + r.procedure + "`.\n Expected: `" + r.expected + "`\n Received: `" + r.received + "`"); if (Array.isArray(e)) this.transport.post(this.overlay, v.MAGIC_HANDLE_REQUEST, e.map(function (e) { var t = _e(e); return a.prefixPayloadMethodForTestMode(t), t })).then(function (e) { t(null, e.map(function (e) { return c(c({}, e.payload), { error: e.hasError ? new de(e.payload.error) : null }) })) }); else { var s = _e(e); this.prefixPayloadMethodForTestMode(s), this.transport.post(this.overlay, v.MAGIC_HANDLE_REQUEST, s).then(function (e) { t(e.hasError ? new de(e.payload.error) : null, e.payload) }) } }, t.prototype.send = function (e, t) { if ("string" == typeof e) { var r = be(e, Array.isArray(t) ? t : []); return this.request(r) } if (!Array.isArray(e) && !t) { var n = new he(m.SyncWeb3Method, "Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead."); return n.log(), new Ie(e).applyError({ code: -32603, message: n.rawMessage }).payload } this.sendAsync(e, t) }, t.prototype.enable = function () { var e = be("eth_accounts"); return this.request(e) }, t.prototype.request = function (t) { return this.prefixPayloadMethodForTestMode(t), e.prototype.request.call(this, t) }, t.prototype.prefixPayloadMethodForTestMode = function (e) { this.sdk.testMode && (e.method = "testMode/eth/" + e.method) }, t }(Te); function xe(e, t) { return t ? new URL(e, t) : new URL(e) } function Fe(e) { var t = this; return function () { for (var r = [], n = 0; n < arguments.length; n++)r[n] = arguments[n]; return u(t, void 0, void 0, function () { return f(this, function (t) { switch (t.label) { case 0: return Le ? [3, 2] : [4, ue.configureStorage()]; case 1: Le = t.sent(), t.label = 2; case 2: return [4, Le.ready()]; case 3: return t.sent(), [2, Le[e].apply(Le, d(r))] } }) }) } } var Ge = { __proto__: null, getItem: Fe("getItem"), setItem: Fe("setItem"), removeItem: Fe("removeItem"), clear: Fe("clear"), length: Fe("length"), key: Fe("key"), keys: Fe("keys"), iterate: Fe("iterate") }, Ue = ["request", "transport", "overlay", "sdk"], Be = function (e) { function t() { var t = e.call(this, void 0) || this; t.__sdk_access_field_descriptors__ = new Map, t.__is_initialized__ = !1, t.utils = { createPromiEvent: Re, isPromiEvent: Oe, encodeJSON: oe, decodeJSON: ie, createJsonRpcRequestPayload: be, standardizeJsonRpcRequestPayload: _e, storage: Ge }; var r = d([t], function (e) { for (var t = Object.getPrototypeOf(e), r = [t]; t !== Te.prototype;)t = Object.getPrototypeOf(t), r.push(t); return r }(t)); return Ue.forEach(function (e) { var n = r.map(function (t) { return Object.getOwnPropertyDescriptor(t, e) }), o = n.findIndex(function (e) { return !!e }), i = n[o]; i && (t.__sdk_access_field_descriptors__.set(e, { descriptor: i, isPrototypeField: o > 0 }), Object.defineProperty(t, e, { configurable: !0, get: function () { throw new le(y.ExtensionNotInitialized, "Extensions must be initialized with a Magic SDK instance before `Extension." + (t = e) + "` can be accessed. Do not invoke `Extension." + t + "` inside an extension constructor."); var t } })) }), t } return s(t, e), t.prototype.init = function (e) { var t = this; this.__is_initialized__ || (Ue.forEach(function (e) { if (t.__sdk_access_field_descriptors__.has(e)) { var r = t.__sdk_access_field_descriptors__.get(e), n = r.descriptor; r.isPrototypeField ? delete t[e] : Object.defineProperty(t, e, n) } }), this.sdk = e, this.__is_initialized__ = !0) }, t.prototype.createDeprecationWarning = function (e) { var t = e.useInstead; return new ve(this, "DEPRECATION_NOTICE", "`" + e.method + "` will be removed from this Extension in version `" + e.removalVersion + "`." + (t ? " Use `" + t + "` instead." : "")) }, t.prototype.createWarning = function (e, t) { return new ve(this, e, t) }, t.prototype.createError = function (e, t, r) { return new pe(this, e, t, r) }, t }(Te), We = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return s(t, e), t }(Be), ze = function (e) { function t() { return null !== e && e.apply(this, arguments) || this } return s(t, e), t.Internal = We, t }(Be); function He(e) { if (e.compat) { if ("magic-sdk" === ue.sdkName) return "string" == typeof e.compat["magic-sdk"] ? te(ue.version, e.compat["magic-sdk"]) : !!e.compat["magic-sdk"]; if ("@magic-sdk/react-native" === ue.sdkName) return "string" == typeof e.compat["@magic-sdk/react-native"] ? te(ue.version, e.compat["@magic-sdk/react-native"]) : !!e.compat["@magic-sdk/react-native"] } return !0 } function Xe(e) { var t, r = this, n = null !== (t = null == e ? void 0 : e.extensions) && void 0 !== t ? t : [], o = {}, i = []; if (Array.isArray(n) ? n.forEach(function (e) { He(e) ? (e.init(r), r[e.name] = e, e instanceof ze.Internal && (ce(e.config) || (o[e.name] = e.config))) : i.push(e) }) : Object.keys(n).forEach(function (e) { if (He(n[e])) { n[e].init(r); var t = n[e]; r[e] = t, t instanceof ze.Internal && (ce(t.config) || (o[n[e].name] = t.config)) } else i.push(n[e]) }), i.length) throw function (e) { var t = "Some extensions are incompatible with `" + ue.sdkName + "@" + ue.version + "`:"; return e.filter(function (e) { return null != e.compat }).forEach(function (e) { var r = e.compat[ue.sdkName]; "string" == typeof r ? t += "\n - Extension `" + e.name + "` supports version(s) `" + r + "`" : r || (t += "\n - Extension `" + e.name + "` does not support " + ue.platform + " environments.") }), new le(y.IncompatibleExtensions, t) }(i); return o } var qe, Ve, Ye = function () { function e(e, t) { var r; if (this.apiKey = e, !e) throw new le(y.MissingApiKey, "Please provide an API key that you acquired from the Magic developer dashboard."); "react-native" === ue.platform && (null == t ? void 0 : t.endpoint) && new he(m.ReactNativeEndpointConfiguration, "CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The `endpoint` parameter SHOULD NOT be provided. The Magic `