diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenAccount.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenAccount.js index 698ef48e92..aad76fd713 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenAccount.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenAccount.js @@ -1,9 +1,9 @@ "use strict"; -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; } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +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); } var _require = require('./commons/index'), onFieldValid = _require.onFieldValid, onBrand = _require.onBrand, diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js index 8af597628f..8d9223d8c3 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js @@ -1,14 +1,14 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var helpers = require('./helpers'); var _require = require('./makePartialPayment'), makePartialPayment = _require.makePartialPayment; @@ -377,7 +377,6 @@ function setCheckoutConfiguration() { // turn billingAddress section on/off showEmailAddress: false // allow shopper to specify their email address }, - paywithgoogle: getGooglePayConfig(), googlepay: getGooglePayConfig(), paypal: getPaypalConfig(), diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js index 312e04b65b..26c6c6d9b9 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../../store'); var constants = require('../constants'); function assignPaymentMethodValue() { diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js index 20937744d8..edfa229282 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js @@ -1,21 +1,21 @@ "use strict"; var _document$getElementB; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 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."); } 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); } 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; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +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; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable no-unsafe-optional-chaining */ var store = require('../../../../store'); var _require = require('./renderPaymentMethod'), @@ -127,7 +127,7 @@ function renderStoredPaymentMethods(data, imagePath) { data.forEach(renderStoredPaymentMethod(imagePath)); } } -function renderPaymentMethods(_x2, _x3, _x4) { +function renderPaymentMethods(_x, _x2, _x3) { return _renderPaymentMethods.apply(this, arguments); } function _renderPaymentMethods() { @@ -222,7 +222,6 @@ function setInstallments(amount) { store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true; } catch (e) {} // eslint-disable-line no-empty } - function setGiftCardContainerVisibility() { var availableGiftCards = giftCardBrands(); if (availableGiftCards.length === 0) { diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js index 1b670bebcb..db7a4fa93c 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../../store'); var constants = require('../constants'); var _require = require('./renderGenericComponent'), diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js index ae52329c6e..c27be6f76c 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js @@ -1,14 +1,14 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../../store'); var helpers = require('./helpers'); var constants = require('../constants'); diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js index cbd636c516..bbd54775b0 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js @@ -1,14 +1,14 @@ "use strict"; -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; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +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; } +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); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var store = require('../../../store'); var helpers = require('./adyen_checkout/helpers'); function handleAuthorised(response) { diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js index cd0a693236..de22b36d6f 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js @@ -1,7 +1,7 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var _require = require('./commons'), @@ -30,6 +30,9 @@ function _mountAmazonPayComponent() { } }); }; + /** + * Makes an ajax call to the controller function GetPaymentMethods + */ getPaymentMethods( /*#__PURE__*/function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) { var _paymentMethodsRespon; diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js index a4bf274b0d..0c1b4f19f5 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js @@ -1,7 +1,7 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function saveShopperDetails(details) { diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/applePayExpress.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/applePayExpress.js index bb2b3ee70f..4795dafc77 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/applePayExpress.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/applePayExpress.js @@ -1,12 +1,12 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +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; } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var helpers = require('./adyen_checkout/helpers'); @@ -119,12 +119,14 @@ function formatCustomerObject(customerData, billingData) { }; } function handleAuthorised(response, resolveApplePay) { - var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5; + var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5, _response$fullRespons6, _response$fullRespons7; resolveApplePay(); document.querySelector('#result').value = JSON.stringify({ pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference, resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode, - paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod + paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod, + donationToken: (_response$fullRespons6 = response.fullResponse) === null || _response$fullRespons6 === void 0 ? void 0 : _response$fullRespons6.donationToken, + amount: (_response$fullRespons7 = response.fullResponse) === null || _response$fullRespons7 === void 0 ? void 0 : _response$fullRespons7.amount }); document.querySelector('#showConfirmationForm').submit(); } diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA5.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA5.js index a7a313ce01..9de568d208 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA5.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA5.js @@ -307,7 +307,6 @@ var adyenCheckout = require('../adyenCheckout'); }, 500); return p; // eslint-disable-line }, - /** * Initialize the checkout stage. * diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA6.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA6.js index ce1ff4c9c1..59be81e0d7 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA6.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA6.js @@ -343,7 +343,6 @@ var adyenCheckout = require('../adyenCheckout'); }, 500); return p; // eslint-disable-line }, - /** * Initialize the checkout stage. * diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js index b94a2fa106..cc7022487f 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js @@ -1,7 +1,7 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } var store = require('../../../../store'); diff --git a/cartridges/int_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js b/cartridges/int_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js index 18efb6cfc2..1f3e9bab21 100644 --- a/cartridges/int_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js +++ b/cartridges/int_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js @@ -1,7 +1,7 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 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."); } 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); } diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/cancelPartialPaymentOrder.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/cancelPartialPaymentOrder.js index 0807c48151..483e8f9a74 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/cancelPartialPaymentOrder.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/cancelPartialPaymentOrder.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); var Transaction = require('dw/system/Transaction'); var Resource = require('dw/web/Resource'); diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/checkBalance.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/checkBalance.js index d3c93ccbc8..399bdffae7 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/checkBalance.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/checkBalance.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); var Money = require('dw/value/Money'); var OrderMgr = require('dw/order/OrderMgr'); diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPayment.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPayment.js index 3503be9287..299e62a499 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPayment.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPayment.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Transaction = require('dw/system/Transaction'); var Money = require('dw/value/Money'); var BasketMgr = require('dw/order/BasketMgr'); @@ -49,7 +49,6 @@ function makePartialPayment(req, res, next) { brand: giftcardBrand })); // entire response exceeds string length }); - var discountAmount = new Money(response.amount.value, response.amount.currency); var remainingAmount = new Money(response.order.remainingAmount.value, response.order.remainingAmount.currency); diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPaymentsOrder.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPaymentsOrder.js index 7b5f58308d..ec443dc534 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPaymentsOrder.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/partialPaymentsOrder.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); var AdyenHelper = require('*/cartridge/scripts/util/adyenHelper'); var adyenCheckout = require('*/cartridge/scripts/adyenCheckout'); diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/selectShippingMethods.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/selectShippingMethods.js index 074dcb9572..3e81d7a27e 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/selectShippingMethods.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/adyen/selectShippingMethods.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BasketMgr = require('dw/order/BasketMgr'); var Resource = require('dw/web/Resource'); var Transaction = require('dw/system/Transaction'); diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/checkout_services/placeOrder.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/checkout_services/placeOrder.js index 3ada91b942..a3a3d1978d 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/checkout_services/placeOrder.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/checkout_services/placeOrder.js @@ -156,7 +156,6 @@ function placeOrder(req, res, next) { Transaction.wrap(function () { mainPaymentInstrument.paymentTransaction.setAmount(formattedAmount); //update amount from order total to PM total }); - GiftCardsHelper.createGiftCardPaymentInstrument(giftCard, divideBy, order); }); } diff --git a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js index c87bdd3512..b2daf4fd15 100644 --- a/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js +++ b/cartridges/int_adyen_SFRA/cartridge/controllers/middlewares/payment_instruments/savePayment.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var server = require('server'); var Resource = require('dw/web/Resource'); var CustomerMgr = require('dw/customer/CustomerMgr'); diff --git a/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js b/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js index 7e0256da77..52ecadcd60 100644 --- a/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js +++ b/cartridges/int_adyen_SFRA/cartridge/models/createPayment.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function getField(name, obj) { return obj && _defineProperty({}, name, obj); } diff --git a/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/processForm.js b/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/processForm.js index 08f8db8a30..1fc466143e 100644 --- a/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/processForm.js +++ b/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/processForm.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var COHelpers = require('*/cartridge/scripts/checkout/checkoutHelpers'); var array = require('*/cartridge/scripts/util/array'); var AdyenHelper = require('*/cartridge/scripts/util/adyenHelper'); diff --git a/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js b/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js index d7dee75804..caf9cd1a12 100644 --- a/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js +++ b/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/savePaymentInformation.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var CustomerMgr = require('dw/customer/CustomerMgr'); var COHelpers = require('*/cartridge/scripts/checkout/checkoutHelpers'); function hasValidBillingData(_ref) { diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenAccount.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenAccount.js index 88cd10ff58..447ebaae87 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenAccount.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenAccount.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _require = __webpack_require__(/*! ./commons/index */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onFieldValid = _require.onFieldValid,\n onBrand = _require.onBrand,\n createSession = _require.createSession;\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar checkout;\nvar card;\n\n// Store configuration\nstore.checkoutConfiguration.amount = {\n value: 0,\n currency: 'EUR'\n};\nstore.checkoutConfiguration.paymentMethodsConfiguration = {\n card: {\n enableStoreDetails: false,\n hasHolderName: true,\n holderNameRequired: true,\n installments: [],\n onBrand: onBrand,\n onFieldValid: onFieldValid,\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n store.componentState = state;\n }\n }\n};\n\n// Handle Payment action\nfunction handleAction(action) {\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n}\n\n// confirm onAdditionalDetails event and paymentsDetails response\nstore.checkoutConfiguration.onAdditionalDetails = function (state) {\n $.ajax({\n type: 'POST',\n url: 'Adyen-PaymentsDetails',\n data: JSON.stringify({\n data: state.data\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.isSuccessful) {\n window.location.href = window.redirectUrl;\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n handleAction(data.action);\n } else {\n $('#action-modal').modal('hide');\n document.getElementById('cardError').style.display = 'block';\n }\n }\n });\n};\nfunction initializeCardComponent() {\n return _initializeCardComponent.apply(this, arguments);\n}\nfunction _initializeCardComponent() {\n _initializeCardComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var session, cardNode;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return createSession();\n case 2:\n session = _context.sent;\n store.checkoutConfiguration.session = {\n id: session.id,\n sessionData: session.sessionData\n };\n cardNode = document.getElementById('card');\n _context.next = 7;\n return AdyenCheckout(store.checkoutConfiguration);\n case 7:\n checkout = _context.sent;\n card = checkout.create('card').mount(cardNode);\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _initializeCardComponent.apply(this, arguments);\n}\nvar formErrorsExist = false;\nfunction submitAddCard() {\n var form = $(document.getElementById('payment-form'));\n $.ajax({\n type: 'POST',\n url: form.attr('action'),\n data: form.serialize(),\n async: false,\n success: function success(data) {\n if (data.redirectAction) {\n handleAction(data.redirectAction);\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n } else if (data.error) {\n formErrorsExist = true;\n }\n }\n });\n}\ninitializeCardComponent();\n\n// Add Payment Button event handler\n$('button[value=\"add-new-payment\"]').on('click', function (event) {\n if (store.isValid) {\n document.querySelector('#adyenStateData').value = JSON.stringify(store.componentState.data);\n submitAddCard();\n if (formErrorsExist) {\n return;\n }\n event.preventDefault();\n } else {\n var _card;\n (_card = card) === null || _card === void 0 ? void 0 : _card.showValidation();\n }\n});\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenAccount.js?"); +eval("\n\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _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); }\nvar _require = __webpack_require__(/*! ./commons/index */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onFieldValid = _require.onFieldValid,\n onBrand = _require.onBrand,\n createSession = _require.createSession;\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar checkout;\nvar card;\n\n// Store configuration\nstore.checkoutConfiguration.amount = {\n value: 0,\n currency: 'EUR'\n};\nstore.checkoutConfiguration.paymentMethodsConfiguration = {\n card: {\n enableStoreDetails: false,\n hasHolderName: true,\n holderNameRequired: true,\n installments: [],\n onBrand: onBrand,\n onFieldValid: onFieldValid,\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n store.componentState = state;\n }\n }\n};\n\n// Handle Payment action\nfunction handleAction(action) {\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n}\n\n// confirm onAdditionalDetails event and paymentsDetails response\nstore.checkoutConfiguration.onAdditionalDetails = function (state) {\n $.ajax({\n type: 'POST',\n url: 'Adyen-PaymentsDetails',\n data: JSON.stringify({\n data: state.data\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.isSuccessful) {\n window.location.href = window.redirectUrl;\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n handleAction(data.action);\n } else {\n $('#action-modal').modal('hide');\n document.getElementById('cardError').style.display = 'block';\n }\n }\n });\n};\nfunction initializeCardComponent() {\n return _initializeCardComponent.apply(this, arguments);\n}\nfunction _initializeCardComponent() {\n _initializeCardComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var session, cardNode;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return createSession();\n case 2:\n session = _context.sent;\n store.checkoutConfiguration.session = {\n id: session.id,\n sessionData: session.sessionData\n };\n cardNode = document.getElementById('card');\n _context.next = 7;\n return AdyenCheckout(store.checkoutConfiguration);\n case 7:\n checkout = _context.sent;\n card = checkout.create('card').mount(cardNode);\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _initializeCardComponent.apply(this, arguments);\n}\nvar formErrorsExist = false;\nfunction submitAddCard() {\n var form = $(document.getElementById('payment-form'));\n $.ajax({\n type: 'POST',\n url: form.attr('action'),\n data: form.serialize(),\n async: false,\n success: function success(data) {\n if (data.redirectAction) {\n handleAction(data.redirectAction);\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n } else if (data.error) {\n formErrorsExist = true;\n }\n }\n });\n}\ninitializeCardComponent();\n\n// Add Payment Button event handler\n$('button[value=\"add-new-payment\"]').on('click', function (event) {\n if (store.isValid) {\n document.querySelector('#adyenStateData').value = JSON.stringify(store.componentState.data);\n submitAddCard();\n if (formErrorsExist) {\n return;\n }\n event.preventDefault();\n } else {\n var _card;\n (_card = card) === null || _card === void 0 ? void 0 : _card.showValidation();\n }\n});\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenAccount.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runti /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _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); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); /***/ }), @@ -130,7 +130,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property);\n } else {\n storeAnnotation(target, property, annotation);\n }\n }\n return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n if ( true && !types.includes(context.kind)) {\n die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_,\n decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* MakeResult.Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1,\n decorate_20223_: decorate_20223_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n if (true) {\n assert20223DecoratorType(context, [\"method\", \"field\"]);\n }\n var kind = context.kind,\n name = context.name,\n addInitializer = context.addInitializer;\n var ann = this;\n var _createAction = function _createAction(m) {\n var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n };\n // Backwards/Legacy behavior, expects makeObservable(this)\n if (kind == \"field\") {\n addInitializer(function () {\n storeAnnotation(this, name, ann);\n });\n return;\n }\n if (kind == \"method\") {\n var _this$options_2;\n if (!isAction(mthd)) {\n mthd = _createAction(mthd);\n }\n if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobxAction = true;\n self[name] = bound;\n });\n }\n return mthd;\n }\n die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2,\n decorate_20223_: decorate_20223_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* MakeResult.Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n var _this$options_3;\n if (true) {\n assert20223DecoratorType(context, [\"method\"]);\n }\n var name = context.name,\n addInitializer = context.addInitializer;\n if (!isFlow(mthd)) {\n mthd = flow(mthd);\n }\n if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobXFlow = true;\n self[name] = bound;\n });\n }\n return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3,\n decorate_20223_: decorate_20223_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n if (true) {\n assert20223DecoratorType(context, [\"getter\"]);\n }\n var ann = this;\n var key = context.name,\n addInitializer = context.addInitializer;\n addInitializer(function () {\n var adm = asObservableObject(this)[$mobx];\n var options = _extends({}, ann.options_, {\n get: get,\n context: this\n });\n options.name || (options.name = true ? adm.name_ + \".\" + key.toString() : undefined);\n adm.values_.set(key, new ComputedValue(options));\n });\n return function () {\n return this[$mobx].getObservablePropValue_(key);\n };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4,\n decorate_20223_: decorate_20223_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n if (true) {\n if (context.kind === \"field\") {\n throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n }\n assert20223DecoratorType(context, [\"accessor\"]);\n }\n var ann = this;\n var kind = context.kind,\n name = context.name;\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n var initializedObjects = new WeakSet();\n function initializeObservable(target, value) {\n var _ann$options_$enhance, _ann$options_;\n var adm = asObservableObject(target)[$mobx];\n var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, true ? adm.name_ + \".\" + name.toString() : undefined, false);\n adm.values_.set(name, observable);\n initializedObjects.add(target);\n }\n if (kind == \"accessor\") {\n return {\n get: function get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this));\n }\n return this[$mobx].getObservablePropValue_(name);\n },\n set: function set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return this[$mobx].setObservablePropValue_(name, value);\n },\n init: function init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return value;\n }\n };\n }\n return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5,\n decorate_20223_: decorate_20223_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* MakeResult.Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2);\n }\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return initObservable(function () {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n });\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2);\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n res.toString = function () {\n return fn.toString();\n };\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n });\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2);\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n initObservable(function () {\n var _annotations;\n var adm = asObservableObject(target, options)[$mobx];\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n });\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n });\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n return initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues);\n }\n return proxy;\n });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n initObservable(function () {\n _this.keysAtom_ = createAtom( true ? _this.name_ + \".keys()\" : undefined);\n _this.data_ = new Map();\n _this.hasMap_ = new Map();\n if (initialData) {\n _this.merge(initialData);\n }\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n var _this = this;\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n initObservable(function () {\n _this.atom_ = createAtom(_this.name_);\n if (initialData) {\n _this.replace(initialData);\n }\n });\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this2 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this2[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this3.data_.add(_this3.enhancer_(value, undefined));\n _this3.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this4 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this4.atom_.reportChanged();\n _this4.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this5 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (isES6Set(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined);\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* MakeResult.Cancel */) {\n return;\n }\n if (outcome === 1 /* MakeResult.Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (true) {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n // Not annotated\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function set() {\n v = true;\n }\n });\n /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n });\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n var derivation = untrackedStart();\n var allowStateChanges = allowStateChangesStart(true);\n startBatch();\n try {\n return cb();\n } finally {\n endBatch();\n allowStateChangesEnd(allowStateChanges);\n untrackedEnd(derivation);\n }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); /***/ }), diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js index 981428b787..95a4ae4cee 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js @@ -106,7 +106,7 @@ eval("\n\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/i /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : store.selectedMethod;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject) {\n var brandSelect = document.getElementById('giftCardSelect');\n var selectedBrandIndex = brandSelect.selectedIndex;\n var giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n var partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n var partialPaymentResponse = makePartialPayment(partialPaymentRequest);\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : store.selectedMethod;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject) {\n var brandSelect = document.getElementById('giftCardSelect');\n var selectedBrandIndex = brandSelect.selectedIndex;\n var giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n var partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n var partialPaymentResponse = makePartialPayment(partialPaymentRequest);\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _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); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -154,7 +154,7 @@ eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(so /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _document$getElementB;\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _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; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n createSession = _require3.createSession,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x2, _x3, _x4) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\n\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var session, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return createSession();\n case 2:\n session = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n store.checkoutConfiguration.session = {\n id: session.id,\n sessionData: session.sessionData,\n imagePath: session.imagePath,\n adyenDescriptions: session.adyenDescriptions\n };\n _context3.next = 9;\n return AdyenCheckout(store.checkoutConfiguration);\n case 9:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setCheckoutConfiguration(store.checkout.options);\n setInstallments(store.checkout.options.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, session.imagePath);\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, session.imagePath, session.adyenDescriptions);\n case 22:\n renderPosTerminals(session.adyenConnectedTerminals);\n renderGiftCardLogo(session.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls createSession and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); +eval("\n\nvar _document$getElementB;\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _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; }\nfunction _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; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n createSession = _require3.createSession,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x, _x2, _x3) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var session, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return createSession();\n case 2:\n session = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n store.checkoutConfiguration.session = {\n id: session.id,\n sessionData: session.sessionData,\n imagePath: session.imagePath,\n adyenDescriptions: session.adyenDescriptions\n };\n _context3.next = 9;\n return AdyenCheckout(store.checkoutConfiguration);\n case 9:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setCheckoutConfiguration(store.checkout.options);\n setInstallments(store.checkout.options.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, session.imagePath);\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, session.imagePath, session.adyenDescriptions);\n case 22:\n renderPosTerminals(session.adyenConnectedTerminals);\n renderGiftCardLogo(session.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls createSession and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); /***/ }), @@ -166,7 +166,7 @@ eval("\n\nvar _document$getElementB;\nfunction _typeof(obj) { \"@babel/helpers - /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n INIT_CHECKOUT_EVENT = _require.INIT_CHECKOUT_EVENT;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.session.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.session.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); +eval("\n\nfunction _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); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n INIT_CHECKOUT_EVENT = _require.INIT_CHECKOUT_EVENT;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.session.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.session.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); /***/ }), @@ -178,7 +178,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); /***/ }), @@ -202,7 +202,7 @@ eval("\n\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridge /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -226,7 +226,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _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); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); /***/ }), @@ -238,7 +238,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property);\n } else {\n storeAnnotation(target, property, annotation);\n }\n }\n return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n if ( true && !types.includes(context.kind)) {\n die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_,\n decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* MakeResult.Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1,\n decorate_20223_: decorate_20223_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n if (true) {\n assert20223DecoratorType(context, [\"method\", \"field\"]);\n }\n var kind = context.kind,\n name = context.name,\n addInitializer = context.addInitializer;\n var ann = this;\n var _createAction = function _createAction(m) {\n var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n };\n // Backwards/Legacy behavior, expects makeObservable(this)\n if (kind == \"field\") {\n addInitializer(function () {\n storeAnnotation(this, name, ann);\n });\n return;\n }\n if (kind == \"method\") {\n var _this$options_2;\n if (!isAction(mthd)) {\n mthd = _createAction(mthd);\n }\n if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobxAction = true;\n self[name] = bound;\n });\n }\n return mthd;\n }\n die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2,\n decorate_20223_: decorate_20223_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* MakeResult.Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n var _this$options_3;\n if (true) {\n assert20223DecoratorType(context, [\"method\"]);\n }\n var name = context.name,\n addInitializer = context.addInitializer;\n if (!isFlow(mthd)) {\n mthd = flow(mthd);\n }\n if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobXFlow = true;\n self[name] = bound;\n });\n }\n return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3,\n decorate_20223_: decorate_20223_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n if (true) {\n assert20223DecoratorType(context, [\"getter\"]);\n }\n var ann = this;\n var key = context.name,\n addInitializer = context.addInitializer;\n addInitializer(function () {\n var adm = asObservableObject(this)[$mobx];\n var options = _extends({}, ann.options_, {\n get: get,\n context: this\n });\n options.name || (options.name = true ? adm.name_ + \".\" + key.toString() : undefined);\n adm.values_.set(key, new ComputedValue(options));\n });\n return function () {\n return this[$mobx].getObservablePropValue_(key);\n };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4,\n decorate_20223_: decorate_20223_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n if (true) {\n if (context.kind === \"field\") {\n throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n }\n assert20223DecoratorType(context, [\"accessor\"]);\n }\n var ann = this;\n var kind = context.kind,\n name = context.name;\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n var initializedObjects = new WeakSet();\n function initializeObservable(target, value) {\n var _ann$options_$enhance, _ann$options_;\n var adm = asObservableObject(target)[$mobx];\n var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, true ? adm.name_ + \".\" + name.toString() : undefined, false);\n adm.values_.set(name, observable);\n initializedObjects.add(target);\n }\n if (kind == \"accessor\") {\n return {\n get: function get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this));\n }\n return this[$mobx].getObservablePropValue_(name);\n },\n set: function set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return this[$mobx].setObservablePropValue_(name, value);\n },\n init: function init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return value;\n }\n };\n }\n return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5,\n decorate_20223_: decorate_20223_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* MakeResult.Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2);\n }\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return initObservable(function () {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n });\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2);\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n res.toString = function () {\n return fn.toString();\n };\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n });\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2);\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n initObservable(function () {\n var _annotations;\n var adm = asObservableObject(target, options)[$mobx];\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n });\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n });\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n return initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues);\n }\n return proxy;\n });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n initObservable(function () {\n _this.keysAtom_ = createAtom( true ? _this.name_ + \".keys()\" : undefined);\n _this.data_ = new Map();\n _this.hasMap_ = new Map();\n if (initialData) {\n _this.merge(initialData);\n }\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n var _this = this;\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n initObservable(function () {\n _this.atom_ = createAtom(_this.name_);\n if (initialData) {\n _this.replace(initialData);\n }\n });\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this2 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this2[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this3.data_.add(_this3.enhancer_(value, undefined));\n _this3.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this4 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this4.atom_.reportChanged();\n _this4.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this5 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (isES6Set(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined);\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* MakeResult.Cancel */) {\n return;\n }\n if (outcome === 1 /* MakeResult.Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (true) {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n // Not annotated\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function set() {\n v = true;\n }\n });\n /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n });\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n var derivation = untrackedStart();\n var allowStateChanges = allowStateChangesStart(true);\n startBatch();\n try {\n return cb();\n } finally {\n endBatch();\n allowStateChangesEnd(allowStateChanges);\n untrackedEnd(derivation);\n }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); /***/ }), diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js index 3d03cacbe8..d8168d50e1 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _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); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _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; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction handleAuthorised(response) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5;\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError() {\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleAmazonResponse(response, component) {\n var _response$fullRespons6;\n if ((_response$fullRespons6 = response.fullResponse) !== null && _response$fullRespons6 !== void 0 && _response$fullRespons6.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.resultCode === window.resultCodeAuthorised) {\n handleAuthorised(response);\n } else {\n // first try the amazon decline flow\n component.handleDeclineFlow();\n // if this does not trigger a redirect, try the regular handleError flow\n handleError();\n }\n}\nfunction paymentFromComponent(data, component) {\n var partialPaymentsOrder = sessionStorage.getItem('partialPaymentsObj');\n var requestData = partialPaymentsOrder ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: JSON.parse(partialPaymentsOrder)\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: 'amazonpay',\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n },\n success: function success(response) {\n sessionStorage.removeItem('partialPaymentsObj');\n helpers.setOrderFormData(response);\n handleAmazonResponse(response, component);\n }\n });\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var amazonPayNode, checkout, amazonConfig, amazonPayComponent;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 3;\n return AdyenCheckout(window.Configuration);\n case 3:\n checkout = _context.sent;\n amazonConfig = {\n showOrderButton: false,\n returnUrl: window.returnURL,\n configuration: {\n merchantId: window.amazonMerchantID,\n storeId: window.amazonStoreID,\n publicKeyId: window.amazonPublicKeyID\n },\n amazonCheckoutSessionId: window.amazonCheckoutSessionId,\n onSubmit: function onSubmit(state, component) {\n document.querySelector('#adyenStateData').value = JSON.stringify(state.data);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n state.data.paymentMethod = 'amazonpay';\n $.ajax({\n type: 'post',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n success: function success(data) {\n if (data.isSuccessful) {\n handleAuthorised(data);\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n checkout.createFromAction(data.action).mount('#amazon-container');\n } else {\n $('#action-modal').modal('hide');\n handleError();\n }\n }\n });\n }\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n $('#dwfrm_billing').submit(function apiRequest(e) {\n e.preventDefault();\n var form = $(this);\n var url = form.attr('action');\n $.ajax({\n type: 'POST',\n url: url,\n data: form.serialize(),\n async: false,\n success: function success(data) {\n store.formErrorsExist = 'fieldErrors' in data;\n }\n });\n });\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n amazonPayComponent.submit();\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js?"); +eval("\n\nfunction _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; }\nfunction _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); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nfunction handleAuthorised(response) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5;\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError() {\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleAmazonResponse(response, component) {\n var _response$fullRespons6;\n if ((_response$fullRespons6 = response.fullResponse) !== null && _response$fullRespons6 !== void 0 && _response$fullRespons6.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.resultCode === window.resultCodeAuthorised) {\n handleAuthorised(response);\n } else {\n // first try the amazon decline flow\n component.handleDeclineFlow();\n // if this does not trigger a redirect, try the regular handleError flow\n handleError();\n }\n}\nfunction paymentFromComponent(data, component) {\n var partialPaymentsOrder = sessionStorage.getItem('partialPaymentsObj');\n var requestData = partialPaymentsOrder ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: JSON.parse(partialPaymentsOrder)\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: 'amazonpay',\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n },\n success: function success(response) {\n sessionStorage.removeItem('partialPaymentsObj');\n helpers.setOrderFormData(response);\n handleAmazonResponse(response, component);\n }\n });\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var amazonPayNode, checkout, amazonConfig, amazonPayComponent;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 3;\n return AdyenCheckout(window.Configuration);\n case 3:\n checkout = _context.sent;\n amazonConfig = {\n showOrderButton: false,\n returnUrl: window.returnURL,\n configuration: {\n merchantId: window.amazonMerchantID,\n storeId: window.amazonStoreID,\n publicKeyId: window.amazonPublicKeyID\n },\n amazonCheckoutSessionId: window.amazonCheckoutSessionId,\n onSubmit: function onSubmit(state, component) {\n document.querySelector('#adyenStateData').value = JSON.stringify(state.data);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n state.data.paymentMethod = 'amazonpay';\n $.ajax({\n type: 'post',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n success: function success(data) {\n if (data.isSuccessful) {\n handleAuthorised(data);\n } else if (!data.isFinal && _typeof(data.action) === 'object') {\n checkout.createFromAction(data.action).mount('#amazon-container');\n } else {\n $('#action-modal').modal('hide');\n handleError();\n }\n }\n });\n }\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n $('#dwfrm_billing').submit(function apiRequest(e) {\n e.preventDefault();\n var form = $(this);\n var url = form.attr('action');\n $.ajax({\n type: 'POST',\n url: url,\n data: form.serialize(),\n async: false,\n success: function success(data) {\n store.formErrorsExist = 'fieldErrors' in data;\n }\n });\n });\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n amazonPayComponent.submit();\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayCheckout.js?"); /***/ }), @@ -130,7 +130,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _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); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); /***/ }), @@ -142,7 +142,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property);\n } else {\n storeAnnotation(target, property, annotation);\n }\n }\n return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n if ( true && !types.includes(context.kind)) {\n die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_,\n decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* MakeResult.Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1,\n decorate_20223_: decorate_20223_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n if (true) {\n assert20223DecoratorType(context, [\"method\", \"field\"]);\n }\n var kind = context.kind,\n name = context.name,\n addInitializer = context.addInitializer;\n var ann = this;\n var _createAction = function _createAction(m) {\n var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n };\n // Backwards/Legacy behavior, expects makeObservable(this)\n if (kind == \"field\") {\n addInitializer(function () {\n storeAnnotation(this, name, ann);\n });\n return;\n }\n if (kind == \"method\") {\n var _this$options_2;\n if (!isAction(mthd)) {\n mthd = _createAction(mthd);\n }\n if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobxAction = true;\n self[name] = bound;\n });\n }\n return mthd;\n }\n die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2,\n decorate_20223_: decorate_20223_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* MakeResult.Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n var _this$options_3;\n if (true) {\n assert20223DecoratorType(context, [\"method\"]);\n }\n var name = context.name,\n addInitializer = context.addInitializer;\n if (!isFlow(mthd)) {\n mthd = flow(mthd);\n }\n if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobXFlow = true;\n self[name] = bound;\n });\n }\n return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3,\n decorate_20223_: decorate_20223_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n if (true) {\n assert20223DecoratorType(context, [\"getter\"]);\n }\n var ann = this;\n var key = context.name,\n addInitializer = context.addInitializer;\n addInitializer(function () {\n var adm = asObservableObject(this)[$mobx];\n var options = _extends({}, ann.options_, {\n get: get,\n context: this\n });\n options.name || (options.name = true ? adm.name_ + \".\" + key.toString() : undefined);\n adm.values_.set(key, new ComputedValue(options));\n });\n return function () {\n return this[$mobx].getObservablePropValue_(key);\n };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4,\n decorate_20223_: decorate_20223_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n if (true) {\n if (context.kind === \"field\") {\n throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n }\n assert20223DecoratorType(context, [\"accessor\"]);\n }\n var ann = this;\n var kind = context.kind,\n name = context.name;\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n var initializedObjects = new WeakSet();\n function initializeObservable(target, value) {\n var _ann$options_$enhance, _ann$options_;\n var adm = asObservableObject(target)[$mobx];\n var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, true ? adm.name_ + \".\" + name.toString() : undefined, false);\n adm.values_.set(name, observable);\n initializedObjects.add(target);\n }\n if (kind == \"accessor\") {\n return {\n get: function get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this));\n }\n return this[$mobx].getObservablePropValue_(name);\n },\n set: function set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return this[$mobx].setObservablePropValue_(name, value);\n },\n init: function init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return value;\n }\n };\n }\n return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5,\n decorate_20223_: decorate_20223_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* MakeResult.Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2);\n }\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return initObservable(function () {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n });\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2);\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n res.toString = function () {\n return fn.toString();\n };\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n });\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2);\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n initObservable(function () {\n var _annotations;\n var adm = asObservableObject(target, options)[$mobx];\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n });\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n });\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n return initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues);\n }\n return proxy;\n });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n initObservable(function () {\n _this.keysAtom_ = createAtom( true ? _this.name_ + \".keys()\" : undefined);\n _this.data_ = new Map();\n _this.hasMap_ = new Map();\n if (initialData) {\n _this.merge(initialData);\n }\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n var _this = this;\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n initObservable(function () {\n _this.atom_ = createAtom(_this.name_);\n if (initialData) {\n _this.replace(initialData);\n }\n });\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this2 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this2[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this3.data_.add(_this3.enhancer_(value, undefined));\n _this3.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this4 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this4.atom_.reportChanged();\n _this4.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this5 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (isES6Set(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined);\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* MakeResult.Cancel */) {\n return;\n }\n if (outcome === 1 /* MakeResult.Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (true) {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n // Not annotated\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function set() {\n v = true;\n }\n });\n /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n });\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n var derivation = untrackedStart();\n var allowStateChanges = allowStateChangesStart(true);\n startBatch();\n try {\n return cb();\n } finally {\n endBatch();\n allowStateChangesEnd(allowStateChanges);\n untrackedEnd(derivation);\n }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); /***/ }), diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js index a87df738da..1621697bf0 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady,\n updateLoadedExpressMethods = _require.updateLoadedExpressMethods;\nvar AMAZON_PAY = 'amazonpay';\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var getPaymentMethods;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n getPaymentMethods = function _getPaymentMethods(paymentMethods) {\n $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get',\n success: function success(data) {\n paymentMethods(data);\n },\n error: function error() {\n updateLoadedExpressMethods(AMAZON_PAY);\n checkIfExpressMethodsAreReady();\n }\n });\n };\n getPaymentMethods( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var _paymentMethodsRespon;\n var paymentMethodsResponse, checkout, amazonPayConfig, amazonPayButtonConfig, amazonPayButton;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n paymentMethodsResponse = data.AdyenPaymentMethods;\n _context.next = 3;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale\n });\n case 3:\n checkout = _context.sent;\n amazonPayConfig = (_paymentMethodsRespon = paymentMethodsResponse.find(function (pm) {\n return pm.type === AMAZON_PAY;\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"return\");\n case 7:\n amazonPayButtonConfig = {\n showPayButton: true,\n productType: 'PayAndShip',\n configuration: amazonPayConfig,\n returnUrl: window.returnUrl\n };\n amazonPayButton = checkout.create(AMAZON_PAY, amazonPayButtonConfig);\n amazonPayButton.mount('#amazonpay-container');\n updateLoadedExpressMethods(AMAZON_PAY);\n checkIfExpressMethodsAreReady();\n case 12:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady,\n updateLoadedExpressMethods = _require.updateLoadedExpressMethods;\nvar AMAZON_PAY = 'amazonpay';\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var getPaymentMethods;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n getPaymentMethods = function _getPaymentMethods(paymentMethods) {\n $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get',\n success: function success(data) {\n paymentMethods(data);\n },\n error: function error() {\n updateLoadedExpressMethods(AMAZON_PAY);\n checkIfExpressMethodsAreReady();\n }\n });\n };\n /**\n * Makes an ajax call to the controller function GetPaymentMethods\n */\n getPaymentMethods( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var _paymentMethodsRespon;\n var paymentMethodsResponse, checkout, amazonPayConfig, amazonPayButtonConfig, amazonPayButton;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n paymentMethodsResponse = data.AdyenPaymentMethods;\n _context.next = 3;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale\n });\n case 3:\n checkout = _context.sent;\n amazonPayConfig = (_paymentMethodsRespon = paymentMethodsResponse.find(function (pm) {\n return pm.type === AMAZON_PAY;\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"return\");\n case 7:\n amazonPayButtonConfig = {\n showPayButton: true,\n productType: 'PayAndShip',\n configuration: amazonPayConfig,\n returnUrl: window.returnUrl\n };\n amazonPayButton = checkout.create(AMAZON_PAY, amazonPayButtonConfig);\n amazonPayButton.mount('#amazonpay-container');\n updateLoadedExpressMethods(AMAZON_PAY);\n checkIfExpressMethodsAreReady();\n case 12:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart1.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _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); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); /***/ }), @@ -130,7 +130,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property);\n } else {\n storeAnnotation(target, property, annotation);\n }\n }\n return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n if ( true && !types.includes(context.kind)) {\n die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_,\n decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* MakeResult.Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1,\n decorate_20223_: decorate_20223_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n if (true) {\n assert20223DecoratorType(context, [\"method\", \"field\"]);\n }\n var kind = context.kind,\n name = context.name,\n addInitializer = context.addInitializer;\n var ann = this;\n var _createAction = function _createAction(m) {\n var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n };\n // Backwards/Legacy behavior, expects makeObservable(this)\n if (kind == \"field\") {\n addInitializer(function () {\n storeAnnotation(this, name, ann);\n });\n return;\n }\n if (kind == \"method\") {\n var _this$options_2;\n if (!isAction(mthd)) {\n mthd = _createAction(mthd);\n }\n if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobxAction = true;\n self[name] = bound;\n });\n }\n return mthd;\n }\n die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2,\n decorate_20223_: decorate_20223_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* MakeResult.Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n var _this$options_3;\n if (true) {\n assert20223DecoratorType(context, [\"method\"]);\n }\n var name = context.name,\n addInitializer = context.addInitializer;\n if (!isFlow(mthd)) {\n mthd = flow(mthd);\n }\n if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobXFlow = true;\n self[name] = bound;\n });\n }\n return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3,\n decorate_20223_: decorate_20223_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n if (true) {\n assert20223DecoratorType(context, [\"getter\"]);\n }\n var ann = this;\n var key = context.name,\n addInitializer = context.addInitializer;\n addInitializer(function () {\n var adm = asObservableObject(this)[$mobx];\n var options = _extends({}, ann.options_, {\n get: get,\n context: this\n });\n options.name || (options.name = true ? adm.name_ + \".\" + key.toString() : undefined);\n adm.values_.set(key, new ComputedValue(options));\n });\n return function () {\n return this[$mobx].getObservablePropValue_(key);\n };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4,\n decorate_20223_: decorate_20223_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n if (true) {\n if (context.kind === \"field\") {\n throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n }\n assert20223DecoratorType(context, [\"accessor\"]);\n }\n var ann = this;\n var kind = context.kind,\n name = context.name;\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n var initializedObjects = new WeakSet();\n function initializeObservable(target, value) {\n var _ann$options_$enhance, _ann$options_;\n var adm = asObservableObject(target)[$mobx];\n var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, true ? adm.name_ + \".\" + name.toString() : undefined, false);\n adm.values_.set(name, observable);\n initializedObjects.add(target);\n }\n if (kind == \"accessor\") {\n return {\n get: function get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this));\n }\n return this[$mobx].getObservablePropValue_(name);\n },\n set: function set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return this[$mobx].setObservablePropValue_(name, value);\n },\n init: function init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return value;\n }\n };\n }\n return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5,\n decorate_20223_: decorate_20223_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* MakeResult.Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2);\n }\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return initObservable(function () {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n });\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2);\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n res.toString = function () {\n return fn.toString();\n };\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n });\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2);\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n initObservable(function () {\n var _annotations;\n var adm = asObservableObject(target, options)[$mobx];\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n });\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n });\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n return initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues);\n }\n return proxy;\n });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n initObservable(function () {\n _this.keysAtom_ = createAtom( true ? _this.name_ + \".keys()\" : undefined);\n _this.data_ = new Map();\n _this.hasMap_ = new Map();\n if (initialData) {\n _this.merge(initialData);\n }\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n var _this = this;\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n initObservable(function () {\n _this.atom_ = createAtom(_this.name_);\n if (initialData) {\n _this.replace(initialData);\n }\n });\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this2 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this2[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this3.data_.add(_this3.enhancer_(value, undefined));\n _this3.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this4 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this4.atom_.reportChanged();\n _this4.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this5 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (isES6Set(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined);\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* MakeResult.Cancel */) {\n return;\n }\n if (outcome === 1 /* MakeResult.Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (true) {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n // Not annotated\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function set() {\n v = true;\n }\n });\n /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n });\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n var derivation = untrackedStart();\n var allowStateChanges = allowStateChangesStart(true);\n startBatch();\n try {\n return cb();\n } finally {\n endBatch();\n allowStateChangesEnd(allowStateChanges);\n untrackedEnd(derivation);\n }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); /***/ }), diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js index c7100824a8..3f054072cf 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction saveShopperDetails(details) {\n $.ajax({\n url: window.saveShopperDetailsURL,\n type: 'post',\n data: {\n shopperDetails: JSON.stringify(details),\n paymentMethod: 'amazonpay'\n },\n success: function success(data) {\n var select = document.querySelector('#shippingMethods');\n select.innerHTML = '';\n data.shippingMethods.forEach(function (shippingMethod) {\n var option = document.createElement('option');\n option.setAttribute('data-shipping-id', shippingMethod.ID);\n option.innerText = \"\".concat(shippingMethod.displayName, \" (\").concat(shippingMethod.estimatedArrivalTime, \")\");\n select.appendChild(option);\n });\n select.options[0].selected = true;\n select.dispatchEvent(new Event('change'));\n }\n });\n}\nfunction getPaymentMethods() {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get',\n success: function success(data) {\n resolve(data);\n },\n error: function error(_error) {\n reject(_error);\n }\n });\n });\n}\nfunction constructAddress(shopperDetails) {\n var addressKeys = Object.keys(shopperDetails.shippingAddress);\n var addressValues = Object.values(shopperDetails.shippingAddress);\n var addressStr = \"\".concat(shopperDetails.shippingAddress.name, \"\\n\");\n for (var i = 0; i < addressKeys.length; i += 1) {\n if (addressValues[i] && addressKeys[i] !== 'name') {\n addressStr += \"\".concat(addressValues[i], \" \");\n }\n }\n return addressStr;\n}\nfunction positionElementBefore(elm) {\n var addressDetails = document.querySelector('#amazonPayAddressDetails');\n var containerNode = addressDetails.parentNode.parentNode.parentNode;\n containerNode.insertBefore(addressDetails, document.querySelector(elm));\n}\nfunction wrapChangeAddressButton() {\n // hide component button and use custom \"Edit\" buttons instead\n var changeDetailsBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--ghost adyen-checkout__amazonpay__button--changeAddress')[0];\n changeDetailsBtn.classList.add('invisible');\n var editAddressBtns = document.querySelectorAll('.editAddressBtn');\n editAddressBtns.forEach(function (btn) {\n btn.addEventListener('click', function () {\n changeDetailsBtn.click();\n });\n });\n}\nfunction showAddressDetails(shopperDetails) {\n var addressText = constructAddress(shopperDetails);\n var addressElement = document.querySelector('#address');\n var paymentDiscriptorElement = document.querySelector('#paymentStr');\n addressElement.innerText = addressText;\n paymentDiscriptorElement.innerText = shopperDetails.paymentDescriptor;\n positionElementBefore('.coupons-and-promos');\n wrapChangeAddressButton();\n var payBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--standalone adyen-checkout__button--pay')[0];\n payBtn.style.background = '#00a1e0';\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var amazonPayNode, checkout, _paymentMethodsRespon, data, paymentMethodsResponse, amazonPayConfig, amazonConfig, amazonPayComponent, shopperDetails;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 3;\n return AdyenCheckout(window.Configuration);\n case 3:\n checkout = _context.sent;\n _context.prev = 4;\n _context.next = 7;\n return getPaymentMethods();\n case 7:\n data = _context.sent;\n paymentMethodsResponse = data.AdyenPaymentMethods;\n amazonPayConfig = (_paymentMethodsRespon = paymentMethodsResponse.find(function (pm) {\n return pm.type === 'amazonpay';\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 12;\n break;\n }\n return _context.abrupt(\"return\");\n case 12:\n amazonConfig = {\n showOrderButton: true,\n configuration: {\n merchantId: amazonPayConfig.merchantId,\n storeId: amazonPayConfig.storeId,\n region: amazonPayConfig.region,\n publicKeyId: amazonPayConfig.publicKeyId\n },\n returnUrl: window.returnUrl,\n showChangePaymentDetailsButton: true,\n amount: JSON.parse(window.basketAmount),\n amazonCheckoutSessionId: window.amazonCheckoutSessionId\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n _context.next = 16;\n return amazonPayComponent.getShopperDetails();\n case 16:\n shopperDetails = _context.sent;\n saveShopperDetails(shopperDetails);\n showAddressDetails(shopperDetails);\n _context.next = 23;\n break;\n case 21:\n _context.prev = 21;\n _context.t0 = _context[\"catch\"](4);\n case 23:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[4, 21]]);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\nmodule.exports = saveShopperDetails;\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction saveShopperDetails(details) {\n $.ajax({\n url: window.saveShopperDetailsURL,\n type: 'post',\n data: {\n shopperDetails: JSON.stringify(details),\n paymentMethod: 'amazonpay'\n },\n success: function success(data) {\n var select = document.querySelector('#shippingMethods');\n select.innerHTML = '';\n data.shippingMethods.forEach(function (shippingMethod) {\n var option = document.createElement('option');\n option.setAttribute('data-shipping-id', shippingMethod.ID);\n option.innerText = \"\".concat(shippingMethod.displayName, \" (\").concat(shippingMethod.estimatedArrivalTime, \")\");\n select.appendChild(option);\n });\n select.options[0].selected = true;\n select.dispatchEvent(new Event('change'));\n }\n });\n}\nfunction getPaymentMethods() {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: window.getPaymentMethodsURL,\n type: 'get',\n success: function success(data) {\n resolve(data);\n },\n error: function error(_error) {\n reject(_error);\n }\n });\n });\n}\nfunction constructAddress(shopperDetails) {\n var addressKeys = Object.keys(shopperDetails.shippingAddress);\n var addressValues = Object.values(shopperDetails.shippingAddress);\n var addressStr = \"\".concat(shopperDetails.shippingAddress.name, \"\\n\");\n for (var i = 0; i < addressKeys.length; i += 1) {\n if (addressValues[i] && addressKeys[i] !== 'name') {\n addressStr += \"\".concat(addressValues[i], \" \");\n }\n }\n return addressStr;\n}\nfunction positionElementBefore(elm) {\n var addressDetails = document.querySelector('#amazonPayAddressDetails');\n var containerNode = addressDetails.parentNode.parentNode.parentNode;\n containerNode.insertBefore(addressDetails, document.querySelector(elm));\n}\nfunction wrapChangeAddressButton() {\n // hide component button and use custom \"Edit\" buttons instead\n var changeDetailsBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--ghost adyen-checkout__amazonpay__button--changeAddress')[0];\n changeDetailsBtn.classList.add('invisible');\n var editAddressBtns = document.querySelectorAll('.editAddressBtn');\n editAddressBtns.forEach(function (btn) {\n btn.addEventListener('click', function () {\n changeDetailsBtn.click();\n });\n });\n}\nfunction showAddressDetails(shopperDetails) {\n var addressText = constructAddress(shopperDetails);\n var addressElement = document.querySelector('#address');\n var paymentDiscriptorElement = document.querySelector('#paymentStr');\n addressElement.innerText = addressText;\n paymentDiscriptorElement.innerText = shopperDetails.paymentDescriptor;\n positionElementBefore('.coupons-and-promos');\n wrapChangeAddressButton();\n var payBtn = document.getElementsByClassName('adyen-checkout__button adyen-checkout__button--standalone adyen-checkout__button--pay')[0];\n payBtn.style.background = '#00a1e0';\n}\nfunction mountAmazonPayComponent() {\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nfunction _mountAmazonPayComponent() {\n _mountAmazonPayComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var amazonPayNode, checkout, _paymentMethodsRespon, data, paymentMethodsResponse, amazonPayConfig, amazonConfig, amazonPayComponent, shopperDetails;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n amazonPayNode = document.getElementById('amazon-container');\n _context.next = 3;\n return AdyenCheckout(window.Configuration);\n case 3:\n checkout = _context.sent;\n _context.prev = 4;\n _context.next = 7;\n return getPaymentMethods();\n case 7:\n data = _context.sent;\n paymentMethodsResponse = data.AdyenPaymentMethods;\n amazonPayConfig = (_paymentMethodsRespon = paymentMethodsResponse.find(function (pm) {\n return pm.type === 'amazonpay';\n })) === null || _paymentMethodsRespon === void 0 ? void 0 : _paymentMethodsRespon.configuration;\n if (amazonPayConfig) {\n _context.next = 12;\n break;\n }\n return _context.abrupt(\"return\");\n case 12:\n amazonConfig = {\n showOrderButton: true,\n configuration: {\n merchantId: amazonPayConfig.merchantId,\n storeId: amazonPayConfig.storeId,\n region: amazonPayConfig.region,\n publicKeyId: amazonPayConfig.publicKeyId\n },\n returnUrl: window.returnUrl,\n showChangePaymentDetailsButton: true,\n amount: JSON.parse(window.basketAmount),\n amazonCheckoutSessionId: window.amazonCheckoutSessionId\n };\n amazonPayComponent = checkout.create('amazonpay', amazonConfig).mount(amazonPayNode);\n _context.next = 16;\n return amazonPayComponent.getShopperDetails();\n case 16:\n shopperDetails = _context.sent;\n saveShopperDetails(shopperDetails);\n showAddressDetails(shopperDetails);\n _context.next = 23;\n break;\n case 21:\n _context.prev = 21;\n _context.t0 = _context[\"catch\"](4);\n case 23:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[4, 21]]);\n }));\n return _mountAmazonPayComponent.apply(this, arguments);\n}\nmountAmazonPayComponent();\nmodule.exports = saveShopperDetails;\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/amazonPayExpressPart2.js?"); /***/ }) diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/applePayExpress.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/applePayExpress.js index 7447fd87ef..3ee477f634 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/applePayExpress.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/applePayExpress.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _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); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./commons/index */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nvar _require2 = __webpack_require__(/*! ./commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n updateLoadedExpressMethods = _require2.updateLoadedExpressMethods;\nvar _require3 = __webpack_require__(/*! ./constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\"),\n APPLE_PAY = _require3.APPLE_PAY;\nvar checkout;\nvar shippingMethodsData;\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var session, sessionData, shippingMethods;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return fetch(window.sessionsUrl);\n case 2:\n session = _context5.sent;\n _context5.next = 5;\n return session.json();\n case 5:\n sessionData = _context5.sent;\n _context5.next = 8;\n return fetch(window.shippingMethodsUrl);\n case 8:\n shippingMethods = _context5.sent;\n _context5.next = 11;\n return shippingMethods.json();\n case 11:\n shippingMethodsData = _context5.sent;\n _context5.next = 14;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale,\n session: sessionData\n });\n case 14:\n checkout = _context5.sent;\n case 15:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\nfunction createApplePayButton(_x) {\n return _createApplePayButton.apply(this, arguments);\n}\nfunction _createApplePayButton() {\n _createApplePayButton = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(applePayButtonConfig) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n return _context6.abrupt(\"return\", checkout.create(APPLE_PAY, applePayButtonConfig));\n case 1:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return _createApplePayButton.apply(this, arguments);\n}\nfunction formatCustomerObject(customerData, billingData) {\n return {\n addressBook: {\n addresses: {},\n preferredAddress: {\n address1: customerData.addressLines[0],\n address2: customerData.addressLines.length > 1 ? customerData.addressLines[1] : null,\n city: customerData.locality,\n countryCode: {\n displayValue: customerData.country,\n value: customerData.countryCode\n },\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n ID: customerData.emailAddress,\n postalCode: customerData.postalCode,\n stateCode: customerData.administrativeArea\n }\n },\n billingAddressDetails: {\n address1: billingData.addressLines[0],\n address2: billingData.addressLines.length > 1 ? billingData.addressLines[1] : null,\n city: billingData.locality,\n countryCode: {\n displayValue: billingData.country,\n value: billingData.countryCode\n },\n firstName: billingData.givenName,\n lastName: billingData.familyName,\n postalCode: billingData.postalCode,\n stateCode: billingData.administrativeArea\n },\n customer: {},\n profile: {\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n email: customerData.emailAddress,\n phone: customerData.phoneNumber\n }\n };\n}\nfunction handleAuthorised(response, resolveApplePay) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5;\n resolveApplePay();\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError(rejectApplePay) {\n rejectApplePay();\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleApplePayResponse(response, resolveApplePay, rejectApplePay) {\n if (response.resultCode === 'Authorised') {\n handleAuthorised(response, resolveApplePay);\n } else {\n handleError(rejectApplePay);\n }\n}\nfunction callPaymentFromComponent(data, resolveApplePay, rejectApplePay) {\n return $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(data),\n paymentMethod: APPLE_PAY\n },\n success: function success(response) {\n helpers.createShowConfirmationForm(window.showConfirmationAction);\n helpers.setOrderFormData(response);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(data);\n handleApplePayResponse(response, resolveApplePay, rejectApplePay);\n }\n }).fail(function () {\n rejectApplePay();\n });\n}\ninitializeCheckout().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var applePayPaymentMethod, applePayConfig, applePayButtonConfig, cartContainer, applePayButton, isApplePayButtonAvailable, expressCheckoutNodesIndex;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n applePayPaymentMethod = checkout.paymentMethodsResponse.paymentMethods.find(function (pm) {\n return pm.type === APPLE_PAY;\n });\n if (applePayPaymentMethod) {\n _context4.next = 5;\n break;\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n return _context4.abrupt(\"return\");\n case 5:\n applePayConfig = applePayPaymentMethod.configuration;\n applePayButtonConfig = {\n showPayButton: true,\n configuration: applePayConfig,\n amount: checkout.options.amount,\n requiredShippingContactFields: ['postalAddress', 'email', 'phone'],\n requiredBillingContactFields: ['postalAddress', 'phone'],\n shippingMethods: shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n }),\n onAuthorized: function () {\n var _onAuthorized = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject, event) {\n var customerData, billingData, customer, stateData, resolveApplePay;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n customerData = event.payment.shippingContact;\n billingData = event.payment.billingContact;\n customer = formatCustomerObject(customerData, billingData);\n stateData = {\n paymentMethod: {\n type: APPLE_PAY,\n applePayToken: event.payment.token.paymentData\n },\n paymentType: 'express'\n };\n resolveApplePay = function resolveApplePay() {\n // ** is used instead of Math.pow\n var value = applePayButtonConfig.amount.value * Math.pow(10, parseInt(window.digitsNumber, 10));\n var finalPriceUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: \"\".concat(Math.round(value))\n }\n };\n resolve(finalPriceUpdate);\n };\n _context.next = 8;\n return callPaymentFromComponent(_objectSpread(_objectSpread({}, stateData), {}, {\n customer: customer\n }), resolveApplePay, reject);\n case 8:\n _context.next = 13;\n break;\n case 10:\n _context.prev = 10;\n _context.t0 = _context[\"catch\"](0);\n reject(_context.t0);\n case 13:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 10]]);\n }));\n function onAuthorized(_x2, _x3, _x4) {\n return _onAuthorized.apply(this, arguments);\n }\n return onAuthorized;\n }(),\n onSubmit: function onSubmit() {\n // This handler is empty to prevent sending a second payment request\n // We already do the payment in paymentFromComponent\n },\n onShippingMethodSelected: function () {\n var _onShippingMethodSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject, event) {\n var shippingMethod, matchingShippingMethod, calculationResponse, newCalculation, applePayShippingMethodUpdate;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n shippingMethod = event.shippingMethod;\n matchingShippingMethod = shippingMethodsData.shippingMethods.find(function (sm) {\n return sm.ID === shippingMethod.identifier;\n });\n _context2.next = 4;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: matchingShippingMethod.shipmentUUID,\n methodID: matchingShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 4:\n calculationResponse = _context2.sent;\n if (!calculationResponse.ok) {\n _context2.next = 14;\n break;\n }\n _context2.next = 8;\n return calculationResponse.json();\n case 8:\n newCalculation = _context2.sent;\n applePayButtonConfig.amount = {\n value: newCalculation.grandTotalAmount.value,\n currency: newCalculation.grandTotalAmount.currency\n };\n applePayShippingMethodUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingMethodUpdate);\n _context2.next = 15;\n break;\n case 14:\n reject();\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function onShippingMethodSelected(_x5, _x6, _x7) {\n return _onShippingMethodSelected.apply(this, arguments);\n }\n return onShippingMethodSelected;\n }(),\n onShippingContactSelected: function () {\n var _onShippingContactSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve, reject, event) {\n var shippingContact, shippingMethods, _shippingMethodsData$, selectedShippingMethod, calculationResponse, shippingMethodsStructured, newCalculation, applePayShippingContactUpdate;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n shippingContact = event.shippingContact;\n _context3.next = 3;\n return fetch(\"\".concat(window.shippingMethodsUrl, \"?\").concat(new URLSearchParams({\n city: shippingContact.locality,\n country: shippingContact.country,\n countryCode: shippingContact.countryCode,\n stateCode: shippingContact.administrativeArea\n })));\n case 3:\n shippingMethods = _context3.sent;\n if (!shippingMethods.ok) {\n _context3.next = 28;\n break;\n }\n _context3.next = 7;\n return shippingMethods.json();\n case 7:\n shippingMethodsData = _context3.sent;\n if (!((_shippingMethodsData$ = shippingMethodsData.shippingMethods) !== null && _shippingMethodsData$ !== void 0 && _shippingMethodsData$.length)) {\n _context3.next = 25;\n break;\n }\n selectedShippingMethod = shippingMethodsData.shippingMethods[0];\n _context3.next = 12;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: selectedShippingMethod.shipmentUUID,\n methodID: selectedShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 12:\n calculationResponse = _context3.sent;\n if (!calculationResponse.ok) {\n _context3.next = 22;\n break;\n }\n shippingMethodsStructured = shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n });\n _context3.next = 17;\n return calculationResponse.json();\n case 17:\n newCalculation = _context3.sent;\n applePayShippingContactUpdate = {\n newShippingMethods: shippingMethodsStructured,\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingContactUpdate);\n _context3.next = 23;\n break;\n case 22:\n reject();\n case 23:\n _context3.next = 26;\n break;\n case 25:\n reject();\n case 26:\n _context3.next = 29;\n break;\n case 28:\n reject();\n case 29:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function onShippingContactSelected(_x8, _x9, _x10) {\n return _onShippingContactSelected.apply(this, arguments);\n }\n return onShippingContactSelected;\n }()\n };\n cartContainer = document.getElementsByClassName(APPLE_PAY);\n _context4.next = 10;\n return createApplePayButton(applePayButtonConfig);\n case 10:\n applePayButton = _context4.sent;\n _context4.next = 13;\n return applePayButton.isAvailable();\n case 13:\n isApplePayButtonAvailable = _context4.sent;\n if (isApplePayButtonAvailable) {\n for (expressCheckoutNodesIndex = 0; expressCheckoutNodesIndex < cartContainer.length; expressCheckoutNodesIndex += 1) {\n applePayButton.mount(cartContainer[expressCheckoutNodesIndex]);\n }\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n case 17:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n})))[\"catch\"](function () {\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n});\nmodule.exports = {\n handleAuthorised: handleAuthorised,\n handleError: handleError,\n handleApplePayResponse: handleApplePayResponse,\n callPaymentFromComponent: callPaymentFromComponent\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/applePayExpress.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar helpers = __webpack_require__(/*! ./adyen_checkout/helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./commons/index */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nvar _require2 = __webpack_require__(/*! ./commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n updateLoadedExpressMethods = _require2.updateLoadedExpressMethods;\nvar _require3 = __webpack_require__(/*! ./constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\"),\n APPLE_PAY = _require3.APPLE_PAY;\nvar checkout;\nvar shippingMethodsData;\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var session, sessionData, shippingMethods;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return fetch(window.sessionsUrl);\n case 2:\n session = _context5.sent;\n _context5.next = 5;\n return session.json();\n case 5:\n sessionData = _context5.sent;\n _context5.next = 8;\n return fetch(window.shippingMethodsUrl);\n case 8:\n shippingMethods = _context5.sent;\n _context5.next = 11;\n return shippingMethods.json();\n case 11:\n shippingMethodsData = _context5.sent;\n _context5.next = 14;\n return AdyenCheckout({\n environment: window.environment,\n clientKey: window.clientKey,\n locale: window.locale,\n session: sessionData\n });\n case 14:\n checkout = _context5.sent;\n case 15:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\nfunction createApplePayButton(_x) {\n return _createApplePayButton.apply(this, arguments);\n}\nfunction _createApplePayButton() {\n _createApplePayButton = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(applePayButtonConfig) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n return _context6.abrupt(\"return\", checkout.create(APPLE_PAY, applePayButtonConfig));\n case 1:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return _createApplePayButton.apply(this, arguments);\n}\nfunction formatCustomerObject(customerData, billingData) {\n return {\n addressBook: {\n addresses: {},\n preferredAddress: {\n address1: customerData.addressLines[0],\n address2: customerData.addressLines.length > 1 ? customerData.addressLines[1] : null,\n city: customerData.locality,\n countryCode: {\n displayValue: customerData.country,\n value: customerData.countryCode\n },\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n ID: customerData.emailAddress,\n postalCode: customerData.postalCode,\n stateCode: customerData.administrativeArea\n }\n },\n billingAddressDetails: {\n address1: billingData.addressLines[0],\n address2: billingData.addressLines.length > 1 ? billingData.addressLines[1] : null,\n city: billingData.locality,\n countryCode: {\n displayValue: billingData.country,\n value: billingData.countryCode\n },\n firstName: billingData.givenName,\n lastName: billingData.familyName,\n postalCode: billingData.postalCode,\n stateCode: billingData.administrativeArea\n },\n customer: {},\n profile: {\n firstName: customerData.givenName,\n lastName: customerData.familyName,\n email: customerData.emailAddress,\n phone: customerData.phoneNumber\n }\n };\n}\nfunction handleAuthorised(response, resolveApplePay) {\n var _response$fullRespons, _response$fullRespons2, _response$fullRespons3, _response$fullRespons4, _response$fullRespons5, _response$fullRespons6, _response$fullRespons7;\n resolveApplePay();\n document.querySelector('#result').value = JSON.stringify({\n pspReference: (_response$fullRespons = response.fullResponse) === null || _response$fullRespons === void 0 ? void 0 : _response$fullRespons.pspReference,\n resultCode: (_response$fullRespons2 = response.fullResponse) === null || _response$fullRespons2 === void 0 ? void 0 : _response$fullRespons2.resultCode,\n paymentMethod: (_response$fullRespons3 = response.fullResponse) !== null && _response$fullRespons3 !== void 0 && _response$fullRespons3.paymentMethod ? response.fullResponse.paymentMethod : (_response$fullRespons4 = response.fullResponse) === null || _response$fullRespons4 === void 0 ? void 0 : (_response$fullRespons5 = _response$fullRespons4.additionalData) === null || _response$fullRespons5 === void 0 ? void 0 : _response$fullRespons5.paymentMethod,\n donationToken: (_response$fullRespons6 = response.fullResponse) === null || _response$fullRespons6 === void 0 ? void 0 : _response$fullRespons6.donationToken,\n amount: (_response$fullRespons7 = response.fullResponse) === null || _response$fullRespons7 === void 0 ? void 0 : _response$fullRespons7.amount\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleError(rejectApplePay) {\n rejectApplePay();\n document.querySelector('#result').value = JSON.stringify({\n error: true\n });\n document.querySelector('#showConfirmationForm').submit();\n}\nfunction handleApplePayResponse(response, resolveApplePay, rejectApplePay) {\n if (response.resultCode === 'Authorised') {\n handleAuthorised(response, resolveApplePay);\n } else {\n handleError(rejectApplePay);\n }\n}\nfunction callPaymentFromComponent(data, resolveApplePay, rejectApplePay) {\n return $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(data),\n paymentMethod: APPLE_PAY\n },\n success: function success(response) {\n helpers.createShowConfirmationForm(window.showConfirmationAction);\n helpers.setOrderFormData(response);\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(data);\n handleApplePayResponse(response, resolveApplePay, rejectApplePay);\n }\n }).fail(function () {\n rejectApplePay();\n });\n}\ninitializeCheckout().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var applePayPaymentMethod, applePayConfig, applePayButtonConfig, cartContainer, applePayButton, isApplePayButtonAvailable, expressCheckoutNodesIndex;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n applePayPaymentMethod = checkout.paymentMethodsResponse.paymentMethods.find(function (pm) {\n return pm.type === APPLE_PAY;\n });\n if (applePayPaymentMethod) {\n _context4.next = 5;\n break;\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n return _context4.abrupt(\"return\");\n case 5:\n applePayConfig = applePayPaymentMethod.configuration;\n applePayButtonConfig = {\n showPayButton: true,\n configuration: applePayConfig,\n amount: checkout.options.amount,\n requiredShippingContactFields: ['postalAddress', 'email', 'phone'],\n requiredBillingContactFields: ['postalAddress', 'phone'],\n shippingMethods: shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n }),\n onAuthorized: function () {\n var _onAuthorized = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject, event) {\n var customerData, billingData, customer, stateData, resolveApplePay;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n customerData = event.payment.shippingContact;\n billingData = event.payment.billingContact;\n customer = formatCustomerObject(customerData, billingData);\n stateData = {\n paymentMethod: {\n type: APPLE_PAY,\n applePayToken: event.payment.token.paymentData\n },\n paymentType: 'express'\n };\n resolveApplePay = function resolveApplePay() {\n // ** is used instead of Math.pow\n var value = applePayButtonConfig.amount.value * Math.pow(10, parseInt(window.digitsNumber, 10));\n var finalPriceUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: \"\".concat(Math.round(value))\n }\n };\n resolve(finalPriceUpdate);\n };\n _context.next = 8;\n return callPaymentFromComponent(_objectSpread(_objectSpread({}, stateData), {}, {\n customer: customer\n }), resolveApplePay, reject);\n case 8:\n _context.next = 13;\n break;\n case 10:\n _context.prev = 10;\n _context.t0 = _context[\"catch\"](0);\n reject(_context.t0);\n case 13:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 10]]);\n }));\n function onAuthorized(_x2, _x3, _x4) {\n return _onAuthorized.apply(this, arguments);\n }\n return onAuthorized;\n }(),\n onSubmit: function onSubmit() {\n // This handler is empty to prevent sending a second payment request\n // We already do the payment in paymentFromComponent\n },\n onShippingMethodSelected: function () {\n var _onShippingMethodSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject, event) {\n var shippingMethod, matchingShippingMethod, calculationResponse, newCalculation, applePayShippingMethodUpdate;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n shippingMethod = event.shippingMethod;\n matchingShippingMethod = shippingMethodsData.shippingMethods.find(function (sm) {\n return sm.ID === shippingMethod.identifier;\n });\n _context2.next = 4;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: matchingShippingMethod.shipmentUUID,\n methodID: matchingShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 4:\n calculationResponse = _context2.sent;\n if (!calculationResponse.ok) {\n _context2.next = 14;\n break;\n }\n _context2.next = 8;\n return calculationResponse.json();\n case 8:\n newCalculation = _context2.sent;\n applePayButtonConfig.amount = {\n value: newCalculation.grandTotalAmount.value,\n currency: newCalculation.grandTotalAmount.currency\n };\n applePayShippingMethodUpdate = {\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingMethodUpdate);\n _context2.next = 15;\n break;\n case 14:\n reject();\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function onShippingMethodSelected(_x5, _x6, _x7) {\n return _onShippingMethodSelected.apply(this, arguments);\n }\n return onShippingMethodSelected;\n }(),\n onShippingContactSelected: function () {\n var _onShippingContactSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve, reject, event) {\n var shippingContact, shippingMethods, _shippingMethodsData$, selectedShippingMethod, calculationResponse, shippingMethodsStructured, newCalculation, applePayShippingContactUpdate;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n shippingContact = event.shippingContact;\n _context3.next = 3;\n return fetch(\"\".concat(window.shippingMethodsUrl, \"?\").concat(new URLSearchParams({\n city: shippingContact.locality,\n country: shippingContact.country,\n countryCode: shippingContact.countryCode,\n stateCode: shippingContact.administrativeArea\n })));\n case 3:\n shippingMethods = _context3.sent;\n if (!shippingMethods.ok) {\n _context3.next = 28;\n break;\n }\n _context3.next = 7;\n return shippingMethods.json();\n case 7:\n shippingMethodsData = _context3.sent;\n if (!((_shippingMethodsData$ = shippingMethodsData.shippingMethods) !== null && _shippingMethodsData$ !== void 0 && _shippingMethodsData$.length)) {\n _context3.next = 25;\n break;\n }\n selectedShippingMethod = shippingMethodsData.shippingMethods[0];\n _context3.next = 12;\n return fetch(\"\".concat(window.calculateAmountUrl, \"?\").concat(new URLSearchParams({\n shipmentUUID: selectedShippingMethod.shipmentUUID,\n methodID: selectedShippingMethod.ID\n })), {\n method: 'POST'\n });\n case 12:\n calculationResponse = _context3.sent;\n if (!calculationResponse.ok) {\n _context3.next = 22;\n break;\n }\n shippingMethodsStructured = shippingMethodsData.shippingMethods.map(function (sm) {\n return {\n label: sm.displayName,\n detail: sm.description,\n identifier: sm.ID,\n amount: \"\".concat(sm.shippingCost.value)\n };\n });\n _context3.next = 17;\n return calculationResponse.json();\n case 17:\n newCalculation = _context3.sent;\n applePayShippingContactUpdate = {\n newShippingMethods: shippingMethodsStructured,\n newTotal: {\n type: 'final',\n label: applePayConfig.merchantName,\n amount: newCalculation.grandTotalAmount.value\n }\n };\n resolve(applePayShippingContactUpdate);\n _context3.next = 23;\n break;\n case 22:\n reject();\n case 23:\n _context3.next = 26;\n break;\n case 25:\n reject();\n case 26:\n _context3.next = 29;\n break;\n case 28:\n reject();\n case 29:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function onShippingContactSelected(_x8, _x9, _x10) {\n return _onShippingContactSelected.apply(this, arguments);\n }\n return onShippingContactSelected;\n }()\n };\n cartContainer = document.getElementsByClassName(APPLE_PAY);\n _context4.next = 10;\n return createApplePayButton(applePayButtonConfig);\n case 10:\n applePayButton = _context4.sent;\n _context4.next = 13;\n return applePayButton.isAvailable();\n case 13:\n isApplePayButtonAvailable = _context4.sent;\n if (isApplePayButtonAvailable) {\n for (expressCheckoutNodesIndex = 0; expressCheckoutNodesIndex < cartContainer.length; expressCheckoutNodesIndex += 1) {\n applePayButton.mount(cartContainer[expressCheckoutNodesIndex]);\n }\n }\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n case 17:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n})))[\"catch\"](function () {\n updateLoadedExpressMethods(APPLE_PAY);\n checkIfExpressMethodsAreReady();\n});\nmodule.exports = {\n handleAuthorised: handleAuthorised,\n handleError: handleError,\n handleApplePayResponse: handleApplePayResponse,\n callPaymentFromComponent: callPaymentFromComponent\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/applePayExpress.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -142,7 +142,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _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); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); /***/ }), @@ -154,7 +154,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property);\n } else {\n storeAnnotation(target, property, annotation);\n }\n }\n return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n if ( true && !types.includes(context.kind)) {\n die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_,\n decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* MakeResult.Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1,\n decorate_20223_: decorate_20223_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n if (true) {\n assert20223DecoratorType(context, [\"method\", \"field\"]);\n }\n var kind = context.kind,\n name = context.name,\n addInitializer = context.addInitializer;\n var ann = this;\n var _createAction = function _createAction(m) {\n var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n };\n // Backwards/Legacy behavior, expects makeObservable(this)\n if (kind == \"field\") {\n addInitializer(function () {\n storeAnnotation(this, name, ann);\n });\n return;\n }\n if (kind == \"method\") {\n var _this$options_2;\n if (!isAction(mthd)) {\n mthd = _createAction(mthd);\n }\n if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobxAction = true;\n self[name] = bound;\n });\n }\n return mthd;\n }\n die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2,\n decorate_20223_: decorate_20223_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* MakeResult.Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n var _this$options_3;\n if (true) {\n assert20223DecoratorType(context, [\"method\"]);\n }\n var name = context.name,\n addInitializer = context.addInitializer;\n if (!isFlow(mthd)) {\n mthd = flow(mthd);\n }\n if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobXFlow = true;\n self[name] = bound;\n });\n }\n return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3,\n decorate_20223_: decorate_20223_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n if (true) {\n assert20223DecoratorType(context, [\"getter\"]);\n }\n var ann = this;\n var key = context.name,\n addInitializer = context.addInitializer;\n addInitializer(function () {\n var adm = asObservableObject(this)[$mobx];\n var options = _extends({}, ann.options_, {\n get: get,\n context: this\n });\n options.name || (options.name = true ? adm.name_ + \".\" + key.toString() : undefined);\n adm.values_.set(key, new ComputedValue(options));\n });\n return function () {\n return this[$mobx].getObservablePropValue_(key);\n };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4,\n decorate_20223_: decorate_20223_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n if (true) {\n if (context.kind === \"field\") {\n throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n }\n assert20223DecoratorType(context, [\"accessor\"]);\n }\n var ann = this;\n var kind = context.kind,\n name = context.name;\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n var initializedObjects = new WeakSet();\n function initializeObservable(target, value) {\n var _ann$options_$enhance, _ann$options_;\n var adm = asObservableObject(target)[$mobx];\n var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, true ? adm.name_ + \".\" + name.toString() : undefined, false);\n adm.values_.set(name, observable);\n initializedObjects.add(target);\n }\n if (kind == \"accessor\") {\n return {\n get: function get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this));\n }\n return this[$mobx].getObservablePropValue_(name);\n },\n set: function set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return this[$mobx].setObservablePropValue_(name, value);\n },\n init: function init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return value;\n }\n };\n }\n return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5,\n decorate_20223_: decorate_20223_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* MakeResult.Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2);\n }\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return initObservable(function () {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n });\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2);\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n res.toString = function () {\n return fn.toString();\n };\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n });\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2);\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n initObservable(function () {\n var _annotations;\n var adm = asObservableObject(target, options)[$mobx];\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n });\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n });\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n return initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues);\n }\n return proxy;\n });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n initObservable(function () {\n _this.keysAtom_ = createAtom( true ? _this.name_ + \".keys()\" : undefined);\n _this.data_ = new Map();\n _this.hasMap_ = new Map();\n if (initialData) {\n _this.merge(initialData);\n }\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n var _this = this;\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n initObservable(function () {\n _this.atom_ = createAtom(_this.name_);\n if (initialData) {\n _this.replace(initialData);\n }\n });\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this2 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this2[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this3.data_.add(_this3.enhancer_(value, undefined));\n _this3.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this4 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this4.atom_.reportChanged();\n _this4.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this5 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (isES6Set(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined);\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* MakeResult.Cancel */) {\n return;\n }\n if (outcome === 1 /* MakeResult.Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (true) {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n // Not annotated\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function set() {\n v = true;\n }\n });\n /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n });\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n var derivation = untrackedStart();\n var allowStateChanges = allowStateChangesStart(true);\n startBatch();\n try {\n return cb();\n } finally {\n endBatch();\n allowStateChangesEnd(allowStateChanges);\n untrackedEnd(derivation);\n }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); /***/ }), diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/checkout.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/checkout.js index 538abe8d9c..45ae57d659 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/checkout.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/checkout.js @@ -250,7 +250,7 @@ eval("\n\nvar store = __webpack_require__(/*! ../../../store */ \"./cartridges/i /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : store.selectedMethod;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject) {\n var brandSelect = document.getElementById('giftCardSelect');\n var selectedBrandIndex = brandSelect.selectedIndex;\n var giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n var partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n var partialPaymentResponse = makePartialPayment(partialPaymentRequest);\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require = __webpack_require__(/*! ./makePartialPayment */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/makePartialPayment.js\"),\n makePartialPayment = _require.makePartialPayment;\nvar _require2 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n onBrand = _require2.onBrand,\n onFieldValid = _require2.onFieldValid;\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require3 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require3.createElementsToShowRemainingGiftCardAmount,\n renderAddedGiftCard = _require3.renderAddedGiftCard,\n getGiftCardElements = _require3.getGiftCardElements,\n showGiftCardInfoMessage = _require3.showGiftCardInfoMessage,\n showGiftCardCancelButton = _require3.showGiftCardCancelButton,\n attachGiftCardCancelListener = _require3.attachGiftCardCancelListener;\nfunction getCardConfig() {\n return {\n enableStoreDetails: window.showStoreDetails,\n showBrandsUnderCardNumber: false,\n clickToPayConfiguration: {\n shopperEmail: window.customerEmail,\n merchantDisplayName: window.merchantAccount\n },\n onChange: function onChange(state) {\n store.isValid = state.isValid;\n var method = state.data.paymentMethod.storedPaymentMethodId ? \"storedCard\".concat(state.data.paymentMethod.storedPaymentMethodId) : store.selectedMethod;\n store.updateSelectedPayment(method, 'isValid', store.isValid);\n store.updateSelectedPayment(method, 'stateData', state.data);\n },\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n onFieldValid: onFieldValid,\n onBrand: onBrand\n };\n}\nfunction getPaypalConfig() {\n store.paypalTerminatedEarly = false;\n return {\n showPayButton: true,\n environment: window.Configuration.environment,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n document.querySelector('#adyenStateData').value = JSON.stringify(store.selectedPayment.stateData);\n helpers.paymentFromComponent(state.data, component);\n },\n onCancel: function onCancel(data, component) {\n store.paypalTerminatedEarly = false;\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value,\n orderToken: document.querySelector('#orderToken').value\n }, component);\n },\n onError: function onError(error, component) {\n store.paypalTerminatedEarly = false;\n if (component) {\n component.setStatus('ready');\n }\n document.querySelector('#showConfirmationForm').submit();\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n store.paypalTerminatedEarly = false;\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n },\n onClick: function onClick(data, actions) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n return actions.reject();\n }\n if (store.paypalTerminatedEarly) {\n helpers.paymentFromComponent({\n cancelTransaction: true,\n merchantReference: document.querySelector('#merchantReference').value\n });\n store.paypalTerminatedEarly = false;\n return actions.resolve();\n }\n store.paypalTerminatedEarly = true;\n return null;\n }\n };\n}\nfunction getGooglePayConfig() {\n return {\n environment: window.Configuration.environment,\n onSubmit: function onSubmit() {\n helpers.assignPaymentMethodValue();\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n },\n configuration: {\n gatewayMerchantId: window.merchantAccount\n },\n showPayButton: true,\n buttonColor: 'white'\n };\n}\nfunction handlePartialPaymentSuccess() {\n var _store$addedGiftCards;\n var _getGiftCardElements = getGiftCardElements(),\n giftCardSelectContainer = _getGiftCardElements.giftCardSelectContainer,\n giftCardSelect = _getGiftCardElements.giftCardSelect,\n giftCardsList = _getGiftCardElements.giftCardsList,\n cancelMainPaymentGiftCard = _getGiftCardElements.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements.giftCardAddButton;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.value = null;\n giftCardsList.innerHTML = '';\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n });\n if (store.componentsObj.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n}\nfunction makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject) {\n var brandSelect = document.getElementById('giftCardSelect');\n var selectedBrandIndex = brandSelect.selectedIndex;\n var giftcardBrand = brandSelect.options[selectedBrandIndex].text;\n var partialPaymentRequest = {\n paymentMethod: giftCardData,\n amount: giftcardBalance,\n partialPaymentsOrder: {\n pspReference: store.adyenOrderData.pspReference,\n orderData: store.adyenOrderData.orderData\n },\n giftcardBrand: giftcardBrand\n };\n var partialPaymentResponse = makePartialPayment(partialPaymentRequest);\n if (partialPaymentResponse !== null && partialPaymentResponse !== void 0 && partialPaymentResponse.error) {\n reject();\n } else {\n handlePartialPaymentSuccess();\n }\n}\nfunction getGiftCardConfig() {\n var giftcardBalance;\n return {\n showPayButton: true,\n onChange: function onChange(state) {\n store.updateSelectedPayment(constants.GIFTCARD, 'isValid', state.isValid);\n store.updateSelectedPayment(constants.GIFTCARD, 'stateData', state.data);\n },\n onBalanceCheck: function onBalanceCheck(resolve, reject, requestData) {\n $.ajax({\n type: 'POST',\n url: window.checkBalanceUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n giftcardBalance = data.balance;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (data.resultCode === constants.SUCCESS) {\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelectWrapper = _getGiftCardElements2.giftCardSelectWrapper;\n if (giftCardSelectWrapper) {\n giftCardSelectWrapper.classList.add('invisible');\n }\n var initialPartialObject = _objectSpread({}, store.partialPaymentsOrderObj);\n cancelMainPaymentGiftCard.classList.remove('invisible');\n cancelMainPaymentGiftCard.addEventListener('click', function () {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n cancelMainPaymentGiftCard.classList.add('invisible');\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = 'null';\n store.partialPaymentsOrderObj.remainingAmountFormatted = initialPartialObject.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = initialPartialObject.totalDiscountedAmount;\n });\n document.querySelector('button[value=\"submit-payment\"]').disabled = true;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n store.partialPaymentsOrderObj.remainingAmountFormatted = data.remainingAmountFormatted;\n store.partialPaymentsOrderObj.totalDiscountedAmount = data.totalAmountFormatted;\n resolve(data);\n } else if (data.resultCode === constants.NOTENOUGHBALANCE) {\n resolve(data);\n } else {\n reject();\n }\n },\n fail: function fail() {\n reject();\n }\n });\n },\n onOrderRequest: function onOrderRequest(resolve, reject, requestData) {\n // Make a POST /orders request\n // Create an order for the total transaction amount\n var giftCardData = requestData.paymentMethod;\n if (store.adyenOrderData) {\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n } else {\n $.ajax({\n type: 'POST',\n url: window.partialPaymentsOrderUrl,\n data: JSON.stringify(requestData),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (data.resultCode === 'Success') {\n store.adyenOrderData = data;\n // make payments call including giftcard data and order data\n makeGiftcardPaymentRequest(giftCardData, giftcardBalance, reject);\n }\n }\n });\n }\n },\n onSubmit: function onSubmit(state, component) {\n store.selectedMethod = state.data.paymentMethod.type;\n store.brand = component === null || component === void 0 ? void 0 : component.displayName;\n document.querySelector('input[name=\"brandCode\"]').checked = false;\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n document.querySelector('button[value=\"submit-payment\"]').click();\n }\n };\n}\nfunction handleOnChange(state) {\n store.isValid = state.isValid;\n if (!store.componentsObj[store.selectedMethod]) {\n store.componentsObj[store.selectedMethod] = {};\n }\n store.componentsObj[store.selectedMethod].isValid = store.isValid;\n store.componentsObj[store.selectedMethod].stateData = state.data;\n}\nvar actionHandler = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(action) {\n var checkout;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return AdyenCheckout(store.checkoutConfiguration);\n case 2:\n checkout = _context.sent;\n checkout.createFromAction(action).mount('#action-container');\n $('#action-modal').modal({\n backdrop: 'static',\n keyboard: false\n });\n if (action.type === constants.ACTIONTYPE.QRCODE) {\n document.getElementById('cancelQrMethodsButton').classList.remove('invisible');\n }\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function actionHandler(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nfunction handleOnAdditionalDetails(state) {\n $.ajax({\n type: 'POST',\n url: window.paymentsDetailsURL,\n data: JSON.stringify({\n data: state.data,\n orderToken: window.orderToken\n }),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(data) {\n if (!data.isFinal && _typeof(data.action) === 'object') {\n actionHandler(data.action);\n } else {\n window.location.href = data.redirectUrl;\n }\n }\n });\n}\nfunction getAmazonpayConfig() {\n return {\n showPayButton: true,\n productType: 'PayAndShip',\n checkoutMode: 'ProcessOrder',\n locale: window.Configuration.locale,\n returnUrl: window.returnURL,\n onClick: function onClick(resolve, reject) {\n $('#dwfrm_billing').trigger('submit');\n if (store.formErrorsExist) {\n reject();\n } else {\n helpers.assignPaymentMethodValue();\n resolve();\n }\n },\n onError: function onError() {}\n };\n}\nfunction getApplePayConfig() {\n return {\n showPayButton: true,\n buttonColor: 'black',\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getCashAppConfig() {\n return {\n showPayButton: true,\n onSubmit: function onSubmit(state, component) {\n $('#dwfrm_billing').trigger('submit');\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n }\n };\n}\nfunction getKlarnaConfig() {\n var _window = window,\n klarnaWidgetEnabled = _window.klarnaWidgetEnabled;\n if (klarnaWidgetEnabled) {\n return {\n showPayButton: true,\n useKlarnaWidget: true,\n onSubmit: function onSubmit(state, component) {\n helpers.assignPaymentMethodValue();\n helpers.paymentFromComponent(state.data, component);\n },\n onAdditionalDetails: function onAdditionalDetails(state) {\n document.querySelector('#additionalDetailsHidden').value = JSON.stringify(state.data);\n document.querySelector('#showConfirmationForm').submit();\n }\n };\n }\n return null;\n}\nfunction setCheckoutConfiguration() {\n store.checkoutConfiguration.onChange = handleOnChange;\n store.checkoutConfiguration.onAdditionalDetails = handleOnAdditionalDetails;\n store.checkoutConfiguration.showPayButton = false;\n store.checkoutConfiguration.clientKey = window.adyenClientKey;\n store.checkoutConfiguration.paymentMethodsConfiguration = {\n card: getCardConfig(),\n bcmc: getCardConfig(),\n storedCard: getCardConfig(),\n boletobancario: {\n personalDetailsRequired: true,\n // turn personalDetails section on/off\n billingAddressRequired: false,\n // turn billingAddress section on/off\n showEmailAddress: false // allow shopper to specify their email address\n },\n paywithgoogle: getGooglePayConfig(),\n googlepay: getGooglePayConfig(),\n paypal: getPaypalConfig(),\n amazonpay: getAmazonpayConfig(),\n giftcard: getGiftCardConfig(),\n applepay: getApplePayConfig(),\n klarna: getKlarnaConfig(),\n klarna_account: getKlarnaConfig(),\n klarna_paynow: getKlarnaConfig(),\n cashapp: getCashAppConfig()\n };\n}\nmodule.exports = {\n getCardConfig: getCardConfig,\n getPaypalConfig: getPaypalConfig,\n getGooglePayConfig: getGooglePayConfig,\n getAmazonpayConfig: getAmazonpayConfig,\n setCheckoutConfiguration: setCheckoutConfiguration,\n actionHandler: actionHandler\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js?"); /***/ }), @@ -262,7 +262,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _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); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -298,7 +298,7 @@ eval("\n\nvar _excluded = [\"giftCards\"];\nfunction _objectWithoutProperties(so /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _document$getElementB;\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _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; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n createSession = _require3.createSession,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x2, _x3, _x4) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\n\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var session, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return createSession();\n case 2:\n session = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n store.checkoutConfiguration.session = {\n id: session.id,\n sessionData: session.sessionData,\n imagePath: session.imagePath,\n adyenDescriptions: session.adyenDescriptions\n };\n _context3.next = 9;\n return AdyenCheckout(store.checkoutConfiguration);\n case 9:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setCheckoutConfiguration(store.checkout.options);\n setInstallments(store.checkout.options.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, session.imagePath);\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, session.imagePath, session.adyenDescriptions);\n case 22:\n renderPosTerminals(session.adyenConnectedTerminals);\n renderGiftCardLogo(session.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls createSession and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); +eval("\n\nvar _document$getElementB;\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _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; }\nfunction _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; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/* eslint-disable no-unsafe-optional-chaining */\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar _require = __webpack_require__(/*! ./renderPaymentMethod */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js\"),\n renderPaymentMethod = _require.renderPaymentMethod;\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar _require2 = __webpack_require__(/*! ./localesUsingInstallments */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/localesUsingInstallments.js\"),\n installmentLocales = _require2.installmentLocales;\nvar _require3 = __webpack_require__(/*! ../commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n createSession = _require3.createSession,\n fetchGiftCards = _require3.fetchGiftCards;\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require4 = __webpack_require__(/*! ./renderGiftcardComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js\"),\n createElementsToShowRemainingGiftCardAmount = _require4.createElementsToShowRemainingGiftCardAmount,\n removeGiftCards = _require4.removeGiftCards,\n renderAddedGiftCard = _require4.renderAddedGiftCard,\n showGiftCardWarningMessage = _require4.showGiftCardWarningMessage,\n attachGiftCardAddButtonListener = _require4.attachGiftCardAddButtonListener,\n showGiftCardInfoMessage = _require4.showGiftCardInfoMessage,\n giftCardBrands = _require4.giftCardBrands,\n clearGiftCardsContainer = _require4.clearGiftCardsContainer,\n attachGiftCardCancelListener = _require4.attachGiftCardCancelListener,\n showGiftCardCancelButton = _require4.showGiftCardCancelButton;\nvar INIT_CHECKOUT_EVENT = 'INIT_CHECKOUT_EVENT';\nfunction addPosTerminals(terminals) {\n var ddTerminals = document.createElement('select');\n ddTerminals.id = 'terminalList';\n Object.keys(terminals).forEach(function (t) {\n var option = document.createElement('option');\n option.value = terminals[t];\n option.text = terminals[t];\n ddTerminals.appendChild(option);\n });\n document.querySelector('#adyenPosTerminals').append(ddTerminals);\n}\nfunction setCheckoutConfiguration(checkoutOptions) {\n var setField = function setField(key, val) {\n return val && _defineProperty({}, key, val);\n };\n store.checkoutConfiguration = _objectSpread(_objectSpread(_objectSpread({}, store.checkoutConfiguration), setField('amount', checkoutOptions.amount)), setField('countryCode', checkoutOptions.countryCode));\n}\nfunction resolveUnmount(key, val) {\n try {\n return Promise.resolve(val.node.unmount(\"component_\".concat(key)));\n } catch (e) {\n // try/catch block for val.unmount\n return Promise.resolve(false);\n }\n}\n\n/**\n * To avoid re-rendering components twice, unmounts existing components from payment methods list\n */\nfunction unmountComponents() {\n var promises = Object.entries(store.componentsObj).map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n key = _ref3[0],\n val = _ref3[1];\n delete store.componentsObj[key];\n return resolveUnmount(key, val);\n });\n return Promise.all(promises);\n}\nfunction isCartModified(amount, orderAmount) {\n return amount.currency !== orderAmount.currency || amount.value !== orderAmount.value;\n}\nfunction renderGiftCardLogo(imagePath) {\n var headingImg = document.querySelector('#headingImg');\n if (headingImg) {\n headingImg.src = \"\".concat(imagePath, \"genericgiftcard.png\");\n }\n}\nfunction applyGiftCards() {\n var now = new Date().toISOString();\n var amount = store.checkoutConfiguration.amount;\n var orderAmount = store.partialPaymentsOrderObj.orderAmount;\n var isPartialPaymentExpired = store.addedGiftCards.some(function (cart) {\n return now > cart.expiresAt;\n });\n var cartModified = isCartModified(amount, orderAmount);\n if (isPartialPaymentExpired) {\n removeGiftCards();\n } else if (cartModified) {\n removeGiftCards();\n showGiftCardWarningMessage();\n } else {\n var _store$addedGiftCards;\n clearGiftCardsContainer();\n store.addedGiftCards.forEach(function (card) {\n renderAddedGiftCard(card);\n });\n if ((_store$addedGiftCards = store.addedGiftCards) !== null && _store$addedGiftCards !== void 0 && _store$addedGiftCards.length) {\n showGiftCardInfoMessage();\n }\n store.checkout.options.amount = store.addedGiftCards[store.addedGiftCards.length - 1].remainingAmount;\n showGiftCardCancelButton(true);\n attachGiftCardCancelListener();\n createElementsToShowRemainingGiftCardAmount();\n }\n}\nfunction renderStoredPaymentMethod(imagePath) {\n return function (pm) {\n if (pm.supportedShopperInteractions.includes('Ecommerce')) {\n renderPaymentMethod(pm, true, imagePath);\n }\n };\n}\nfunction renderStoredPaymentMethods(data, imagePath) {\n if (data.length) {\n data.forEach(renderStoredPaymentMethod(imagePath));\n }\n}\nfunction renderPaymentMethods(_x, _x2, _x3) {\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction _renderPaymentMethods() {\n _renderPaymentMethods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethods, imagePath, adyenDescriptions) {\n var i, pm;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < paymentMethods.length)) {\n _context2.next = 8;\n break;\n }\n pm = paymentMethods[i]; // eslint-disable-next-line\n _context2.next = 5;\n return renderPaymentMethod(pm, false, imagePath, adyenDescriptions[pm.type]);\n case 5:\n i += 1;\n _context2.next = 1;\n break;\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _renderPaymentMethods.apply(this, arguments);\n}\nfunction renderPosTerminals(adyenConnectedTerminals) {\n var _adyenConnectedTermin;\n var removeChilds = function removeChilds() {\n var posTerminals = document.querySelector('#adyenPosTerminals');\n while (posTerminals.firstChild) {\n posTerminals.removeChild(posTerminals.firstChild);\n }\n };\n if (adyenConnectedTerminals !== null && adyenConnectedTerminals !== void 0 && (_adyenConnectedTermin = adyenConnectedTerminals.uniqueTerminalIds) !== null && _adyenConnectedTermin !== void 0 && _adyenConnectedTermin.length) {\n removeChilds();\n addPosTerminals(adyenConnectedTerminals.uniqueTerminalIds);\n }\n}\nfunction setAmazonPayConfig(adyenPaymentMethods) {\n var amazonpay = adyenPaymentMethods.paymentMethods.find(function (paymentMethod) {\n return paymentMethod.type === 'amazonpay';\n });\n if (amazonpay) {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6, _document$querySelect7, _document$querySelect8;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.configuration = amazonpay.configuration;\n store.checkoutConfiguration.paymentMethodsConfiguration.amazonpay.addressDetails = {\n name: \"\".concat((_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value, \" \").concat((_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value),\n addressLine1: (_document$querySelect3 = document.querySelector('#shippingAddressOnedefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n city: (_document$querySelect4 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.value,\n stateOrRegion: (_document$querySelect5 = document.querySelector('#shippingAddressCitydefault')) === null || _document$querySelect5 === void 0 ? void 0 : _document$querySelect5.value,\n postalCode: (_document$querySelect6 = document.querySelector('#shippingZipCodedefault')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.value,\n countryCode: (_document$querySelect7 = document.querySelector('#shippingCountrydefault')) === null || _document$querySelect7 === void 0 ? void 0 : _document$querySelect7.value,\n phoneNumber: (_document$querySelect8 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect8 === void 0 ? void 0 : _document$querySelect8.value\n };\n }\n}\nfunction setInstallments(amount) {\n try {\n if (installmentLocales.indexOf(window.Configuration.locale) < 0) {\n return;\n }\n var installments = JSON.parse(window.installments.replace(/"/g, '\"'));\n if (installments.length) {\n store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions = {};\n }\n installments.forEach(function (installment) {\n var _installment = _slicedToArray(installment, 3),\n minAmount = _installment[0],\n numOfInstallments = _installment[1],\n cards = _installment[2];\n if (minAmount <= amount.value) {\n cards.forEach(function (cardType) {\n var installmentOptions = store.checkoutConfiguration.paymentMethodsConfiguration.card.installmentOptions;\n if (!installmentOptions[cardType]) {\n installmentOptions[cardType] = {\n values: [1]\n };\n }\n if (!installmentOptions[cardType].values.includes(numOfInstallments)) {\n installmentOptions[cardType].values.push(numOfInstallments);\n installmentOptions[cardType].values.sort(function (a, b) {\n return a - b;\n });\n }\n });\n }\n });\n store.checkoutConfiguration.paymentMethodsConfiguration.card.showInstallmentAmounts = true;\n } catch (e) {} // eslint-disable-line no-empty\n}\nfunction setGiftCardContainerVisibility() {\n var availableGiftCards = giftCardBrands();\n if (availableGiftCards.length === 0) {\n var giftCardContainer = document.querySelector('.gift-card-selection');\n giftCardContainer.style.display = 'none';\n var giftCardSeparator = document.querySelector('.gift-card-separator');\n giftCardSeparator.style.display = 'none';\n }\n}\nfunction initializeCheckout() {\n return _initializeCheckout.apply(this, arguments);\n}\nfunction _initializeCheckout() {\n _initializeCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var session, giftCardsData, totalDiscountedAmount, giftCards, lastGiftCard, paymentMethodsWithoutGiftCards, storedPaymentMethodsWithoutGiftCards, firstPaymentMethod;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return createSession();\n case 2:\n session = _context3.sent;\n _context3.next = 5;\n return fetchGiftCards();\n case 5:\n giftCardsData = _context3.sent;\n store.checkoutConfiguration.session = {\n id: session.id,\n sessionData: session.sessionData,\n imagePath: session.imagePath,\n adyenDescriptions: session.adyenDescriptions\n };\n _context3.next = 9;\n return AdyenCheckout(store.checkoutConfiguration);\n case 9:\n store.checkout = _context3.sent;\n setGiftCardContainerVisibility();\n totalDiscountedAmount = giftCardsData.totalDiscountedAmount, giftCards = giftCardsData.giftCards;\n if (giftCards !== null && giftCards !== void 0 && giftCards.length) {\n store.addedGiftCards = giftCards;\n lastGiftCard = store.addedGiftCards[store.addedGiftCards.length - 1];\n store.partialPaymentsOrderObj = _objectSpread(_objectSpread({}, lastGiftCard), {}, {\n totalDiscountedAmount: totalDiscountedAmount\n });\n }\n setCheckoutConfiguration(store.checkout.options);\n setInstallments(store.checkout.options.amount);\n setAmazonPayConfig(store.checkout.paymentMethodsResponse);\n document.querySelector('#paymentMethodsList').innerHTML = '';\n paymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n storedPaymentMethodsWithoutGiftCards = store.checkout.paymentMethodsResponse.storedPaymentMethods.filter(function (pm) {\n return pm.type !== constants.GIFTCARD;\n });\n renderStoredPaymentMethods(storedPaymentMethodsWithoutGiftCards, session.imagePath);\n _context3.next = 22;\n return renderPaymentMethods(paymentMethodsWithoutGiftCards, session.imagePath, session.adyenDescriptions);\n case 22:\n renderPosTerminals(session.adyenConnectedTerminals);\n renderGiftCardLogo(session.imagePath);\n firstPaymentMethod = document.querySelector('input[type=radio][name=brandCode]');\n if (firstPaymentMethod) {\n firstPaymentMethod.checked = true;\n helpers.displaySelectedMethod(firstPaymentMethod.value);\n }\n helpers.createShowConfirmationForm(window.ShowConfirmationPaymentFromComponent);\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _initializeCheckout.apply(this, arguments);\n}\n(_document$getElementB = document.getElementById('email')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('change', function (e) {\n var emailPattern = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n if (emailPattern.test(e.target.value)) {\n var paymentMethodsConfiguration = store.checkoutConfiguration.paymentMethodsConfiguration;\n paymentMethodsConfiguration.card.clickToPayConfiguration.shopperEmail = e.target.value;\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n});\n\n// used by renderGiftCardComponent.js\ndocument.addEventListener(INIT_CHECKOUT_EVENT, function () {\n var handleCheckoutEvent = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context.next = 3;\n break;\n }\n _context.next = 3;\n return unmountComponents();\n case 3:\n _context.next = 5;\n return initializeCheckout();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function handleCheckoutEvent() {\n return _ref4.apply(this, arguments);\n };\n }();\n handleCheckoutEvent();\n});\n\n/**\n * Calls createSession and then renders the retrieved payment methods (including card component)\n */\nfunction renderGenericComponent() {\n return _renderGenericComponent.apply(this, arguments);\n}\nfunction _renderGenericComponent() {\n _renderGenericComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _store$addedGiftCards2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!(Object.keys(store.componentsObj).length !== 0)) {\n _context4.next = 3;\n break;\n }\n _context4.next = 3;\n return unmountComponents();\n case 3:\n _context4.next = 5;\n return initializeCheckout();\n case 5:\n if ((_store$addedGiftCards2 = store.addedGiftCards) !== null && _store$addedGiftCards2 !== void 0 && _store$addedGiftCards2.length) {\n applyGiftCards();\n }\n attachGiftCardAddButtonListener();\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _renderGenericComponent.apply(this, arguments);\n}\nmodule.exports = {\n renderGenericComponent: renderGenericComponent,\n initializeCheckout: initializeCheckout,\n INIT_CHECKOUT_EVENT: INIT_CHECKOUT_EVENT\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js?"); /***/ }), @@ -310,7 +310,7 @@ eval("\n\nvar _document$getElementB;\nfunction _typeof(obj) { \"@babel/helpers - /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n INIT_CHECKOUT_EVENT = _require.INIT_CHECKOUT_EVENT;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.session.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.session.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); +eval("\n\nfunction _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); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nvar _require = __webpack_require__(/*! ./renderGenericComponent */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGenericComponent.js\"),\n INIT_CHECKOUT_EVENT = _require.INIT_CHECKOUT_EVENT;\nfunction getGiftCardElements() {\n var giftCardSelect = document.querySelector('#giftCardSelect');\n var giftCardUl = document.querySelector('#giftCardUl');\n var giftCardContainer = document.querySelector('#giftCardContainer');\n var giftCardAddButton = document.querySelector('#giftCardAddButton');\n var giftCardCancelContainer = document.querySelector('#giftCardsCancelContainer');\n var giftCardCancelButton = document.querySelector('#giftCardCancelButton');\n var giftCardSelectContainer = document.querySelector('#giftCardSelectContainer');\n var giftCardSelectWrapper = document.querySelector('#giftCardSelectWrapper');\n var giftCardsList = document.querySelector('#giftCardsList');\n var giftCardsInfoMessageContainer = document.querySelector('#giftCardsInfoMessage');\n var cancelMainPaymentGiftCard = document.querySelector('#cancelGiftCardButton');\n var giftCardInformation = document.querySelector('#giftCardInformation');\n return {\n giftCardSelect: giftCardSelect,\n giftCardUl: giftCardUl,\n giftCardContainer: giftCardContainer,\n giftCardAddButton: giftCardAddButton,\n giftCardSelectContainer: giftCardSelectContainer,\n giftCardsList: giftCardsList,\n giftCardsInfoMessageContainer: giftCardsInfoMessageContainer,\n giftCardSelectWrapper: giftCardSelectWrapper,\n giftCardCancelContainer: giftCardCancelContainer,\n giftCardCancelButton: giftCardCancelButton,\n cancelMainPaymentGiftCard: cancelMainPaymentGiftCard,\n giftCardInformation: giftCardInformation\n };\n}\nfunction showGiftCardCancelButton(show) {\n var _getGiftCardElements = getGiftCardElements(),\n giftCardCancelContainer = _getGiftCardElements.giftCardCancelContainer;\n if (show) {\n giftCardCancelContainer.classList.remove('invisible');\n } else {\n giftCardCancelContainer.classList.add('invisible');\n }\n}\nfunction removeGiftCards() {\n var _store$addedGiftCards;\n (_store$addedGiftCards = store.addedGiftCards) === null || _store$addedGiftCards === void 0 ? void 0 : _store$addedGiftCards.forEach(function (card) {\n $.ajax({\n type: 'POST',\n url: window.cancelPartialPaymentOrderUrl,\n data: JSON.stringify(card),\n contentType: 'application/json; charset=utf-8',\n async: false,\n success: function success(res) {\n var adyenPartialPaymentsOrder = document.querySelector('#adyenPartialPaymentsOrder');\n var _getGiftCardElements2 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements2.giftCardsList,\n giftCardAddButton = _getGiftCardElements2.giftCardAddButton,\n giftCardSelect = _getGiftCardElements2.giftCardSelect,\n giftCardUl = _getGiftCardElements2.giftCardUl,\n giftCardsInfoMessageContainer = _getGiftCardElements2.giftCardsInfoMessageContainer,\n giftCardSelectContainer = _getGiftCardElements2.giftCardSelectContainer,\n cancelMainPaymentGiftCard = _getGiftCardElements2.cancelMainPaymentGiftCard,\n giftCardInformation = _getGiftCardElements2.giftCardInformation;\n adyenPartialPaymentsOrder.value = null;\n giftCardsList.innerHTML = '';\n giftCardAddButton.style.display = 'block';\n giftCardSelect.value = null;\n giftCardSelectContainer.classList.add('invisible');\n giftCardSelect.classList.remove('invisible');\n giftCardUl.innerHTML = '';\n cancelMainPaymentGiftCard.classList.add('invisible');\n showGiftCardCancelButton(false);\n giftCardInformation === null || giftCardInformation === void 0 ? void 0 : giftCardInformation.remove();\n store.checkout.options.amount = res.amount;\n store.partialPaymentsOrderObj = null;\n store.addedGiftCards = null;\n store.adyenOrderData = null;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n document.querySelector('button[value=\"submit-payment\"]').disabled = false;\n if (res.resultCode === constants.RECEIVED) {\n var _document$querySelect, _store$componentsObj, _store$componentsObj$;\n (_document$querySelect = document.querySelector('#cancelGiftCardContainer')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.parentNode.remove();\n (_store$componentsObj = store.componentsObj) === null || _store$componentsObj === void 0 ? void 0 : (_store$componentsObj$ = _store$componentsObj.giftcard) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node.unmount('component_giftcard');\n }\n var event = new Event(INIT_CHECKOUT_EVENT);\n document.dispatchEvent(event);\n }\n });\n });\n}\nfunction giftCardBrands() {\n var paymentMethodsResponse = store.checkout.paymentMethodsResponse;\n return paymentMethodsResponse.paymentMethods.filter(function (pm) {\n return pm.type === constants.GIFTCARD;\n });\n}\nfunction renderGiftCardSelectForm() {\n var _getGiftCardElements3 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements3.giftCardUl,\n giftCardSelect = _getGiftCardElements3.giftCardSelect;\n if (giftCardUl !== null && giftCardUl !== void 0 && giftCardUl.innerHTML) {\n giftCardSelect.classList.remove('invisible');\n return;\n }\n var imagePath = store.checkoutConfiguration.session.imagePath;\n giftCardBrands().forEach(function (giftCard) {\n var newListItem = document.createElement('li');\n newListItem.setAttribute('data-brand', giftCard.brand);\n newListItem.setAttribute('data-name', giftCard.name);\n newListItem.setAttribute('data-type', giftCard.type);\n var span = document.createElement('span');\n span.textContent = giftCard.name;\n var img = document.createElement('img');\n img.src = \"\".concat(imagePath).concat(giftCard.brand, \".png\");\n img.width = 40;\n img.height = 26;\n newListItem.appendChild(span);\n newListItem.appendChild(img);\n giftCardUl.appendChild(newListItem);\n });\n}\nfunction attachGiftCardFormListeners() {\n if (store.giftCardComponentListenersAdded) {\n return;\n }\n var _getGiftCardElements4 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements4.giftCardUl,\n giftCardSelect = _getGiftCardElements4.giftCardSelect,\n giftCardContainer = _getGiftCardElements4.giftCardContainer,\n giftCardSelectWrapper = _getGiftCardElements4.giftCardSelectWrapper;\n if (giftCardUl) {\n giftCardUl.addEventListener('click', function (event) {\n var _store$componentsObj2;\n giftCardUl.classList.toggle('invisible');\n var selectedGiftCard = {\n name: event.target.dataset.name,\n brand: event.target.dataset.brand,\n type: event.target.dataset.type\n };\n if ((_store$componentsObj2 = store.componentsObj) !== null && _store$componentsObj2 !== void 0 && _store$componentsObj2.giftcard) {\n store.componentsObj.giftcard.node.unmount('component_giftcard');\n }\n if (!store.partialPaymentsOrderObj) {\n store.partialPaymentsOrderObj = {};\n }\n var newOption = document.createElement('option');\n newOption.textContent = selectedGiftCard.name;\n newOption.value = selectedGiftCard.brand;\n newOption.style.visibility = 'hidden';\n giftCardSelect.appendChild(newOption);\n giftCardSelect.value = selectedGiftCard.brand;\n giftCardContainer.innerHTML = '';\n var giftCardNode = store.checkout.create(constants.GIFTCARD, _objectSpread(_objectSpread({}, store.checkoutConfiguration.giftcard), {}, {\n brand: selectedGiftCard.brand,\n name: selectedGiftCard.name\n })).mount(giftCardContainer);\n store.componentsObj.giftcard = {\n node: giftCardNode\n };\n });\n }\n if (giftCardSelect) {\n giftCardSelectWrapper.addEventListener('mousedown', function () {\n giftCardUl.classList.toggle('invisible');\n });\n }\n store.giftCardComponentListenersAdded = true;\n}\nfunction showGiftCardWarningMessage() {\n var alertContainer = document.createElement('div');\n alertContainer.setAttribute('id', 'giftCardWarningMessage');\n alertContainer.classList.add('alert', 'alert-warning', 'error-message', 'gift-card-warning-msg');\n alertContainer.setAttribute('role', 'alert');\n var alertContainerP = document.createElement('p');\n alertContainerP.classList.add('error-message-text');\n alertContainerP.textContent = window.giftCardWarningMessage;\n alertContainer.appendChild(alertContainerP);\n var orderTotalSummaryEl = document.querySelector('.card-body.order-total-summary');\n orderTotalSummaryEl === null || orderTotalSummaryEl === void 0 ? void 0 : orderTotalSummaryEl.appendChild(alertContainer);\n}\nfunction attachGiftCardAddButtonListener() {\n var _getGiftCardElements5 = getGiftCardElements(),\n giftCardAddButton = _getGiftCardElements5.giftCardAddButton,\n giftCardSelectContainer = _getGiftCardElements5.giftCardSelectContainer,\n giftCardSelectWrapper = _getGiftCardElements5.giftCardSelectWrapper,\n giftCardSelect = _getGiftCardElements5.giftCardSelect;\n if (giftCardAddButton) {\n giftCardAddButton.addEventListener('click', function () {\n renderGiftCardSelectForm();\n attachGiftCardFormListeners();\n var giftCardWarningMessageEl = document.querySelector('#giftCardWarningMessage');\n if (giftCardWarningMessageEl) {\n giftCardWarningMessageEl.style.display = 'none';\n }\n giftCardSelect.value = 'null';\n giftCardAddButton.style.display = 'none';\n giftCardSelectContainer.classList.remove('invisible');\n giftCardSelectWrapper.classList.remove('invisible');\n });\n }\n}\nfunction attachGiftCardCancelListener() {\n var _getGiftCardElements6 = getGiftCardElements(),\n giftCardCancelButton = _getGiftCardElements6.giftCardCancelButton;\n giftCardCancelButton === null || giftCardCancelButton === void 0 ? void 0 : giftCardCancelButton.addEventListener('click', function () {\n removeGiftCards();\n });\n}\nfunction removeGiftCardFormListeners() {\n var _getGiftCardElements7 = getGiftCardElements(),\n giftCardUl = _getGiftCardElements7.giftCardUl,\n giftCardSelect = _getGiftCardElements7.giftCardSelect;\n giftCardUl.replaceWith(giftCardUl.cloneNode(true));\n giftCardSelect.replaceWith(giftCardSelect.cloneNode(true));\n store.giftCardComponentListenersAdded = false;\n}\nfunction clearGiftCardsContainer() {\n var _getGiftCardElements8 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements8.giftCardsList;\n giftCardsList.innerHTML = '';\n}\nfunction renderAddedGiftCard(card) {\n var giftCardData = card.giftCard;\n var imagePath = store.checkoutConfiguration.session.imagePath;\n var _getGiftCardElements9 = getGiftCardElements(),\n giftCardsList = _getGiftCardElements9.giftCardsList,\n giftCardAddButton = _getGiftCardElements9.giftCardAddButton;\n var giftCardDiv = document.createElement('div');\n giftCardDiv.classList.add('gift-card');\n var brandContainer = document.createElement('div');\n brandContainer.classList.add('brand-container');\n var giftCardImg = document.createElement('img');\n var giftCardImgSrc = \"\".concat(imagePath).concat(giftCardData.brand, \".png\");\n giftCardImg.setAttribute('src', giftCardImgSrc);\n giftCardImg.classList.add('gift-card-logo');\n var giftCardNameP = document.createElement('p');\n giftCardNameP.textContent = giftCardData.name;\n brandContainer.appendChild(giftCardImg);\n brandContainer.appendChild(giftCardNameP);\n var giftCardAction = document.createElement('div');\n giftCardAction.classList.add('gift-card-action');\n var brandAndRemoveActionWrapper = document.createElement('div');\n brandAndRemoveActionWrapper.classList.add('wrapper');\n brandAndRemoveActionWrapper.appendChild(brandContainer);\n brandAndRemoveActionWrapper.appendChild(giftCardAction);\n var giftCardAmountDiv = document.createElement('div');\n giftCardAmountDiv.classList.add('wrapper');\n var amountLabel = document.createElement('p');\n amountLabel.textContent = window.deductedBalanceGiftCardResource;\n var amountValue = document.createElement('strong');\n amountValue.textContent = card.discountedAmount ? \"-\".concat(card.discountedAmount) : '';\n giftCardAmountDiv.appendChild(amountLabel);\n giftCardAmountDiv.appendChild(amountValue);\n giftCardDiv.appendChild(brandAndRemoveActionWrapper);\n giftCardDiv.appendChild(giftCardAmountDiv);\n giftCardsList.appendChild(giftCardDiv);\n giftCardAddButton.style.display = 'block';\n removeGiftCardFormListeners();\n}\nfunction createElementsToShowRemainingGiftCardAmount() {\n var renderedRemainingAmountEndSpan = document.getElementById('remainingAmountEndSpan');\n var renderedDiscountedAmountEndSpan = document.getElementById('discountedAmountEndSpan');\n if (renderedRemainingAmountEndSpan && renderedDiscountedAmountEndSpan) {\n renderedRemainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n renderedDiscountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n return;\n }\n var mainContainer = document.createElement('div');\n var remainingAmountContainer = document.createElement('div');\n var remainingAmountStart = document.createElement('div');\n var remainingAmountEnd = document.createElement('div');\n var discountedAmountContainer = document.createElement('div');\n var discountedAmountStart = document.createElement('div');\n var discountedAmountEnd = document.createElement('div');\n var remainingAmountStartP = document.createElement('p');\n var remainingAmountEndP = document.createElement('p');\n var discountedAmountStartP = document.createElement('p');\n var discountedAmountEndP = document.createElement('p');\n var remainingAmountStartSpan = document.createElement('span');\n var discountedAmountStartSpan = document.createElement('span');\n var remainingAmountEndSpan = document.createElement('span');\n remainingAmountEndSpan.id = 'remainingAmountEndSpan';\n var discountedAmountEndSpan = document.createElement('span');\n discountedAmountEndSpan.id = 'discountedAmountEndSpan';\n remainingAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n remainingAmountStart.classList.add('col-6', 'start-lines');\n remainingAmountEnd.classList.add('col-6', 'end-lines');\n remainingAmountStartP.classList.add('order-receipt-label');\n discountedAmountContainer.classList.add('row', 'grand-total', 'leading-lines');\n discountedAmountStart.classList.add('col-6', 'start-lines');\n discountedAmountEnd.classList.add('col-6', 'end-lines');\n discountedAmountStartP.classList.add('order-receipt-label');\n remainingAmountEndP.classList.add('text-right');\n discountedAmountEndP.classList.add('text-right');\n discountedAmountContainer.id = 'discountedAmountContainer';\n remainingAmountContainer.id = 'remainingAmountContainer';\n remainingAmountStartSpan.innerText = window.remainingAmountGiftCardResource;\n discountedAmountStartSpan.innerText = window.discountedAmountGiftCardResource;\n remainingAmountEndSpan.innerText = store.partialPaymentsOrderObj.remainingAmountFormatted;\n discountedAmountEndSpan.innerText = store.partialPaymentsOrderObj.totalDiscountedAmount;\n remainingAmountContainer.appendChild(remainingAmountStart);\n remainingAmountContainer.appendChild(remainingAmountEnd);\n remainingAmountStart.appendChild(remainingAmountStartP);\n discountedAmountContainer.appendChild(discountedAmountStart);\n discountedAmountContainer.appendChild(discountedAmountEnd);\n discountedAmountStart.appendChild(discountedAmountStartP);\n remainingAmountEnd.appendChild(remainingAmountEndP);\n remainingAmountStartP.appendChild(remainingAmountStartSpan);\n discountedAmountEnd.appendChild(discountedAmountEndP);\n discountedAmountStartP.appendChild(discountedAmountStartSpan);\n remainingAmountEndP.appendChild(remainingAmountEndSpan);\n discountedAmountEndP.appendChild(discountedAmountEndSpan);\n var pricingContainer = document.querySelector('.card-body.order-total-summary');\n mainContainer.id = 'giftCardInformation';\n mainContainer.appendChild(discountedAmountContainer);\n mainContainer.appendChild(remainingAmountContainer);\n pricingContainer.appendChild(mainContainer);\n}\nfunction showGiftCardInfoMessage() {\n var messageText = store.partialPaymentsOrderObj.message;\n var _getGiftCardElements10 = getGiftCardElements(),\n giftCardsInfoMessageContainer = _getGiftCardElements10.giftCardsInfoMessageContainer;\n giftCardsInfoMessageContainer.innerHTML = '';\n giftCardsInfoMessageContainer.classList.remove('gift-cards-info-message-container');\n if (!messageText) return;\n var giftCardsInfoMessage = document.createElement('div');\n giftCardsInfoMessage.classList.add('adyen-checkout__alert-message', 'adyen-checkout__alert-message--warning');\n giftCardsInfoMessage.setAttribute('role', 'alert');\n var infoMessage = document.createElement('span');\n infoMessage.textContent = messageText;\n giftCardsInfoMessage.appendChild(infoMessage);\n giftCardsInfoMessageContainer.appendChild(giftCardsInfoMessage);\n giftCardsInfoMessageContainer.classList.add('gift-cards-info-message-container');\n}\nmodule.exports = {\n removeGiftCards: removeGiftCards,\n renderAddedGiftCard: renderAddedGiftCard,\n attachGiftCardAddButtonListener: attachGiftCardAddButtonListener,\n getGiftCardElements: getGiftCardElements,\n showGiftCardWarningMessage: showGiftCardWarningMessage,\n createElementsToShowRemainingGiftCardAmount: createElementsToShowRemainingGiftCardAmount,\n renderGiftCardSelectForm: renderGiftCardSelectForm,\n showGiftCardInfoMessage: showGiftCardInfoMessage,\n giftCardBrands: giftCardBrands,\n clearGiftCardsContainer: clearGiftCardsContainer,\n attachGiftCardCancelListener: attachGiftCardCancelListener,\n showGiftCardCancelButton: showGiftCardCancelButton\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js?"); /***/ }), @@ -322,7 +322,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction getFallback(paymentMethod) {\n var fallback = {};\n if (fallback[paymentMethod.type]) {\n store.componentsObj[paymentMethod.type] = {};\n }\n return fallback[paymentMethod.type];\n}\nfunction getPersonalDetails() {\n var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;\n return {\n firstName: (_document$querySelect = document.querySelector('#shippingFirstNamedefault')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.value,\n lastName: (_document$querySelect2 = document.querySelector('#shippingLastNamedefault')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value,\n telephoneNumber: (_document$querySelect3 = document.querySelector('#shippingPhoneNumberdefault')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.value,\n shopperEmail: (_document$querySelect4 = document.querySelector('.customer-summary-email')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.textContent\n };\n}\nfunction setNode(paymentMethodID) {\n var createNode = function createNode() {\n if (!store.componentsObj[paymentMethodID]) {\n store.componentsObj[paymentMethodID] = {};\n }\n try {\n var _store$checkout;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // ALl nodes created for the checkout component are enriched with shopper personal details\n var node = (_store$checkout = store.checkout).create.apply(_store$checkout, args.concat([{\n data: _objectSpread(_objectSpread({}, getPersonalDetails()), {}, {\n personalDetails: getPersonalDetails()\n }),\n visibility: {\n personalDetails: 'editable',\n billingAddress: 'hidden',\n deliveryAddress: 'hidden'\n }\n }]));\n store.componentsObj[paymentMethodID].node = node;\n store.componentsObj[paymentMethodID].isValid = node.isValid;\n } catch (e) {\n /* No component for payment method */\n }\n };\n return createNode;\n}\nfunction getPaymentMethodID(isStored, paymentMethod) {\n if (isStored) {\n return \"storedCard\".concat(paymentMethod.id);\n }\n if (paymentMethod.type === constants.GIFTCARD) {\n return constants.GIFTCARD;\n }\n if (paymentMethod.brand) {\n return \"\".concat(paymentMethod.type, \"_\").concat(paymentMethod.brand);\n }\n return paymentMethod.type;\n}\nfunction getImage(isStored, paymentMethod) {\n return isStored ? paymentMethod.brand : paymentMethod.type;\n}\nfunction getLabel(isStored, paymentMethod) {\n var label = isStored ? \" \".concat(store.MASKED_CC_PREFIX).concat(paymentMethod.lastFour) : '';\n return \"\".concat(paymentMethod.name).concat(label);\n}\nfunction handleFallbackPayment(_ref) {\n var paymentMethod = _ref.paymentMethod,\n container = _ref.container,\n paymentMethodID = _ref.paymentMethodID;\n var fallback = getFallback(paymentMethod);\n var createTemplate = function createTemplate() {\n var template = document.createElement('template');\n template.innerHTML = fallback;\n container.append(template.content);\n };\n return fallback ? createTemplate() : setNode(paymentMethod.type)(paymentMethodID);\n}\nfunction handlePayment(options) {\n return options.isStored ? setNode(options.paymentMethodID)('card', options.paymentMethod) : handleFallbackPayment(options);\n}\nfunction getListContents(_ref2) {\n var imagePath = _ref2.imagePath,\n isStored = _ref2.isStored,\n paymentMethod = _ref2.paymentMethod,\n description = _ref2.description;\n var paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n var label = getLabel(isStored, paymentMethod);\n var liContents = \"\\n \\n \\n \\n \");\n return description ? \"\".concat(liContents, \"

\").concat(description, \"

\") : liContents;\n}\nfunction getImagePath(_ref3) {\n var isStored = _ref3.isStored,\n paymentMethod = _ref3.paymentMethod,\n path = _ref3.path,\n isSchemeNotStored = _ref3.isSchemeNotStored;\n var paymentMethodImage = \"\".concat(path).concat(getImage(isStored, paymentMethod), \".png\");\n var cardImage = \"\".concat(path, \"card.png\");\n return isSchemeNotStored ? cardImage : paymentMethodImage;\n}\nfunction setValid(_ref4) {\n var isStored = _ref4.isStored,\n paymentMethodID = _ref4.paymentMethodID;\n if (isStored && ['bcmc', 'scheme'].indexOf(paymentMethodID) > -1) {\n store.componentsObj[paymentMethodID].isValid = true;\n }\n}\nfunction configureContainer(_ref5) {\n var paymentMethodID = _ref5.paymentMethodID,\n container = _ref5.container;\n container.classList.add('additionalFields');\n container.setAttribute('id', \"component_\".concat(paymentMethodID));\n container.setAttribute('style', 'display:none');\n}\nfunction handleInput(_ref6) {\n var paymentMethodID = _ref6.paymentMethodID;\n var input = document.querySelector(\"#rb_\".concat(paymentMethodID));\n input.onchange = /*#__PURE__*/function () {\n var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n helpers.displaySelectedMethod(event.target.value);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref7.apply(this, arguments);\n };\n }();\n}\nfunction createListItem(rerender, paymentMethodID, liContents) {\n var li;\n if (rerender) {\n li = document.querySelector(\"#rb_\".concat(paymentMethodID)).closest('li');\n } else {\n li = document.createElement('li');\n li.innerHTML = liContents;\n li.classList.add('paymentMethod');\n }\n return li;\n}\nfunction checkIfNodeIsAvailable(_x2) {\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction _checkIfNodeIsAvailable() {\n _checkIfNodeIsAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(node) {\n var isNodeAvailable;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (!node.isAvailable) {\n _context3.next = 6;\n break;\n }\n _context3.next = 3;\n return node.isAvailable();\n case 3:\n isNodeAvailable = _context3.sent;\n if (isNodeAvailable) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _checkIfNodeIsAvailable.apply(this, arguments);\n}\nfunction appendNodeToContainerIfAvailable(_x3, _x4, _x5, _x6) {\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nfunction _appendNodeToContainerIfAvailable() {\n _appendNodeToContainerIfAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentMethodsUI, li, node, container) {\n var canBeMounted;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!node) {\n _context4.next = 5;\n break;\n }\n _context4.next = 3;\n return checkIfNodeIsAvailable(node);\n case 3:\n canBeMounted = _context4.sent;\n if (canBeMounted) {\n paymentMethodsUI.append(li);\n node.mount(container);\n }\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _appendNodeToContainerIfAvailable.apply(this, arguments);\n}\nmodule.exports.renderPaymentMethod = /*#__PURE__*/function () {\n var _renderPaymentMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(paymentMethod, isStored, path) {\n var description,\n rerender,\n canRender,\n _store$componentsObj$,\n paymentMethodsUI,\n paymentMethodID,\n isSchemeNotStored,\n container,\n options,\n imagePath,\n liContents,\n li,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n description = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;\n rerender = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : false;\n _context2.prev = 2;\n paymentMethodsUI = document.querySelector('#paymentMethodsList');\n paymentMethodID = getPaymentMethodID(isStored, paymentMethod);\n if (!(paymentMethodID === constants.GIFTCARD)) {\n _context2.next = 7;\n break;\n }\n return _context2.abrupt(\"return\");\n case 7:\n isSchemeNotStored = paymentMethod.type === 'scheme' && !isStored;\n container = document.createElement('div');\n options = {\n container: container,\n paymentMethod: paymentMethod,\n isStored: isStored,\n path: path,\n description: description,\n paymentMethodID: paymentMethodID,\n isSchemeNotStored: isSchemeNotStored\n };\n imagePath = getImagePath(options);\n liContents = getListContents(_objectSpread(_objectSpread({}, options), {}, {\n imagePath: imagePath,\n description: description\n }));\n li = createListItem(rerender, paymentMethodID, liContents);\n handlePayment(options);\n configureContainer(options);\n li.append(container);\n _context2.next = 18;\n return appendNodeToContainerIfAvailable(paymentMethodsUI, li, (_store$componentsObj$ = store.componentsObj[paymentMethodID]) === null || _store$componentsObj$ === void 0 ? void 0 : _store$componentsObj$.node, container);\n case 18:\n if (paymentMethodID === constants.GIROPAY) {\n container.innerHTML = '';\n }\n handleInput(options);\n setValid(options);\n canRender = true;\n _context2.next = 27;\n break;\n case 24:\n _context2.prev = 24;\n _context2.t0 = _context2[\"catch\"](2);\n // method not available\n canRender = false;\n case 27:\n return _context2.abrupt(\"return\", canRender);\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 24]]);\n }));\n function renderPaymentMethod(_x7, _x8, _x9) {\n return _renderPaymentMethod.apply(this, arguments);\n }\n return renderPaymentMethod;\n}();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderPaymentMethod.js?"); /***/ }), @@ -370,7 +370,7 @@ eval("\n\nfunction hasData() {\n for (var _len = arguments.length, args = new A /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar shippingHelpers = __webpack_require__(/*! base/checkout/shipping */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/shipping.js\");\nvar billingHelpers = __webpack_require__(/*! base/checkout/billing */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/billing.js\");\nvar summaryHelpers = __webpack_require__(/*! base/checkout/summary */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/summary.js\");\nvar formHelpers = __webpack_require__(/*! base/checkout/formErrors */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/formErrors.js\");\nvar scrollAnimate = __webpack_require__(/*! base/components/scrollAnimate */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js\");\nvar billing = __webpack_require__(/*! ./billing */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/billing.js\");\n// ### Custom Adyen cartridge start ###\nvar adyenCheckout = __webpack_require__(/*! ../adyenCheckout */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js\");\n// ### Custom Adyen cartridge end ###\n\n/**\n * Create the jQuery Checkout Plugin.\n *\n * This jQuery plugin will be registered on the dom element in checkout.isml with the\n * id of \"checkout-main\".\n *\n * The checkout plugin will handle the different state the user interface is in as the user\n * progresses through the varying forms such as shipping and payment.\n *\n * Billing info and payment info are used a bit synonymously in this code.\n *\n */\n(function ($) {\n $.fn.checkout = function () {\n // eslint-disable-line\n var plugin = this;\n\n //\n // Collect form data from user input\n //\n var formData = {\n // Shipping Address\n shipping: {},\n // Billing Address\n billing: {},\n // Payment\n payment: {},\n // Gift Codes\n giftCode: {}\n };\n\n //\n // The different states/stages of checkout\n //\n var checkoutStages = ['shipping', 'payment', 'placeOrder', 'submitted'];\n\n /**\n * Updates the URL to determine stage\n * @param {number} currentStage - The current stage the user is currently on in the checkout\n */\n function updateUrl(currentStage) {\n history.pushState(checkoutStages[currentStage], document.title, location.pathname + '?stage=' + checkoutStages[currentStage] + '#' + checkoutStages[currentStage]);\n }\n\n //\n // Local member methods of the Checkout plugin\n //\n var members = {\n // initialize the currentStage variable for the first time\n currentStage: 0,\n /**\n * Set or update the checkout stage (AKA the shipping, billing, payment, etc... steps)\n * @returns {Object} a promise\n */\n updateStage: function updateStage() {\n var stage = checkoutStages[members.currentStage];\n var defer = $.Deferred(); // eslint-disable-line\n\n if (stage === 'shipping') {\n //\n // Clear Previous Errors\n //\n formHelpers.clearPreviousErrors('.shipping-form');\n\n //\n // Submit the Shipping Address Form\n //\n var isMultiShip = $('#checkout-main').hasClass('multi-ship');\n var formSelector = isMultiShip ? '.multi-shipping .active form' : '.single-shipping .shipping-form';\n var form = $(formSelector);\n if (isMultiShip && form.length === 0) {\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n // in case the multi ship form is already submitted\n var url = $('#checkout-main').attr('data-checkout-get-url');\n $.ajax({\n url: url,\n method: 'GET',\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (!data.error) {\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n defer.resolve();\n } else if (data.message && $('.shipping-error .alert-danger').length < 1) {\n var errorMsg = data.message;\n var errorHtml = '
' + '' + errorMsg + '
';\n $('.shipping-error').append(errorHtml);\n scrollAnimate($('.shipping-error'));\n defer.reject();\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n },\n error: function error() {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // Server error submitting form\n defer.reject();\n }\n });\n } else {\n var shippingFormData = form.serialize();\n $('body').trigger('checkout:serializeShipping', {\n form: form,\n data: shippingFormData,\n callback: function callback(data) {\n shippingFormData = data;\n }\n });\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: form.attr('action'),\n type: 'post',\n data: shippingFormData,\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n shippingHelpers.methods.shippingFormResponse(defer, data);\n },\n error: function error(err) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n // Server error submitting form\n defer.reject(err.responseJSON);\n }\n });\n }\n return defer;\n } else if (stage === 'payment') {\n //\n // Submit the Billing Address Form\n //\n\n formHelpers.clearPreviousErrors('.payment-form');\n var billingAddressForm = $('#dwfrm_billing .billing-address-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .billing-address-block'),\n data: billingAddressForm,\n callback: function callback(data) {\n if (data) {\n billingAddressForm = data;\n }\n }\n });\n var contactInfoForm = $('#dwfrm_billing .contact-info-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .contact-info-block'),\n data: contactInfoForm,\n callback: function callback(data) {\n if (data) {\n contactInfoForm = data;\n }\n }\n });\n var activeTabId = $('.tab-pane.active').attr('id');\n var paymentInfoSelector = '#dwfrm_billing .' + activeTabId + ' .payment-form-fields :input';\n var paymentInfoForm = $(paymentInfoSelector).serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $(paymentInfoSelector),\n data: paymentInfoForm,\n callback: function callback(data) {\n if (data) {\n paymentInfoForm = data;\n }\n }\n });\n var paymentForm = billingAddressForm + '&' + contactInfoForm + '&' + paymentInfoForm;\n if ($('.data-checkout-stage').data('customer-type') === 'registered') {\n // if payment method is credit card\n if ($('.payment-information').data('payment-method-id') === 'CREDIT_CARD') {\n if (!$('.payment-information').data('is-new-payment')) {\n var cvvCode = $('.saved-payment-instrument.' + 'selected-payment .saved-payment-security-code').val();\n if (cvvCode === '') {\n var cvvElement = $('.saved-payment-instrument.' + 'selected-payment ' + '.form-control');\n cvvElement.addClass('is-invalid');\n scrollAnimate(cvvElement);\n defer.reject();\n return defer;\n }\n var $savedPaymentInstrument = $('.saved-payment-instrument' + '.selected-payment');\n paymentForm += '&storedPaymentUUID=' + $savedPaymentInstrument.data('uuid');\n paymentForm += '&securityCode=' + cvvCode;\n }\n }\n }\n // disable the next:Place Order button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('#dwfrm_billing').attr('action'),\n method: 'POST',\n data: paymentForm,\n success: function success(data) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // look for field validation errors\n if (data.error) {\n if (data.fieldErrors.length) {\n data.fieldErrors.forEach(function (error) {\n if (Object.keys(error).length) {\n formHelpers.loadFormErrors('.payment-form', error);\n }\n });\n }\n if (data.serverErrors.length) {\n data.serverErrors.forEach(function (error) {\n $('.error-message').show();\n $('.error-message-text').text(error);\n scrollAnimate($('.error-message'));\n });\n }\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n }\n defer.reject();\n } else {\n //\n // Populate the Address Summary\n //\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n if (data.renderedPaymentInstruments) {\n $('.stored-payments').empty().html(data.renderedPaymentInstruments);\n }\n if (data.customer.registeredUser && data.customer.customerPaymentInstruments.length) {\n $('.cancel-new-payment').removeClass('checkout-hidden');\n }\n scrollAnimate();\n defer.resolve(data);\n }\n },\n error: function error(err) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n }\n });\n return defer;\n } else if (stage === 'placeOrder') {\n // disable the placeOrder button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('.place-order').data('action'),\n method: 'POST',\n success: function success(data) {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (data.error) {\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n defer.reject();\n } else {\n // go to appropriate stage and display error message\n defer.reject(data);\n }\n // ### Custom Adyen cartridge start ###\n } else if (data.adyenAction) {\n window.orderToken = data.orderToken;\n adyenCheckout.actionHandler(data.adyenAction);\n // ### Custom Adyen cartridge end ###\n } else {\n var continueUrl = data.continueUrl;\n var urlParams = {\n ID: data.orderID,\n token: data.orderToken\n };\n continueUrl += (continueUrl.indexOf('?') !== -1 ? '&' : '?') + Object.keys(urlParams).map(function (key) {\n return key + '=' + encodeURIComponent(urlParams[key]);\n }).join('&');\n window.location.href = continueUrl;\n defer.resolve(data);\n }\n },\n error: function error() {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', $('.next-step-button button'));\n }\n });\n return defer;\n }\n var p = $('
').promise(); // eslint-disable-line\n setTimeout(function () {\n p.done(); // eslint-disable-line\n }, 500);\n return p; // eslint-disable-line\n },\n\n /**\n * Initialize the checkout stage.\n *\n * TODO: update this to allow stage to be set from server?\n */\n initialize: function initialize() {\n // set the initial state of checkout\n members.currentStage = checkoutStages.indexOf($('.data-checkout-stage').data('checkout-stage'));\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n\n //\n // Handle Payment option selection\n //\n $('input[name$=\"paymentMethod\"]', plugin).on('change', function () {\n $('.credit-card-form').toggle($(this).val() === 'CREDIT_CARD');\n });\n\n //\n // Handle Next State button click\n //\n $(plugin).on('click', '.next-step-button button', function () {\n members.nextStage();\n });\n\n //\n // Handle Edit buttons on shipping and payment summary cards\n //\n $('.shipping-summary .edit-button', plugin).on('click', function () {\n if (!$('#checkout-main').hasClass('multi-ship')) {\n $('body').trigger('shipping:selectSingleShipping');\n }\n members.gotoStage('shipping');\n });\n $('.payment-summary .edit-button', plugin).on('click', function () {\n members.gotoStage('payment');\n });\n\n //\n // remember stage (e.g. shipping)\n //\n updateUrl(members.currentStage);\n\n //\n // Listen for foward/back button press and move to correct checkout-stage\n //\n $(window).on('popstate', function (e) {\n //\n // Back button when event state less than current state in ordered\n // checkoutStages array.\n //\n if (e.state === null || checkoutStages.indexOf(e.state) < members.currentStage) {\n members.handlePrevStage(false);\n } else if (checkoutStages.indexOf(e.state) > members.currentStage) {\n // Forward button pressed\n members.handleNextStage(false);\n }\n });\n\n //\n // Set the form data\n //\n plugin.data('formData', formData);\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n */\n nextStage: function nextStage() {\n var promise = members.updateStage();\n promise.done(function () {\n // Update UI with new stage\n members.handleNextStage(true);\n });\n promise.fail(function (data) {\n // show errors\n if (data) {\n if (data.errorStage) {\n members.gotoStage(data.errorStage.stage);\n if (data.errorStage.step === 'billingAddress') {\n var $billingAddressSameAsShipping = $('input[name$=\"_shippingAddressUseAsBillingAddress\"]');\n if ($billingAddressSameAsShipping.is(':checked')) {\n $billingAddressSameAsShipping.prop('checked', false);\n }\n }\n }\n if (data.errorMessage) {\n $('.error-message').show();\n $('.error-message-text').text(data.errorMessage);\n }\n }\n });\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n *\n * @param {boolean} bPushState - boolean when true pushes state using the history api.\n */\n handleNextStage: function handleNextStage(bPushState) {\n if (members.currentStage < checkoutStages.length - 1) {\n // move stage forward\n members.currentStage++;\n\n //\n // show new stage in url (e.g.payment)\n //\n if (bPushState) {\n updateUrl(members.currentStage);\n }\n }\n\n // Set the next stage on the DOM\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Previous State\n */\n handlePrevStage: function handlePrevStage() {\n if (members.currentStage > 0) {\n // move state back\n members.currentStage--;\n updateUrl(members.currentStage);\n }\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Use window history to go to a checkout stage\n * @param {string} stageName - the checkout state to goto\n */\n gotoStage: function gotoStage(stageName) {\n members.currentStage = checkoutStages.indexOf(stageName);\n updateUrl(members.currentStage);\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n }\n };\n\n //\n // Initialize the checkout\n //\n members.initialize();\n return this;\n };\n})(jQuery);\nmodule.exports = {\n updateCheckoutView: function updateCheckoutView() {\n $('body').on('checkout:updateCheckoutView', function (e, data) {\n shippingHelpers.methods.updateMultiShipInformation(data.order);\n summaryHelpers.updateTotals(data.order.totals);\n data.order.shipping.forEach(function (shipping) {\n shippingHelpers.methods.updateShippingInformation(shipping, data.order, data.customer, data.options);\n });\n var currentStage = window.location.search.substring(window.location.search.indexOf('=') + 1);\n if (currentStage === ('shipping' || false)) {\n adyenCheckout.renderGenericComponent();\n }\n billingHelpers.methods.updateBillingInformation(data.order, data.customer, data.options);\n billing.methods.updatePaymentInformation(data.order, data.options);\n summaryHelpers.updateOrderProductSummaryInformation(data.order, data.options);\n });\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA5.js?"); +eval("\n\nvar shippingHelpers = __webpack_require__(/*! base/checkout/shipping */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/shipping.js\");\nvar billingHelpers = __webpack_require__(/*! base/checkout/billing */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/billing.js\");\nvar summaryHelpers = __webpack_require__(/*! base/checkout/summary */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/summary.js\");\nvar formHelpers = __webpack_require__(/*! base/checkout/formErrors */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/formErrors.js\");\nvar scrollAnimate = __webpack_require__(/*! base/components/scrollAnimate */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js\");\nvar billing = __webpack_require__(/*! ./billing */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/billing.js\");\n// ### Custom Adyen cartridge start ###\nvar adyenCheckout = __webpack_require__(/*! ../adyenCheckout */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js\");\n// ### Custom Adyen cartridge end ###\n\n/**\n * Create the jQuery Checkout Plugin.\n *\n * This jQuery plugin will be registered on the dom element in checkout.isml with the\n * id of \"checkout-main\".\n *\n * The checkout plugin will handle the different state the user interface is in as the user\n * progresses through the varying forms such as shipping and payment.\n *\n * Billing info and payment info are used a bit synonymously in this code.\n *\n */\n(function ($) {\n $.fn.checkout = function () {\n // eslint-disable-line\n var plugin = this;\n\n //\n // Collect form data from user input\n //\n var formData = {\n // Shipping Address\n shipping: {},\n // Billing Address\n billing: {},\n // Payment\n payment: {},\n // Gift Codes\n giftCode: {}\n };\n\n //\n // The different states/stages of checkout\n //\n var checkoutStages = ['shipping', 'payment', 'placeOrder', 'submitted'];\n\n /**\n * Updates the URL to determine stage\n * @param {number} currentStage - The current stage the user is currently on in the checkout\n */\n function updateUrl(currentStage) {\n history.pushState(checkoutStages[currentStage], document.title, location.pathname + '?stage=' + checkoutStages[currentStage] + '#' + checkoutStages[currentStage]);\n }\n\n //\n // Local member methods of the Checkout plugin\n //\n var members = {\n // initialize the currentStage variable for the first time\n currentStage: 0,\n /**\n * Set or update the checkout stage (AKA the shipping, billing, payment, etc... steps)\n * @returns {Object} a promise\n */\n updateStage: function updateStage() {\n var stage = checkoutStages[members.currentStage];\n var defer = $.Deferred(); // eslint-disable-line\n\n if (stage === 'shipping') {\n //\n // Clear Previous Errors\n //\n formHelpers.clearPreviousErrors('.shipping-form');\n\n //\n // Submit the Shipping Address Form\n //\n var isMultiShip = $('#checkout-main').hasClass('multi-ship');\n var formSelector = isMultiShip ? '.multi-shipping .active form' : '.single-shipping .shipping-form';\n var form = $(formSelector);\n if (isMultiShip && form.length === 0) {\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n // in case the multi ship form is already submitted\n var url = $('#checkout-main').attr('data-checkout-get-url');\n $.ajax({\n url: url,\n method: 'GET',\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (!data.error) {\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n defer.resolve();\n } else if (data.message && $('.shipping-error .alert-danger').length < 1) {\n var errorMsg = data.message;\n var errorHtml = '
' + '' + errorMsg + '
';\n $('.shipping-error').append(errorHtml);\n scrollAnimate($('.shipping-error'));\n defer.reject();\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n },\n error: function error() {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // Server error submitting form\n defer.reject();\n }\n });\n } else {\n var shippingFormData = form.serialize();\n $('body').trigger('checkout:serializeShipping', {\n form: form,\n data: shippingFormData,\n callback: function callback(data) {\n shippingFormData = data;\n }\n });\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: form.attr('action'),\n type: 'post',\n data: shippingFormData,\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n shippingHelpers.methods.shippingFormResponse(defer, data);\n },\n error: function error(err) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n // Server error submitting form\n defer.reject(err.responseJSON);\n }\n });\n }\n return defer;\n } else if (stage === 'payment') {\n //\n // Submit the Billing Address Form\n //\n\n formHelpers.clearPreviousErrors('.payment-form');\n var billingAddressForm = $('#dwfrm_billing .billing-address-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .billing-address-block'),\n data: billingAddressForm,\n callback: function callback(data) {\n if (data) {\n billingAddressForm = data;\n }\n }\n });\n var contactInfoForm = $('#dwfrm_billing .contact-info-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .contact-info-block'),\n data: contactInfoForm,\n callback: function callback(data) {\n if (data) {\n contactInfoForm = data;\n }\n }\n });\n var activeTabId = $('.tab-pane.active').attr('id');\n var paymentInfoSelector = '#dwfrm_billing .' + activeTabId + ' .payment-form-fields :input';\n var paymentInfoForm = $(paymentInfoSelector).serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $(paymentInfoSelector),\n data: paymentInfoForm,\n callback: function callback(data) {\n if (data) {\n paymentInfoForm = data;\n }\n }\n });\n var paymentForm = billingAddressForm + '&' + contactInfoForm + '&' + paymentInfoForm;\n if ($('.data-checkout-stage').data('customer-type') === 'registered') {\n // if payment method is credit card\n if ($('.payment-information').data('payment-method-id') === 'CREDIT_CARD') {\n if (!$('.payment-information').data('is-new-payment')) {\n var cvvCode = $('.saved-payment-instrument.' + 'selected-payment .saved-payment-security-code').val();\n if (cvvCode === '') {\n var cvvElement = $('.saved-payment-instrument.' + 'selected-payment ' + '.form-control');\n cvvElement.addClass('is-invalid');\n scrollAnimate(cvvElement);\n defer.reject();\n return defer;\n }\n var $savedPaymentInstrument = $('.saved-payment-instrument' + '.selected-payment');\n paymentForm += '&storedPaymentUUID=' + $savedPaymentInstrument.data('uuid');\n paymentForm += '&securityCode=' + cvvCode;\n }\n }\n }\n // disable the next:Place Order button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('#dwfrm_billing').attr('action'),\n method: 'POST',\n data: paymentForm,\n success: function success(data) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // look for field validation errors\n if (data.error) {\n if (data.fieldErrors.length) {\n data.fieldErrors.forEach(function (error) {\n if (Object.keys(error).length) {\n formHelpers.loadFormErrors('.payment-form', error);\n }\n });\n }\n if (data.serverErrors.length) {\n data.serverErrors.forEach(function (error) {\n $('.error-message').show();\n $('.error-message-text').text(error);\n scrollAnimate($('.error-message'));\n });\n }\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n }\n defer.reject();\n } else {\n //\n // Populate the Address Summary\n //\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n if (data.renderedPaymentInstruments) {\n $('.stored-payments').empty().html(data.renderedPaymentInstruments);\n }\n if (data.customer.registeredUser && data.customer.customerPaymentInstruments.length) {\n $('.cancel-new-payment').removeClass('checkout-hidden');\n }\n scrollAnimate();\n defer.resolve(data);\n }\n },\n error: function error(err) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n }\n });\n return defer;\n } else if (stage === 'placeOrder') {\n // disable the placeOrder button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('.place-order').data('action'),\n method: 'POST',\n success: function success(data) {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (data.error) {\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n defer.reject();\n } else {\n // go to appropriate stage and display error message\n defer.reject(data);\n }\n // ### Custom Adyen cartridge start ###\n } else if (data.adyenAction) {\n window.orderToken = data.orderToken;\n adyenCheckout.actionHandler(data.adyenAction);\n // ### Custom Adyen cartridge end ###\n } else {\n var continueUrl = data.continueUrl;\n var urlParams = {\n ID: data.orderID,\n token: data.orderToken\n };\n continueUrl += (continueUrl.indexOf('?') !== -1 ? '&' : '?') + Object.keys(urlParams).map(function (key) {\n return key + '=' + encodeURIComponent(urlParams[key]);\n }).join('&');\n window.location.href = continueUrl;\n defer.resolve(data);\n }\n },\n error: function error() {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', $('.next-step-button button'));\n }\n });\n return defer;\n }\n var p = $('
').promise(); // eslint-disable-line\n setTimeout(function () {\n p.done(); // eslint-disable-line\n }, 500);\n return p; // eslint-disable-line\n },\n /**\n * Initialize the checkout stage.\n *\n * TODO: update this to allow stage to be set from server?\n */\n initialize: function initialize() {\n // set the initial state of checkout\n members.currentStage = checkoutStages.indexOf($('.data-checkout-stage').data('checkout-stage'));\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n\n //\n // Handle Payment option selection\n //\n $('input[name$=\"paymentMethod\"]', plugin).on('change', function () {\n $('.credit-card-form').toggle($(this).val() === 'CREDIT_CARD');\n });\n\n //\n // Handle Next State button click\n //\n $(plugin).on('click', '.next-step-button button', function () {\n members.nextStage();\n });\n\n //\n // Handle Edit buttons on shipping and payment summary cards\n //\n $('.shipping-summary .edit-button', plugin).on('click', function () {\n if (!$('#checkout-main').hasClass('multi-ship')) {\n $('body').trigger('shipping:selectSingleShipping');\n }\n members.gotoStage('shipping');\n });\n $('.payment-summary .edit-button', plugin).on('click', function () {\n members.gotoStage('payment');\n });\n\n //\n // remember stage (e.g. shipping)\n //\n updateUrl(members.currentStage);\n\n //\n // Listen for foward/back button press and move to correct checkout-stage\n //\n $(window).on('popstate', function (e) {\n //\n // Back button when event state less than current state in ordered\n // checkoutStages array.\n //\n if (e.state === null || checkoutStages.indexOf(e.state) < members.currentStage) {\n members.handlePrevStage(false);\n } else if (checkoutStages.indexOf(e.state) > members.currentStage) {\n // Forward button pressed\n members.handleNextStage(false);\n }\n });\n\n //\n // Set the form data\n //\n plugin.data('formData', formData);\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n */\n nextStage: function nextStage() {\n var promise = members.updateStage();\n promise.done(function () {\n // Update UI with new stage\n members.handleNextStage(true);\n });\n promise.fail(function (data) {\n // show errors\n if (data) {\n if (data.errorStage) {\n members.gotoStage(data.errorStage.stage);\n if (data.errorStage.step === 'billingAddress') {\n var $billingAddressSameAsShipping = $('input[name$=\"_shippingAddressUseAsBillingAddress\"]');\n if ($billingAddressSameAsShipping.is(':checked')) {\n $billingAddressSameAsShipping.prop('checked', false);\n }\n }\n }\n if (data.errorMessage) {\n $('.error-message').show();\n $('.error-message-text').text(data.errorMessage);\n }\n }\n });\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n *\n * @param {boolean} bPushState - boolean when true pushes state using the history api.\n */\n handleNextStage: function handleNextStage(bPushState) {\n if (members.currentStage < checkoutStages.length - 1) {\n // move stage forward\n members.currentStage++;\n\n //\n // show new stage in url (e.g.payment)\n //\n if (bPushState) {\n updateUrl(members.currentStage);\n }\n }\n\n // Set the next stage on the DOM\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Previous State\n */\n handlePrevStage: function handlePrevStage() {\n if (members.currentStage > 0) {\n // move state back\n members.currentStage--;\n updateUrl(members.currentStage);\n }\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Use window history to go to a checkout stage\n * @param {string} stageName - the checkout state to goto\n */\n gotoStage: function gotoStage(stageName) {\n members.currentStage = checkoutStages.indexOf(stageName);\n updateUrl(members.currentStage);\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n }\n };\n\n //\n // Initialize the checkout\n //\n members.initialize();\n return this;\n };\n})(jQuery);\nmodule.exports = {\n updateCheckoutView: function updateCheckoutView() {\n $('body').on('checkout:updateCheckoutView', function (e, data) {\n shippingHelpers.methods.updateMultiShipInformation(data.order);\n summaryHelpers.updateTotals(data.order.totals);\n data.order.shipping.forEach(function (shipping) {\n shippingHelpers.methods.updateShippingInformation(shipping, data.order, data.customer, data.options);\n });\n var currentStage = window.location.search.substring(window.location.search.indexOf('=') + 1);\n if (currentStage === ('shipping' || false)) {\n adyenCheckout.renderGenericComponent();\n }\n billingHelpers.methods.updateBillingInformation(data.order, data.customer, data.options);\n billing.methods.updatePaymentInformation(data.order, data.options);\n summaryHelpers.updateOrderProductSummaryInformation(data.order, data.options);\n });\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA5.js?"); /***/ }), @@ -382,7 +382,7 @@ eval("\n\nvar shippingHelpers = __webpack_require__(/*! base/checkout/shipping * /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar customerHelpers = __webpack_require__(/*! base/checkout/customer */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/customer.js\");\nvar shippingHelpers = __webpack_require__(/*! base/checkout/shipping */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/shipping.js\");\nvar billingHelpers = __webpack_require__(/*! base/checkout/billing */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/billing.js\");\nvar summaryHelpers = __webpack_require__(/*! base/checkout/summary */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/summary.js\");\nvar formHelpers = __webpack_require__(/*! base/checkout/formErrors */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/formErrors.js\");\nvar scrollAnimate = __webpack_require__(/*! base/components/scrollAnimate */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js\");\nvar billing = __webpack_require__(/*! ./billing */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/billing.js\");\n// ### Custom Adyen cartridge start ###\nvar adyenCheckout = __webpack_require__(/*! ../adyenCheckout */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js\");\n// ### Custom Adyen cartridge end ###\n\n/**\n * Create the jQuery Checkout Plugin.\n *\n * This jQuery plugin will be registered on the dom element in checkout.isml with the\n * id of \"checkout-main\".\n *\n * The checkout plugin will handle the different state the user interface is in as the user\n * progresses through the varying forms such as shipping and payment.\n *\n * Billing info and payment info are used a bit synonymously in this code.\n *\n */\n(function ($) {\n $.fn.checkout = function () {\n var plugin = this;\n\n //\n // Collect form data from user input\n //\n var formData = {\n // Customer Data\n customer: {},\n // Shipping Address\n shipping: {},\n // Billing Address\n billing: {},\n // Payment\n payment: {},\n // Gift Codes\n giftCode: {}\n };\n\n //\n // The different states/stages of checkout\n //\n var checkoutStages = ['customer', 'shipping', 'payment', 'placeOrder', 'submitted'];\n\n /**\n * Updates the URL to determine stage\n * @param {number} currentStage - The current stage the user is currently on in the checkout\n */\n function updateUrl(currentStage) {\n history.pushState(checkoutStages[currentStage], document.title, location.pathname + '?stage=' + checkoutStages[currentStage] + '#' + checkoutStages[currentStage]);\n }\n\n //\n // Local member methods of the Checkout plugin\n //\n var members = {\n // initialize the currentStage variable for the first time\n currentStage: 0,\n /**\n * Set or update the checkout stage (AKA the shipping, billing, payment, etc... steps)\n * @returns {Object} a promise\n */\n updateStage: function updateStage() {\n var stage = checkoutStages[members.currentStage];\n var defer = $.Deferred(); // eslint-disable-line\n\n if (stage === 'customer') {\n //\n // Clear Previous Errors\n //\n customerHelpers.methods.clearErrors();\n //\n // Submit the Customer Form\n //\n var customerFormSelector = customerHelpers.methods.isGuestFormActive() ? customerHelpers.vars.GUEST_FORM : customerHelpers.vars.REGISTERED_FORM;\n var customerForm = $(customerFormSelector);\n $.ajax({\n url: customerForm.attr('action'),\n type: 'post',\n data: customerForm.serialize(),\n success: function success(data) {\n if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n } else {\n customerHelpers.methods.customerFormResponse(defer, data);\n }\n },\n error: function error(err) {\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n // Server error submitting form\n defer.reject(err.responseJSON);\n }\n });\n return defer;\n } else if (stage === 'shipping') {\n //\n // Clear Previous Errors\n //\n formHelpers.clearPreviousErrors('.shipping-form');\n\n //\n // Submit the Shipping Address Form\n //\n var isMultiShip = $('#checkout-main').hasClass('multi-ship');\n var formSelector = isMultiShip ? '.multi-shipping .active form' : '.single-shipping .shipping-form';\n var form = $(formSelector);\n if (isMultiShip && form.length === 0) {\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n // in case the multi ship form is already submitted\n var url = $('#checkout-main').attr('data-checkout-get-url');\n $.ajax({\n url: url,\n method: 'GET',\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (!data.error) {\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n defer.resolve();\n } else if (data.message && $('.shipping-error .alert-danger').length < 1) {\n var errorMsg = data.message;\n var errorHtml = '
' + '' + errorMsg + '
';\n $('.shipping-error').append(errorHtml);\n scrollAnimate($('.shipping-error'));\n defer.reject();\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n },\n error: function error() {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // Server error submitting form\n defer.reject();\n }\n });\n } else {\n var shippingFormData = form.serialize();\n $('body').trigger('checkout:serializeShipping', {\n form: form,\n data: shippingFormData,\n callback: function callback(data) {\n shippingFormData = data;\n }\n });\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: form.attr('action'),\n type: 'post',\n data: shippingFormData,\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n shippingHelpers.methods.shippingFormResponse(defer, data);\n },\n error: function error(err) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n // Server error submitting form\n defer.reject(err.responseJSON);\n }\n });\n }\n return defer;\n } else if (stage === 'payment') {\n //\n // Submit the Billing Address Form\n //\n\n formHelpers.clearPreviousErrors('.payment-form');\n var billingAddressForm = $('#dwfrm_billing .billing-address-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .billing-address-block'),\n data: billingAddressForm,\n callback: function callback(data) {\n if (data) {\n billingAddressForm = data;\n }\n }\n });\n var contactInfoForm = $('#dwfrm_billing .contact-info-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .contact-info-block'),\n data: contactInfoForm,\n callback: function callback(data) {\n if (data) {\n contactInfoForm = data;\n }\n }\n });\n var activeTabId = $('.tab-pane.active').attr('id');\n var paymentInfoSelector = '#dwfrm_billing .' + activeTabId + ' .payment-form-fields :input';\n var paymentInfoForm = $(paymentInfoSelector).serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $(paymentInfoSelector),\n data: paymentInfoForm,\n callback: function callback(data) {\n if (data) {\n paymentInfoForm = data;\n }\n }\n });\n var paymentForm = billingAddressForm + '&' + contactInfoForm + '&' + paymentInfoForm;\n if ($('.data-checkout-stage').data('customer-type') === 'registered') {\n // if payment method is credit card\n if ($('.payment-information').data('payment-method-id') === 'CREDIT_CARD') {\n if (!$('.payment-information').data('is-new-payment')) {\n var cvvCode = $('.saved-payment-instrument.' + 'selected-payment .saved-payment-security-code').val();\n if (cvvCode === '') {\n var cvvElement = $('.saved-payment-instrument.' + 'selected-payment ' + '.form-control');\n cvvElement.addClass('is-invalid');\n scrollAnimate(cvvElement);\n defer.reject();\n return defer;\n }\n var $savedPaymentInstrument = $('.saved-payment-instrument' + '.selected-payment');\n paymentForm += '&storedPaymentUUID=' + $savedPaymentInstrument.data('uuid');\n paymentForm += '&securityCode=' + cvvCode;\n }\n }\n }\n // disable the next:Place Order button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('#dwfrm_billing').attr('action'),\n method: 'POST',\n data: paymentForm,\n success: function success(data) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // look for field validation errors\n if (data.error) {\n if (data.fieldErrors.length) {\n data.fieldErrors.forEach(function (error) {\n if (Object.keys(error).length) {\n formHelpers.loadFormErrors('.payment-form', error);\n }\n });\n }\n if (data.serverErrors.length) {\n data.serverErrors.forEach(function (error) {\n $('.error-message').show();\n $('.error-message-text').text(error);\n scrollAnimate($('.error-message'));\n });\n }\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n }\n defer.reject();\n } else {\n //\n // Populate the Address Summary\n //\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n if (data.renderedPaymentInstruments) {\n $('.stored-payments').empty().html(data.renderedPaymentInstruments);\n }\n if (data.customer.registeredUser && data.customer.customerPaymentInstruments.length) {\n $('.cancel-new-payment').removeClass('checkout-hidden');\n }\n scrollAnimate();\n defer.resolve(data);\n }\n },\n error: function error(err) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n }\n });\n return defer;\n } else if (stage === 'placeOrder') {\n // disable the placeOrder button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('.place-order').data('action'),\n method: 'POST',\n success: function success(data) {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (data.error) {\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n defer.reject();\n } else {\n // go to appropriate stage and display error message\n defer.reject(data);\n }\n // ### Custom Adyen cartridge start ###\n } else if (data.adyenAction) {\n window.orderToken = data.orderToken;\n adyenCheckout.actionHandler(data.adyenAction);\n // ### Custom Adyen cartridge end ###\n } else {\n var redirect = $('
').appendTo(document.body).attr({\n method: 'POST',\n action: data.continueUrl\n });\n $('').appendTo(redirect).attr({\n name: 'orderID',\n value: data.orderID\n });\n $('').appendTo(redirect).attr({\n name: 'orderToken',\n value: data.orderToken\n });\n redirect.submit();\n defer.resolve(data);\n }\n },\n error: function error() {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', $('.next-step-button button'));\n }\n });\n return defer;\n }\n var p = $('
').promise(); // eslint-disable-line\n setTimeout(function () {\n p.done(); // eslint-disable-line\n }, 500);\n return p; // eslint-disable-line\n },\n\n /**\n * Initialize the checkout stage.\n *\n * TODO: update this to allow stage to be set from server?\n */\n initialize: function initialize() {\n // set the initial state of checkout\n members.currentStage = checkoutStages.indexOf($('.data-checkout-stage').data('checkout-stage'));\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n $('body').on('click', '.submit-customer-login', function (e) {\n e.preventDefault();\n members.nextStage();\n });\n $('body').on('click', '.submit-customer', function (e) {\n e.preventDefault();\n members.nextStage();\n });\n\n //\n // Handle Payment option selection\n //\n $('input[name$=\"paymentMethod\"]', plugin).on('change', function () {\n $('.credit-card-form').toggle($(this).val() === 'CREDIT_CARD');\n });\n\n //\n // Handle Next State button click\n //\n $(plugin).on('click', '.next-step-button button', function () {\n members.nextStage();\n });\n\n //\n // Handle Edit buttons on shipping and payment summary cards\n //\n $('.customer-summary .edit-button', plugin).on('click', function () {\n members.gotoStage('customer');\n });\n $('.shipping-summary .edit-button', plugin).on('click', function () {\n if (!$('#checkout-main').hasClass('multi-ship')) {\n $('body').trigger('shipping:selectSingleShipping');\n }\n members.gotoStage('shipping');\n });\n $('.payment-summary .edit-button', plugin).on('click', function () {\n members.gotoStage('payment');\n });\n\n //\n // remember stage (e.g. shipping)\n //\n updateUrl(members.currentStage);\n\n //\n // Listen for foward/back button press and move to correct checkout-stage\n //\n $(window).on('popstate', function (e) {\n //\n // Back button when event state less than current state in ordered\n // checkoutStages array.\n //\n if (e.state === null || checkoutStages.indexOf(e.state) < members.currentStage) {\n members.handlePrevStage(false);\n } else if (checkoutStages.indexOf(e.state) > members.currentStage) {\n // Forward button pressed\n members.handleNextStage(false);\n }\n });\n\n //\n // Set the form data\n //\n plugin.data('formData', formData);\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n */\n nextStage: function nextStage() {\n var promise = members.updateStage();\n promise.done(function () {\n // Update UI with new stage\n $('.error-message').hide();\n members.handleNextStage(true);\n });\n promise.fail(function (data) {\n // show errors\n if (data) {\n if (data.errorStage) {\n members.gotoStage(data.errorStage.stage);\n if (data.errorStage.step === 'billingAddress') {\n var $billingAddressSameAsShipping = $('input[name$=\"_shippingAddressUseAsBillingAddress\"]');\n if ($billingAddressSameAsShipping.is(':checked')) {\n $billingAddressSameAsShipping.prop('checked', false);\n }\n }\n }\n if (data.errorMessage) {\n $('.error-message').show();\n $('.error-message-text').text(data.errorMessage);\n }\n }\n });\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n *\n * @param {boolean} bPushState - boolean when true pushes state using the history api.\n */\n handleNextStage: function handleNextStage(bPushState) {\n if (members.currentStage < checkoutStages.length - 1) {\n // move stage forward\n members.currentStage++;\n\n //\n // show new stage in url (e.g.payment)\n //\n if (bPushState) {\n updateUrl(members.currentStage);\n }\n }\n\n // Set the next stage on the DOM\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Previous State\n */\n handlePrevStage: function handlePrevStage() {\n if (members.currentStage > 0) {\n // move state back\n members.currentStage--;\n updateUrl(members.currentStage);\n }\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Use window history to go to a checkout stage\n * @param {string} stageName - the checkout state to goto\n */\n gotoStage: function gotoStage(stageName) {\n members.currentStage = checkoutStages.indexOf(stageName);\n updateUrl(members.currentStage);\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n }\n };\n\n //\n // Initialize the checkout\n //\n members.initialize();\n return this;\n };\n})(jQuery);\nmodule.exports = {\n updateCheckoutView: function updateCheckoutView() {\n $('body').on('checkout:updateCheckoutView', function (e, data) {\n if (data.csrfToken) {\n $(\"input[name*='csrf_token']\").val(data.csrfToken);\n }\n customerHelpers.methods.updateCustomerInformation(data.customer, data.order);\n shippingHelpers.methods.updateMultiShipInformation(data.order);\n summaryHelpers.updateTotals(data.order.totals);\n data.order.shipping.forEach(function (shipping) {\n shippingHelpers.methods.updateShippingInformation(shipping, data.order, data.customer, data.options);\n });\n var currentStage = window.location.search.substring(window.location.search.indexOf('=') + 1);\n if (currentStage === ('shipping' || false)) {\n adyenCheckout.renderGenericComponent();\n }\n billingHelpers.methods.updateBillingInformation(data.order, data.customer, data.options);\n billing.methods.updatePaymentInformation(data.order, data.options);\n summaryHelpers.updateOrderProductSummaryInformation(data.order, data.options);\n });\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA6.js?"); +eval("\n\nvar customerHelpers = __webpack_require__(/*! base/checkout/customer */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/customer.js\");\nvar shippingHelpers = __webpack_require__(/*! base/checkout/shipping */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/shipping.js\");\nvar billingHelpers = __webpack_require__(/*! base/checkout/billing */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/billing.js\");\nvar summaryHelpers = __webpack_require__(/*! base/checkout/summary */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/summary.js\");\nvar formHelpers = __webpack_require__(/*! base/checkout/formErrors */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/formErrors.js\");\nvar scrollAnimate = __webpack_require__(/*! base/components/scrollAnimate */ \"../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js\");\nvar billing = __webpack_require__(/*! ./billing */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/billing.js\");\n// ### Custom Adyen cartridge start ###\nvar adyenCheckout = __webpack_require__(/*! ../adyenCheckout */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js\");\n// ### Custom Adyen cartridge end ###\n\n/**\n * Create the jQuery Checkout Plugin.\n *\n * This jQuery plugin will be registered on the dom element in checkout.isml with the\n * id of \"checkout-main\".\n *\n * The checkout plugin will handle the different state the user interface is in as the user\n * progresses through the varying forms such as shipping and payment.\n *\n * Billing info and payment info are used a bit synonymously in this code.\n *\n */\n(function ($) {\n $.fn.checkout = function () {\n var plugin = this;\n\n //\n // Collect form data from user input\n //\n var formData = {\n // Customer Data\n customer: {},\n // Shipping Address\n shipping: {},\n // Billing Address\n billing: {},\n // Payment\n payment: {},\n // Gift Codes\n giftCode: {}\n };\n\n //\n // The different states/stages of checkout\n //\n var checkoutStages = ['customer', 'shipping', 'payment', 'placeOrder', 'submitted'];\n\n /**\n * Updates the URL to determine stage\n * @param {number} currentStage - The current stage the user is currently on in the checkout\n */\n function updateUrl(currentStage) {\n history.pushState(checkoutStages[currentStage], document.title, location.pathname + '?stage=' + checkoutStages[currentStage] + '#' + checkoutStages[currentStage]);\n }\n\n //\n // Local member methods of the Checkout plugin\n //\n var members = {\n // initialize the currentStage variable for the first time\n currentStage: 0,\n /**\n * Set or update the checkout stage (AKA the shipping, billing, payment, etc... steps)\n * @returns {Object} a promise\n */\n updateStage: function updateStage() {\n var stage = checkoutStages[members.currentStage];\n var defer = $.Deferred(); // eslint-disable-line\n\n if (stage === 'customer') {\n //\n // Clear Previous Errors\n //\n customerHelpers.methods.clearErrors();\n //\n // Submit the Customer Form\n //\n var customerFormSelector = customerHelpers.methods.isGuestFormActive() ? customerHelpers.vars.GUEST_FORM : customerHelpers.vars.REGISTERED_FORM;\n var customerForm = $(customerFormSelector);\n $.ajax({\n url: customerForm.attr('action'),\n type: 'post',\n data: customerForm.serialize(),\n success: function success(data) {\n if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n } else {\n customerHelpers.methods.customerFormResponse(defer, data);\n }\n },\n error: function error(err) {\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n // Server error submitting form\n defer.reject(err.responseJSON);\n }\n });\n return defer;\n } else if (stage === 'shipping') {\n //\n // Clear Previous Errors\n //\n formHelpers.clearPreviousErrors('.shipping-form');\n\n //\n // Submit the Shipping Address Form\n //\n var isMultiShip = $('#checkout-main').hasClass('multi-ship');\n var formSelector = isMultiShip ? '.multi-shipping .active form' : '.single-shipping .shipping-form';\n var form = $(formSelector);\n if (isMultiShip && form.length === 0) {\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n // in case the multi ship form is already submitted\n var url = $('#checkout-main').attr('data-checkout-get-url');\n $.ajax({\n url: url,\n method: 'GET',\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (!data.error) {\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n defer.resolve();\n } else if (data.message && $('.shipping-error .alert-danger').length < 1) {\n var errorMsg = data.message;\n var errorHtml = '
' + '' + errorMsg + '
';\n $('.shipping-error').append(errorHtml);\n scrollAnimate($('.shipping-error'));\n defer.reject();\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n },\n error: function error() {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // Server error submitting form\n defer.reject();\n }\n });\n } else {\n var shippingFormData = form.serialize();\n $('body').trigger('checkout:serializeShipping', {\n form: form,\n data: shippingFormData,\n callback: function callback(data) {\n shippingFormData = data;\n }\n });\n // disable the next:Payment button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: form.attr('action'),\n type: 'post',\n data: shippingFormData,\n success: function success(data) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n shippingHelpers.methods.shippingFormResponse(defer, data);\n },\n error: function error(err) {\n // enable the next:Payment button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n // Server error submitting form\n defer.reject(err.responseJSON);\n }\n });\n }\n return defer;\n } else if (stage === 'payment') {\n //\n // Submit the Billing Address Form\n //\n\n formHelpers.clearPreviousErrors('.payment-form');\n var billingAddressForm = $('#dwfrm_billing .billing-address-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .billing-address-block'),\n data: billingAddressForm,\n callback: function callback(data) {\n if (data) {\n billingAddressForm = data;\n }\n }\n });\n var contactInfoForm = $('#dwfrm_billing .contact-info-block :input').serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $('#dwfrm_billing .contact-info-block'),\n data: contactInfoForm,\n callback: function callback(data) {\n if (data) {\n contactInfoForm = data;\n }\n }\n });\n var activeTabId = $('.tab-pane.active').attr('id');\n var paymentInfoSelector = '#dwfrm_billing .' + activeTabId + ' .payment-form-fields :input';\n var paymentInfoForm = $(paymentInfoSelector).serialize();\n $('body').trigger('checkout:serializeBilling', {\n form: $(paymentInfoSelector),\n data: paymentInfoForm,\n callback: function callback(data) {\n if (data) {\n paymentInfoForm = data;\n }\n }\n });\n var paymentForm = billingAddressForm + '&' + contactInfoForm + '&' + paymentInfoForm;\n if ($('.data-checkout-stage').data('customer-type') === 'registered') {\n // if payment method is credit card\n if ($('.payment-information').data('payment-method-id') === 'CREDIT_CARD') {\n if (!$('.payment-information').data('is-new-payment')) {\n var cvvCode = $('.saved-payment-instrument.' + 'selected-payment .saved-payment-security-code').val();\n if (cvvCode === '') {\n var cvvElement = $('.saved-payment-instrument.' + 'selected-payment ' + '.form-control');\n cvvElement.addClass('is-invalid');\n scrollAnimate(cvvElement);\n defer.reject();\n return defer;\n }\n var $savedPaymentInstrument = $('.saved-payment-instrument' + '.selected-payment');\n paymentForm += '&storedPaymentUUID=' + $savedPaymentInstrument.data('uuid');\n paymentForm += '&securityCode=' + cvvCode;\n }\n }\n }\n // disable the next:Place Order button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('#dwfrm_billing').attr('action'),\n method: 'POST',\n data: paymentForm,\n success: function success(data) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n // look for field validation errors\n if (data.error) {\n if (data.fieldErrors.length) {\n data.fieldErrors.forEach(function (error) {\n if (Object.keys(error).length) {\n formHelpers.loadFormErrors('.payment-form', error);\n }\n });\n }\n if (data.serverErrors.length) {\n data.serverErrors.forEach(function (error) {\n $('.error-message').show();\n $('.error-message-text').text(error);\n scrollAnimate($('.error-message'));\n });\n }\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n }\n defer.reject();\n } else {\n //\n // Populate the Address Summary\n //\n $('body').trigger('checkout:updateCheckoutView', {\n order: data.order,\n customer: data.customer\n });\n if (data.renderedPaymentInstruments) {\n $('.stored-payments').empty().html(data.renderedPaymentInstruments);\n }\n if (data.customer.registeredUser && data.customer.customerPaymentInstruments.length) {\n $('.cancel-new-payment').removeClass('checkout-hidden');\n }\n scrollAnimate();\n defer.resolve(data);\n }\n },\n error: function error(err) {\n // enable the next:Place Order button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (err.responseJSON && err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n }\n });\n return defer;\n } else if (stage === 'placeOrder') {\n // disable the placeOrder button here\n $('body').trigger('checkout:disableButton', '.next-step-button button');\n $.ajax({\n url: $('.place-order').data('action'),\n method: 'POST',\n success: function success(data) {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', '.next-step-button button');\n if (data.error) {\n if (data.cartError) {\n window.location.href = data.redirectUrl;\n defer.reject();\n } else {\n // go to appropriate stage and display error message\n defer.reject(data);\n }\n // ### Custom Adyen cartridge start ###\n } else if (data.adyenAction) {\n window.orderToken = data.orderToken;\n adyenCheckout.actionHandler(data.adyenAction);\n // ### Custom Adyen cartridge end ###\n } else {\n var redirect = $('').appendTo(document.body).attr({\n method: 'POST',\n action: data.continueUrl\n });\n $('').appendTo(redirect).attr({\n name: 'orderID',\n value: data.orderID\n });\n $('').appendTo(redirect).attr({\n name: 'orderToken',\n value: data.orderToken\n });\n redirect.submit();\n defer.resolve(data);\n }\n },\n error: function error() {\n // enable the placeOrder button here\n $('body').trigger('checkout:enableButton', $('.next-step-button button'));\n }\n });\n return defer;\n }\n var p = $('
').promise(); // eslint-disable-line\n setTimeout(function () {\n p.done(); // eslint-disable-line\n }, 500);\n return p; // eslint-disable-line\n },\n /**\n * Initialize the checkout stage.\n *\n * TODO: update this to allow stage to be set from server?\n */\n initialize: function initialize() {\n // set the initial state of checkout\n members.currentStage = checkoutStages.indexOf($('.data-checkout-stage').data('checkout-stage'));\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n $('body').on('click', '.submit-customer-login', function (e) {\n e.preventDefault();\n members.nextStage();\n });\n $('body').on('click', '.submit-customer', function (e) {\n e.preventDefault();\n members.nextStage();\n });\n\n //\n // Handle Payment option selection\n //\n $('input[name$=\"paymentMethod\"]', plugin).on('change', function () {\n $('.credit-card-form').toggle($(this).val() === 'CREDIT_CARD');\n });\n\n //\n // Handle Next State button click\n //\n $(plugin).on('click', '.next-step-button button', function () {\n members.nextStage();\n });\n\n //\n // Handle Edit buttons on shipping and payment summary cards\n //\n $('.customer-summary .edit-button', plugin).on('click', function () {\n members.gotoStage('customer');\n });\n $('.shipping-summary .edit-button', plugin).on('click', function () {\n if (!$('#checkout-main').hasClass('multi-ship')) {\n $('body').trigger('shipping:selectSingleShipping');\n }\n members.gotoStage('shipping');\n });\n $('.payment-summary .edit-button', plugin).on('click', function () {\n members.gotoStage('payment');\n });\n\n //\n // remember stage (e.g. shipping)\n //\n updateUrl(members.currentStage);\n\n //\n // Listen for foward/back button press and move to correct checkout-stage\n //\n $(window).on('popstate', function (e) {\n //\n // Back button when event state less than current state in ordered\n // checkoutStages array.\n //\n if (e.state === null || checkoutStages.indexOf(e.state) < members.currentStage) {\n members.handlePrevStage(false);\n } else if (checkoutStages.indexOf(e.state) > members.currentStage) {\n // Forward button pressed\n members.handleNextStage(false);\n }\n });\n\n //\n // Set the form data\n //\n plugin.data('formData', formData);\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n */\n nextStage: function nextStage() {\n var promise = members.updateStage();\n promise.done(function () {\n // Update UI with new stage\n $('.error-message').hide();\n members.handleNextStage(true);\n });\n promise.fail(function (data) {\n // show errors\n if (data) {\n if (data.errorStage) {\n members.gotoStage(data.errorStage.stage);\n if (data.errorStage.step === 'billingAddress') {\n var $billingAddressSameAsShipping = $('input[name$=\"_shippingAddressUseAsBillingAddress\"]');\n if ($billingAddressSameAsShipping.is(':checked')) {\n $billingAddressSameAsShipping.prop('checked', false);\n }\n }\n }\n if (data.errorMessage) {\n $('.error-message').show();\n $('.error-message-text').text(data.errorMessage);\n }\n }\n });\n },\n /**\n * The next checkout state step updates the css for showing correct buttons etc...\n *\n * @param {boolean} bPushState - boolean when true pushes state using the history api.\n */\n handleNextStage: function handleNextStage(bPushState) {\n if (members.currentStage < checkoutStages.length - 1) {\n // move stage forward\n members.currentStage++;\n\n //\n // show new stage in url (e.g.payment)\n //\n if (bPushState) {\n updateUrl(members.currentStage);\n }\n }\n\n // Set the next stage on the DOM\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Previous State\n */\n handlePrevStage: function handlePrevStage() {\n if (members.currentStage > 0) {\n // move state back\n members.currentStage--;\n updateUrl(members.currentStage);\n }\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n },\n /**\n * Use window history to go to a checkout stage\n * @param {string} stageName - the checkout state to goto\n */\n gotoStage: function gotoStage(stageName) {\n members.currentStage = checkoutStages.indexOf(stageName);\n updateUrl(members.currentStage);\n $(plugin).attr('data-checkout-stage', checkoutStages[members.currentStage]);\n }\n };\n\n //\n // Initialize the checkout\n //\n members.initialize();\n return this;\n };\n})(jQuery);\nmodule.exports = {\n updateCheckoutView: function updateCheckoutView() {\n $('body').on('checkout:updateCheckoutView', function (e, data) {\n if (data.csrfToken) {\n $(\"input[name*='csrf_token']\").val(data.csrfToken);\n }\n customerHelpers.methods.updateCustomerInformation(data.customer, data.order);\n shippingHelpers.methods.updateMultiShipInformation(data.order);\n summaryHelpers.updateTotals(data.order.totals);\n data.order.shipping.forEach(function (shipping) {\n shippingHelpers.methods.updateShippingInformation(shipping, data.order, data.customer, data.options);\n });\n var currentStage = window.location.search.substring(window.location.search.indexOf('=') + 1);\n if (currentStage === ('shipping' || false)) {\n adyenCheckout.renderGenericComponent();\n }\n billingHelpers.methods.updateBillingInformation(data.order, data.customer, data.options);\n billing.methods.updatePaymentInformation(data.order, data.options);\n summaryHelpers.updateOrderProductSummaryInformation(data.order, data.options);\n });\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/checkout/checkoutSFRA6.js?"); /***/ }), @@ -394,7 +394,7 @@ eval("\n\nvar customerHelpers = __webpack_require__(/*! base/checkout/customer * /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -418,7 +418,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _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); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); /***/ }), @@ -430,7 +430,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property);\n } else {\n storeAnnotation(target, property, annotation);\n }\n }\n return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n if ( true && !types.includes(context.kind)) {\n die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_,\n decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* MakeResult.Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1,\n decorate_20223_: decorate_20223_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n if (true) {\n assert20223DecoratorType(context, [\"method\", \"field\"]);\n }\n var kind = context.kind,\n name = context.name,\n addInitializer = context.addInitializer;\n var ann = this;\n var _createAction = function _createAction(m) {\n var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n };\n // Backwards/Legacy behavior, expects makeObservable(this)\n if (kind == \"field\") {\n addInitializer(function () {\n storeAnnotation(this, name, ann);\n });\n return;\n }\n if (kind == \"method\") {\n var _this$options_2;\n if (!isAction(mthd)) {\n mthd = _createAction(mthd);\n }\n if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobxAction = true;\n self[name] = bound;\n });\n }\n return mthd;\n }\n die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2,\n decorate_20223_: decorate_20223_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* MakeResult.Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n var _this$options_3;\n if (true) {\n assert20223DecoratorType(context, [\"method\"]);\n }\n var name = context.name,\n addInitializer = context.addInitializer;\n if (!isFlow(mthd)) {\n mthd = flow(mthd);\n }\n if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobXFlow = true;\n self[name] = bound;\n });\n }\n return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3,\n decorate_20223_: decorate_20223_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n if (true) {\n assert20223DecoratorType(context, [\"getter\"]);\n }\n var ann = this;\n var key = context.name,\n addInitializer = context.addInitializer;\n addInitializer(function () {\n var adm = asObservableObject(this)[$mobx];\n var options = _extends({}, ann.options_, {\n get: get,\n context: this\n });\n options.name || (options.name = true ? adm.name_ + \".\" + key.toString() : undefined);\n adm.values_.set(key, new ComputedValue(options));\n });\n return function () {\n return this[$mobx].getObservablePropValue_(key);\n };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4,\n decorate_20223_: decorate_20223_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n if (true) {\n if (context.kind === \"field\") {\n throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n }\n assert20223DecoratorType(context, [\"accessor\"]);\n }\n var ann = this;\n var kind = context.kind,\n name = context.name;\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n var initializedObjects = new WeakSet();\n function initializeObservable(target, value) {\n var _ann$options_$enhance, _ann$options_;\n var adm = asObservableObject(target)[$mobx];\n var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, true ? adm.name_ + \".\" + name.toString() : undefined, false);\n adm.values_.set(name, observable);\n initializedObjects.add(target);\n }\n if (kind == \"accessor\") {\n return {\n get: function get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this));\n }\n return this[$mobx].getObservablePropValue_(name);\n },\n set: function set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return this[$mobx].setObservablePropValue_(name, value);\n },\n init: function init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return value;\n }\n };\n }\n return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5,\n decorate_20223_: decorate_20223_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* MakeResult.Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2);\n }\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return initObservable(function () {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n });\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2);\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n res.toString = function () {\n return fn.toString();\n };\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n });\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2);\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n initObservable(function () {\n var _annotations;\n var adm = asObservableObject(target, options)[$mobx];\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n });\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n });\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n return initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues);\n }\n return proxy;\n });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n initObservable(function () {\n _this.keysAtom_ = createAtom( true ? _this.name_ + \".keys()\" : undefined);\n _this.data_ = new Map();\n _this.hasMap_ = new Map();\n if (initialData) {\n _this.merge(initialData);\n }\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n var _this = this;\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n initObservable(function () {\n _this.atom_ = createAtom(_this.name_);\n if (initialData) {\n _this.replace(initialData);\n }\n });\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this2 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this2[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this3.data_.add(_this3.enhancer_(value, undefined));\n _this3.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this4 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this4.atom_.reportChanged();\n _this4.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this5 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (isES6Set(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined);\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* MakeResult.Cancel */) {\n return;\n }\n if (outcome === 1 /* MakeResult.Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (true) {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n // Not annotated\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function set() {\n v = true;\n }\n });\n /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n });\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n var derivation = untrackedStart();\n var allowStateChanges = allowStateChangesStart(true);\n startBatch();\n try {\n return cb();\n } finally {\n endBatch();\n allowStateChangesEnd(allowStateChanges);\n untrackedEnd(derivation);\n }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); /***/ }), diff --git a/cartridges/int_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js b/cartridges/int_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js index d686cb2c39..7d1731e4e1 100644 --- a/cartridges/int_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js +++ b/cartridges/int_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/int_adyen_SFRA/cartridge/store/index.js\");\nmodule.exports.onFieldValid = function onFieldValid(data) {\n if (data.endDigits) {\n store.endDigits = data.endDigits;\n document.querySelector('#cardNumber').value = store.maskedCardNumber;\n }\n};\nmodule.exports.onBrand = function onBrand(brandObject) {\n document.querySelector('#cardType').value = brandObject.brand;\n};\n\n/**\n * Makes an ajax call to the controller function CreateSession\n */\nmodule.exports.createSession = /*#__PURE__*/function () {\n var _createSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", $.ajax({\n url: window.sessionsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n function createSession() {\n return _createSession.apply(this, arguments);\n }\n return createSession;\n}();\n\n/**\n * Makes an ajax call to the controller function FetchGiftCards\n */\nmodule.exports.fetchGiftCards = /*#__PURE__*/function () {\n var _fetchGiftCards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", $.ajax({\n url: window.fetchGiftCardsUrl,\n type: 'get'\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function fetchGiftCards() {\n return _fetchGiftCards.apply(this, arguments);\n }\n return fetchGiftCards;\n}();\nmodule.exports.checkIfExpressMethodsAreReady = function checkIfExpressMethodsAreReady() {\n var expressMethodsConfig = {\n applepay: window.isApplePayExpressEnabled === 'true',\n amazonpay: window.isAmazonPayExpressEnabled === 'true'\n };\n var enabledExpressMethods = [];\n Object.keys(expressMethodsConfig).forEach(function (key) {\n if (expressMethodsConfig[key]) {\n enabledExpressMethods.push(key);\n }\n });\n enabledExpressMethods = enabledExpressMethods.sort();\n var loadedExpressMethods = window.loadedExpressMethods && window.loadedExpressMethods.length ? window.loadedExpressMethods.sort() : [];\n var areAllMethodsReady = JSON.stringify(enabledExpressMethods) === JSON.stringify(loadedExpressMethods);\n if (!enabledExpressMethods.length || areAllMethodsReady) {\n var _document$getElementB, _document$getElementB2;\n (_document$getElementB = document.getElementById('express-loader-container')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add('hidden');\n (_document$getElementB2 = document.getElementById('express-container')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.remove('hidden');\n }\n};\nmodule.exports.updateLoadedExpressMethods = function updateLoadedExpressMethods(method) {\n if (!window.loadedExpressMethods) {\n window.loadedExpressMethods = [];\n }\n if (!window.loadedExpressMethods.includes(method)) {\n window.loadedExpressMethods.push(method);\n }\n};\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js?"); /***/ }), @@ -106,7 +106,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _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; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nfunction handleExpressPaymentsVisibility() {\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nfunction _handleExpressPaymentsVisibility() {\n _handleExpressPaymentsVisibility = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _window, expressMethodsOrder, sortOrder, container, toSort;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _window = window, expressMethodsOrder = _window.expressMethodsOrder;\n if (expressMethodsOrder) {\n sortOrder = expressMethodsOrder.split(',');\n container = document.getElementById('express-container');\n toSort = Array.prototype.slice.call(container.children, 0);\n toSort.sort(function (a, b) {\n return sortOrder.indexOf(a.dataset.method) - sortOrder.indexOf(b.dataset.method);\n });\n container.innerHTML = '';\n _toConsumableArray(toSort).map(function (node) {\n return container.appendChild(node);\n });\n }\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nhandleExpressPaymentsVisibility();\ncheckIfExpressMethodsAreReady();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js?"); +eval("\n\nfunction _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); }\nfunction _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; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _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; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nvar _require = __webpack_require__(/*! ./commons */ \"./cartridges/int_adyen_SFRA/cartridge/client/default/js/commons/index.js\"),\n checkIfExpressMethodsAreReady = _require.checkIfExpressMethodsAreReady;\nfunction handleExpressPaymentsVisibility() {\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nfunction _handleExpressPaymentsVisibility() {\n _handleExpressPaymentsVisibility = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _window, expressMethodsOrder, sortOrder, container, toSort;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _window = window, expressMethodsOrder = _window.expressMethodsOrder;\n if (expressMethodsOrder) {\n sortOrder = expressMethodsOrder.split(',');\n container = document.getElementById('express-container');\n toSort = Array.prototype.slice.call(container.children, 0);\n toSort.sort(function (a, b) {\n return sortOrder.indexOf(a.dataset.method) - sortOrder.indexOf(b.dataset.method);\n });\n container.innerHTML = '';\n _toConsumableArray(toSort).map(function (node) {\n return container.appendChild(node);\n });\n }\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _handleExpressPaymentsVisibility.apply(this, arguments);\n}\nhandleExpressPaymentsVisibility();\ncheckIfExpressMethodsAreReady();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/client/default/js/expressPaymentMethodsVisibility.js?"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _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); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n return Store;\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/int_adyen_SFRA/cartridge/store/index.js?"); /***/ }), @@ -130,7 +130,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\n 2(prop) {\n return `invalid decorator for '${prop.toString()}'`\n },\n 3(prop) {\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n },\n 4(prop) {\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n },\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n if (is20223Decorator(property)) {\n return annotation.decorate_20223_(target, property);\n } else {\n storeAnnotation(target, property, annotation);\n }\n }\n return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n // die(\n // `No annotations were passed to makeObservable, but no decorated members have been found either`\n // )\n // }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n if ( true && !types.includes(context.kind)) {\n die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\n * Create a new atom. For debugging purposes it is recommended to give it a name.\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Invoke this method to notify mobx that your atom has been used somehow.\n * Returns true if there is currently a reactive context.\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (true) {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_,\n decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* MakeResult.Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1,\n decorate_20223_: decorate_20223_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n if (true) {\n assert20223DecoratorType(context, [\"method\", \"field\"]);\n }\n var kind = context.kind,\n name = context.name,\n addInitializer = context.addInitializer;\n var ann = this;\n var _createAction = function _createAction(m) {\n var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n };\n // Backwards/Legacy behavior, expects makeObservable(this)\n if (kind == \"field\") {\n addInitializer(function () {\n storeAnnotation(this, name, ann);\n });\n return;\n }\n if (kind == \"method\") {\n var _this$options_2;\n if (!isAction(mthd)) {\n mthd = _createAction(mthd);\n }\n if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobxAction = true;\n self[name] = bound;\n });\n }\n return mthd;\n }\n die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2,\n decorate_20223_: decorate_20223_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* MakeResult.Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* MakeResult.Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* MakeResult.Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n var _this$options_3;\n if (true) {\n assert20223DecoratorType(context, [\"method\"]);\n }\n var name = context.name,\n addInitializer = context.addInitializer;\n if (!isFlow(mthd)) {\n mthd = flow(mthd);\n }\n if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n addInitializer(function () {\n var self = this;\n var bound = self[name].bind(self);\n bound.isMobXFlow = true;\n self[name] = bound;\n });\n }\n return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3,\n decorate_20223_: decorate_20223_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n if (true) {\n assert20223DecoratorType(context, [\"getter\"]);\n }\n var ann = this;\n var key = context.name,\n addInitializer = context.addInitializer;\n addInitializer(function () {\n var adm = asObservableObject(this)[$mobx];\n var options = _extends({}, ann.options_, {\n get: get,\n context: this\n });\n options.name || (options.name = true ? adm.name_ + \".\" + key.toString() : undefined);\n adm.values_.set(key, new ComputedValue(options));\n });\n return function () {\n return this[$mobx].getObservablePropValue_(key);\n };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4,\n decorate_20223_: decorate_20223_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n if (true) {\n if (context.kind === \"field\") {\n throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n }\n assert20223DecoratorType(context, [\"accessor\"]);\n }\n var ann = this;\n var kind = context.kind,\n name = context.name;\n // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n // `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n // This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n // before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n // from an object whose class did not declare it` error.\n // TODO: it seems that this will not be required anymore in the final version of the spec\n // See TODO: link\n var initializedObjects = new WeakSet();\n function initializeObservable(target, value) {\n var _ann$options_$enhance, _ann$options_;\n var adm = asObservableObject(target)[$mobx];\n var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, true ? adm.name_ + \".\" + name.toString() : undefined, false);\n adm.values_.set(name, observable);\n initializedObjects.add(target);\n }\n if (kind == \"accessor\") {\n return {\n get: function get() {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, desc.get.call(this));\n }\n return this[$mobx].getObservablePropValue_(name);\n },\n set: function set(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return this[$mobx].setObservablePropValue_(name, value);\n },\n init: function init(value) {\n if (!initializedObjects.has(this)) {\n initializeObservable(this, value);\n }\n return value;\n }\n };\n }\n return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5,\n decorate_20223_: decorate_20223_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* MakeResult.Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp; (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return observableAnnotation.decorate_20223_(v, arg2);\n }\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return initObservable(function () {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n });\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n if (is20223Decorator(arg2)) {\n // @computed (2022.3 Decorators)\n return computedAnnotation.decorate_20223_(arg1, arg2);\n }\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (true) {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (true) {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n res.toString = function () {\n return fn.toString();\n };\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n * give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n * go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\n * Create a new computed value based on a function expression.\n *\n * The `name` property is for debug purposes only.\n *\n * The `equals` property specifies the comparer function to use to determine if a newly produced\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n * Structural comparison can be convenient if you always produce a new aggregated object and\n * don't want to notify observers if it is structurally the same.\n * This is useful for working with vectors, mouse coordinates etc.\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\n * Returns the current value of this computed value.\n * Will evaluate its computation first if needed.\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\n * Simple optimization, give each derivation run an unique id (runId)\n * Check if last time this observable was accessed the same runId is used\n * if this is the case, the relation is already known\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\n * internal, use schedule() if you intend to kick off a reaction\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (true) {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n });\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow (2022.3 Decorators)\n if (is20223Decorator(arg2)) {\n return flowAnnotation.decorate_20223_(arg1, arg2);\n }\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if ( true && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n if ( true && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n if ( true && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if ( true && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n initObservable(function () {\n var _annotations;\n var adm = asObservableObject(target, options)[$mobx];\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n });\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n initObservable(function () {\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n });\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn( true ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : undefined);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n return initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n adm.spliceWithArray_(0, 0, initialValues);\n }\n return proxy;\n });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n * since these functions alter the inner structure of the array, the have side effects.\n * Because the have side effects, they should not be used in computed function,\n * and for that reason the do not call dependencyState.notifyObserved\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n initObservable(function () {\n _this.keysAtom_ = createAtom( true ? _this.name_ + \".keys()\" : undefined);\n _this.data_ = new Map();\n _this.hasMap_ = new Map();\n if (initialData) {\n _this.merge(initialData);\n }\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, true ? _this4.name_ + \".\" + stringifyKey(key) : undefined, false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n var _this = this;\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n initObservable(function () {\n _this.atom_ = createAtom(_this.name_);\n if (initialData) {\n _this.replace(initialData);\n }\n });\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this2 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this2[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this3.data_.add(_this3.enhancer_(value, undefined));\n _this3.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this4 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && \"development\" !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this4.atom_.reportChanged();\n _this4.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && \"development\" !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this5 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (isES6Set(other)) {\n _this5.clear();\n other.forEach(function (value) {\n return _this5.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined);\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\n * @param {PropertyKey} key\n * @param {any} value\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\n * @param {PropertyKey} key\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* MakeResult.Cancel */) {\n return;\n }\n if (outcome === 1 /* MakeResult.Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * @param {PropertyKey} key\n * @param {PropertyDescriptor} descriptor\n * @param {boolean} proxyTrap whether it's called from proxy trap\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (true) {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n * for callback details\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if ( true && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if ( true && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\n // Configurable, not sealed, not frozen\n // Possibly not needed, just a little better error then the one thrown by engine.\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n if (__DEV__) {\n const configurable = getDescriptor(adm.target_, key)?.configurable\n const frozen = Object.isFrozen(adm.target_)\n const sealed = Object.isSealed(adm.target_)\n if (!configurable || frozen || sealed) {\n const fieldName = `${adm.name_}.${key.toString()}`\n const requestedAnnotationType = annotation.annotationType_\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n if (frozen) {\n error += `\\nObject is frozen.`\n }\n if (sealed) {\n error += `\\nObject is sealed.`\n }\n if (!configurable) {\n error += `\\nproperty is not configurable.`\n // Mention only if caused by us to avoid confusion\n if (hasProp(adm.appliedAnnotations!, key)) {\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\n }\n }\n die(error)\n }\n }\n */\n // Not annotated\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n var v = false;\n var p = {};\n Object.defineProperty(p, \"0\", {\n set: function set() {\n v = true;\n }\n });\n /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n initObservable(function () {\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n }\n if (safariPrototypeSetterInheritanceBug) {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n });\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n var derivation = untrackedStart();\n var allowStateChanges = allowStateChangesStart(true);\n startBatch();\n try {\n return cb();\n } finally {\n endBatch();\n allowStateChangesEnd(allowStateChanges);\n untrackedEnd(derivation);\n }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/ Most of the public static methods exposed by the module can be found here.\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/ Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../sgmf-scripts/node_modules/webpack/buildin/global.js */ \"./node_modules/sgmf-scripts/node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?"); /***/ }), diff --git a/cartridges/int_adyen_SFRA/cartridge/store/index.js b/cartridges/int_adyen_SFRA/cartridge/store/index.js index e547c0c9b0..e8bf61e787 100644 --- a/cartridges/int_adyen_SFRA/cartridge/store/index.js +++ b/cartridges/int_adyen_SFRA/cartridge/store/index.js @@ -1,18 +1,18 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +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); } var _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13; -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; } -function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); } +function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); } var _require = require('mobx'), observable = _require.observable, computed = _require.computed; diff --git a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js index 2a5f74a4b8..054f51a8f4 100644 --- a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js +++ b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js @@ -1,13 +1,13 @@ "use strict"; -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; } +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; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 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."); } 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); } 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; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +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; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +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); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } require('./adyen-giving'); @@ -79,7 +79,6 @@ function _initializeBillingEvents() { // turn billingAddress section on/off showEmailAddress: false // allow shopper to specify their email address }, - paywithgoogle: getGooglePayConfig(), googlepay: getGooglePayConfig(), paypal: { @@ -441,7 +440,6 @@ function renderPaymentMethod(paymentMethod, storedPaymentMethodBool, path) { node.mount(container); })["catch"](function () {}); // eslint-disable-line no-empty } - var input = document.querySelector("#rb_".concat(paymentMethodID)); input.onchange = /*#__PURE__*/function () { var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) { @@ -462,7 +460,7 @@ function renderPaymentMethod(paymentMethod, storedPaymentMethodBool, path) { } }, _callee); })); - return function (_x2) { + return function (_x) { return _ref3.apply(this, arguments); }; }(); diff --git a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/amazon.js b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/amazon.js index 161e4b99af..84d465a60c 100644 --- a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/amazon.js +++ b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/amazon.js @@ -1,9 +1,9 @@ "use strict"; -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; } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +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); } if (window.amazonCheckoutSessionId) { var handleAuthorised = function handleAuthorised(response) { document.querySelector('#result').value = JSON.stringify({ diff --git a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/summary.js b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/summary.js index 23ad2c664a..25f93e0d28 100644 --- a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/summary.js +++ b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/summary.js @@ -1,7 +1,7 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -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; } +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); } +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; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } // This script is executed only on the checkout summary page diff --git a/cartridges/int_adyen_overlay/cartridge/scripts/adyenCheckout.js b/cartridges/int_adyen_overlay/cartridge/scripts/adyenCheckout.js index 6116a42c78..1b38668384 100644 --- a/cartridges/int_adyen_overlay/cartridge/scripts/adyenCheckout.js +++ b/cartridges/int_adyen_overlay/cartridge/scripts/adyenCheckout.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** * ###### * ###### @@ -52,6 +52,7 @@ function createPaymentRequest(args) { // Create request object with payment details var paymentRequest = AdyenHelper.createAdyenRequestObject(order, paymentInstrument); paymentRequest = AdyenHelper.add3DS2Data(paymentRequest); + var paymentMethodType = paymentRequest.paymentMethod.type; // Add Risk data if (AdyenConfigs.getAdyenBasketFieldsEnabled()) { @@ -59,7 +60,7 @@ function createPaymentRequest(args) { } // L2/3 Data - if (AdyenConfigs.getAdyenLevel23DataEnabled()) { + if (AdyenConfigs.getAdyenLevel23DataEnabled() && paymentMethodType.indexOf('scheme') > -1) { paymentRequest.additionalData = _objectSpread(_objectSpread({}, paymentRequest.additionalData), adyenLevelTwoThreeData.getLineItems(args)); } @@ -90,7 +91,7 @@ function createPaymentRequest(args) { value: value }; } - var paymentMethodType = paymentRequest.paymentMethod.type; + // Create billing and delivery address objects for new orders, // no address fields for credit cards through My Account paymentRequest = AdyenHelper.createAddressObjects(order, paymentMethodType, paymentRequest); diff --git a/cartridges/int_adyen_overlay/cartridge/scripts/adyenGiving.js b/cartridges/int_adyen_overlay/cartridge/scripts/adyenGiving.js index 5936b629c4..fdacebc211 100644 --- a/cartridges/int_adyen_overlay/cartridge/scripts/adyenGiving.js +++ b/cartridges/int_adyen_overlay/cartridge/scripts/adyenGiving.js @@ -30,6 +30,7 @@ var constants = require('*/cartridge/adyenConstants/constants'); var AdyenLogs = require('*/cartridge/scripts/adyenCustomLogs'); function donate(donationReference, donationAmount, orderToken) { try { + var _paymentData$fullResp, _paymentData$fullResp2, _paymentData$paymentM, _paymentData$fullResp3, _paymentData$fullResp4; if (session.privacy.orderNo !== donationReference) { throw new Error("Donation reference is invalid"); } @@ -39,14 +40,19 @@ function donate(donationReference, donationAmount, orderToken) { var donationToken = paymentInstrument.paymentTransaction.custom.Adyen_donationToken; var originalReference = paymentInstrument.paymentTransaction.custom.Adyen_pspReference; var paymentData = JSON.parse(paymentInstrument.paymentTransaction.custom.Adyen_log); - var paymentCurrency = paymentData.amount.currency; + var paymentCurrency = paymentData.amount.currency || ((_paymentData$fullResp = paymentData.fullResponse) === null || _paymentData$fullResp === void 0 ? void 0 : (_paymentData$fullResp2 = _paymentData$fullResp.amount) === null || _paymentData$fullResp2 === void 0 ? void 0 : _paymentData$fullResp2.currency); var availableDonationAmounts = AdyenHelper.getDonationAmounts(); - paymentMethodVariant = paymentInstrument.custom.Adyen_Payment_Method_Variant; + paymentMethodVariant = ((_paymentData$paymentM = paymentData.paymentMethod) === null || _paymentData$paymentM === void 0 ? void 0 : _paymentData$paymentM.type) || ((_paymentData$fullResp3 = paymentData.fullResponse) === null || _paymentData$fullResp3 === void 0 ? void 0 : (_paymentData$fullResp4 = _paymentData$fullResp3.paymentMethod) === null || _paymentData$fullResp4 === void 0 ? void 0 : _paymentData$fullResp4.type); // for iDeal donations, the payment method variant needs to be set to sepadirectdebit if (paymentMethodVariant === 'ideal') { paymentMethodVariant = 'sepadirectdebit'; } + // for Apple Pay donations, the payment method variant needs to be the brand + if (paymentMethodVariant === 'applepay') { + var _paymentData$paymentM2, _paymentData$fullResp5, _paymentData$fullResp6; + paymentMethodVariant = ((_paymentData$paymentM2 = paymentData.paymentMethod) === null || _paymentData$paymentM2 === void 0 ? void 0 : _paymentData$paymentM2.brand) || ((_paymentData$fullResp5 = paymentData.fullResponse) === null || _paymentData$fullResp5 === void 0 ? void 0 : (_paymentData$fullResp6 = _paymentData$fullResp5.paymentMethod) === null || _paymentData$fullResp6 === void 0 ? void 0 : _paymentData$fullResp6.brand); + } var requestObject = { merchantAccount: AdyenConfigs.getAdyenMerchantAccount(), donationAccount: AdyenConfigs.getAdyenGivingCharityAccount(), diff --git a/cartridges/int_adyen_overlay/cartridge/scripts/adyenLevelTwoThreeData.js b/cartridges/int_adyen_overlay/cartridge/scripts/adyenLevelTwoThreeData.js index 13794239ce..28451222fa 100644 --- a/cartridges/int_adyen_overlay/cartridge/scripts/adyenLevelTwoThreeData.js +++ b/cartridges/int_adyen_overlay/cartridge/scripts/adyenLevelTwoThreeData.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** * ###### * ###### @@ -37,14 +37,13 @@ function getLineItems(_ref) { var allLineItems = orderOrBasket.getProductLineItems(); var shopperReference = getShopperReference(orderOrBasket); return allLineItems.toArray().reduce(function (acc, lineItem, index) { - var _objectSpread2; var description = LineItemHelper.getDescription(lineItem); var id = LineItemHelper.getId(lineItem); var quantity = LineItemHelper.getQuantity(lineItem); var itemAmount = LineItemHelper.getItemAmount(lineItem).divide(quantity); var vatAmount = LineItemHelper.getVatAmount(lineItem).divide(quantity); var commodityCode = AdyenConfigs.getAdyenLevel23CommodityCode(); - var currentLineItem = _objectSpread(_objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".unitPrice"), itemAmount.value.toFixed()), _defineProperty(_objectSpread2, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".totalAmount"), parseFloat(itemAmount.value.toFixed()) + parseFloat(vatAmount.value.toFixed())), _defineProperty(_objectSpread2, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".quantity"), quantity), _defineProperty(_objectSpread2, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".unitOfMeasure"), 'EAC'), _objectSpread2), commodityCode && _defineProperty({}, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".commodityCode"), commodityCode)), description && _defineProperty({}, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".description"), description.substring(0, 26).replace(/[^\x00-\x7F]/g, ''))), id && _defineProperty({}, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".productCode"), id.substring(0, 12))); + var currentLineItem = _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".unitPrice"), itemAmount.value.toFixed()), "enhancedSchemeData.itemDetailLine".concat(index + 1, ".totalAmount"), parseFloat(itemAmount.value.toFixed()) + parseFloat(vatAmount.value.toFixed())), "enhancedSchemeData.itemDetailLine".concat(index + 1, ".quantity"), quantity), "enhancedSchemeData.itemDetailLine".concat(index + 1, ".unitOfMeasure"), 'EAC'), commodityCode && _defineProperty({}, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".commodityCode"), commodityCode)), description && _defineProperty({}, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".description"), description.substring(0, 26).replace(/[^\x00-\x7F]/g, ''))), id && _defineProperty({}, "enhancedSchemeData.itemDetailLine".concat(index + 1, ".productCode"), id.substring(0, 12))); return _objectSpread(_objectSpread(_objectSpread({}, acc), currentLineItem), {}, { 'enhancedSchemeData.totalTaxAmount': acc['enhancedSchemeData.totalTaxAmount'] + parseFloat(vatAmount.value.toFixed()) }); diff --git a/cartridges/int_adyen_overlay/cartridge/scripts/adyenSessions.js b/cartridges/int_adyen_overlay/cartridge/scripts/adyenSessions.js index 528d09ed11..8fd260bcff 100644 --- a/cartridges/int_adyen_overlay/cartridge/scripts/adyenSessions.js +++ b/cartridges/int_adyen_overlay/cartridge/scripts/adyenSessions.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** * ###### * ###### diff --git a/cartridges/int_adyen_overlay/cartridge/scripts/util/adyenHelper.js b/cartridges/int_adyen_overlay/cartridge/scripts/util/adyenHelper.js index 4a89f917bd..1a8c348069 100644 --- a/cartridges/int_adyen_overlay/cartridge/scripts/util/adyenHelper.js +++ b/cartridges/int_adyen_overlay/cartridge/scripts/util/adyenHelper.js @@ -1,11 +1,11 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +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); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 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; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** * ###### * ###### @@ -71,7 +71,6 @@ var adyenHelperObj = { AdyenLogs.error_log("Can't get service instance with name ".concat(service)); // e.message } - return adyenService; }, // returns SFCC customer object based on currentCustomer object @@ -535,7 +534,7 @@ var adyenHelperObj = { }, // saves the payment details in the paymentInstrument's custom object savePaymentDetails: function savePaymentDetails(paymentInstrument, order, result) { - var _result$additionalDat; + var _result$additionalDat, _result$fullResponse; paymentInstrument.paymentTransaction.transactionID = result.pspReference; paymentInstrument.paymentTransaction.custom.Adyen_pspReference = result.pspReference; if ((_result$additionalDat = result.additionalData) !== null && _result$additionalDat !== void 0 && _result$additionalDat.paymentMethod) { @@ -552,8 +551,8 @@ var adyenHelperObj = { } paymentInstrument.paymentTransaction.custom.authCode = result.resultCode ? result.resultCode : ''; order.custom.Adyen_value = '0'; - if (result.donationToken) { - paymentInstrument.paymentTransaction.custom.Adyen_donationToken = result.donationToken; + if (result.donationToken || (_result$fullResponse = result.fullResponse) !== null && _result$fullResponse !== void 0 && _result$fullResponse.donationToken) { + paymentInstrument.paymentTransaction.custom.Adyen_donationToken = result.donationToken || result.fullResponse.donationToken; } // Save full response to transaction custom attribute paymentInstrument.paymentTransaction.custom.Adyen_log = JSON.stringify(result);